From 199e7f657d94c25df80e76b2a0bb7b57a1729880 Mon Sep 17 00:00:00 2001 From: "xmc-action-bot[bot]" <121654204+xmc-action-bot[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 22:02:17 +0000 Subject: [PATCH] feat: updating from newer svd2rust (#64) Co-authored-by: lucasbrendel --- build.rs | 1 + src/can.rs | 102 +- src/can/clc.rs | 79 +- src/can/fdr.rs | 109 +- src/can/id.rs | 36 +- src/can/list.rs | 35 +- src/can/mcr.rs | 63 +- src/can/mitr.rs | 40 +- src/can/msid.rs | 25 +- src/can/msimask.rs | 63 +- src/can/mspnd.rs | 63 +- src/can/panctr.rs | 91 +- src/can_mo0.rs | 79 +- src/can_mo0/moamr.rs | 84 +- src/can_mo0/moar.rs | 123 +- src/can_mo0/moctr.rs | 178 +- src/can_mo0/modatah.rs | 87 +- src/can_mo0/modatal.rs | 87 +- src/can_mo0/mofcr.rs | 307 +- src/can_mo0/mofgpr.rs | 87 +- src/can_mo0/moipr.rs | 133 +- src/can_mo0/mostat.rs | 101 +- src/can_node0.rs | 65 +- src/can_node0/nbtr.rs | 108 +- src/can_node0/ncr.rs | 197 +- src/can_node0/necnt.rs | 91 +- src/can_node0/nfcr.rs | 159 +- src/can_node0/nipr.rs | 179 +- src/can_node0/npcr.rs | 84 +- src/can_node0/nsr.rs | 173 +- src/ccu40.rs | 87 +- src/ccu40/ecrd.rs | 63 +- src/ccu40/gcsc.rs | 130 +- src/ccu40/gcss.rs | 130 +- src/ccu40/gcst.rs | 103 +- src/ccu40/gctrl.rs | 279 +- src/ccu40/gidlc.rs | 64 +- src/ccu40/gidls.rs | 70 +- src/ccu40/gstat.rs | 53 +- src/ccu40/midr.rs | 29 +- src/ccu40_cc40.rs | 240 +- src/ccu40_cc40/c0v.rs | 33 +- src/ccu40_cc40/c1v.rs | 33 +- src/ccu40_cc40/c2v.rs | 33 +- src/ccu40_cc40/c3v.rs | 33 +- src/ccu40_cc40/cmc.rs | 379 +- src/ccu40_cc40/cr.rs | 25 +- src/ccu40_cc40/crs.rs | 63 +- src/ccu40_cc40/dit.rs | 27 +- src/ccu40_cc40/dits.rs | 63 +- src/ccu40_cc40/fpc.rs | 65 +- src/ccu40_cc40/fpcs.rs | 63 +- src/ccu40_cc40/ins.rs | 577 +-- src/ccu40_cc40/inte.rs | 202 +- src/ccu40_cc40/ints.rs | 67 +- src/ccu40_cc40/pr.rs | 25 +- src/ccu40_cc40/prs.rs | 63 +- src/ccu40_cc40/psc.rs | 63 +- src/ccu40_cc40/psl.rs | 76 +- src/ccu40_cc40/srs.rs | 230 +- src/ccu40_cc40/swr.rs | 82 +- src/ccu40_cc40/sws.rs | 82 +- src/ccu40_cc40/tc.rs | 464 +-- src/ccu40_cc40/tcclr.rs | 52 +- src/ccu40_cc40/tcset.rs | 40 +- src/ccu40_cc40/tcst.rs | 35 +- src/ccu40_cc40/timer.rs | 63 +- src/ccu80.rs | 96 +- src/ccu80/ecrd.rs | 63 +- src/ccu80/gcsc.rs | 154 +- src/ccu80/gcss.rs | 154 +- src/ccu80/gcst.rs | 111 +- src/ccu80/gctrl.rs | 279 +- src/ccu80/gidlc.rs | 70 +- src/ccu80/gidls.rs | 76 +- src/ccu80/gpchk.rs | 223 +- src/ccu80/gstat.rs | 59 +- src/ccu80/midr.rs | 29 +- src/ccu80_cc80.rs | 303 +- src/ccu80_cc80/c0v.rs | 33 +- src/ccu80_cc80/c1v.rs | 33 +- src/ccu80_cc80/c2v.rs | 33 +- src/ccu80_cc80/c3v.rs | 33 +- src/ccu80_cc80/chc.rs | 160 +- src/ccu80_cc80/cmc.rs | 379 +- src/ccu80_cc80/cr1.rs | 25 +- src/ccu80_cc80/cr1s.rs | 63 +- src/ccu80_cc80/cr2.rs | 25 +- src/ccu80_cc80/cr2s.rs | 63 +- src/ccu80_cc80/dc1r.rs | 71 +- src/ccu80_cc80/dc2r.rs | 71 +- src/ccu80_cc80/dit.rs | 27 +- src/ccu80_cc80/dits.rs | 63 +- src/ccu80_cc80/dtc.rs | 216 +- src/ccu80_cc80/fpc.rs | 65 +- src/ccu80_cc80/fpcs.rs | 63 +- src/ccu80_cc80/ins.rs | 577 +-- src/ccu80_cc80/inte.rs | 244 +- src/ccu80_cc80/ints.rs | 79 +- src/ccu80_cc80/pr.rs | 25 +- src/ccu80_cc80/prs.rs | 63 +- src/ccu80_cc80/psc.rs | 63 +- src/ccu80_cc80/psl.rs | 139 +- src/ccu80_cc80/srs.rs | 265 +- src/ccu80_cc80/stc.rs | 107 +- src/ccu80_cc80/swr.rs | 94 +- src/ccu80_cc80/sws.rs | 94 +- src/ccu80_cc80/tc.rs | 596 ++-- src/ccu80_cc80/tcclr.rs | 64 +- src/ccu80_cc80/tcset.rs | 40 +- src/ccu80_cc80/tcst.rs | 47 +- src/ccu80_cc80/timer.rs | 63 +- src/dac.rs | 110 +- src/dac/dac01data.rs | 71 +- src/dac/dac0cfg0.rs | 218 +- src/dac/dac0cfg1.rs | 240 +- src/dac/dac0data.rs | 63 +- src/dac/dac0path.rs | 79 +- src/dac/dac0patl.rs | 103 +- src/dac/dac1cfg0.rs | 218 +- src/dac/dac1cfg1.rs | 219 +- src/dac/dac1data.rs | 63 +- src/dac/dac1path.rs | 79 +- src/dac/dac1patl.rs | 103 +- src/dac/id.rs | 29 +- src/dlr.rs | 40 +- src/dlr/lnen.rs | 223 +- src/dlr/ovrclr.rs | 82 +- src/dlr/ovrstat.rs | 39 +- src/dlr/srsel0.rs | 119 +- src/dsd.rs | 86 +- src/dsd/cgcfg.rs | 195 +- src/dsd/clc.rs | 103 +- src/dsd/evflag.rs | 349 +- src/dsd/evflagclr.rs | 154 +- src/dsd/globcfg.rs | 82 +- src/dsd/globrc.rs | 139 +- src/dsd/id.rs | 29 +- src/dsd/ocs.rs | 106 +- src/dsd_ch0.rs | 130 +- src/dsd_ch0/boundsel.rs | 71 +- src/dsd_ch0/cgsync.rs | 75 +- src/dsd_ch0/dicfg.rs | 299 +- src/dsd_ch0/fcfga.rs | 183 +- src/dsd_ch0/fcfgc.rs | 156 +- src/dsd_ch0/iwctr.rs | 110 +- src/dsd_ch0/modcfg.rs | 105 +- src/dsd_ch0/offm.rs | 63 +- src/dsd_ch0/rectcfg.rs | 129 +- src/dsd_ch0/resa.rs | 25 +- src/dsd_ch0/resm.rs | 25 +- src/dsd_ch0/tstmp.rs | 29 +- src/eru0.rs | 31 +- src/eru0/exicon.rs | 272 +- src/eru0/exisel.rs | 335 +- src/eru0/exocon.rs | 236 +- src/eth0.rs | 1257 +++++-- src/eth0/ahb_status.rs | 25 +- src/eth0/bus_mode.rs | 161 +- .../current_host_receive_buffer_address.rs | 25 +- src/eth0/current_host_receive_descriptor.rs | 25 +- .../current_host_transmit_buffer_address.rs | 25 +- src/eth0/current_host_transmit_descriptor.rs | 25 +- src/eth0/debug.rs | 47 +- src/eth0/flow_control.rs | 111 +- src/eth0/gmii_address.rs | 95 +- src/eth0/gmii_data.rs | 63 +- src/eth0/hash_table_high.rs | 63 +- src/eth0/hash_table_low.rs | 63 +- src/eth0/hw_feature.rs | 115 +- src/eth0/interrupt_enable.rs | 175 +- src/eth0/interrupt_mask.rs | 71 +- src/eth0/interrupt_status.rs | 35 +- src/eth0/mac_address0_high.rs | 65 +- src/eth0/mac_address0_low.rs | 63 +- src/eth0/mac_address1_high.rs | 87 +- src/eth0/mac_address1_low.rs | 63 +- src/eth0/mac_address2_high.rs | 87 +- src/eth0/mac_address2_low.rs | 63 +- src/eth0/mac_address3_high.rs | 87 +- src/eth0/mac_address3_low.rs | 63 +- src/eth0/mac_configuration.rs | 213 +- src/eth0/mac_frame_filter.rs | 155 +- ...issed_frame_and_buffer_overflow_counter.rs | 31 +- src/eth0/mmc_control.rs | 111 +- src/eth0/mmc_ipc_receive_interrupt.rs | 79 +- src/eth0/mmc_ipc_receive_interrupt_mask.rs | 279 +- src/eth0/mmc_receive_interrupt.rs | 75 +- src/eth0/mmc_receive_interrupt_mask.rs | 263 +- src/eth0/mmc_transmit_interrupt.rs | 75 +- src/eth0/mmc_transmit_interrupt_mask.rs | 263 +- src/eth0/operation_mode.rs | 151 +- src/eth0/pmt_control_status.rs | 99 +- src/eth0/pps_control.rs | 79 +- src/eth0/receive_descriptor_list_address.rs | 63 +- src/eth0/receive_interrupt_watchdog_timer.rs | 63 +- src/eth0/receive_poll_demand.rs | 63 +- src/eth0/remote_wake_up_frame_filter.rs | 63 +- .../rx_1024tomaxoctets_frames_good_bad.rs | 25 +- src/eth0/rx_128to255octets_frames_good_bad.rs | 25 +- src/eth0/rx_256to511octets_frames_good_bad.rs | 25 +- .../rx_512to1023octets_frames_good_bad.rs | 25 +- src/eth0/rx_64octets_frames_good_bad.rs | 25 +- src/eth0/rx_65to127octets_frames_good_bad.rs | 25 +- src/eth0/rx_alignment_error_frames.rs | 25 +- src/eth0/rx_broadcast_frames_good.rs | 25 +- src/eth0/rx_control_frames_good.rs | 25 +- src/eth0/rx_crc_error_frames.rs | 25 +- src/eth0/rx_fifo_overflow_frames.rs | 25 +- src/eth0/rx_frames_count_good_bad.rs | 25 +- src/eth0/rx_jabber_error_frames.rs | 25 +- src/eth0/rx_length_error_frames.rs | 25 +- src/eth0/rx_multicast_frames_good.rs | 25 +- src/eth0/rx_octet_count_good.rs | 25 +- src/eth0/rx_octet_count_good_bad.rs | 25 +- src/eth0/rx_out_of_range_type_frames.rs | 25 +- src/eth0/rx_oversize_frames_good.rs | 25 +- src/eth0/rx_pause_frames.rs | 25 +- src/eth0/rx_receive_error_frames.rs | 25 +- src/eth0/rx_runt_error_frames.rs | 29 +- src/eth0/rx_undersize_frames_good.rs | 25 +- src/eth0/rx_unicast_frames_good.rs | 25 +- src/eth0/rx_vlan_frames_good_bad.rs | 25 +- src/eth0/rx_watchdog_error_frames.rs | 25 +- src/eth0/rxicmp_error_frames.rs | 25 +- src/eth0/rxicmp_error_octets.rs | 25 +- src/eth0/rxicmp_good_frames.rs | 25 +- src/eth0/rxicmp_good_octets.rs | 25 +- src/eth0/rxipv4_fragmented_frames.rs | 25 +- src/eth0/rxipv4_fragmented_octets.rs | 25 +- src/eth0/rxipv4_good_frames.rs | 25 +- src/eth0/rxipv4_good_octets.rs | 25 +- src/eth0/rxipv4_header_error_frames.rs | 25 +- src/eth0/rxipv4_header_error_octets.rs | 25 +- src/eth0/rxipv4_no_payload_frames.rs | 25 +- src/eth0/rxipv4_no_payload_octets.rs | 25 +- .../rxipv4_udp_checksum_disable_octets.rs | 25 +- .../rxipv4_udp_checksum_disabled_frames.rs | 25 +- src/eth0/rxipv6_good_frames.rs | 25 +- src/eth0/rxipv6_good_octets.rs | 25 +- src/eth0/rxipv6_header_error_frames.rs | 25 +- src/eth0/rxipv6_header_error_octets.rs | 25 +- src/eth0/rxipv6_no_payload_frames.rs | 25 +- src/eth0/rxipv6_no_payload_octets.rs | 25 +- src/eth0/rxtcp_error_frames.rs | 25 +- src/eth0/rxtcp_error_octets.rs | 25 +- src/eth0/rxtcp_good_frames.rs | 25 +- src/eth0/rxtcp_good_octets.rs | 25 +- src/eth0/rxudp_error_frames.rs | 25 +- src/eth0/rxudp_error_octets.rs | 25 +- src/eth0/rxudp_good_frames.rs | 25 +- src/eth0/rxudp_good_octets.rs | 25 +- src/eth0/status.rs | 187 +- src/eth0/sub_second_increment.rs | 63 +- src/eth0/system_time_higher_word_seconds.rs | 63 +- src/eth0/system_time_nanoseconds.rs | 25 +- src/eth0/system_time_nanoseconds_update.rs | 71 +- src/eth0/system_time_seconds.rs | 25 +- src/eth0/system_time_seconds_update.rs | 63 +- src/eth0/target_time_nanoseconds.rs | 65 +- src/eth0/target_time_seconds.rs | 63 +- src/eth0/timestamp_addend.rs | 63 +- src/eth0/timestamp_control.rs | 183 +- src/eth0/timestamp_status.rs | 41 +- src/eth0/transmit_descriptor_list_address.rs | 63 +- src/eth0/transmit_poll_demand.rs | 63 +- .../tx_1024tomaxoctets_frames_good_bad.rs | 25 +- src/eth0/tx_128to255octets_frames_good_bad.rs | 25 +- src/eth0/tx_256to511octets_frames_good_bad.rs | 25 +- .../tx_512to1023octets_frames_good_bad.rs | 25 +- src/eth0/tx_64octets_frames_good_bad.rs | 25 +- src/eth0/tx_65to127octets_frames_good_bad.rs | 25 +- src/eth0/tx_broadcast_frames_good.rs | 25 +- src/eth0/tx_broadcast_frames_good_bad.rs | 25 +- src/eth0/tx_carrier_error_frames.rs | 25 +- src/eth0/tx_deferred_frames.rs | 25 +- src/eth0/tx_excessive_collision_frames.rs | 25 +- src/eth0/tx_excessive_deferral_error.rs | 25 +- src/eth0/tx_frame_count_good.rs | 25 +- src/eth0/tx_frame_count_good_bad.rs | 25 +- src/eth0/tx_late_collision_frames.rs | 25 +- src/eth0/tx_multicast_frames_good.rs | 25 +- src/eth0/tx_multicast_frames_good_bad.rs | 25 +- src/eth0/tx_multiple_collision_good_frames.rs | 25 +- src/eth0/tx_octet_count_good.rs | 25 +- src/eth0/tx_octet_count_good_bad.rs | 25 +- src/eth0/tx_osize_frames_good.rs | 25 +- src/eth0/tx_pause_frames.rs | 25 +- src/eth0/tx_single_collision_good_frames.rs | 25 +- src/eth0/tx_underflow_error_frames.rs | 25 +- src/eth0/tx_unicast_frames_good_bad.rs | 25 +- src/eth0/tx_vlan_frames_good.rs | 25 +- src/eth0/version.rs | 27 +- src/eth0/vlan_tag.rs | 89 +- src/eth0_con.rs | 11 +- src/eth0_con/eth0_con.rs | 461 +-- src/fce.rs | 22 +- src/fce/clc.rs | 65 +- src/fce/id.rs | 29 +- src/fce_ke0.rs | 73 +- src/fce_ke0/cfg.rs | 244 +- src/fce_ke0/check.rs | 63 +- src/fce_ke0/crc.rs | 63 +- src/fce_ke0/ctr.rs | 79 +- src/fce_ke0/ir.rs | 63 +- src/fce_ke0/length.rs | 63 +- src/fce_ke0/res.rs | 25 +- src/fce_ke0/sts.rs | 87 +- src/flash0.rs | 69 +- src/flash0/fcon.rs | 352 +- src/flash0/fsr.rs | 139 +- src/flash0/id.rs | 29 +- src/flash0/marp.rs | 107 +- src/flash0/procon0.rs | 89 +- src/flash0/procon1.rs | 83 +- src/flash0/procon2.rs | 83 +- src/generic.rs | 369 +- src/generic/raw.rs | 79 + src/gpdma0.rs | 350 +- src/gpdma0/chenreg.rs | 88 +- src/gpdma0/clearblock.rs | 154 +- src/gpdma0/cleardsttran.rs | 154 +- src/gpdma0/clearerr.rs | 154 +- src/gpdma0/clearsrctran.rs | 154 +- src/gpdma0/cleartfr.rs | 154 +- src/gpdma0/dmacfgreg.rs | 76 +- src/gpdma0/id.rs | 25 +- src/gpdma0/lstdstreg.rs | 343 +- src/gpdma0/lstsrcreg.rs | 343 +- src/gpdma0/maskblock.rs | 343 +- src/gpdma0/maskdsttran.rs | 343 +- src/gpdma0/maskerr.rs | 343 +- src/gpdma0/masksrctran.rs | 343 +- src/gpdma0/masktfr.rs | 343 +- src/gpdma0/rawblock.rs | 119 +- src/gpdma0/rawdsttran.rs | 119 +- src/gpdma0/rawerr.rs | 119 +- src/gpdma0/rawsrctran.rs | 119 +- src/gpdma0/rawtfr.rs | 119 +- src/gpdma0/reqdstreg.rs | 239 +- src/gpdma0/reqsrcreg.rs | 239 +- src/gpdma0/sglreqdstreg.rs | 239 +- src/gpdma0/sglreqsrcreg.rs | 239 +- src/gpdma0/statusblock.rs | 39 +- src/gpdma0/statusdsttran.rs | 39 +- src/gpdma0/statuserr.rs | 39 +- src/gpdma0/statusint.rs | 33 +- src/gpdma0/statussrctran.rs | 39 +- src/gpdma0/statustfr.rs | 39 +- src/gpdma0/type_.rs | 25 +- src/gpdma0/version.rs | 25 +- src/gpdma0_ch0.rs | 135 +- src/gpdma0_ch0/cfgh.rs | 137 +- src/gpdma0_ch0/cfgl.rs | 276 +- src/gpdma0_ch0/ctlh.rs | 71 +- src/gpdma0_ch0/ctll.rs | 223 +- src/gpdma0_ch0/dar.rs | 63 +- src/gpdma0_ch0/dsr.rs | 71 +- src/gpdma0_ch0/dstat.rs | 63 +- src/gpdma0_ch0/dstatar.rs | 63 +- src/gpdma0_ch0/llp.rs | 63 +- src/gpdma0_ch0/sar.rs | 63 +- src/gpdma0_ch0/sgr.rs | 71 +- src/gpdma0_ch0/sstat.rs | 63 +- src/gpdma0_ch0/sstatar.rs | 63 +- src/gpdma0_ch2.rs | 62 +- src/gpdma0_ch2/cfgh.rs | 121 +- src/gpdma0_ch2/cfgl.rs | 260 +- src/gpdma0_ch2/ctlh.rs | 71 +- src/gpdma0_ch2/ctll.rs | 165 +- src/gpdma0_ch2/dar.rs | 63 +- src/gpdma0_ch2/sar.rs | 63 +- src/hrpwm0.rs | 163 +- src/hrpwm0/csgcfg.rs | 172 +- src/hrpwm0/csgclrg.rs | 88 +- src/hrpwm0/csgfcg.rs | 124 +- src/hrpwm0/csgfsg.rs | 59 +- src/hrpwm0/csgsetg.rs | 88 +- src/hrpwm0/csgstatg.rs | 77 +- src/hrpwm0/csgtrc.rs | 52 +- src/hrpwm0/csgtrg.rs | 70 +- src/hrpwm0/csgtrsg.rs | 59 +- src/hrpwm0/glbana.rs | 140 +- src/hrpwm0/hrbsc.rs | 98 +- src/hrpwm0/hrccfg.rs | 279 +- src/hrpwm0/hrcctrg.rs | 82 +- src/hrpwm0/hrcstrg.rs | 82 +- src/hrpwm0/hrcstsg.rs | 71 +- src/hrpwm0/hrghrs.rs | 29 +- src/hrpwm0/midr.rs | 29 +- src/hrpwm0_csg0.rs | 146 +- src/hrpwm0_csg0/blv.rs | 63 +- src/hrpwm0_csg0/cc.rs | 360 +- src/hrpwm0_csg0/dci.rs | 205 +- src/hrpwm0_csg0/dsv1.rs | 25 +- src/hrpwm0_csg0/dsv2.rs | 63 +- src/hrpwm0_csg0/ies.rs | 226 +- src/hrpwm0_csg0/istat.rs | 77 +- src/hrpwm0_csg0/pc.rs | 25 +- src/hrpwm0_csg0/plc.rs | 273 +- src/hrpwm0_csg0/sc.rs | 447 +-- src/hrpwm0_csg0/sdsv1.rs | 63 +- src/hrpwm0_csg0/spc.rs | 63 +- src/hrpwm0_csg0/sre.rs | 127 +- src/hrpwm0_csg0/srs.rs | 300 +- src/hrpwm0_csg0/swc.rs | 88 +- src/hrpwm0_csg0/sws.rs | 88 +- src/hrpwm0_hrc0.rs | 128 +- src/hrpwm0_hrc0/cr1.rs | 25 +- src/hrpwm0_hrc0/cr2.rs | 25 +- src/hrpwm0_hrc0/dcf.rs | 25 +- src/hrpwm0_hrc0/dcr.rs | 25 +- src/hrpwm0_hrc0/gc.rs | 293 +- src/hrpwm0_hrc0/gsel.rs | 427 ++- src/hrpwm0_hrc0/pl.rs | 97 +- src/hrpwm0_hrc0/sc.rs | 29 +- src/hrpwm0_hrc0/scr1.rs | 63 +- src/hrpwm0_hrc0/scr2.rs | 63 +- src/hrpwm0_hrc0/sdcf.rs | 63 +- src/hrpwm0_hrc0/sdcr.rs | 63 +- src/hrpwm0_hrc0/ssc.rs | 76 +- src/hrpwm0_hrc0/tsel.rs | 167 +- src/ledts0.rs | 101 +- src/ledts0/evfr.rs | 112 +- src/ledts0/fnctl.rs | 355 +- src/ledts0/globctl.rs | 257 +- src/ledts0/id.rs | 29 +- src/ledts0/ldcmp0.rs | 87 +- src/ledts0/ldcmp1.rs | 87 +- src/ledts0/line0.rs | 87 +- src/ledts0/line1.rs | 87 +- src/ledts0/tscmp0.rs | 87 +- src/ledts0/tscmp1.rs | 87 +- src/ledts0/tsval.rs | 65 +- src/lib.rs | 3101 ++++++++++++++++- src/pba0.rs | 20 +- src/pba0/sts.rs | 76 +- src/pba0/waddr.rs | 25 +- src/pmu0.rs | 11 +- src/pmu0/id.rs | 29 +- src/port0.rs | 120 +- src/port0/hwsel.rs | 551 +-- src/port0/in_.rs | 119 +- src/port0/iocr0.rs | 419 ++- src/port0/iocr12.rs | 419 ++- src/port0/iocr4.rs | 419 ++- src/port0/iocr8.rs | 419 ++- src/port0/omr.rs | 226 +- src/port0/out.rs | 391 ++- src/port0/pdisc.rs | 119 +- src/port0/pdr0.rs | 119 +- src/port0/pdr1.rs | 119 +- src/port0/pps.rs | 391 ++- src/port1.rs | 120 +- src/port1/hwsel.rs | 551 +-- src/port1/in_.rs | 119 +- src/port1/iocr0.rs | 419 ++- src/port1/iocr12.rs | 419 ++- src/port1/iocr4.rs | 419 ++- src/port1/iocr8.rs | 419 ++- src/port1/omr.rs | 226 +- src/port1/out.rs | 391 ++- src/port1/pdisc.rs | 119 +- src/port1/pdr0.rs | 119 +- src/port1/pdr1.rs | 119 +- src/port1/pps.rs | 391 ++- src/port14.rs | 100 +- src/port14/hwsel.rs | 551 +-- src/port14/in_.rs | 119 +- src/port14/iocr0.rs | 419 ++- src/port14/iocr12.rs | 419 ++- src/port14/iocr4.rs | 419 ++- src/port14/iocr8.rs | 419 ++- src/port14/omr.rs | 226 +- src/port14/out.rs | 391 ++- src/port14/pdisc.rs | 391 ++- src/port14/pps.rs | 391 ++- src/port15.rs | 91 +- src/port15/hwsel.rs | 551 +-- src/port15/in_.rs | 119 +- src/port15/iocr0.rs | 419 ++- src/port15/iocr4.rs | 419 ++- src/port15/iocr8.rs | 419 ++- src/port15/omr.rs | 226 +- src/port15/out.rs | 391 ++- src/port15/pdisc.rs | 391 ++- src/port15/pps.rs | 391 ++- src/port2.rs | 120 +- src/port2/hwsel.rs | 551 +-- src/port2/in_.rs | 119 +- src/port2/iocr0.rs | 419 ++- src/port2/iocr12.rs | 419 ++- src/port2/iocr4.rs | 419 ++- src/port2/iocr8.rs | 419 ++- src/port2/omr.rs | 226 +- src/port2/out.rs | 391 ++- src/port2/pdisc.rs | 119 +- src/port2/pdr0.rs | 119 +- src/port2/pdr1.rs | 119 +- src/port2/pps.rs | 391 ++- src/port3.rs | 93 +- src/port3/hwsel.rs | 551 +-- src/port3/in_.rs | 119 +- src/port3/iocr0.rs | 419 ++- src/port3/iocr4.rs | 419 ++- src/port3/omr.rs | 226 +- src/port3/out.rs | 391 ++- src/port3/pdisc.rs | 119 +- src/port3/pdr0.rs | 119 +- src/port3/pps.rs | 391 ++- src/port4.rs | 84 +- src/port4/hwsel.rs | 551 +-- src/port4/in_.rs | 119 +- src/port4/iocr0.rs | 419 ++- src/port4/omr.rs | 226 +- src/port4/out.rs | 391 ++- src/port4/pdisc.rs | 119 +- src/port4/pdr0.rs | 119 +- src/port4/pps.rs | 391 ++- src/port5.rs | 93 +- src/port5/hwsel.rs | 551 +-- src/port5/in_.rs | 119 +- src/port5/iocr0.rs | 419 ++- src/port5/iocr4.rs | 419 ++- src/port5/omr.rs | 226 +- src/port5/out.rs | 391 ++- src/port5/pdisc.rs | 119 +- src/port5/pdr0.rs | 119 +- src/port5/pps.rs | 391 ++- src/posif0.rs | 185 +- src/posif0/halp.rs | 27 +- src/posif0/halps.rs | 71 +- src/posif0/mcm.rs | 25 +- src/posif0/mcmc.rs | 46 +- src/posif0/mcmf.rs | 29 +- src/posif0/mcms.rs | 52 +- src/posif0/mcsm.rs | 63 +- src/posif0/midr.rs | 29 +- src/posif0/pconf.rs | 524 +-- src/posif0/pdbg.rs | 37 +- src/posif0/pflg.rs | 77 +- src/posif0/pflge.rs | 433 +-- src/posif0/prun.rs | 29 +- src/posif0/prunc.rs | 46 +- src/posif0/pruns.rs | 40 +- src/posif0/psus.rs | 125 +- src/posif0/qdc.rs | 155 +- src/posif0/rpflg.rs | 88 +- src/posif0/spflg.rs | 88 +- src/ppb.rs | 784 ++++- src/ppb/actlr.rs | 95 +- src/ppb/afsr.rs | 63 +- src/ppb/aircr.rs | 104 +- src/ppb/bfar.rs | 63 +- src/ppb/ccr.rs | 182 +- src/ppb/cfsr.rs | 454 +-- src/ppb/cpacr.rs | 117 +- src/ppb/cpuid.rs | 61 +- src/ppb/fpcar.rs | 63 +- src/ppb/fpccr.rs | 244 +- src/ppb/fpdscr.rs | 87 +- src/ppb/hfsr.rs | 105 +- src/ppb/icsr.rs | 152 +- src/ppb/mmfar.rs | 63 +- src/ppb/mpu_ctrl.rs | 118 +- src/ppb/mpu_rasr.rs | 159 +- src/ppb/mpu_rasr_a1.rs | 159 +- src/ppb/mpu_rasr_a2.rs | 159 +- src/ppb/mpu_rasr_a3.rs | 159 +- src/ppb/mpu_rbar.rs | 92 +- src/ppb/mpu_rbar_a1.rs | 92 +- src/ppb/mpu_rbar_a2.rs | 92 +- src/ppb/mpu_rbar_a3.rs | 92 +- src/ppb/mpu_rnr.rs | 63 +- src/ppb/mpu_type.rs | 29 +- src/ppb/nvic_iabr0.rs | 82 +- src/ppb/nvic_iabr1.rs | 82 +- src/ppb/nvic_iabr2.rs | 82 +- src/ppb/nvic_iabr3.rs | 82 +- src/ppb/nvic_icer0.rs | 82 +- src/ppb/nvic_icer1.rs | 82 +- src/ppb/nvic_icer2.rs | 82 +- src/ppb/nvic_icer3.rs | 82 +- src/ppb/nvic_icpr0.rs | 82 +- src/ppb/nvic_icpr1.rs | 82 +- src/ppb/nvic_icpr2.rs | 82 +- src/ppb/nvic_icpr3.rs | 82 +- src/ppb/nvic_ipr0.rs | 87 +- src/ppb/nvic_ipr1.rs | 87 +- src/ppb/nvic_ipr10.rs | 87 +- src/ppb/nvic_ipr11.rs | 87 +- src/ppb/nvic_ipr12.rs | 87 +- src/ppb/nvic_ipr13.rs | 87 +- src/ppb/nvic_ipr14.rs | 87 +- src/ppb/nvic_ipr15.rs | 87 +- src/ppb/nvic_ipr16.rs | 87 +- src/ppb/nvic_ipr17.rs | 87 +- src/ppb/nvic_ipr18.rs | 87 +- src/ppb/nvic_ipr19.rs | 87 +- src/ppb/nvic_ipr2.rs | 87 +- src/ppb/nvic_ipr20.rs | 87 +- src/ppb/nvic_ipr21.rs | 87 +- src/ppb/nvic_ipr22.rs | 87 +- src/ppb/nvic_ipr23.rs | 87 +- src/ppb/nvic_ipr24.rs | 87 +- src/ppb/nvic_ipr25.rs | 87 +- src/ppb/nvic_ipr26.rs | 87 +- src/ppb/nvic_ipr27.rs | 87 +- src/ppb/nvic_ipr3.rs | 87 +- src/ppb/nvic_ipr4.rs | 87 +- src/ppb/nvic_ipr5.rs | 87 +- src/ppb/nvic_ipr6.rs | 87 +- src/ppb/nvic_ipr7.rs | 87 +- src/ppb/nvic_ipr8.rs | 87 +- src/ppb/nvic_ipr9.rs | 87 +- src/ppb/nvic_iser0.rs | 82 +- src/ppb/nvic_iser1.rs | 82 +- src/ppb/nvic_iser2.rs | 82 +- src/ppb/nvic_iser3.rs | 82 +- src/ppb/nvic_ispr0.rs | 82 +- src/ppb/nvic_ispr1.rs | 82 +- src/ppb/nvic_ispr2.rs | 82 +- src/ppb/nvic_ispr3.rs | 82 +- src/ppb/scr.rs | 118 +- src/ppb/shcsr.rs | 167 +- src/ppb/shpr1.rs | 79 +- src/ppb/shpr2.rs | 63 +- src/ppb/shpr3.rs | 71 +- src/ppb/stir.rs | 40 +- src/ppb/syst_calib.rs | 105 +- src/ppb/syst_csr.rs | 126 +- src/ppb/syst_cvr.rs | 63 +- src/ppb/syst_rvr.rs | 63 +- src/ppb/vtor.rs | 63 +- src/pref.rs | 11 +- src/pref/pcon.rs | 91 +- src/rtc.rs | 92 +- src/rtc/atim0.rs | 87 +- src/rtc/atim1.rs | 71 +- src/rtc/clrsr.rs | 76 +- src/rtc/ctr.rs | 127 +- src/rtc/id.rs | 29 +- src/rtc/msksr.rs | 111 +- src/rtc/rawstat.rs | 37 +- src/rtc/stssr.rs | 37 +- src/rtc/tim0.rs | 87 +- src/rtc/tim1.rs | 79 +- src/scu_clk.rs | 204 +- src/scu_clk/ccuclkcr.rs | 76 +- src/scu_clk/cgatclr0.rs | 214 +- src/scu_clk/cgatclr1.rs | 124 +- src/scu_clk/cgatclr2.rs | 109 +- src/scu_clk/cgatset0.rs | 214 +- src/scu_clk/cgatset1.rs | 124 +- src/scu_clk/cgatset2.rs | 109 +- src/scu_clk/cgatstat0.rs | 95 +- src/scu_clk/cgatstat1.rs | 59 +- src/scu_clk/cgatstat2.rs | 53 +- src/scu_clk/clkclr.rs | 94 +- src/scu_clk/clkset.rs | 94 +- src/scu_clk/clkstat.rs | 47 +- src/scu_clk/cpuclkcr.rs | 76 +- src/scu_clk/dsleepcr.rs | 223 +- src/scu_clk/extclkcr.rs | 98 +- src/scu_clk/mlinkclkcr.rs | 186 +- src/scu_clk/pbclkcr.rs | 76 +- src/scu_clk/sleepcr.rs | 160 +- src/scu_clk/sysclkcr.rs | 84 +- src/scu_clk/usbclkcr.rs | 84 +- src/scu_clk/wdtclkcr.rs | 94 +- src/scu_general.rs | 176 +- src/scu_general/ccucon.rs | 202 +- src/scu_general/dtempalarm.rs | 35 +- src/scu_general/dtemplim.rs | 71 +- src/scu_general/dtscon.rs | 123 +- src/scu_general/dtsstat.rs | 37 +- src/scu_general/g0orcen.rs | 97 +- src/scu_general/g1orcen.rs | 97 +- src/scu_general/gpr0.rs | 63 +- src/scu_general/gpr1.rs | 63 +- src/scu_general/id.rs | 29 +- src/scu_general/idchip.rs | 25 +- src/scu_general/idmanuf.rs | 27 +- src/scu_general/mirrallreq.rs | 49 +- src/scu_general/mirrallstat.rs | 29 +- src/scu_general/mirrsts.rs | 143 +- src/scu_general/rmacr.rs | 84 +- src/scu_general/rmdata.rs | 63 +- src/scu_general/stcon.rs | 121 +- src/scu_hibernate.rs | 148 +- src/scu_hibernate/hdclr.rs | 184 +- src/scu_hibernate/hdcr.rs | 614 ++-- src/scu_hibernate/hdset.rs | 184 +- src/scu_hibernate/hdstat.rs | 89 +- src/scu_hibernate/hintclr.rs | 115 +- src/scu_hibernate/hintset.rs | 130 +- src/scu_hibernate/hintst.rs | 55 +- src/scu_hibernate/lpacclr.rs | 124 +- src/scu_hibernate/lpacconf.rs | 161 +- src/scu_hibernate/lpacset.rs | 124 +- src/scu_hibernate/lpacst.rs | 59 +- src/scu_hibernate/lpacth0.rs | 71 +- src/scu_hibernate/lpacth1.rs | 87 +- src/scu_hibernate/oscsictrl.rs | 76 +- src/scu_hibernate/osculctrl.rs | 111 +- src/scu_hibernate/osculstat.rs | 25 +- src/scu_interrupt.rs | 56 +- src/scu_interrupt/nmireqen.rs | 202 +- src/scu_interrupt/srclr.rs | 394 ++- src/scu_interrupt/srmsk.rs | 559 +-- src/scu_interrupt/srraw.rs | 155 +- src/scu_interrupt/srset.rs | 394 ++- src/scu_interrupt/srstat.rs | 155 +- src/scu_osc.rs | 31 +- src/scu_osc/clkcalconst.rs | 63 +- src/scu_osc/oschpctrl.rs | 140 +- src/scu_osc/oschpstat.rs | 25 +- src/scu_parity.rs | 67 +- src/scu_parity/mchkcon.rs | 265 +- src/scu_parity/peen.rs | 265 +- src/scu_parity/peflag.rs | 265 +- src/scu_parity/persten.rs | 76 +- src/scu_parity/pete.rs | 265 +- src/scu_parity/pmtpr.rs | 65 +- src/scu_parity/pmtsr.rs | 265 +- src/scu_pll.rs | 67 +- src/scu_pll/clkmxstat.rs | 34 +- src/scu_pll/pllcon0.rs | 250 +- src/scu_pll/pllcon1.rs | 87 +- src/scu_pll/pllcon2.rs | 97 +- src/scu_pll/pllstat.rs | 77 +- src/scu_pll/usbpllcon.rs | 203 +- src/scu_pll/usbpllstat.rs | 53 +- src/scu_power.rs | 60 +- src/scu_power/evrstat.rs | 29 +- src/scu_power/evrvadcstat.rs | 27 +- src/scu_power/pwrclr.rs | 94 +- src/scu_power/pwrmon.rs | 79 +- src/scu_power/pwrset.rs | 94 +- src/scu_power/pwrstat.rs | 47 +- src/scu_reset.rs | 110 +- src/scu_reset/prclr0.rs | 214 +- src/scu_reset/prclr1.rs | 124 +- src/scu_reset/prclr2.rs | 109 +- src/scu_reset/prset0.rs | 214 +- src/scu_reset/prset1.rs | 124 +- src/scu_reset/prset2.rs | 109 +- src/scu_reset/prstat0.rs | 95 +- src/scu_reset/prstat1.rs | 59 +- src/scu_reset/prstat2.rs | 53 +- src/scu_reset/rstclr.rs | 94 +- src/scu_reset/rstset.rs | 79 +- src/scu_reset/rststat.rs | 62 +- src/scu_trap.rs | 47 +- src/scu_trap/trapclr.rs | 184 +- src/scu_trap/trapdis.rs | 265 +- src/scu_trap/trapraw.rs | 83 +- src/scu_trap/trapset.rs | 184 +- src/scu_trap/trapstat.rs | 83 +- src/usb0.rs | 435 ++- src/usb0/daint.rs | 27 +- src/usb0/daintmsk.rs | 71 +- src/usb0/dcfg.rs | 181 +- src/usb0/dctl.rs | 205 +- src/usb0/diepempmsk.rs | 63 +- src/usb0/diepmsk.rs | 127 +- src/usb0/dieptxf1.rs | 71 +- src/usb0/dieptxf2.rs | 71 +- src/usb0/dieptxf3.rs | 71 +- src/usb0/dieptxf4.rs | 71 +- src/usb0/dieptxf5.rs | 71 +- src/usb0/dieptxf6.rs | 71 +- src/usb0/doepmsk.rs | 143 +- src/usb0/dsts.rs | 38 +- src/usb0/dvbusdis.rs | 63 +- src/usb0/dvbuspulse.rs | 63 +- src/usb0/gahbcfg.rs | 199 +- src/usb0/gdfifocfg.rs | 71 +- src/usb0/gintmsk_devicemode.rs | 215 +- src/usb0/gintmsk_hostmode.rs | 151 +- src/usb0/gintsts_devicemode.rs | 177 +- src/usb0/gintsts_hostmode.rs | 127 +- src/usb0/gnptxfsiz_devicemode.rs | 71 +- src/usb0/gnptxfsiz_hostmode.rs | 71 +- src/usb0/gnptxsts.rs | 62 +- src/usb0/gotgctl.rs | 322 +- src/usb0/gotgint.rs | 103 +- src/usb0/grstctl.rs | 130 +- src/usb0/grxfsiz.rs | 63 +- src/usb0/grxstsp_devicemode.rs | 61 +- src/usb0/grxstsp_hostmode.rs | 57 +- src/usb0/grxstsr_devicemode.rs | 61 +- src/usb0/grxstsr_hostmode.rs | 57 +- src/usb0/guid.rs | 79 +- src/usb0/gusbcfg.rs | 205 +- src/usb0/haint.rs | 25 +- src/usb0/haintmsk.rs | 63 +- src/usb0/hcfg.rs | 150 +- src/usb0/hfir.rs | 84 +- src/usb0/hflbaddr.rs | 63 +- src/usb0/hfnum.rs | 65 +- src/usb0/hprt.rs | 207 +- src/usb0/hptxfsiz.rs | 71 +- src/usb0/hptxsts.rs | 101 +- src/usb0/pcgcctl.rs | 71 +- src/usb0_ch0.rs | 64 +- src/usb0_ch0/hcchar.rs | 216 +- src/usb0_ch0/hcdma_buffermode.rs | 63 +- src/usb0_ch0/hcdma_scatgather.rs | 90 +- src/usb0_ch0/hcdmab.rs | 25 +- src/usb0_ch0/hcint.rs | 167 +- src/usb0_ch0/hcintmsk.rs | 159 +- src/usb0_ch0/hctsiz_buffermode.rs | 106 +- src/usb0_ch0/hctsiz_scatgather.rs | 106 +- src/usb0_ep0.rs | 113 +- src/usb0_ep0/diepctl0.rs | 144 +- src/usb0_ep0/diepdma0.rs | 63 +- src/usb0_ep0/diepdmab0.rs | 25 +- src/usb0_ep0/diepint0.rs | 113 +- src/usb0_ep0/dieptsiz0.rs | 71 +- src/usb0_ep0/doepctl0.rs | 118 +- src/usb0_ep0/doepdma0.rs | 63 +- src/usb0_ep0/doepdmab0.rs | 25 +- src/usb0_ep0/doepint0.rs | 151 +- src/usb0_ep0/doeptsiz0.rs | 102 +- src/usb0_ep0/dtxfsts0.rs | 36 +- src/usb0_ep1.rs | 118 +- src/usb0_ep1/diepctl_intbulk.rs | 182 +- src/usb0_ep1/diepctl_isocont.rs | 182 +- src/usb0_ep1/diepdma.rs | 63 +- src/usb0_ep1/diepdmab.rs | 25 +- src/usb0_ep1/diepint.rs | 113 +- src/usb0_ep1/dieptsiz.rs | 71 +- src/usb0_ep1/doepctl_intbulk.rs | 182 +- src/usb0_ep1/doepctl_isocont.rs | 182 +- src/usb0_ep1/doepdma.rs | 63 +- src/usb0_ep1/doepdmab.rs | 25 +- src/usb0_ep1/doepint.rs | 151 +- src/usb0_ep1/doeptsiz_control.rs | 79 +- src/usb0_ep1/doeptsiz_iso.rs | 86 +- src/usb0_ep1/dtxfsts.rs | 36 +- src/usic0.rs | 11 +- src/usic0/id.rs | 29 +- src/usic0_ch0.rs | 412 ++- src/usic0_ch0/brg.rs | 264 +- src/usic0_ch0/byp.rs | 63 +- src/usic0_ch0/bypcr.rs | 183 +- src/usic0_ch0/ccfg.rs | 59 +- src/usic0_ch0/ccr.rs | 308 +- src/usic0_ch0/cmtr.rs | 63 +- src/usic0_ch0/dx0cr.rs | 252 +- src/usic0_ch0/dx1cr.rs | 273 +- src/usic0_ch0/dx2cr.rs | 252 +- src/usic0_ch0/dx3cr.rs | 252 +- src/usic0_ch0/dx4cr.rs | 252 +- src/usic0_ch0/dx5cr.rs | 252 +- src/usic0_ch0/fdr.rs | 100 +- src/usic0_ch0/fmr.rs | 190 +- src/usic0_ch0/in_.rs | 40 +- src/usic0_ch0/inpr.rs | 130 +- src/usic0_ch0/kscfg.rs | 164 +- src/usic0_ch0/outdr.rs | 27 +- src/usic0_ch0/outr.rs | 27 +- src/usic0_ch0/pcr.rs | 311 +- src/usic0_ch0/pcr_ascmode.rs | 333 +- src/usic0_ch0/pcr_iicmode.rs | 323 +- src/usic0_ch0/pcr_iismode.rs | 231 +- src/usic0_ch0/pcr_sscmode.rs | 343 +- src/usic0_ch0/pscr.rs | 289 +- src/usic0_ch0/psr.rs | 282 +- src/usic0_ch0/psr_ascmode.rs | 397 ++- src/usic0_ch0/psr_iicmode.rs | 412 +-- src/usic0_ch0/psr_iismode.rs | 328 +- src/usic0_ch0/psr_sscmode.rs | 307 +- src/usic0_ch0/rbctr.rs | 396 ++- src/usic0_ch0/rbuf.rs | 25 +- src/usic0_ch0/rbuf0.rs | 25 +- src/usic0_ch0/rbuf01sr.rs | 100 +- src/usic0_ch0/rbuf1.rs | 25 +- src/usic0_ch0/rbufd.rs | 25 +- src/usic0_ch0/rbufsr.rs | 37 +- src/usic0_ch0/sctr.rs | 256 +- src/usic0_ch0/tbctr.rs | 307 +- src/usic0_ch0/tbuf.rs | 63 +- src/usic0_ch0/tcsr.rs | 332 +- src/usic0_ch0/trbptr.rs | 31 +- src/usic0_ch0/trbscr.rs | 154 +- src/usic0_ch0/trbsr.rs | 212 +- src/vadc.rs | 185 +- src/vadc/brsctrl.rs | 171 +- src/vadc/brsmr.rs | 231 +- src/vadc/brspnd.rs | 223 +- src/vadc/brssel.rs | 223 +- src/vadc/clc.rs | 103 +- src/vadc/emuxsel.rs | 71 +- src/vadc/globbound.rs | 71 +- src/vadc/globcfg.rs | 260 +- src/vadc/globeflag.rs | 127 +- src/vadc/globevnp.rs | 125 +- src/vadc/globiclass.rs | 141 +- src/vadc/globrcr.rs | 120 +- src/vadc/globres.rs | 98 +- src/vadc/globresd.rs | 98 +- src/vadc/globtf.rs | 170 +- src/vadc/id.rs | 29 +- src/vadc/ocs.rs | 156 +- src/vadc_g0.rs | 388 ++- src/vadc_g0/alias.rs | 71 +- src/vadc_g0/arbcfg.rs | 148 +- src/vadc_g0/arbpr.rs | 262 +- src/vadc_g0/asctrl.rs | 207 +- src/vadc_g0/asmr.rs | 231 +- src/vadc_g0/aspnd.rs | 223 +- src/vadc_g0/assel.rs | 223 +- src/vadc_g0/bfl.rs | 247 +- src/vadc_g0/bflc.rs | 195 +- src/vadc_g0/bflnp.rs | 211 +- src/vadc_g0/bfls.rs | 154 +- src/vadc_g0/bound.rs | 71 +- src/vadc_g0/cefclr.rs | 154 +- src/vadc_g0/ceflag.rs | 223 +- src/vadc_g0/cevnp0.rs | 335 +- src/vadc_g0/chass.rs | 223 +- src/vadc_g0/chctr.rs | 354 +- src/vadc_g0/emuxctr.rs | 171 +- src/vadc_g0/iclass.rs | 141 +- src/vadc_g0/q0r0.rs | 49 +- src/vadc_g0/qbur0.rs | 37 +- src/vadc_g0/qctrl0.rs | 207 +- src/vadc_g0/qinr0.rs | 85 +- src/vadc_g0/qmr0.rs | 192 +- src/vadc_g0/qsr0.rs | 56 +- src/vadc_g0/rcr.rs | 163 +- src/vadc_g0/refclr.rs | 274 +- src/vadc_g0/reflag.rs | 391 ++- src/vadc_g0/res.rs | 94 +- src/vadc_g0/resd.rs | 56 +- src/vadc_g0/revnp0.rs | 335 +- src/vadc_g0/revnp1.rs | 335 +- src/vadc_g0/sefclr.rs | 64 +- src/vadc_g0/seflag.rs | 97 +- src/vadc_g0/sevnp.rs | 125 +- src/vadc_g0/sract.rs | 154 +- src/vadc_g0/synctr.rs | 153 +- src/vadc_g0/vfr.rs | 391 ++- src/wdt.rs | 74 +- src/wdt/ctr.rs | 87 +- src/wdt/id.rs | 29 +- src/wdt/srv.rs | 40 +- src/wdt/tim.rs | 25 +- src/wdt/wdtclr.rs | 40 +- src/wdt/wdtsts.rs | 25 +- src/wdt/wlb.rs | 63 +- src/wdt/wub.rs | 63 +- 954 files changed, 61714 insertions(+), 67176 deletions(-) create mode 100644 src/generic/raw.rs diff --git a/build.rs b/build.rs index b22445de..86556343 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,4 @@ +#![doc = r" Builder file for Peripheral access crate generated by svd2rust tool"] use std::env; use std::fs::File; use std::io::Write; diff --git a/src/can.rs b/src/can.rs index 2d7d6ad0..1cd3034d 100644 --- a/src/can.rs +++ b/src/can.rs @@ -1,69 +1,121 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - CAN Clock Control Register"] - pub clc: CLC, + clc: CLC, _reserved1: [u8; 0x04], + id: ID, + fdr: FDR, + _reserved3: [u8; 0xf0], + list: [LIST; 8], + _reserved4: [u8; 0x20], + mspnd: [MSPND; 8], + _reserved5: [u8; 0x20], + msid: [MSID; 8], + _reserved6: [u8; 0x20], + msimask: MSIMASK, + panctr: PANCTR, + mcr: MCR, + mitr: MITR, +} +impl RegisterBlock { + #[doc = "0x00 - CAN Clock Control Register"] + #[inline(always)] + pub const fn clc(&self) -> &CLC { + &self.clc + } #[doc = "0x08 - Module Identification Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } #[doc = "0x0c - CAN Fractional Divider Register"] - pub fdr: FDR, - _reserved3: [u8; 0xf0], + #[inline(always)] + pub const fn fdr(&self) -> &FDR { + &self.fdr + } #[doc = "0x100..0x120 - List Register"] - pub list: [LIST; 8], - _reserved4: [u8; 0x20], + #[inline(always)] + pub const fn list(&self, n: usize) -> &LIST { + &self.list[n] + } #[doc = "0x140..0x160 - Message Pending Register"] - pub mspnd: [MSPND; 8], - _reserved5: [u8; 0x20], + #[inline(always)] + pub const fn mspnd(&self, n: usize) -> &MSPND { + &self.mspnd[n] + } #[doc = "0x180..0x1a0 - Message Index Register"] - pub msid: [MSID; 8], - _reserved6: [u8; 0x20], + #[inline(always)] + pub const fn msid(&self, n: usize) -> &MSID { + &self.msid[n] + } #[doc = "0x1c0 - Message Index Mask Register"] - pub msimask: MSIMASK, + #[inline(always)] + pub const fn msimask(&self) -> &MSIMASK { + &self.msimask + } #[doc = "0x1c4 - Panel Control Register"] - pub panctr: PANCTR, + #[inline(always)] + pub const fn panctr(&self) -> &PANCTR { + &self.panctr + } #[doc = "0x1c8 - Module Control Register"] - pub mcr: MCR, + #[inline(always)] + pub const fn mcr(&self) -> &MCR { + &self.mcr + } #[doc = "0x1cc - Module Interrupt Trigger Register"] - pub mitr: MITR, + #[inline(always)] + pub const fn mitr(&self) -> &MITR { + &self.mitr + } } -#[doc = "CLC (rw) register accessor: an alias for `Reg`"] +#[doc = "CLC (rw) register accessor: CAN Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clc`] +module"] pub type CLC = crate::Reg; #[doc = "CAN Clock Control Register"] pub mod clc; -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "FDR (rw) register accessor: an alias for `Reg`"] +#[doc = "FDR (rw) register accessor: CAN Fractional Divider Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fdr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fdr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fdr`] +module"] pub type FDR = crate::Reg; #[doc = "CAN Fractional Divider Register"] pub mod fdr; -#[doc = "LIST (r) register accessor: an alias for `Reg`"] +#[doc = "LIST (r) register accessor: List Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`list::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@list`] +module"] pub type LIST = crate::Reg; #[doc = "List Register"] pub mod list; -#[doc = "MSPND (rw) register accessor: an alias for `Reg`"] +#[doc = "MSPND (rw) register accessor: Message Pending Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mspnd::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mspnd::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mspnd`] +module"] pub type MSPND = crate::Reg; #[doc = "Message Pending Register"] pub mod mspnd; -#[doc = "MSID (r) register accessor: an alias for `Reg`"] +#[doc = "MSID (r) register accessor: Message Index Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msid::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@msid`] +module"] pub type MSID = crate::Reg; #[doc = "Message Index Register"] pub mod msid; -#[doc = "MSIMASK (rw) register accessor: an alias for `Reg`"] +#[doc = "MSIMASK (rw) register accessor: Message Index Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msimask::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`msimask::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@msimask`] +module"] pub type MSIMASK = crate::Reg; #[doc = "Message Index Mask Register"] pub mod msimask; -#[doc = "PANCTR (rw) register accessor: an alias for `Reg`"] +#[doc = "PANCTR (rw) register accessor: Panel Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`panctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`panctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@panctr`] +module"] pub type PANCTR = crate::Reg; #[doc = "Panel Control Register"] pub mod panctr; -#[doc = "MCR (rw) register accessor: an alias for `Reg`"] +#[doc = "MCR (rw) register accessor: Module Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mcr`] +module"] pub type MCR = crate::Reg; #[doc = "Module Control Register"] pub mod mcr; -#[doc = "MITR (w) register accessor: an alias for `Reg`"] +#[doc = "MITR (w) register accessor: Module Interrupt Trigger Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mitr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mitr`] +module"] 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 9b234978..cb1e959f 100644 --- a/src/can/clc.rs +++ b/src/can/clc.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DISR` reader - Module Disable Request Bit"] -pub type DISR_R = crate::BitReader; +pub type DISR_R = crate::BitReader; #[doc = "Field `DISR` writer - Module Disable Request Bit"] -pub type DISR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLC_SPEC, bool, O>; +pub type DISR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DISS` reader - Module Disable Status Bit"] -pub type DISS_R = crate::BitReader; +pub type DISS_R = crate::BitReader; #[doc = "Field `EDIS` reader - Sleep Mode Enable Control"] -pub type EDIS_R = crate::BitReader; +pub type EDIS_R = crate::BitReader; #[doc = "Field `EDIS` writer - Sleep Mode Enable Control"] -pub type EDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLC_SPEC, bool, O>; +pub type EDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SBWE` writer - Module Suspend Bit Write Enable for OCDS"] -pub type SBWE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLC_SPEC, bool, O>; +pub type SBWE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Module Disable Request Bit"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bit 0 - Module Disable Request Bit"] #[inline(always)] #[must_use] - pub fn disr(&mut self) -> DISR_W<0> { - DISR_W::new(self) + pub fn disr(&mut self) -> DISR_W { + DISR_W::new(self, 0) } #[doc = "Bit 3 - Sleep Mode Enable Control"] #[inline(always)] #[must_use] - pub fn edis(&mut self) -> EDIS_W<3> { - EDIS_W::new(self) + pub fn edis(&mut self) -> EDIS_W { + EDIS_W::new(self, 3) } #[doc = "Bit 4 - Module Suspend Bit Write Enable for OCDS"] #[inline(always)] #[must_use] - pub fn sbwe(&mut self) -> SBWE_W<4> { - SBWE_W::new(self) + pub fn sbwe(&mut self) -> SBWE_W { + SBWE_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CAN Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`clc::R`](R) reader structure"] +impl crate::Readable for CLC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`clc::W`](W) writer structure"] impl crate::Writable for CLC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can/fdr.rs b/src/can/fdr.rs index d3b8dfb5..b9dd7f31 100644 --- a/src/can/fdr.rs +++ b/src/can/fdr.rs @@ -1,69 +1,37 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `STEP` reader - Step Value"] -pub type STEP_R = crate::FieldReader; +pub type STEP_R = crate::FieldReader; #[doc = "Field `STEP` writer - Step Value"] -pub type STEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FDR_SPEC, u16, u16, 10, O>; +pub type STEP_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `SM` reader - Suspend Mode"] -pub type SM_R = crate::BitReader; +pub type SM_R = crate::BitReader; #[doc = "Field `SM` writer - Suspend Mode"] -pub type SM_W<'a, const O: u8> = crate::BitWriter<'a, u32, FDR_SPEC, bool, O>; +pub type SM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SC` reader - Suspend Control"] -pub type SC_R = crate::FieldReader; +pub type SC_R = crate::FieldReader; #[doc = "Field `SC` writer - Suspend Control"] -pub type SC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FDR_SPEC, u8, u8, 2, O>; +pub type SC_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `DM` reader - Divider Mode"] -pub type DM_R = crate::FieldReader; +pub type DM_R = crate::FieldReader; #[doc = "Field `DM` writer - Divider Mode"] -pub type DM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FDR_SPEC, u8, u8, 2, O>; +pub type DM_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `RESULT` reader - Result Value"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; #[doc = "Field `SUSACK` reader - Suspend Mode Acknowledge"] -pub type SUSACK_R = crate::BitReader; +pub type SUSACK_R = crate::BitReader; #[doc = "Field `SUSREQ` reader - Suspend Mode Request"] -pub type SUSREQ_R = crate::BitReader; +pub type SUSREQ_R = crate::BitReader; #[doc = "Field `ENHW` reader - Enable Hardware Clock Control"] -pub type ENHW_R = crate::BitReader; +pub type ENHW_R = crate::BitReader; #[doc = "Field `ENHW` writer - Enable Hardware Clock Control"] -pub type ENHW_W<'a, const O: u8> = crate::BitWriter<'a, u32, FDR_SPEC, bool, O>; +pub type ENHW_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DISCLK` reader - Disable Clock"] -pub type DISCLK_R = crate::BitReader; +pub type DISCLK_R = crate::BitReader; #[doc = "Field `DISCLK` writer - Disable Clock"] -pub type DISCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, FDR_SPEC, bool, O>; +pub type DISCLK_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:9 - Step Value"] #[inline(always)] @@ -115,58 +83,59 @@ impl W { #[doc = "Bits 0:9 - Step Value"] #[inline(always)] #[must_use] - pub fn step(&mut self) -> STEP_W<0> { - STEP_W::new(self) + pub fn step(&mut self) -> STEP_W { + STEP_W::new(self, 0) } #[doc = "Bit 11 - Suspend Mode"] #[inline(always)] #[must_use] - pub fn sm(&mut self) -> SM_W<11> { - SM_W::new(self) + pub fn sm(&mut self) -> SM_W { + SM_W::new(self, 11) } #[doc = "Bits 12:13 - Suspend Control"] #[inline(always)] #[must_use] - pub fn sc(&mut self) -> SC_W<12> { - SC_W::new(self) + pub fn sc(&mut self) -> SC_W { + SC_W::new(self, 12) } #[doc = "Bits 14:15 - Divider Mode"] #[inline(always)] #[must_use] - pub fn dm(&mut self) -> DM_W<14> { - DM_W::new(self) + pub fn dm(&mut self) -> DM_W { + DM_W::new(self, 14) } #[doc = "Bit 30 - Enable Hardware Clock Control"] #[inline(always)] #[must_use] - pub fn enhw(&mut self) -> ENHW_W<30> { - ENHW_W::new(self) + pub fn enhw(&mut self) -> ENHW_W { + ENHW_W::new(self, 30) } #[doc = "Bit 31 - Disable Clock"] #[inline(always)] #[must_use] - pub fn disclk(&mut self) -> DISCLK_W<31> { - DISCLK_W::new(self) + pub fn disclk(&mut self) -> DISCLK_W { + DISCLK_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CAN Fractional Divider Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fdr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fdr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fdr::R`](R) reader structure"] +impl crate::Readable for FDR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fdr::W`](W) writer structure"] impl crate::Writable for FDR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can/id.rs b/src/can/id.rs index 33186f15..f4fba0df 100644 --- a/src/can/id.rs +++ b/src/can/id.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision Number"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Module Type\n\nValue on reset: 192"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -30,23 +17,26 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MOD_TYPE_A { + type Ux = u8; +} impl MOD_TYPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 192 => Some(MOD_TYPE_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Define the module as a 32-bit module."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MOD_TYPE_A::VALUE1 } } #[doc = "Field `MOD_NUMBER` reader - Module Number Value"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -64,15 +54,13 @@ 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"] +#[doc = "Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x002b_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x002b_c000; diff --git a/src/can/list.rs b/src/can/list.rs index de9b2d07..23aa1b2b 100644 --- a/src/can/list.rs +++ b/src/can/list.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `BEGIN` reader - List Begin"] -pub type BEGIN_R = crate::FieldReader; +pub type BEGIN_R = crate::FieldReader; #[doc = "Field `END` reader - List End"] -pub type END_R = crate::FieldReader; +pub type END_R = crate::FieldReader; #[doc = "Field `SIZE` reader - List Size"] -pub type SIZE_R = crate::FieldReader; +pub type SIZE_R = crate::FieldReader; #[doc = "Field `EMPTY` reader - List Empty Indication"] pub type EMPTY_R = crate::BitReader; #[doc = "List Empty Indication\n\nValue on reset: 0"] @@ -38,18 +25,18 @@ impl From for bool { impl EMPTY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMPTY_A { + pub const fn variant(&self) -> EMPTY_A { match self.bits { false => EMPTY_A::VALUE1, true => EMPTY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "At least one message object is allocated to list i."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMPTY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No message object is allocated to the list x. List x is empty."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMPTY_A::VALUE2 @@ -77,15 +64,13 @@ impl R { EMPTY_R::new(((self.bits >> 24) & 1) != 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"] +#[doc = "List Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`list::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`list::R`](R) reader structure"] +impl crate::Readable for LIST_SPEC {} #[doc = "`reset()` method sets LIST[%s] to value 0"] impl crate::Resettable for LIST_SPEC { diff --git a/src/can/mcr.rs b/src/can/mcr.rs index ca019423..203e5550 100644 --- a/src/can/mcr.rs +++ b/src/can/mcr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MPSEL` reader - Message Pending Selector"] -pub type MPSEL_R = crate::FieldReader; +pub type MPSEL_R = crate::FieldReader; #[doc = "Field `MPSEL` writer - Message Pending Selector"] -pub type MPSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MCR_SPEC, u8, u8, 4, O>; +pub type MPSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 12:15 - Message Pending Selector"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 12:15 - Message Pending Selector"] #[inline(always)] #[must_use] - pub fn mpsel(&mut self) -> MPSEL_W<12> { - MPSEL_W::new(self) + pub fn mpsel(&mut self) -> MPSEL_W { + MPSEL_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Module Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mcr::R`](R) reader structure"] +impl crate::Readable for MCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mcr::W`](W) writer structure"] impl crate::Writable for MCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can/mitr.rs b/src/can/mitr.rs index b9b657e6..ca6a1a0f 100644 --- a/src/can/mitr.rs +++ b/src/can/mitr.rs @@ -1,48 +1,32 @@ #[doc = "Register `MITR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `IT` writer - Interrupt Trigger"] -pub type IT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MITR_SPEC, u8, u8, 8, O>; +pub type IT_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl W { #[doc = "Bits 0:7 - Interrupt Trigger"] #[inline(always)] #[must_use] - pub fn it(&mut self) -> IT_W<0> { - IT_W::new(self) + pub fn it(&mut self) -> IT_W { + IT_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Module Interrupt Trigger Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mitr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MITR_SPEC; impl crate::RegisterSpec for MITR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [mitr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`mitr::W`](W) writer structure"] impl crate::Writable for MITR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can/msid.rs b/src/can/msid.rs index 99bbc90d..7367d456 100644 --- a/src/can/msid.rs +++ b/src/can/msid.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `INDEX` reader - Message Pending Index"] -pub type INDEX_R = crate::FieldReader; +pub type INDEX_R = crate::FieldReader; impl R { #[doc = "Bits 0:5 - Message Pending Index"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Message Index Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msid::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`msid::R`](R) reader structure"] +impl crate::Readable for MSID_SPEC {} #[doc = "`reset()` method sets MSID[%s] to value 0x20"] impl crate::Resettable for MSID_SPEC { diff --git a/src/can/msimask.rs b/src/can/msimask.rs index 209ceed6..260644f5 100644 --- a/src/can/msimask.rs +++ b/src/can/msimask.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `IM` reader - Message Index Mask"] -pub type IM_R = crate::FieldReader; +pub type IM_R = crate::FieldReader; #[doc = "Field `IM` writer - Message Index Mask"] -pub type IM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MSIMASK_SPEC, u32, u32, 32, O>; +pub type IM_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Message Index Mask"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Message Index Mask"] #[inline(always)] #[must_use] - pub fn im(&mut self) -> IM_W<0> { - IM_W::new(self) + pub fn im(&mut self) -> IM_W { + IM_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Index Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msimask::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`msimask::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`msimask::R`](R) reader structure"] +impl crate::Readable for MSIMASK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`msimask::W`](W) writer structure"] impl crate::Writable for MSIMASK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can/mspnd.rs b/src/can/mspnd.rs index eced709e..e74bc6c1 100644 --- a/src/can/mspnd.rs +++ b/src/can/mspnd.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PND` reader - Message Pending"] -pub type PND_R = crate::FieldReader; +pub type PND_R = crate::FieldReader; #[doc = "Field `PND` writer - Message Pending"] -pub type PND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MSPND_SPEC, u32, u32, 32, O>; +pub type PND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Message Pending"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Message Pending"] #[inline(always)] #[must_use] - pub fn pnd(&mut self) -> PND_W<0> { - PND_W::new(self) + pub fn pnd(&mut self) -> PND_W { + PND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Pending Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mspnd::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mspnd::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mspnd::R`](R) reader structure"] +impl crate::Readable for MSPND_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mspnd::W`](W) writer structure"] impl crate::Writable for MSPND_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can/panctr.rs b/src/can/panctr.rs index 1d719134..5e651c33 100644 --- a/src/can/panctr.rs +++ b/src/can/panctr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PANCMD` reader - Panel Command"] -pub type PANCMD_R = crate::FieldReader; +pub type PANCMD_R = crate::FieldReader; #[doc = "Field `PANCMD` writer - Panel Command"] -pub type PANCMD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PANCTR_SPEC, u8, u8, 8, O>; +pub type PANCMD_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `BUSY` reader - Panel Busy Flag"] pub type BUSY_R = crate::BitReader; #[doc = "Panel Busy Flag\n\nValue on reset: 1"] @@ -57,18 +25,18 @@ impl From for bool { impl BUSY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BUSY_A { + pub const fn variant(&self) -> BUSY_A { match self.bits { false => BUSY_A::VALUE1, true => BUSY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Panel has finished command and is ready to accept a new command."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BUSY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Panel operation is in progress."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BUSY_A::VALUE2 @@ -93,31 +61,31 @@ impl From for bool { impl RBUSY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RBUSY_A { + pub const fn variant(&self) -> RBUSY_A { match self.bits { false => RBUSY_A::VALUE1, true => RBUSY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No update of PANAR1 and PANAR2 is scheduled by the list controller."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RBUSY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A list command is running (BUSY = 1) that will write results to PANAR1 and PANAR2, but the results are not yet available."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RBUSY_A::VALUE2 } } #[doc = "Field `PANAR1` reader - Panel Argument 1"] -pub type PANAR1_R = crate::FieldReader; +pub type PANAR1_R = crate::FieldReader; #[doc = "Field `PANAR1` writer - Panel Argument 1"] -pub type PANAR1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PANCTR_SPEC, u8, u8, 8, O>; +pub type PANAR1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PANAR2` reader - Panel Argument 2"] -pub type PANAR2_R = crate::FieldReader; +pub type PANAR2_R = crate::FieldReader; #[doc = "Field `PANAR2` writer - Panel Argument 2"] -pub type PANAR2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PANCTR_SPEC, u8, u8, 8, O>; +pub type PANAR2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Panel Command"] #[inline(always)] @@ -149,40 +117,41 @@ impl W { #[doc = "Bits 0:7 - Panel Command"] #[inline(always)] #[must_use] - pub fn pancmd(&mut self) -> PANCMD_W<0> { - PANCMD_W::new(self) + pub fn pancmd(&mut self) -> PANCMD_W { + PANCMD_W::new(self, 0) } #[doc = "Bits 16:23 - Panel Argument 1"] #[inline(always)] #[must_use] - pub fn panar1(&mut self) -> PANAR1_W<16> { - PANAR1_W::new(self) + pub fn panar1(&mut self) -> PANAR1_W { + PANAR1_W::new(self, 16) } #[doc = "Bits 24:31 - Panel Argument 2"] #[inline(always)] #[must_use] - pub fn panar2(&mut self) -> PANAR2_W<24> { - PANAR2_W::new(self) + pub fn panar2(&mut self) -> PANAR2_W { + PANAR2_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Panel Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`panctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`panctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`panctr::R`](R) reader structure"] +impl crate::Readable for PANCTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`panctr::W`](W) writer structure"] impl crate::Writable for PANCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0.rs b/src/can_mo0.rs index 1635b388..fbff8fde 100644 --- a/src/can_mo0.rs +++ b/src/can_mo0.rs @@ -1,67 +1,104 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + mofcr: MOFCR, + mofgpr: MOFGPR, + moipr: MOIPR, + moamr: MOAMR, + modatal: MODATAL, + modatah: MODATAH, + moar: MOAR, + _reserved_7_moctr: [u8; 0x04], +} +impl RegisterBlock { #[doc = "0x00 - Message Object Function Control Register"] - pub mofcr: MOFCR, + #[inline(always)] + pub const fn mofcr(&self) -> &MOFCR { + &self.mofcr + } #[doc = "0x04 - Message Object FIFO/Gateway Pointer Register"] - pub mofgpr: MOFGPR, + #[inline(always)] + pub const fn mofgpr(&self) -> &MOFGPR { + &self.mofgpr + } #[doc = "0x08 - Message Object Interrupt Pointer Register"] - pub moipr: MOIPR, + #[inline(always)] + pub const fn moipr(&self) -> &MOIPR { + &self.moipr + } #[doc = "0x0c - Message Object Acceptance Mask Register"] - pub moamr: MOAMR, + #[inline(always)] + pub const fn moamr(&self) -> &MOAMR { + &self.moamr + } #[doc = "0x10 - Message Object Data Register Low"] - pub modatal: MODATAL, + #[inline(always)] + pub const fn modatal(&self) -> &MODATAL { + &self.modatal + } #[doc = "0x14 - Message Object Data Register High"] - pub modatah: MODATAH, + #[inline(always)] + pub const fn modatah(&self) -> &MODATAH { + &self.modatah + } #[doc = "0x18 - Message Object Arbitration Register"] - pub moar: MOAR, - _reserved_7_moctr: [u8; 0x04], -} -impl RegisterBlock { + #[inline(always)] + pub const fn moar(&self) -> &MOAR { + &self.moar + } #[doc = "0x1c - Message Object Status Register"] #[inline(always)] pub const fn mostat(&self) -> &MOSTAT { - unsafe { &*(self as *const Self).cast::().add(28usize).cast() } + unsafe { &*(self as *const Self).cast::().add(28).cast() } } #[doc = "0x1c - Message Object Control Register"] #[inline(always)] pub const fn moctr(&self) -> &MOCTR { - unsafe { &*(self as *const Self).cast::().add(28usize).cast() } + unsafe { &*(self as *const Self).cast::().add(28).cast() } } } -#[doc = "MOFCR (rw) register accessor: an alias for `Reg`"] +#[doc = "MOFCR (rw) register accessor: Message Object Function Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mofcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mofcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mofcr`] +module"] pub type MOFCR = crate::Reg; #[doc = "Message Object Function Control Register"] pub mod mofcr; -#[doc = "MOFGPR (rw) register accessor: an alias for `Reg`"] +#[doc = "MOFGPR (rw) register accessor: Message Object FIFO/Gateway Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mofgpr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mofgpr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mofgpr`] +module"] pub type MOFGPR = crate::Reg; #[doc = "Message Object FIFO/Gateway Pointer Register"] pub mod mofgpr; -#[doc = "MOIPR (rw) register accessor: an alias for `Reg`"] +#[doc = "MOIPR (rw) register accessor: Message Object Interrupt Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`moipr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`moipr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@moipr`] +module"] pub type MOIPR = crate::Reg; #[doc = "Message Object Interrupt Pointer Register"] pub mod moipr; -#[doc = "MOAMR (rw) register accessor: an alias for `Reg`"] +#[doc = "MOAMR (rw) register accessor: Message Object Acceptance Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`moamr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`moamr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@moamr`] +module"] pub type MOAMR = crate::Reg; #[doc = "Message Object Acceptance Mask Register"] pub mod moamr; -#[doc = "MODATAL (rw) register accessor: an alias for `Reg`"] +#[doc = "MODATAL (rw) register accessor: Message Object Data Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`modatal::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`modatal::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@modatal`] +module"] pub type MODATAL = crate::Reg; #[doc = "Message Object Data Register Low"] pub mod modatal; -#[doc = "MODATAH (rw) register accessor: an alias for `Reg`"] +#[doc = "MODATAH (rw) register accessor: Message Object Data Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`modatah::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`modatah::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@modatah`] +module"] pub type MODATAH = crate::Reg; #[doc = "Message Object Data Register High"] pub mod modatah; -#[doc = "MOAR (rw) register accessor: an alias for `Reg`"] +#[doc = "MOAR (rw) register accessor: Message Object Arbitration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`moar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`moar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@moar`] +module"] pub type MOAR = crate::Reg; #[doc = "Message Object Arbitration Register"] pub mod moar; -#[doc = "MOCTR (w) register accessor: an alias for `Reg`"] +#[doc = "MOCTR (w) register accessor: Message Object Control Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`moctr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@moctr`] +module"] pub type MOCTR = crate::Reg; #[doc = "Message Object Control Register"] pub mod moctr; -#[doc = "MOSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "MOSTAT (r) register accessor: Message Object Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mostat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mostat`] +module"] 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 13b3f915..aa88763d 100644 --- a/src/can_mo0/moamr.rs +++ b/src/can_mo0/moamr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `AM` reader - Acceptance Mask for Message Identifier"] -pub type AM_R = crate::FieldReader; +pub type AM_R = crate::FieldReader; #[doc = "Field `AM` writer - Acceptance Mask for Message Identifier"] -pub type AM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOAMR_SPEC, u32, u32, 29, O>; +pub type AM_W<'a, REG> = crate::FieldWriter<'a, REG, 29, u32>; #[doc = "Field `MIDE` reader - Acceptance Mask Bit for Message IDE Bit"] pub type MIDE_R = crate::BitReader; #[doc = "Acceptance Mask Bit for Message IDE Bit\n\nValue on reset: 1"] @@ -57,34 +25,37 @@ impl From for bool { impl MIDE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MIDE_A { + pub const fn variant(&self) -> MIDE_A { match self.bits { false => MIDE_A::VALUE1, true => MIDE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message object n accepts the reception of both, standard and extended frames."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MIDE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message object n receives frames only with matching IDE bit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MIDE_A::VALUE2 } } #[doc = "Field `MIDE` writer - Acceptance Mask Bit for Message IDE Bit"] -pub type MIDE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOAMR_SPEC, MIDE_A, O>; -impl<'a, const O: u8> MIDE_W<'a, O> { +pub type MIDE_W<'a, REG> = crate::BitWriter<'a, REG, MIDE_A>; +impl<'a, REG> MIDE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Message object n accepts the reception of both, standard and extended frames."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MIDE_A::VALUE1) } #[doc = "Message object n receives frames only with matching IDE bit."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MIDE_A::VALUE2) } } @@ -104,34 +75,35 @@ impl W { #[doc = "Bits 0:28 - Acceptance Mask for Message Identifier"] #[inline(always)] #[must_use] - pub fn am(&mut self) -> AM_W<0> { - AM_W::new(self) + pub fn am(&mut self) -> AM_W { + AM_W::new(self, 0) } #[doc = "Bit 29 - Acceptance Mask Bit for Message IDE Bit"] #[inline(always)] #[must_use] - pub fn mide(&mut self) -> MIDE_W<29> { - MIDE_W::new(self) + pub fn mide(&mut self) -> MIDE_W { + MIDE_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Object Acceptance Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`moamr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`moamr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`moamr::R`](R) reader structure"] +impl crate::Readable for MOAMR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`moamr::W`](W) writer structure"] impl crate::Writable for MOAMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0/moar.rs b/src/can_mo0/moar.rs index e70d8a83..7d54d941 100644 --- a/src/can_mo0/moar.rs +++ b/src/can_mo0/moar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ID` reader - CAN Identifier of Message Object n"] -pub type ID_R = crate::FieldReader; +pub type ID_R = crate::FieldReader; #[doc = "Field `ID` writer - CAN Identifier of Message Object n"] -pub type ID_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOAR_SPEC, u32, u32, 29, O>; +pub type ID_W<'a, REG> = crate::FieldWriter<'a, REG, 29, u32>; #[doc = "Field `IDE` reader - Identifier Extension Bit of Message Object n"] pub type IDE_R = crate::BitReader; #[doc = "Identifier Extension Bit of Message Object n\n\nValue on reset: 0"] @@ -57,46 +25,49 @@ impl From for bool { impl IDE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IDE_A { + pub const fn variant(&self) -> IDE_A { match self.bits { false => IDE_A::VALUE1, true => IDE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message object n handles standard frames with 11-bit identifier."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IDE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message object n handles extended frames with 29-bit identifier."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IDE_A::VALUE2 } } #[doc = "Field `IDE` writer - Identifier Extension Bit of Message Object n"] -pub type IDE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOAR_SPEC, IDE_A, O>; -impl<'a, const O: u8> IDE_W<'a, O> { +pub type IDE_W<'a, REG> = crate::BitWriter<'a, REG, IDE_A>; +impl<'a, REG> IDE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Message object n handles standard frames with 11-bit identifier."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IDE_A::VALUE1) } #[doc = "Message object n handles extended frames with 29-bit identifier."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IDE_A::VALUE2) } } #[doc = "Field `PRI` reader - Priority Class"] -pub type PRI_R = crate::FieldReader; +pub type PRI_R = crate::FieldReader; #[doc = "Priority Class\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] pub enum PRI_A { #[doc = "0: Applicable only if TTCAN is available."] VALUE1 = 0, - #[doc = "1: Transmit acceptance filtering is based on the list order. This means that message object n is considered for transmission only if there is no other message object with valid transmit request (MSGVAL & TXEN0 & TXEN1 = 1) somewhere before this object in the list."] + #[doc = "1: Transmit acceptance filtering is based on the list order. This means that message object n is considered for transmission only if there is no other message object with valid transmit request (MSGVAL & TXEN0 & TXEN1 = 1) somewhere before this object in the list."] VALUE2 = 1, #[doc = "2: Transmit acceptance filtering is based on the CAN identifier. This means, message object n is considered for transmission only if there is no other message object with higher priority identifier + IDE + DIR (with respect to CAN arbitration rules) somewhere in the list (see )."] VALUE3 = 2, @@ -109,10 +80,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PRI_A { + type Ux = u8; +} impl PRI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRI_A { + pub const fn variant(&self) -> PRI_A { match self.bits { 0 => PRI_A::VALUE1, 1 => PRI_A::VALUE2, @@ -121,48 +95,52 @@ impl PRI_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Applicable only if TTCAN is available."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Transmit acceptance filtering is based on the list order. This means that message object n is considered for transmission only if there is no other message object with valid transmit request (MSGVAL & TXEN0 & TXEN1 = 1) somewhere before this object in the list."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRI_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Transmit acceptance filtering is based on the CAN identifier. This means, message object n is considered for transmission only if there is no other message object with higher priority identifier + IDE + DIR (with respect to CAN arbitration rules) somewhere in the list (see )."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PRI_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Transmit acceptance filtering is based on the list order (as PRI = 01B)."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PRI_A::VALUE4 } } #[doc = "Field `PRI` writer - Priority Class"] -pub type PRI_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, MOAR_SPEC, u8, PRI_A, 2, O>; -impl<'a, const O: u8> PRI_W<'a, O> { +pub type PRI_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PRI_A>; +impl<'a, REG> PRI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Applicable only if TTCAN is available."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRI_A::VALUE1) } - #[doc = "Transmit acceptance filtering is based on the list order. This means that message object n is considered for transmission only if there is no other message object with valid transmit request (MSGVAL & TXEN0 & TXEN1 = 1) somewhere before this object in the list."] + #[doc = "Transmit acceptance filtering is based on the list order. This means that message object n is considered for transmission only if there is no other message object with valid transmit request (MSGVAL & TXEN0 & TXEN1 = 1) somewhere before this object in the list."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRI_A::VALUE2) } #[doc = "Transmit acceptance filtering is based on the CAN identifier. This means, message object n is considered for transmission only if there is no other message object with higher priority identifier + IDE + DIR (with respect to CAN arbitration rules) somewhere in the list (see )."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PRI_A::VALUE3) } #[doc = "Transmit acceptance filtering is based on the list order (as PRI = 01B)."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PRI_A::VALUE4) } } @@ -187,40 +165,41 @@ impl W { #[doc = "Bits 0:28 - CAN Identifier of Message Object n"] #[inline(always)] #[must_use] - pub fn id(&mut self) -> ID_W<0> { - ID_W::new(self) + pub fn id(&mut self) -> ID_W { + ID_W::new(self, 0) } #[doc = "Bit 29 - Identifier Extension Bit of Message Object n"] #[inline(always)] #[must_use] - pub fn ide(&mut self) -> IDE_W<29> { - IDE_W::new(self) + pub fn ide(&mut self) -> IDE_W { + IDE_W::new(self, 29) } #[doc = "Bits 30:31 - Priority Class"] #[inline(always)] #[must_use] - pub fn pri(&mut self) -> PRI_W<30> { - PRI_W::new(self) + pub fn pri(&mut self) -> PRI_W { + PRI_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Object Arbitration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`moar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`moar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`moar::R`](R) reader structure"] +impl crate::Readable for MOAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`moar::W`](W) writer structure"] impl crate::Writable for MOAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0/moctr.rs b/src/can_mo0/moctr.rs index 598bf310..3c0aba7a 100644 --- a/src/can_mo0/moctr.rs +++ b/src/can_mo0/moctr.rs @@ -1,232 +1,216 @@ #[doc = "Register `MOCTR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RESRXPND` writer - Reset/Set Receive Pending"] -pub type RESRXPND_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESRXPND_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESTXPND` writer - Reset/Set Transmit Pending"] -pub type RESTXPND_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESTXPND_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESRXUPD` writer - Reset/Set Receive Updating"] -pub type RESRXUPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESRXUPD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESNEWDAT` writer - Reset/Set New Data"] -pub type RESNEWDAT_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESNEWDAT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESMSGLST` writer - Reset/Set Message Lost"] -pub type RESMSGLST_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESMSGLST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESMSGVAL` writer - Reset/Set Message Valid"] -pub type RESMSGVAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESMSGVAL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESRTSEL` writer - Reset/Set Receive/Transmit Selected"] -pub type RESRTSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESRTSEL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESRXEN` writer - Reset/Set Receive Enable"] -pub type RESRXEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESRXEN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESTXRQ` writer - Reset/Set Transmit Request"] -pub type RESTXRQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESTXRQ_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESTXEN0` writer - Reset/Set Transmit Enable 0"] -pub type RESTXEN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESTXEN0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESTXEN1` writer - Reset/Set Transmit Enable 1"] -pub type RESTXEN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESTXEN1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RESDIR` writer - Reset/Set Message Direction"] -pub type RESDIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type RESDIR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETRXPND` writer - Reset/Set Receive Pending"] -pub type SETRXPND_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETRXPND_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETTXPND` writer - Reset/Set Transmit Pending"] -pub type SETTXPND_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETTXPND_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETRXUPD` writer - Reset/Set Receive Updating"] -pub type SETRXUPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETRXUPD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETNEWDAT` writer - Reset/Set New Data"] -pub type SETNEWDAT_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETNEWDAT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETMSGLST` writer - Reset/Set Message Lost"] -pub type SETMSGLST_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETMSGLST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETMSGVAL` writer - Reset/Set Message Valid"] -pub type SETMSGVAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETMSGVAL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETRTSEL` writer - Reset/Set Receive/Transmit Selected"] -pub type SETRTSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETRTSEL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETRXEN` writer - Reset/Set Receive Enable"] -pub type SETRXEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETRXEN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETTXRQ` writer - Reset/Set Transmit Request"] -pub type SETTXRQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETTXRQ_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETTXEN0` writer - Reset/Set Transmit Enable 0"] -pub type SETTXEN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETTXEN0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETTXEN1` writer - Reset/Set Transmit Enable 1"] -pub type SETTXEN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETTXEN1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SETDIR` writer - Reset/Set Message Direction"] -pub type SETDIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOCTR_SPEC, bool, O>; +pub type SETDIR_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Reset/Set Receive Pending"] #[inline(always)] #[must_use] - pub fn resrxpnd(&mut self) -> RESRXPND_W<0> { - RESRXPND_W::new(self) + pub fn resrxpnd(&mut self) -> RESRXPND_W { + RESRXPND_W::new(self, 0) } #[doc = "Bit 1 - Reset/Set Transmit Pending"] #[inline(always)] #[must_use] - pub fn restxpnd(&mut self) -> RESTXPND_W<1> { - RESTXPND_W::new(self) + pub fn restxpnd(&mut self) -> RESTXPND_W { + RESTXPND_W::new(self, 1) } #[doc = "Bit 2 - Reset/Set Receive Updating"] #[inline(always)] #[must_use] - pub fn resrxupd(&mut self) -> RESRXUPD_W<2> { - RESRXUPD_W::new(self) + pub fn resrxupd(&mut self) -> RESRXUPD_W { + RESRXUPD_W::new(self, 2) } #[doc = "Bit 3 - Reset/Set New Data"] #[inline(always)] #[must_use] - pub fn resnewdat(&mut self) -> RESNEWDAT_W<3> { - RESNEWDAT_W::new(self) + pub fn resnewdat(&mut self) -> RESNEWDAT_W { + RESNEWDAT_W::new(self, 3) } #[doc = "Bit 4 - Reset/Set Message Lost"] #[inline(always)] #[must_use] - pub fn resmsglst(&mut self) -> RESMSGLST_W<4> { - RESMSGLST_W::new(self) + pub fn resmsglst(&mut self) -> RESMSGLST_W { + RESMSGLST_W::new(self, 4) } #[doc = "Bit 5 - Reset/Set Message Valid"] #[inline(always)] #[must_use] - pub fn resmsgval(&mut self) -> RESMSGVAL_W<5> { - RESMSGVAL_W::new(self) + pub fn resmsgval(&mut self) -> RESMSGVAL_W { + RESMSGVAL_W::new(self, 5) } #[doc = "Bit 6 - Reset/Set Receive/Transmit Selected"] #[inline(always)] #[must_use] - pub fn resrtsel(&mut self) -> RESRTSEL_W<6> { - RESRTSEL_W::new(self) + pub fn resrtsel(&mut self) -> RESRTSEL_W { + RESRTSEL_W::new(self, 6) } #[doc = "Bit 7 - Reset/Set Receive Enable"] #[inline(always)] #[must_use] - pub fn resrxen(&mut self) -> RESRXEN_W<7> { - RESRXEN_W::new(self) + pub fn resrxen(&mut self) -> RESRXEN_W { + RESRXEN_W::new(self, 7) } #[doc = "Bit 8 - Reset/Set Transmit Request"] #[inline(always)] #[must_use] - pub fn restxrq(&mut self) -> RESTXRQ_W<8> { - RESTXRQ_W::new(self) + pub fn restxrq(&mut self) -> RESTXRQ_W { + RESTXRQ_W::new(self, 8) } #[doc = "Bit 9 - Reset/Set Transmit Enable 0"] #[inline(always)] #[must_use] - pub fn restxen0(&mut self) -> RESTXEN0_W<9> { - RESTXEN0_W::new(self) + pub fn restxen0(&mut self) -> RESTXEN0_W { + RESTXEN0_W::new(self, 9) } #[doc = "Bit 10 - Reset/Set Transmit Enable 1"] #[inline(always)] #[must_use] - pub fn restxen1(&mut self) -> RESTXEN1_W<10> { - RESTXEN1_W::new(self) + pub fn restxen1(&mut self) -> RESTXEN1_W { + RESTXEN1_W::new(self, 10) } #[doc = "Bit 11 - Reset/Set Message Direction"] #[inline(always)] #[must_use] - pub fn resdir(&mut self) -> RESDIR_W<11> { - RESDIR_W::new(self) + pub fn resdir(&mut self) -> RESDIR_W { + RESDIR_W::new(self, 11) } #[doc = "Bit 16 - Reset/Set Receive Pending"] #[inline(always)] #[must_use] - pub fn setrxpnd(&mut self) -> SETRXPND_W<16> { - SETRXPND_W::new(self) + pub fn setrxpnd(&mut self) -> SETRXPND_W { + SETRXPND_W::new(self, 16) } #[doc = "Bit 17 - Reset/Set Transmit Pending"] #[inline(always)] #[must_use] - pub fn settxpnd(&mut self) -> SETTXPND_W<17> { - SETTXPND_W::new(self) + pub fn settxpnd(&mut self) -> SETTXPND_W { + SETTXPND_W::new(self, 17) } #[doc = "Bit 18 - Reset/Set Receive Updating"] #[inline(always)] #[must_use] - pub fn setrxupd(&mut self) -> SETRXUPD_W<18> { - SETRXUPD_W::new(self) + pub fn setrxupd(&mut self) -> SETRXUPD_W { + SETRXUPD_W::new(self, 18) } #[doc = "Bit 19 - Reset/Set New Data"] #[inline(always)] #[must_use] - pub fn setnewdat(&mut self) -> SETNEWDAT_W<19> { - SETNEWDAT_W::new(self) + pub fn setnewdat(&mut self) -> SETNEWDAT_W { + SETNEWDAT_W::new(self, 19) } #[doc = "Bit 20 - Reset/Set Message Lost"] #[inline(always)] #[must_use] - pub fn setmsglst(&mut self) -> SETMSGLST_W<20> { - SETMSGLST_W::new(self) + pub fn setmsglst(&mut self) -> SETMSGLST_W { + SETMSGLST_W::new(self, 20) } #[doc = "Bit 21 - Reset/Set Message Valid"] #[inline(always)] #[must_use] - pub fn setmsgval(&mut self) -> SETMSGVAL_W<21> { - SETMSGVAL_W::new(self) + pub fn setmsgval(&mut self) -> SETMSGVAL_W { + SETMSGVAL_W::new(self, 21) } #[doc = "Bit 22 - Reset/Set Receive/Transmit Selected"] #[inline(always)] #[must_use] - pub fn setrtsel(&mut self) -> SETRTSEL_W<22> { - SETRTSEL_W::new(self) + pub fn setrtsel(&mut self) -> SETRTSEL_W { + SETRTSEL_W::new(self, 22) } #[doc = "Bit 23 - Reset/Set Receive Enable"] #[inline(always)] #[must_use] - pub fn setrxen(&mut self) -> SETRXEN_W<23> { - SETRXEN_W::new(self) + pub fn setrxen(&mut self) -> SETRXEN_W { + SETRXEN_W::new(self, 23) } #[doc = "Bit 24 - Reset/Set Transmit Request"] #[inline(always)] #[must_use] - pub fn settxrq(&mut self) -> SETTXRQ_W<24> { - SETTXRQ_W::new(self) + pub fn settxrq(&mut self) -> SETTXRQ_W { + SETTXRQ_W::new(self, 24) } #[doc = "Bit 25 - Reset/Set Transmit Enable 0"] #[inline(always)] #[must_use] - pub fn settxen0(&mut self) -> SETTXEN0_W<25> { - SETTXEN0_W::new(self) + pub fn settxen0(&mut self) -> SETTXEN0_W { + SETTXEN0_W::new(self, 25) } #[doc = "Bit 26 - Reset/Set Transmit Enable 1"] #[inline(always)] #[must_use] - pub fn settxen1(&mut self) -> SETTXEN1_W<26> { - SETTXEN1_W::new(self) + pub fn settxen1(&mut self) -> SETTXEN1_W { + SETTXEN1_W::new(self, 26) } #[doc = "Bit 27 - Reset/Set Message Direction"] #[inline(always)] #[must_use] - pub fn setdir(&mut self) -> SETDIR_W<27> { - SETDIR_W::new(self) + pub fn setdir(&mut self) -> SETDIR_W { + SETDIR_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Object Control Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`moctr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MOCTR_SPEC; impl crate::RegisterSpec for MOCTR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [moctr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`moctr::W`](W) writer structure"] impl crate::Writable for MOCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0/modatah.rs b/src/can_mo0/modatah.rs index fc555add..06ed07d6 100644 --- a/src/can_mo0/modatah.rs +++ b/src/can_mo0/modatah.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `DB4` reader - Data Byte 4 of Message Object n"] -pub type DB4_R = crate::FieldReader; +pub type DB4_R = crate::FieldReader; #[doc = "Field `DB4` writer - Data Byte 4 of Message Object n"] -pub type DB4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODATAH_SPEC, u8, u8, 8, O>; +pub type DB4_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `DB5` reader - Data Byte 5 of Message Object n"] -pub type DB5_R = crate::FieldReader; +pub type DB5_R = crate::FieldReader; #[doc = "Field `DB5` writer - Data Byte 5 of Message Object n"] -pub type DB5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODATAH_SPEC, u8, u8, 8, O>; +pub type DB5_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `DB6` reader - Data Byte 6 of Message Object n"] -pub type DB6_R = crate::FieldReader; +pub type DB6_R = crate::FieldReader; #[doc = "Field `DB6` writer - Data Byte 6 of Message Object n"] -pub type DB6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODATAH_SPEC, u8, u8, 8, O>; +pub type DB6_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `DB7` reader - Data Byte 7 of Message Object n"] -pub type DB7_R = crate::FieldReader; +pub type DB7_R = crate::FieldReader; #[doc = "Field `DB7` writer - Data Byte 7 of Message Object n"] -pub type DB7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODATAH_SPEC, u8, u8, 8, O>; +pub type DB7_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Data Byte 4 of Message Object n"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Data Byte 4 of Message Object n"] #[inline(always)] #[must_use] - pub fn db4(&mut self) -> DB4_W<0> { - DB4_W::new(self) + pub fn db4(&mut self) -> DB4_W { + DB4_W::new(self, 0) } #[doc = "Bits 8:15 - Data Byte 5 of Message Object n"] #[inline(always)] #[must_use] - pub fn db5(&mut self) -> DB5_W<8> { - DB5_W::new(self) + pub fn db5(&mut self) -> DB5_W { + DB5_W::new(self, 8) } #[doc = "Bits 16:23 - Data Byte 6 of Message Object n"] #[inline(always)] #[must_use] - pub fn db6(&mut self) -> DB6_W<16> { - DB6_W::new(self) + pub fn db6(&mut self) -> DB6_W { + DB6_W::new(self, 16) } #[doc = "Bits 24:31 - Data Byte 7 of Message Object n"] #[inline(always)] #[must_use] - pub fn db7(&mut self) -> DB7_W<24> { - DB7_W::new(self) + pub fn db7(&mut self) -> DB7_W { + DB7_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Object Data Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`modatah::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`modatah::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`modatah::R`](R) reader structure"] +impl crate::Readable for MODATAH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`modatah::W`](W) writer structure"] impl crate::Writable for MODATAH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0/modatal.rs b/src/can_mo0/modatal.rs index 5349bd99..b34f0c39 100644 --- a/src/can_mo0/modatal.rs +++ b/src/can_mo0/modatal.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `DB0` reader - Data Byte 0 of Message Object n"] -pub type DB0_R = crate::FieldReader; +pub type DB0_R = crate::FieldReader; #[doc = "Field `DB0` writer - Data Byte 0 of Message Object n"] -pub type DB0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODATAL_SPEC, u8, u8, 8, O>; +pub type DB0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `DB1` reader - Data Byte 1 of Message Object n"] -pub type DB1_R = crate::FieldReader; +pub type DB1_R = crate::FieldReader; #[doc = "Field `DB1` writer - Data Byte 1 of Message Object n"] -pub type DB1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODATAL_SPEC, u8, u8, 8, O>; +pub type DB1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `DB2` reader - Data Byte 2 of Message Object n"] -pub type DB2_R = crate::FieldReader; +pub type DB2_R = crate::FieldReader; #[doc = "Field `DB2` writer - Data Byte 2 of Message Object n"] -pub type DB2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODATAL_SPEC, u8, u8, 8, O>; +pub type DB2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `DB3` reader - Data Byte 3 of Message Object n"] -pub type DB3_R = crate::FieldReader; +pub type DB3_R = crate::FieldReader; #[doc = "Field `DB3` writer - Data Byte 3 of Message Object n"] -pub type DB3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODATAL_SPEC, u8, u8, 8, O>; +pub type DB3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Data Byte 0 of Message Object n"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Data Byte 0 of Message Object n"] #[inline(always)] #[must_use] - pub fn db0(&mut self) -> DB0_W<0> { - DB0_W::new(self) + pub fn db0(&mut self) -> DB0_W { + DB0_W::new(self, 0) } #[doc = "Bits 8:15 - Data Byte 1 of Message Object n"] #[inline(always)] #[must_use] - pub fn db1(&mut self) -> DB1_W<8> { - DB1_W::new(self) + pub fn db1(&mut self) -> DB1_W { + DB1_W::new(self, 8) } #[doc = "Bits 16:23 - Data Byte 2 of Message Object n"] #[inline(always)] #[must_use] - pub fn db2(&mut self) -> DB2_W<16> { - DB2_W::new(self) + pub fn db2(&mut self) -> DB2_W { + DB2_W::new(self, 16) } #[doc = "Bits 24:31 - Data Byte 3 of Message Object n"] #[inline(always)] #[must_use] - pub fn db3(&mut self) -> DB3_W<24> { - DB3_W::new(self) + pub fn db3(&mut self) -> DB3_W { + DB3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Object Data Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`modatal::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`modatal::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`modatal::R`](R) reader structure"] +impl crate::Readable for MODATAL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`modatal::W`](W) writer structure"] impl crate::Writable for MODATAL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0/mofcr.rs b/src/can_mo0/mofcr.rs index d0ab3d76..e6541b25 100644 --- a/src/can_mo0/mofcr.rs +++ b/src/can_mo0/mofcr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MMC` reader - Message Mode Control"] -pub type MMC_R = crate::FieldReader; +pub type MMC_R = crate::FieldReader; #[doc = "Message Mode Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MMC_A { + type Ux = u8; +} impl MMC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(MMC_A::VALUE1), 1 => Some(MMC_A::VALUE2), @@ -70,58 +41,62 @@ impl MMC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard Message Object"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MMC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Receive FIFO Base Object"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MMC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Transmit FIFO Base Object"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MMC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Transmit FIFO Slave Object"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MMC_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Gateway Source Object"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == MMC_A::VALUE5 } } #[doc = "Field `MMC` writer - Message Mode Control"] -pub type MMC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOFCR_SPEC, u8, MMC_A, 4, O>; -impl<'a, const O: u8> MMC_W<'a, O> { +pub type MMC_W<'a, REG> = crate::FieldWriter<'a, REG, 4, MMC_A>; +impl<'a, REG> MMC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Standard Message Object"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MMC_A::VALUE1) } #[doc = "Receive FIFO Base Object"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MMC_A::VALUE2) } #[doc = "Transmit FIFO Base Object"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MMC_A::VALUE3) } #[doc = "Transmit FIFO Slave Object"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MMC_A::VALUE4) } #[doc = "Gateway Source Object"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(MMC_A::VALUE5) } } @@ -144,34 +119,37 @@ impl From for bool { impl GDFS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GDFS_A { + pub const fn variant(&self) -> GDFS_A { match self.bits { false => GDFS_A::VALUE1, true => GDFS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "TXRQ is unchanged in the destination object."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GDFS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TXRQ is set in the gateway destination object after the internal transfer from the gateway source to the gateway destination object."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GDFS_A::VALUE2 } } #[doc = "Field `GDFS` writer - Gateway Data Frame Send"] -pub type GDFS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, GDFS_A, O>; -impl<'a, const O: u8> GDFS_W<'a, O> { +pub type GDFS_W<'a, REG> = crate::BitWriter<'a, REG, GDFS_A>; +impl<'a, REG> GDFS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "TXRQ is unchanged in the destination object."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GDFS_A::VALUE1) } #[doc = "TXRQ is set in the gateway destination object after the internal transfer from the gateway source to the gateway destination object."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GDFS_A::VALUE2) } } @@ -194,34 +172,37 @@ impl From for bool { impl IDC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IDC_A { + pub const fn variant(&self) -> IDC_A { match self.bits { false => IDC_A::VALUE1, true => IDC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The identifier of the gateway source object is not copied."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IDC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The identifier of the gateway source object (after storing the received frame in the source) is copied to the gateway destination object."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IDC_A::VALUE2 } } #[doc = "Field `IDC` writer - Identifier Copy"] -pub type IDC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, IDC_A, O>; -impl<'a, const O: u8> IDC_W<'a, O> { +pub type IDC_W<'a, REG> = crate::BitWriter<'a, REG, IDC_A>; +impl<'a, REG> IDC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The identifier of the gateway source object is not copied."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IDC_A::VALUE1) } #[doc = "The identifier of the gateway source object (after storing the received frame in the source) is copied to the gateway destination object."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IDC_A::VALUE2) } } @@ -244,34 +225,37 @@ impl From for bool { impl DLCC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DLCC_A { + pub const fn variant(&self) -> DLCC_A { match self.bits { false => DLCC_A::VALUE1, true => DLCC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data length code is not copied."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DLCC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data length code of the gateway source object (after storing the received frame in the source) is copied to the gateway destination object."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DLCC_A::VALUE2 } } #[doc = "Field `DLCC` writer - Data Length Code Copy"] -pub type DLCC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, DLCC_A, O>; -impl<'a, const O: u8> DLCC_W<'a, O> { +pub type DLCC_W<'a, REG> = crate::BitWriter<'a, REG, DLCC_A>; +impl<'a, REG> DLCC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Data length code is not copied."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLCC_A::VALUE1) } #[doc = "Data length code of the gateway source object (after storing the received frame in the source) is copied to the gateway destination object."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLCC_A::VALUE2) } } @@ -294,34 +278,37 @@ impl From for bool { impl DATC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DATC_A { + pub const fn variant(&self) -> DATC_A { match self.bits { false => DATC_A::VALUE1, true => DATC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data fields are not copied."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DATC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data fields in registers MODATALn and MODATAHn of the gateway source object (after storing the received frame in the source) are copied to the gateway destination."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DATC_A::VALUE2 } } #[doc = "Field `DATC` writer - Data Copy"] -pub type DATC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, DATC_A, O>; -impl<'a, const O: u8> DATC_W<'a, O> { +pub type DATC_W<'a, REG> = crate::BitWriter<'a, REG, DATC_A>; +impl<'a, REG> DATC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Data fields are not copied."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DATC_A::VALUE1) } #[doc = "Data fields in registers MODATALn and MODATAHn of the gateway source object (after storing the received frame in the source) are copied to the gateway destination."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DATC_A::VALUE2) } } @@ -344,34 +331,37 @@ impl From for bool { impl RXIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXIE_A { + pub const fn variant(&self) -> RXIE_A { match self.bits { false => RXIE_A::VALUE1, true => RXIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message receive interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message receive interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXIE_A::VALUE2 } } #[doc = "Field `RXIE` writer - Receive Interrupt Enable"] -pub type RXIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, RXIE_A, O>; -impl<'a, const O: u8> RXIE_W<'a, O> { +pub type RXIE_W<'a, REG> = crate::BitWriter<'a, REG, RXIE_A>; +impl<'a, REG> RXIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Message receive interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXIE_A::VALUE1) } #[doc = "Message receive interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXIE_A::VALUE2) } } @@ -394,34 +384,37 @@ impl From for bool { impl TXIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TXIE_A { + pub const fn variant(&self) -> TXIE_A { match self.bits { false => TXIE_A::VALUE1, true => TXIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message transmit interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TXIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message transmit interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TXIE_A::VALUE2 } } #[doc = "Field `TXIE` writer - Transmit Interrupt Enable"] -pub type TXIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, TXIE_A, O>; -impl<'a, const O: u8> TXIE_W<'a, O> { +pub type TXIE_W<'a, REG> = crate::BitWriter<'a, REG, TXIE_A>; +impl<'a, REG> TXIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Message transmit interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TXIE_A::VALUE1) } #[doc = "Message transmit interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TXIE_A::VALUE2) } } @@ -444,34 +437,37 @@ impl From for bool { impl OVIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OVIE_A { + pub const fn variant(&self) -> OVIE_A { match self.bits { false => OVIE_A::VALUE1, true => OVIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "FIFO full interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OVIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "FIFO full interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OVIE_A::VALUE2 } } #[doc = "Field `OVIE` writer - Overflow Interrupt Enable"] -pub type OVIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, OVIE_A, O>; -impl<'a, const O: u8> OVIE_W<'a, O> { +pub type OVIE_W<'a, REG> = crate::BitWriter<'a, REG, OVIE_A>; +impl<'a, REG> OVIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "FIFO full interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OVIE_A::VALUE1) } #[doc = "FIFO full interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OVIE_A::VALUE2) } } @@ -494,34 +490,37 @@ impl From for bool { impl FRREN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FRREN_A { + pub const fn variant(&self) -> FRREN_A { match self.bits { false => FRREN_A::VALUE1, true => FRREN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "TXRQ of message object n is set on reception of a matching Remote Frame."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FRREN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TXRQ of the message object referenced by the pointer CUR is set on reception of a matching Remote Frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FRREN_A::VALUE2 } } #[doc = "Field `FRREN` writer - Foreign Remote Request Enable"] -pub type FRREN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, FRREN_A, O>; -impl<'a, const O: u8> FRREN_W<'a, O> { +pub type FRREN_W<'a, REG> = crate::BitWriter<'a, REG, FRREN_A>; +impl<'a, REG> FRREN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "TXRQ of message object n is set on reception of a matching Remote Frame."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FRREN_A::VALUE1) } #[doc = "TXRQ of the message object referenced by the pointer CUR is set on reception of a matching Remote Frame."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FRREN_A::VALUE2) } } @@ -544,49 +543,52 @@ impl From for bool { impl RMM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RMM_A { + pub const fn variant(&self) -> RMM_A { match self.bits { false => RMM_A::VALUE1, true => RMM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == RMM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Remote monitoring is enabled: Identifier, IDE bit, and DLC of a matching Remote Frame are copied to transmit object n in order to monitor incoming Remote Frames."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RMM_A::VALUE2 } } #[doc = "Field `RMM` writer - Transmit Object Remote Monitoring"] -pub type RMM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, RMM_A, O>; -impl<'a, const O: u8> RMM_W<'a, O> { +pub type RMM_W<'a, REG> = crate::BitWriter<'a, REG, RMM_A>; +impl<'a, REG> RMM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RMM_A::VALUE1) } #[doc = "Remote monitoring is enabled: Identifier, IDE bit, and DLC of a matching Remote Frame are copied to transmit object n in order to monitor incoming Remote Frames."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RMM_A::VALUE2) } } #[doc = "Field `SDT` reader - Single Data Transfer"] -pub type SDT_R = crate::BitReader; +pub type SDT_R = crate::BitReader; #[doc = "Field `SDT` writer - Single Data Transfer"] -pub type SDT_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, bool, O>; +pub type SDT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STT` reader - Single Transmit Trial"] -pub type STT_R = crate::BitReader; +pub type STT_R = crate::BitReader; #[doc = "Field `STT` writer - Single Transmit Trial"] -pub type STT_W<'a, const O: u8> = crate::BitWriter<'a, u32, MOFCR_SPEC, bool, O>; +pub type STT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DLC` reader - Data Length Code"] -pub type DLC_R = crate::FieldReader; +pub type DLC_R = crate::FieldReader; #[doc = "Field `DLC` writer - Data Length Code"] -pub type DLC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOFCR_SPEC, u8, u8, 4, O>; +pub type DLC_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Message Mode Control"] #[inline(always)] @@ -658,100 +660,101 @@ impl W { #[doc = "Bits 0:3 - Message Mode Control"] #[inline(always)] #[must_use] - pub fn mmc(&mut self) -> MMC_W<0> { - MMC_W::new(self) + pub fn mmc(&mut self) -> MMC_W { + MMC_W::new(self, 0) } #[doc = "Bit 8 - Gateway Data Frame Send"] #[inline(always)] #[must_use] - pub fn gdfs(&mut self) -> GDFS_W<8> { - GDFS_W::new(self) + pub fn gdfs(&mut self) -> GDFS_W { + GDFS_W::new(self, 8) } #[doc = "Bit 9 - Identifier Copy"] #[inline(always)] #[must_use] - pub fn idc(&mut self) -> IDC_W<9> { - IDC_W::new(self) + pub fn idc(&mut self) -> IDC_W { + IDC_W::new(self, 9) } #[doc = "Bit 10 - Data Length Code Copy"] #[inline(always)] #[must_use] - pub fn dlcc(&mut self) -> DLCC_W<10> { - DLCC_W::new(self) + pub fn dlcc(&mut self) -> DLCC_W { + DLCC_W::new(self, 10) } #[doc = "Bit 11 - Data Copy"] #[inline(always)] #[must_use] - pub fn datc(&mut self) -> DATC_W<11> { - DATC_W::new(self) + pub fn datc(&mut self) -> DATC_W { + DATC_W::new(self, 11) } #[doc = "Bit 16 - Receive Interrupt Enable"] #[inline(always)] #[must_use] - pub fn rxie(&mut self) -> RXIE_W<16> { - RXIE_W::new(self) + pub fn rxie(&mut self) -> RXIE_W { + RXIE_W::new(self, 16) } #[doc = "Bit 17 - Transmit Interrupt Enable"] #[inline(always)] #[must_use] - pub fn txie(&mut self) -> TXIE_W<17> { - TXIE_W::new(self) + pub fn txie(&mut self) -> TXIE_W { + TXIE_W::new(self, 17) } #[doc = "Bit 18 - Overflow Interrupt Enable"] #[inline(always)] #[must_use] - pub fn ovie(&mut self) -> OVIE_W<18> { - OVIE_W::new(self) + pub fn ovie(&mut self) -> OVIE_W { + OVIE_W::new(self, 18) } #[doc = "Bit 20 - Foreign Remote Request Enable"] #[inline(always)] #[must_use] - pub fn frren(&mut self) -> FRREN_W<20> { - FRREN_W::new(self) + pub fn frren(&mut self) -> FRREN_W { + FRREN_W::new(self, 20) } #[doc = "Bit 21 - Transmit Object Remote Monitoring"] #[inline(always)] #[must_use] - pub fn rmm(&mut self) -> RMM_W<21> { - RMM_W::new(self) + pub fn rmm(&mut self) -> RMM_W { + RMM_W::new(self, 21) } #[doc = "Bit 22 - Single Data Transfer"] #[inline(always)] #[must_use] - pub fn sdt(&mut self) -> SDT_W<22> { - SDT_W::new(self) + pub fn sdt(&mut self) -> SDT_W { + SDT_W::new(self, 22) } #[doc = "Bit 23 - Single Transmit Trial"] #[inline(always)] #[must_use] - pub fn stt(&mut self) -> STT_W<23> { - STT_W::new(self) + pub fn stt(&mut self) -> STT_W { + STT_W::new(self, 23) } #[doc = "Bits 24:27 - Data Length Code"] #[inline(always)] #[must_use] - pub fn dlc(&mut self) -> DLC_W<24> { - DLC_W::new(self) + pub fn dlc(&mut self) -> DLC_W { + DLC_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Object Function Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mofcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mofcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mofcr::R`](R) reader structure"] +impl crate::Readable for MOFCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mofcr::W`](W) writer structure"] impl crate::Writable for MOFCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0/mofgpr.rs b/src/can_mo0/mofgpr.rs index 35be1912..dfe53182 100644 --- a/src/can_mo0/mofgpr.rs +++ b/src/can_mo0/mofgpr.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `BOT` reader - Bottom Pointer"] -pub type BOT_R = crate::FieldReader; +pub type BOT_R = crate::FieldReader; #[doc = "Field `BOT` writer - Bottom Pointer"] -pub type BOT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOFGPR_SPEC, u8, u8, 8, O>; +pub type BOT_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `TOP` reader - Top Pointer"] -pub type TOP_R = crate::FieldReader; +pub type TOP_R = crate::FieldReader; #[doc = "Field `TOP` writer - Top Pointer"] -pub type TOP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOFGPR_SPEC, u8, u8, 8, O>; +pub type TOP_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CUR` reader - Current Object Pointer"] -pub type CUR_R = crate::FieldReader; +pub type CUR_R = crate::FieldReader; #[doc = "Field `CUR` writer - Current Object Pointer"] -pub type CUR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOFGPR_SPEC, u8, u8, 8, O>; +pub type CUR_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `SEL` reader - Object Select Pointer"] -pub type SEL_R = crate::FieldReader; +pub type SEL_R = crate::FieldReader; #[doc = "Field `SEL` writer - Object Select Pointer"] -pub type SEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOFGPR_SPEC, u8, u8, 8, O>; +pub type SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Bottom Pointer"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Bottom Pointer"] #[inline(always)] #[must_use] - pub fn bot(&mut self) -> BOT_W<0> { - BOT_W::new(self) + pub fn bot(&mut self) -> BOT_W { + BOT_W::new(self, 0) } #[doc = "Bits 8:15 - Top Pointer"] #[inline(always)] #[must_use] - pub fn top(&mut self) -> TOP_W<8> { - TOP_W::new(self) + pub fn top(&mut self) -> TOP_W { + TOP_W::new(self, 8) } #[doc = "Bits 16:23 - Current Object Pointer"] #[inline(always)] #[must_use] - pub fn cur(&mut self) -> CUR_W<16> { - CUR_W::new(self) + pub fn cur(&mut self) -> CUR_W { + CUR_W::new(self, 16) } #[doc = "Bits 24:31 - Object Select Pointer"] #[inline(always)] #[must_use] - pub fn sel(&mut self) -> SEL_W<24> { - SEL_W::new(self) + pub fn sel(&mut self) -> SEL_W { + SEL_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Object FIFO/Gateway Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mofgpr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mofgpr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mofgpr::R`](R) reader structure"] +impl crate::Readable for MOFGPR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mofgpr::W`](W) writer structure"] impl crate::Writable for MOFGPR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0/moipr.rs b/src/can_mo0/moipr.rs index 4a2f23a3..44a52cea 100644 --- a/src/can_mo0/moipr.rs +++ b/src/can_mo0/moipr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RXINP` reader - Receive Interrupt Node Pointer"] -pub type RXINP_R = crate::FieldReader; +pub type RXINP_R = crate::FieldReader; #[doc = "Receive Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RXINP_A { + type Ux = u8; +} impl RXINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(RXINP_A::VALUE1), 1 => Some(RXINP_A::VALUE2), @@ -64,43 +35,47 @@ impl RXINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RXINP_A::VALUE3 } } #[doc = "Field `RXINP` writer - Receive Interrupt Node Pointer"] -pub type RXINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOIPR_SPEC, u8, RXINP_A, 3, O>; -impl<'a, const O: u8> RXINP_W<'a, O> { +pub type RXINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, RXINP_A>; +impl<'a, REG> RXINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXINP_A::VALUE1) } #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXINP_A::VALUE2) } #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(RXINP_A::VALUE3) } } #[doc = "Field `TXINP` reader - Transmit Interrupt Node Pointer"] -pub type TXINP_R = crate::FieldReader; +pub type TXINP_R = crate::FieldReader; #[doc = "Transmit Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TXINP_A { + type Ux = u8; +} impl TXINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TXINP_A::VALUE1), 1 => Some(TXINP_A::VALUE2), @@ -129,49 +107,53 @@ impl TXINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TXINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TXINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TXINP_A::VALUE3 } } #[doc = "Field `TXINP` writer - Transmit Interrupt Node Pointer"] -pub type TXINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOIPR_SPEC, u8, TXINP_A, 3, O>; -impl<'a, const O: u8> TXINP_W<'a, O> { +pub type TXINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TXINP_A>; +impl<'a, REG> TXINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TXINP_A::VALUE1) } #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TXINP_A::VALUE2) } #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TXINP_A::VALUE3) } } #[doc = "Field `MPN` reader - Message Pending Number"] -pub type MPN_R = crate::FieldReader; +pub type MPN_R = crate::FieldReader; #[doc = "Field `MPN` writer - Message Pending Number"] -pub type MPN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOIPR_SPEC, u8, u8, 8, O>; +pub type MPN_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CFCVAL` reader - CAN Frame Counter Value"] -pub type CFCVAL_R = crate::FieldReader; +pub type CFCVAL_R = crate::FieldReader; #[doc = "Field `CFCVAL` writer - CAN Frame Counter Value"] -pub type CFCVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MOIPR_SPEC, u16, u16, 16, O>; +pub type CFCVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:2 - Receive Interrupt Node Pointer"] #[inline(always)] @@ -198,46 +180,47 @@ impl W { #[doc = "Bits 0:2 - Receive Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn rxinp(&mut self) -> RXINP_W<0> { - RXINP_W::new(self) + pub fn rxinp(&mut self) -> RXINP_W { + RXINP_W::new(self, 0) } #[doc = "Bits 4:6 - Transmit Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn txinp(&mut self) -> TXINP_W<4> { - TXINP_W::new(self) + pub fn txinp(&mut self) -> TXINP_W { + TXINP_W::new(self, 4) } #[doc = "Bits 8:15 - Message Pending Number"] #[inline(always)] #[must_use] - pub fn mpn(&mut self) -> MPN_W<8> { - MPN_W::new(self) + pub fn mpn(&mut self) -> MPN_W { + MPN_W::new(self, 8) } #[doc = "Bits 16:31 - CAN Frame Counter Value"] #[inline(always)] #[must_use] - pub fn cfcval(&mut self) -> CFCVAL_W<16> { - CFCVAL_W::new(self) + pub fn cfcval(&mut self) -> CFCVAL_W { + CFCVAL_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Message Object Interrupt Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`moipr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`moipr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`moipr::R`](R) reader structure"] +impl crate::Readable for MOIPR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`moipr::W`](W) writer structure"] impl crate::Writable for MOIPR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_mo0/mostat.rs b/src/can_mo0/mostat.rs index d4952470..083c90e4 100644 --- a/src/can_mo0/mostat.rs +++ b/src/can_mo0/mostat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `RXPND` reader - Receive Pending"] pub type RXPND_R = crate::BitReader; #[doc = "Receive Pending\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl RXPND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXPND_A { + pub const fn variant(&self) -> RXPND_A { match self.bits { false => RXPND_A::VALUE1, true => RXPND_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No CAN message has been received."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXPND_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A CAN message has been received by the message object n, either directly or via gateway copy action."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXPND_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl TXPND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TXPND_A { + pub const fn variant(&self) -> TXPND_A { match self.bits { false => TXPND_A::VALUE1, true => TXPND_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No CAN message has been transmitted."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TXPND_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A CAN message from message object n has been transmitted successfully over the CAN bus."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TXPND_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl RXUPD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXUPD_A { + pub const fn variant(&self) -> RXUPD_A { match self.bits { false => RXUPD_A::VALUE1, true => RXUPD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No receive update ongoing."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXUPD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message identifier, DLC, and data of the message object are currently updated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXUPD_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl NEWDAT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NEWDAT_A { + pub const fn variant(&self) -> NEWDAT_A { match self.bits { false => NEWDAT_A::VALUE1, true => NEWDAT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No update of the message object n since last flag reset."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NEWDAT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message object n has been updated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NEWDAT_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl MSGLST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSGLST_A { + pub const fn variant(&self) -> MSGLST_A { match self.bits { false => MSGLST_A::VALUE1, true => MSGLST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No CAN message is lost."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSGLST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A CAN message is lost because NEWDAT has become set again when it has already been set."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSGLST_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl MSGVAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSGVAL_A { + pub const fn variant(&self) -> MSGVAL_A { match self.bits { false => MSGVAL_A::VALUE1, true => MSGVAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message object n is not valid."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSGVAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message object n is valid."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSGVAL_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl RTSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTSEL_A { + pub const fn variant(&self) -> RTSEL_A { match self.bits { false => RTSEL_A::VALUE1, true => RTSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message object n is not selected for receive or transmit operation."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message object n is selected for receive or transmit operation."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTSEL_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl RXEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXEN_A { + pub const fn variant(&self) -> RXEN_A { match self.bits { false => RXEN_A::VALUE1, true => RXEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message object n is not enabled for frame reception."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message object n is enabled for frame reception."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXEN_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl TXRQ_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TXRQ_A { + pub const fn variant(&self) -> TXRQ_A { match self.bits { false => TXRQ_A::VALUE1, true => TXRQ_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No transmission of message object n is requested."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TXRQ_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Transmission of message object n on the CAN bus is requested."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TXRQ_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl TXEN0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TXEN0_A { + pub const fn variant(&self) -> TXEN0_A { match self.bits { false => TXEN0_A::VALUE1, true => TXEN0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message object n is not enabled for frame transmission."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TXEN0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message object n is enabled for frame transmission."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TXEN0_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl TXEN1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TXEN1_A { + pub const fn variant(&self) -> TXEN1_A { match self.bits { false => TXEN1_A::VALUE1, true => TXEN1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Message object n is not enabled for frame transmission."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TXEN1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Message object n is enabled for frame transmission."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TXEN1_A::VALUE2 @@ -428,29 +415,29 @@ impl From for bool { impl DIR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIR_A { + pub const fn variant(&self) -> DIR_A { match self.bits { false => DIR_A::VALUE1, true => DIR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Receive Object selected: With TXRQ = 1, a Remote Frame with the identifier of message object n is scheduled for transmission. On reception of a Data Frame with matching identifier, the message is stored in message object n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Transmit Object selected: If TXRQ = 1, message object n is scheduled for transmission of a Data Frame. On reception of a Remote Frame with matching identifier, bit TXRQ is set."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIR_A::VALUE2 } } #[doc = "Field `LIST` reader - List Allocation"] -pub type LIST_R = crate::FieldReader; +pub type LIST_R = crate::FieldReader; #[doc = "Field `PPREV` reader - Pointer to Previous Message Object"] -pub type PPREV_R = crate::FieldReader; +pub type PPREV_R = crate::FieldReader; #[doc = "Field `PNEXT` reader - Pointer to Next Message Object"] -pub type PNEXT_R = crate::FieldReader; +pub type PNEXT_R = crate::FieldReader; impl R { #[doc = "Bit 0 - Receive Pending"] #[inline(always)] @@ -528,15 +515,13 @@ 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"] +#[doc = "Message Object Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mostat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`mostat::R`](R) reader structure"] +impl crate::Readable for MOSTAT_SPEC {} #[doc = "`reset()` method sets MOSTAT to value 0"] impl crate::Resettable for MOSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/can_node0.rs b/src/can_node0.rs index 9592d055..02145aef 100644 --- a/src/can_node0.rs +++ b/src/can_node0.rs @@ -1,46 +1,83 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + ncr: NCR, + nsr: NSR, + nipr: NIPR, + npcr: NPCR, + nbtr: NBTR, + necnt: NECNT, + nfcr: NFCR, +} +impl RegisterBlock { #[doc = "0x00 - Node Control Register"] - pub ncr: NCR, + #[inline(always)] + pub const fn ncr(&self) -> &NCR { + &self.ncr + } #[doc = "0x04 - Node Status Register"] - pub nsr: NSR, + #[inline(always)] + pub const fn nsr(&self) -> &NSR { + &self.nsr + } #[doc = "0x08 - Node Interrupt Pointer Register"] - pub nipr: NIPR, + #[inline(always)] + pub const fn nipr(&self) -> &NIPR { + &self.nipr + } #[doc = "0x0c - Node Port Control Register"] - pub npcr: NPCR, + #[inline(always)] + pub const fn npcr(&self) -> &NPCR { + &self.npcr + } #[doc = "0x10 - Node Bit Timing Register"] - pub nbtr: NBTR, + #[inline(always)] + pub const fn nbtr(&self) -> &NBTR { + &self.nbtr + } #[doc = "0x14 - Node Error Counter Register"] - pub necnt: NECNT, + #[inline(always)] + pub const fn necnt(&self) -> &NECNT { + &self.necnt + } #[doc = "0x18 - Node Frame Counter Register"] - pub nfcr: NFCR, + #[inline(always)] + pub const fn nfcr(&self) -> &NFCR { + &self.nfcr + } } -#[doc = "NCR (rw) register accessor: an alias for `Reg`"] +#[doc = "NCR (rw) register accessor: Node Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ncr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ncr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ncr`] +module"] pub type NCR = crate::Reg; #[doc = "Node Control Register"] pub mod ncr; -#[doc = "NSR (rw) register accessor: an alias for `Reg`"] +#[doc = "NSR (rw) register accessor: Node Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nsr`] +module"] pub type NSR = crate::Reg; #[doc = "Node Status Register"] pub mod nsr; -#[doc = "NIPR (rw) register accessor: an alias for `Reg`"] +#[doc = "NIPR (rw) register accessor: Node Interrupt Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nipr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nipr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nipr`] +module"] pub type NIPR = crate::Reg; #[doc = "Node Interrupt Pointer Register"] pub mod nipr; -#[doc = "NPCR (rw) register accessor: an alias for `Reg`"] +#[doc = "NPCR (rw) register accessor: Node Port Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`npcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`npcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@npcr`] +module"] pub type NPCR = crate::Reg; #[doc = "Node Port Control Register"] pub mod npcr; -#[doc = "NBTR (rw) register accessor: an alias for `Reg`"] +#[doc = "NBTR (rw) register accessor: Node Bit Timing Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nbtr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nbtr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nbtr`] +module"] pub type NBTR = crate::Reg; #[doc = "Node Bit Timing Register"] pub mod nbtr; -#[doc = "NECNT (rw) register accessor: an alias for `Reg`"] +#[doc = "NECNT (rw) register accessor: Node Error Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`necnt::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`necnt::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@necnt`] +module"] pub type NECNT = crate::Reg; #[doc = "Node Error Counter Register"] pub mod necnt; -#[doc = "NFCR (rw) register accessor: an alias for `Reg`"] +#[doc = "NFCR (rw) register accessor: Node Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nfcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nfcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nfcr`] +module"] 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 706055c6..0d100276 100644 --- a/src/can_node0/nbtr.rs +++ b/src/can_node0/nbtr.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BRP` reader - Baud Rate Prescaler"] -pub type BRP_R = crate::FieldReader; +pub type BRP_R = crate::FieldReader; #[doc = "Field `BRP` writer - Baud Rate Prescaler"] -pub type BRP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NBTR_SPEC, u8, u8, 6, O>; +pub type BRP_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `SJW` reader - (Re) Synchronization Jump Width"] -pub type SJW_R = crate::FieldReader; +pub type SJW_R = crate::FieldReader; #[doc = "Field `SJW` writer - (Re) Synchronization Jump Width"] -pub type SJW_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NBTR_SPEC, u8, u8, 2, O>; +pub type SJW_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `TSEG1` reader - Time Segment Before Sample Point"] -pub type TSEG1_R = crate::FieldReader; +pub type TSEG1_R = crate::FieldReader; #[doc = "Field `TSEG1` writer - Time Segment Before Sample Point"] -pub type TSEG1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NBTR_SPEC, u8, u8, 4, O>; +pub type TSEG1_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `TSEG2` reader - Time Segment After Sample Point"] -pub type TSEG2_R = crate::FieldReader; +pub type TSEG2_R = crate::FieldReader; #[doc = "Field `TSEG2` writer - Time Segment After Sample Point"] -pub type TSEG2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NBTR_SPEC, u8, u8, 3, O>; +pub type TSEG2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `DIV8` reader - Divide Prescaler Clock by 8"] pub type DIV8_R = crate::BitReader; #[doc = "Divide Prescaler Clock by 8\n\nValue on reset: 0"] @@ -69,34 +37,37 @@ impl From for bool { impl DIV8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIV8_A { + pub const fn variant(&self) -> DIV8_A { match self.bits { false => DIV8_A::VALUE1, true => DIV8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A time quantum lasts (BRP+1) clock cycles."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIV8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A time quantum lasts 8 (BRP+1) clock cycles."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIV8_A::VALUE2 } } #[doc = "Field `DIV8` writer - Divide Prescaler Clock by 8"] -pub type DIV8_W<'a, const O: u8> = crate::BitWriter<'a, u32, NBTR_SPEC, DIV8_A, O>; -impl<'a, const O: u8> DIV8_W<'a, O> { +pub type DIV8_W<'a, REG> = crate::BitWriter<'a, REG, DIV8_A>; +impl<'a, REG> DIV8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A time quantum lasts (BRP+1) clock cycles."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIV8_A::VALUE1) } #[doc = "A time quantum lasts 8 (BRP+1) clock cycles."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIV8_A::VALUE2) } } @@ -131,52 +102,53 @@ impl W { #[doc = "Bits 0:5 - Baud Rate Prescaler"] #[inline(always)] #[must_use] - pub fn brp(&mut self) -> BRP_W<0> { - BRP_W::new(self) + pub fn brp(&mut self) -> BRP_W { + BRP_W::new(self, 0) } #[doc = "Bits 6:7 - (Re) Synchronization Jump Width"] #[inline(always)] #[must_use] - pub fn sjw(&mut self) -> SJW_W<6> { - SJW_W::new(self) + pub fn sjw(&mut self) -> SJW_W { + SJW_W::new(self, 6) } #[doc = "Bits 8:11 - Time Segment Before Sample Point"] #[inline(always)] #[must_use] - pub fn tseg1(&mut self) -> TSEG1_W<8> { - TSEG1_W::new(self) + pub fn tseg1(&mut self) -> TSEG1_W { + TSEG1_W::new(self, 8) } #[doc = "Bits 12:14 - Time Segment After Sample Point"] #[inline(always)] #[must_use] - pub fn tseg2(&mut self) -> TSEG2_W<12> { - TSEG2_W::new(self) + pub fn tseg2(&mut self) -> TSEG2_W { + TSEG2_W::new(self, 12) } #[doc = "Bit 15 - Divide Prescaler Clock by 8"] #[inline(always)] #[must_use] - pub fn div8(&mut self) -> DIV8_W<15> { - DIV8_W::new(self) + pub fn div8(&mut self) -> DIV8_W { + DIV8_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Node Bit Timing Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nbtr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nbtr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nbtr::R`](R) reader structure"] +impl crate::Readable for NBTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nbtr::W`](W) writer structure"] impl crate::Writable for NBTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_node0/ncr.rs b/src/can_node0/ncr.rs index 07747f6a..8fc86ff8 100644 --- a/src/can_node0/ncr.rs +++ b/src/can_node0/ncr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INIT` reader - Node Initialization"] pub type INIT_R = crate::BitReader; #[doc = "Node Initialization\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl INIT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INIT_A { + pub const fn variant(&self) -> INIT_A { match self.bits { false => INIT_A::VALUE1, true => INIT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == INIT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Setting this bit terminates the participation of this node in the CAN traffic. Any ongoing frame transfer is cancelled and the transmit line goes recessive. If the CAN node is in the bus-off state, then the running bus-off recovery sequence is continued. If the INIT bit is still set after the successful completion of the bus-off recovery sequence, i.e. after detecting 128 sequences of 11 consecutive recessive bits (11 1), then the CAN node leaves the bus-off state but remains inactive as long as INIT remains set."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INIT_A::VALUE2 } } #[doc = "Field `INIT` writer - Node Initialization"] -pub type INIT_W<'a, const O: u8> = crate::BitWriter<'a, u32, NCR_SPEC, INIT_A, O>; -impl<'a, const O: u8> INIT_W<'a, O> { +pub type INIT_W<'a, REG> = crate::BitWriter<'a, REG, INIT_A>; +impl<'a, REG> INIT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INIT_A::VALUE1) } #[doc = "Setting this bit terminates the participation of this node in the CAN traffic. Any ongoing frame transfer is cancelled and the transmit line goes recessive. If the CAN node is in the bus-off state, then the running bus-off recovery sequence is continued. If the INIT bit is still set after the successful completion of the bus-off recovery sequence, i.e. after detecting 128 sequences of 11 consecutive recessive bits (11 1), then the CAN node leaves the bus-off state but remains inactive as long as INIT remains set."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INIT_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl TRIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRIE_A { + pub const fn variant(&self) -> TRIE_A { match self.bits { false => TRIE_A::VALUE1, true => TRIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Transfer interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Transfer interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRIE_A::VALUE2 } } #[doc = "Field `TRIE` writer - Transfer Interrupt Enable"] -pub type TRIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, NCR_SPEC, TRIE_A, O>; -impl<'a, const O: u8> TRIE_W<'a, O> { +pub type TRIE_W<'a, REG> = crate::BitWriter<'a, REG, TRIE_A>; +impl<'a, REG> TRIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Transfer interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRIE_A::VALUE1) } #[doc = "Transfer interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRIE_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl LECIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LECIE_A { + pub const fn variant(&self) -> LECIE_A { match self.bits { false => LECIE_A::VALUE1, true => LECIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Last error code interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LECIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last error code interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LECIE_A::VALUE2 } } #[doc = "Field `LECIE` writer - LEC Indicated Error Interrupt Enable"] -pub type LECIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, NCR_SPEC, LECIE_A, O>; -impl<'a, const O: u8> LECIE_W<'a, O> { +pub type LECIE_W<'a, REG> = crate::BitWriter<'a, REG, LECIE_A>; +impl<'a, REG> LECIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Last error code interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LECIE_A::VALUE1) } #[doc = "Last error code interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LECIE_A::VALUE2) } } @@ -203,41 +180,44 @@ impl From for bool { impl ALIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALIE_A { + pub const fn variant(&self) -> ALIE_A { match self.bits { false => ALIE_A::VALUE1, true => ALIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Alert interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Alert interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALIE_A::VALUE2 } } #[doc = "Field `ALIE` writer - Alert Interrupt Enable"] -pub type ALIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, NCR_SPEC, ALIE_A, O>; -impl<'a, const O: u8> ALIE_W<'a, O> { +pub type ALIE_W<'a, REG> = crate::BitWriter<'a, REG, ALIE_A>; +impl<'a, REG> ALIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Alert interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALIE_A::VALUE1) } #[doc = "Alert interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALIE_A::VALUE2) } } #[doc = "Field `CANDIS` reader - CAN Disable"] -pub type CANDIS_R = crate::BitReader; +pub type CANDIS_R = crate::BitReader; #[doc = "Field `CANDIS` writer - CAN Disable"] -pub type CANDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, NCR_SPEC, bool, O>; +pub type CANDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CCE` reader - Configuration Change Enable"] pub type CCE_R = crate::BitReader; #[doc = "Configuration Change Enable\n\nValue on reset: 0"] @@ -257,41 +237,44 @@ impl From for bool { impl CCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCE_A { + pub const fn variant(&self) -> CCE_A { match self.bits { false => CCE_A::VALUE1, true => CCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == CCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The Bit Timing Register, the Port Control Register, and the Error Counter Register may be read and written."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCE_A::VALUE2 } } #[doc = "Field `CCE` writer - Configuration Change Enable"] -pub type CCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, NCR_SPEC, CCE_A, O>; -impl<'a, const O: u8> CCE_W<'a, O> { +pub type CCE_W<'a, REG> = crate::BitWriter<'a, REG, CCE_A>; +impl<'a, REG> CCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCE_A::VALUE1) } #[doc = "The Bit Timing Register, the Port Control Register, and the Error Counter Register may be read and written."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCE_A::VALUE2) } } #[doc = "Field `CALM` reader - CAN Analyzer Mode"] -pub type CALM_R = crate::BitReader; +pub type CALM_R = crate::BitReader; #[doc = "Field `CALM` writer - CAN Analyzer Mode"] -pub type CALM_W<'a, const O: u8> = crate::BitWriter<'a, u32, NCR_SPEC, bool, O>; +pub type CALM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SUSEN` reader - Suspend Enable"] pub type SUSEN_R = crate::BitReader; #[doc = "Suspend Enable\n\nValue on reset: 0"] @@ -311,34 +294,37 @@ impl From for bool { impl SUSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SUSEN_A { + pub const fn variant(&self) -> SUSEN_A { match self.bits { false => SUSEN_A::VALUE1, true => SUSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An OCDS suspend trigger is ignored by the CAN node."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An OCDS suspend trigger disables the CAN node: As soon as the CAN node becomes bus-idle or bus-off, bit INIT is internally forced to 1 to disable the CAN node. The actual value of bit INIT remains unchanged."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUSEN_A::VALUE2 } } #[doc = "Field `SUSEN` writer - Suspend Enable"] -pub type SUSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, NCR_SPEC, SUSEN_A, O>; -impl<'a, const O: u8> SUSEN_W<'a, O> { +pub type SUSEN_W<'a, REG> = crate::BitWriter<'a, REG, SUSEN_A>; +impl<'a, REG> SUSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An OCDS suspend trigger is ignored by the CAN node."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUSEN_A::VALUE1) } #[doc = "An OCDS suspend trigger disables the CAN node: As soon as the CAN node becomes bus-idle or bus-off, bit INIT is internally forced to 1 to disable the CAN node. The actual value of bit INIT remains unchanged."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUSEN_A::VALUE2) } } @@ -388,70 +374,71 @@ impl W { #[doc = "Bit 0 - Node Initialization"] #[inline(always)] #[must_use] - pub fn init(&mut self) -> INIT_W<0> { - INIT_W::new(self) + pub fn init(&mut self) -> INIT_W { + INIT_W::new(self, 0) } #[doc = "Bit 1 - Transfer Interrupt Enable"] #[inline(always)] #[must_use] - pub fn trie(&mut self) -> TRIE_W<1> { - TRIE_W::new(self) + pub fn trie(&mut self) -> TRIE_W { + TRIE_W::new(self, 1) } #[doc = "Bit 2 - LEC Indicated Error Interrupt Enable"] #[inline(always)] #[must_use] - pub fn lecie(&mut self) -> LECIE_W<2> { - LECIE_W::new(self) + pub fn lecie(&mut self) -> LECIE_W { + LECIE_W::new(self, 2) } #[doc = "Bit 3 - Alert Interrupt Enable"] #[inline(always)] #[must_use] - pub fn alie(&mut self) -> ALIE_W<3> { - ALIE_W::new(self) + pub fn alie(&mut self) -> ALIE_W { + ALIE_W::new(self, 3) } #[doc = "Bit 4 - CAN Disable"] #[inline(always)] #[must_use] - pub fn candis(&mut self) -> CANDIS_W<4> { - CANDIS_W::new(self) + pub fn candis(&mut self) -> CANDIS_W { + CANDIS_W::new(self, 4) } #[doc = "Bit 6 - Configuration Change Enable"] #[inline(always)] #[must_use] - pub fn cce(&mut self) -> CCE_W<6> { - CCE_W::new(self) + pub fn cce(&mut self) -> CCE_W { + CCE_W::new(self, 6) } #[doc = "Bit 7 - CAN Analyzer Mode"] #[inline(always)] #[must_use] - pub fn calm(&mut self) -> CALM_W<7> { - CALM_W::new(self) + pub fn calm(&mut self) -> CALM_W { + CALM_W::new(self, 7) } #[doc = "Bit 8 - Suspend Enable"] #[inline(always)] #[must_use] - pub fn susen(&mut self) -> SUSEN_W<8> { - SUSEN_W::new(self) + pub fn susen(&mut self) -> SUSEN_W { + SUSEN_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Node Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ncr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ncr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ncr::R`](R) reader structure"] +impl crate::Readable for NCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ncr::W`](W) writer structure"] impl crate::Writable for NCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_node0/necnt.rs b/src/can_node0/necnt.rs index fcaf9de3..e45a451f 100644 --- a/src/can_node0/necnt.rs +++ b/src/can_node0/necnt.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `REC` reader - Receive Error Counter"] -pub type REC_R = crate::FieldReader; +pub type REC_R = crate::FieldReader; #[doc = "Field `REC` writer - Receive Error Counter"] -pub type REC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NECNT_SPEC, u8, u8, 8, O>; +pub type REC_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `TEC` reader - Transmit Error Counter"] -pub type TEC_R = crate::FieldReader; +pub type TEC_R = crate::FieldReader; #[doc = "Field `TEC` writer - Transmit Error Counter"] -pub type TEC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NECNT_SPEC, u8, u8, 8, O>; +pub type TEC_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `EWRNLVL` reader - Error Warning Level"] -pub type EWRNLVL_R = crate::FieldReader; +pub type EWRNLVL_R = crate::FieldReader; #[doc = "Field `EWRNLVL` writer - Error Warning Level"] -pub type EWRNLVL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NECNT_SPEC, u8, u8, 8, O>; +pub type EWRNLVL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `LETD` reader - Last Error Transfer Direction"] pub type LETD_R = crate::BitReader; #[doc = "Last Error Transfer Direction\n\nValue on reset: 0"] @@ -65,18 +33,18 @@ impl From for bool { impl LETD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LETD_A { + pub const fn variant(&self) -> LETD_A { match self.bits { false => LETD_A::VALUE1, true => LETD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The last error occurred while the CAN node x was receiver (REC has been incremented)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LETD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The last error occurred while the CAN node x was transmitter (TEC has been incremented)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LETD_A::VALUE2 @@ -101,18 +69,18 @@ impl From for bool { impl LEINC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LEINC_A { + pub const fn variant(&self) -> LEINC_A { match self.bits { false => LEINC_A::VALUE1, true => LEINC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The last error led to an error counter increment of 1."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LEINC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The last error led to an error counter increment of 8."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LEINC_A::VALUE2 @@ -149,40 +117,41 @@ impl W { #[doc = "Bits 0:7 - Receive Error Counter"] #[inline(always)] #[must_use] - pub fn rec(&mut self) -> REC_W<0> { - REC_W::new(self) + pub fn rec(&mut self) -> REC_W { + REC_W::new(self, 0) } #[doc = "Bits 8:15 - Transmit Error Counter"] #[inline(always)] #[must_use] - pub fn tec(&mut self) -> TEC_W<8> { - TEC_W::new(self) + pub fn tec(&mut self) -> TEC_W { + TEC_W::new(self, 8) } #[doc = "Bits 16:23 - Error Warning Level"] #[inline(always)] #[must_use] - pub fn ewrnlvl(&mut self) -> EWRNLVL_W<16> { - EWRNLVL_W::new(self) + pub fn ewrnlvl(&mut self) -> EWRNLVL_W { + EWRNLVL_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Node Error Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`necnt::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`necnt::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`necnt::R`](R) reader structure"] +impl crate::Readable for NECNT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`necnt::W`](W) writer structure"] impl crate::Writable for NECNT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_node0/nfcr.rs b/src/can_node0/nfcr.rs index 52ab0a99..6d0d86f4 100644 --- a/src/can_node0/nfcr.rs +++ b/src/can_node0/nfcr.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CFC` reader - CAN Frame Counter"] -pub type CFC_R = crate::FieldReader; +pub type CFC_R = crate::FieldReader; #[doc = "Field `CFC` writer - CAN Frame Counter"] -pub type CFC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NFCR_SPEC, u16, u16, 16, O>; +pub type CFC_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `CFSEL` reader - CAN Frame Count Selection"] -pub type CFSEL_R = crate::FieldReader; +pub type CFSEL_R = crate::FieldReader; #[doc = "CAN Frame Count Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,32 +21,39 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CFSEL_A { + type Ux = u8; +} impl CFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CFSEL_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The frame counter is incremented (internally) at the beginning of a new bit time. The value is sampled during the SOF bit of a new frame. The sampled value is visible in the CFC field."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFSEL_A::VALUE1 } } #[doc = "Field `CFSEL` writer - CAN Frame Count Selection"] -pub type CFSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NFCR_SPEC, u8, CFSEL_A, 3, O>; -impl<'a, const O: u8> CFSEL_W<'a, O> { +pub type CFSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CFSEL_A>; +impl<'a, REG> CFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The frame counter is incremented (internally) at the beginning of a new bit time. The value is sampled during the SOF bit of a new frame. The sampled value is visible in the CFC field."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CFSEL_A::VALUE1) } } #[doc = "Field `CFMOD` reader - CAN Frame Counter Mode"] -pub type CFMOD_R = crate::FieldReader; +pub type CFMOD_R = crate::FieldReader; #[doc = "CAN Frame Counter Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -96,10 +71,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CFMOD_A { + type Ux = u8; +} impl CFMOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CFMOD_A::VALUE1), 1 => Some(CFMOD_A::VALUE2), @@ -107,38 +85,42 @@ impl CFMOD_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Frame Count Mode: The frame counter is incremented upon the reception and transmission of frames."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFMOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Time Stamp Mode: The frame counter is used to count bit times."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CFMOD_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Bit Timing Mode: The frame counter is used for analysis of the bit timing."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CFMOD_A::VALUE3 } } #[doc = "Field `CFMOD` writer - CAN Frame Counter Mode"] -pub type CFMOD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NFCR_SPEC, u8, CFMOD_A, 2, O>; -impl<'a, const O: u8> CFMOD_W<'a, O> { +pub type CFMOD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CFMOD_A>; +impl<'a, REG> CFMOD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Frame Count Mode: The frame counter is incremented upon the reception and transmission of frames."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CFMOD_A::VALUE1) } #[doc = "Time Stamp Mode: The frame counter is used to count bit times."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CFMOD_A::VALUE2) } #[doc = "Bit Timing Mode: The frame counter is used for analysis of the bit timing."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CFMOD_A::VALUE3) } } @@ -161,34 +143,37 @@ impl From for bool { impl CFCIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CFCIE_A { + pub const fn variant(&self) -> CFCIE_A { match self.bits { false => CFCIE_A::VALUE1, true => CFCIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CAN frame counter overflow interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFCIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CAN frame counter overflow interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CFCIE_A::VALUE2 } } #[doc = "Field `CFCIE` writer - CAN Frame Count Interrupt Enable"] -pub type CFCIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, NFCR_SPEC, CFCIE_A, O>; -impl<'a, const O: u8> CFCIE_W<'a, O> { +pub type CFCIE_W<'a, REG> = crate::BitWriter<'a, REG, CFCIE_A>; +impl<'a, REG> CFCIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "CAN frame counter overflow interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CFCIE_A::VALUE1) } #[doc = "CAN frame counter overflow interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CFCIE_A::VALUE2) } } @@ -211,34 +196,37 @@ impl From for bool { impl CFCOV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CFCOV_A { + pub const fn variant(&self) -> CFCOV_A { match self.bits { false => CFCOV_A::VALUE1, true => CFCOV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No overflow has occurred since last flag reset."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFCOV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An overflow has occurred since last flag reset."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CFCOV_A::VALUE2 } } #[doc = "Field `CFCOV` writer - CAN Frame Counter Overflow Flag"] -pub type CFCOV_W<'a, const O: u8> = crate::BitWriter<'a, u32, NFCR_SPEC, CFCOV_A, O>; -impl<'a, const O: u8> CFCOV_W<'a, O> { +pub type CFCOV_W<'a, REG> = crate::BitWriter<'a, REG, CFCOV_A>; +impl<'a, REG> CFCOV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No overflow has occurred since last flag reset."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CFCOV_A::VALUE1) } #[doc = "An overflow has occurred since last flag reset."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CFCOV_A::VALUE2) } } @@ -273,52 +261,53 @@ impl W { #[doc = "Bits 0:15 - CAN Frame Counter"] #[inline(always)] #[must_use] - pub fn cfc(&mut self) -> CFC_W<0> { - CFC_W::new(self) + pub fn cfc(&mut self) -> CFC_W { + CFC_W::new(self, 0) } #[doc = "Bits 16:18 - CAN Frame Count Selection"] #[inline(always)] #[must_use] - pub fn cfsel(&mut self) -> CFSEL_W<16> { - CFSEL_W::new(self) + pub fn cfsel(&mut self) -> CFSEL_W { + CFSEL_W::new(self, 16) } #[doc = "Bits 19:20 - CAN Frame Counter Mode"] #[inline(always)] #[must_use] - pub fn cfmod(&mut self) -> CFMOD_W<19> { - CFMOD_W::new(self) + pub fn cfmod(&mut self) -> CFMOD_W { + CFMOD_W::new(self, 19) } #[doc = "Bit 22 - CAN Frame Count Interrupt Enable"] #[inline(always)] #[must_use] - pub fn cfcie(&mut self) -> CFCIE_W<22> { - CFCIE_W::new(self) + pub fn cfcie(&mut self) -> CFCIE_W { + CFCIE_W::new(self, 22) } #[doc = "Bit 23 - CAN Frame Counter Overflow Flag"] #[inline(always)] #[must_use] - pub fn cfcov(&mut self) -> CFCOV_W<23> { - CFCOV_W::new(self) + pub fn cfcov(&mut self) -> CFCOV_W { + CFCOV_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Node Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nfcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nfcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nfcr::R`](R) reader structure"] +impl crate::Readable for NFCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nfcr::W`](W) writer structure"] impl crate::Writable for NFCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_node0/nipr.rs b/src/can_node0/nipr.rs index 1e171e36..59a99b5e 100644 --- a/src/can_node0/nipr.rs +++ b/src/can_node0/nipr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ALINP` reader - Alert Interrupt Node Pointer"] -pub type ALINP_R = crate::FieldReader; +pub type ALINP_R = crate::FieldReader; #[doc = "Alert Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ALINP_A { + type Ux = u8; +} impl ALINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ALINP_A::VALUE1), 1 => Some(ALINP_A::VALUE2), @@ -64,43 +35,47 @@ impl ALINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ALINP_A::VALUE3 } } #[doc = "Field `ALINP` writer - Alert Interrupt Node Pointer"] -pub type ALINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NIPR_SPEC, u8, ALINP_A, 3, O>; -impl<'a, const O: u8> ALINP_W<'a, O> { +pub type ALINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, ALINP_A>; +impl<'a, REG> ALINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALINP_A::VALUE1) } #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALINP_A::VALUE2) } #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ALINP_A::VALUE3) } } #[doc = "Field `LECINP` reader - Last Error Code Interrupt Node Pointer"] -pub type LECINP_R = crate::FieldReader; +pub type LECINP_R = crate::FieldReader; #[doc = "Last Error Code Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LECINP_A { + type Ux = u8; +} impl LECINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(LECINP_A::VALUE1), 1 => Some(LECINP_A::VALUE2), @@ -129,43 +107,47 @@ impl LECINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LECINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LECINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LECINP_A::VALUE3 } } #[doc = "Field `LECINP` writer - Last Error Code Interrupt Node Pointer"] -pub type LECINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NIPR_SPEC, u8, LECINP_A, 3, O>; -impl<'a, const O: u8> LECINP_W<'a, O> { +pub type LECINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, LECINP_A>; +impl<'a, REG> LECINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LECINP_A::VALUE1) } #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LECINP_A::VALUE2) } #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LECINP_A::VALUE3) } } #[doc = "Field `TRINP` reader - Transfer OK Interrupt Node Pointer"] -pub type TRINP_R = crate::FieldReader; +pub type TRINP_R = crate::FieldReader; #[doc = "Transfer OK Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TRINP_A { + type Ux = u8; +} impl TRINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TRINP_A::VALUE1), 1 => Some(TRINP_A::VALUE2), @@ -194,43 +179,47 @@ impl TRINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TRINP_A::VALUE3 } } #[doc = "Field `TRINP` writer - Transfer OK Interrupt Node Pointer"] -pub type TRINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NIPR_SPEC, u8, TRINP_A, 3, O>; -impl<'a, const O: u8> TRINP_W<'a, O> { +pub type TRINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TRINP_A>; +impl<'a, REG> TRINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRINP_A::VALUE1) } #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRINP_A::VALUE2) } #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TRINP_A::VALUE3) } } #[doc = "Field `CFCINP` reader - Frame Counter Interrupt Node Pointer"] -pub type CFCINP_R = crate::FieldReader; +pub type CFCINP_R = crate::FieldReader; #[doc = "Frame Counter Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CFCINP_A { + type Ux = u8; +} impl CFCINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CFCINP_A::VALUE1), 1 => Some(CFCINP_A::VALUE2), @@ -259,38 +251,42 @@ impl CFCINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFCINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CFCINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CFCINP_A::VALUE3 } } #[doc = "Field `CFCINP` writer - Frame Counter Interrupt Node Pointer"] -pub type CFCINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NIPR_SPEC, u8, CFCINP_A, 3, O>; -impl<'a, const O: u8> CFCINP_W<'a, O> { +pub type CFCINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CFCINP_A>; +impl<'a, REG> CFCINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Interrupt output line INT_O0 is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CFCINP_A::VALUE1) } #[doc = "Interrupt output line INT_O1 is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CFCINP_A::VALUE2) } #[doc = "Interrupt output line INT_O7 is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CFCINP_A::VALUE3) } } @@ -320,46 +316,47 @@ impl W { #[doc = "Bits 0:2 - Alert Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn alinp(&mut self) -> ALINP_W<0> { - ALINP_W::new(self) + pub fn alinp(&mut self) -> ALINP_W { + ALINP_W::new(self, 0) } #[doc = "Bits 4:6 - Last Error Code Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn lecinp(&mut self) -> LECINP_W<4> { - LECINP_W::new(self) + pub fn lecinp(&mut self) -> LECINP_W { + LECINP_W::new(self, 4) } #[doc = "Bits 8:10 - Transfer OK Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn trinp(&mut self) -> TRINP_W<8> { - TRINP_W::new(self) + pub fn trinp(&mut self) -> TRINP_W { + TRINP_W::new(self, 8) } #[doc = "Bits 12:14 - Frame Counter Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn cfcinp(&mut self) -> CFCINP_W<12> { - CFCINP_W::new(self) + pub fn cfcinp(&mut self) -> CFCINP_W { + CFCINP_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Node Interrupt Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nipr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nipr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nipr::R`](R) reader structure"] +impl crate::Readable for NIPR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nipr::W`](W) writer structure"] impl crate::Writable for NIPR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_node0/npcr.rs b/src/can_node0/npcr.rs index faa1fca2..897882f9 100644 --- a/src/can_node0/npcr.rs +++ b/src/can_node0/npcr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RXSEL` reader - Receive Select"] -pub type RXSEL_R = crate::FieldReader; +pub type RXSEL_R = crate::FieldReader; #[doc = "Field `RXSEL` writer - Receive Select"] -pub type RXSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NPCR_SPEC, u8, u8, 3, O>; +pub type RXSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `LBM` reader - Loop-Back Mode"] pub type LBM_R = crate::BitReader; #[doc = "Loop-Back Mode\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl LBM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LBM_A { + pub const fn variant(&self) -> LBM_A { match self.bits { false => LBM_A::VALUE1, true => LBM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Loop-Back Mode is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LBM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Loop-Back Mode is enabled. This node is connected to an internal (virtual) loop-back CAN bus. All CAN nodes which are in Loop-Back Mode are connected to this virtual CAN bus so that they can communicate with each other internally. The external transmit line is forced recessive in Loop-Back Mode."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LBM_A::VALUE2 } } #[doc = "Field `LBM` writer - Loop-Back Mode"] -pub type LBM_W<'a, const O: u8> = crate::BitWriter<'a, u32, NPCR_SPEC, LBM_A, O>; -impl<'a, const O: u8> LBM_W<'a, O> { +pub type LBM_W<'a, REG> = crate::BitWriter<'a, REG, LBM_A>; +impl<'a, REG> LBM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Loop-Back Mode is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LBM_A::VALUE1) } #[doc = "Loop-Back Mode is enabled. This node is connected to an internal (virtual) loop-back CAN bus. All CAN nodes which are in Loop-Back Mode are connected to this virtual CAN bus so that they can communicate with each other internally. The external transmit line is forced recessive in Loop-Back Mode."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LBM_A::VALUE2) } } @@ -104,34 +75,35 @@ impl W { #[doc = "Bits 0:2 - Receive Select"] #[inline(always)] #[must_use] - pub fn rxsel(&mut self) -> RXSEL_W<0> { - RXSEL_W::new(self) + pub fn rxsel(&mut self) -> RXSEL_W { + RXSEL_W::new(self, 0) } #[doc = "Bit 8 - Loop-Back Mode"] #[inline(always)] #[must_use] - pub fn lbm(&mut self) -> LBM_W<8> { - LBM_W::new(self) + pub fn lbm(&mut self) -> LBM_W { + LBM_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Node Port Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`npcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`npcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`npcr::R`](R) reader structure"] +impl crate::Readable for NPCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`npcr::W`](W) writer structure"] impl crate::Writable for NPCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/can_node0/nsr.rs b/src/can_node0/nsr.rs index 2c41aac5..f1bd9d7b 100644 --- a/src/can_node0/nsr.rs +++ b/src/can_node0/nsr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `LEC` reader - Last Error Code"] -pub type LEC_R = crate::FieldReader; +pub type LEC_R = crate::FieldReader; #[doc = "Field `LEC` writer - Last Error Code"] -pub type LEC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NSR_SPEC, u8, u8, 3, O>; +pub type LEC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `TXOK` reader - Message Transmitted Successfully"] pub type TXOK_R = crate::BitReader; #[doc = "Message Transmitted Successfully\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl TXOK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TXOK_A { + pub const fn variant(&self) -> TXOK_A { match self.bits { false => TXOK_A::VALUE1, true => TXOK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No successful transmission since last (most recent) flag reset."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TXOK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A message has been transmitted successfully (error-free and acknowledged by at least another node)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TXOK_A::VALUE2 } } #[doc = "Field `TXOK` writer - Message Transmitted Successfully"] -pub type TXOK_W<'a, const O: u8> = crate::BitWriter<'a, u32, NSR_SPEC, TXOK_A, O>; -impl<'a, const O: u8> TXOK_W<'a, O> { +pub type TXOK_W<'a, REG> = crate::BitWriter<'a, REG, TXOK_A>; +impl<'a, REG> TXOK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No successful transmission since last (most recent) flag reset."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TXOK_A::VALUE1) } #[doc = "A message has been transmitted successfully (error-free and acknowledged by at least another node)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TXOK_A::VALUE2) } } @@ -107,41 +78,44 @@ impl From for bool { impl RXOK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXOK_A { + pub const fn variant(&self) -> RXOK_A { match self.bits { false => RXOK_A::VALUE1, true => RXOK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No successful reception since last (most recent) flag reset."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXOK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A message has been received successfully."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXOK_A::VALUE2 } } #[doc = "Field `RXOK` writer - Message Received Successfully"] -pub type RXOK_W<'a, const O: u8> = crate::BitWriter<'a, u32, NSR_SPEC, RXOK_A, O>; -impl<'a, const O: u8> RXOK_W<'a, O> { +pub type RXOK_W<'a, REG> = crate::BitWriter<'a, REG, RXOK_A>; +impl<'a, REG> RXOK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No successful reception since last (most recent) flag reset."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXOK_A::VALUE1) } #[doc = "A message has been received successfully."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXOK_A::VALUE2) } } #[doc = "Field `ALERT` reader - Alert Warning"] -pub type ALERT_R = crate::BitReader; +pub type ALERT_R = crate::BitReader; #[doc = "Field `ALERT` writer - Alert Warning"] -pub type ALERT_W<'a, const O: u8> = crate::BitWriter<'a, u32, NSR_SPEC, bool, O>; +pub type ALERT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EWRN` reader - Error Warning Status"] pub type EWRN_R = crate::BitReader; #[doc = "Error Warning Status\n\nValue on reset: 0"] @@ -161,18 +135,18 @@ impl From for bool { impl EWRN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EWRN_A { + pub const fn variant(&self) -> EWRN_A { match self.bits { false => EWRN_A::VALUE1, true => EWRN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No warning limit exceeded."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EWRN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "One of the error counters REC or TEC reached the warning limit EWRNLVL."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EWRN_A::VALUE2 @@ -197,18 +171,18 @@ impl From for bool { impl BOFF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BOFF_A { + pub const fn variant(&self) -> BOFF_A { match self.bits { false => BOFF_A::VALUE1, true => BOFF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CAN controller is not in the bus-off state."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BOFF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CAN controller is in the bus-off state."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BOFF_A::VALUE2 @@ -233,34 +207,37 @@ impl From for bool { impl LLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LLE_A { + pub const fn variant(&self) -> LLE_A { match self.bits { false => LLE_A::VALUE1, true => LLE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No List Length Error since last (most recent) flag reset."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A List Length Error has been detected during message acceptance filtering. The number of elements in the list that belongs to this CAN node differs from the list SIZE given in the list termination pointer."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LLE_A::VALUE2 } } #[doc = "Field `LLE` writer - List Length Error"] -pub type LLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, NSR_SPEC, LLE_A, O>; -impl<'a, const O: u8> LLE_W<'a, O> { +pub type LLE_W<'a, REG> = crate::BitWriter<'a, REG, LLE_A>; +impl<'a, REG> LLE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No List Length Error since last (most recent) flag reset."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LLE_A::VALUE1) } #[doc = "A List Length Error has been detected during message acceptance filtering. The number of elements in the list that belongs to this CAN node differs from the list SIZE given in the list termination pointer."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LLE_A::VALUE2) } } @@ -283,34 +260,37 @@ impl From for bool { impl LOE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LOE_A { + pub const fn variant(&self) -> LOE_A { match self.bits { false => LOE_A::VALUE1, true => LOE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No List Object Error since last (most recent) flag reset."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LOE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A List Object Error has been detected during message acceptance filtering. A message object with wrong LIST index entry in the Message Object Control Register has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LOE_A::VALUE2 } } #[doc = "Field `LOE` writer - List Object Error"] -pub type LOE_W<'a, const O: u8> = crate::BitWriter<'a, u32, NSR_SPEC, LOE_A, O>; -impl<'a, const O: u8> LOE_W<'a, O> { +pub type LOE_W<'a, REG> = crate::BitWriter<'a, REG, LOE_A>; +impl<'a, REG> LOE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No List Object Error since last (most recent) flag reset."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LOE_A::VALUE1) } #[doc = "A List Object Error has been detected during message acceptance filtering. A message object with wrong LIST index entry in the Message Object Control Register has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LOE_A::VALUE2) } } @@ -333,18 +313,18 @@ impl From for bool { impl SUSACK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SUSACK_A { + pub const fn variant(&self) -> SUSACK_A { match self.bits { false => SUSACK_A::VALUE1, true => SUSACK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The CAN node is not in Suspend Mode or a suspend request is pending, but the CAN node has not yet reached bus-idle or bus-off."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUSACK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The CAN node is in Suspend Mode: The CAN node is inactive (bit NCR.INIT internally forced to 1) due to an OCDS suspend request."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUSACK_A::VALUE2 @@ -401,58 +381,59 @@ impl W { #[doc = "Bits 0:2 - Last Error Code"] #[inline(always)] #[must_use] - pub fn lec(&mut self) -> LEC_W<0> { - LEC_W::new(self) + pub fn lec(&mut self) -> LEC_W { + LEC_W::new(self, 0) } #[doc = "Bit 3 - Message Transmitted Successfully"] #[inline(always)] #[must_use] - pub fn txok(&mut self) -> TXOK_W<3> { - TXOK_W::new(self) + pub fn txok(&mut self) -> TXOK_W { + TXOK_W::new(self, 3) } #[doc = "Bit 4 - Message Received Successfully"] #[inline(always)] #[must_use] - pub fn rxok(&mut self) -> RXOK_W<4> { - RXOK_W::new(self) + pub fn rxok(&mut self) -> RXOK_W { + RXOK_W::new(self, 4) } #[doc = "Bit 5 - Alert Warning"] #[inline(always)] #[must_use] - pub fn alert(&mut self) -> ALERT_W<5> { - ALERT_W::new(self) + pub fn alert(&mut self) -> ALERT_W { + ALERT_W::new(self, 5) } #[doc = "Bit 8 - List Length Error"] #[inline(always)] #[must_use] - pub fn lle(&mut self) -> LLE_W<8> { - LLE_W::new(self) + pub fn lle(&mut self) -> LLE_W { + LLE_W::new(self, 8) } #[doc = "Bit 9 - List Object Error"] #[inline(always)] #[must_use] - pub fn loe(&mut self) -> LOE_W<9> { - LOE_W::new(self) + pub fn loe(&mut self) -> LOE_W { + LOE_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Node Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nsr::R`](R) reader structure"] +impl crate::Readable for NSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nsr::W`](W) writer structure"] impl crate::Writable for NSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40.rs b/src/ccu40.rs index 74888202..463f3bcc 100644 --- a/src/ccu40.rs +++ b/src/ccu40.rs @@ -1,60 +1,107 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + gctrl: GCTRL, + gstat: GSTAT, + gidls: GIDLS, + gidlc: GIDLC, + gcss: GCSS, + gcsc: GCSC, + gcst: GCST, + _reserved7: [u8; 0x34], + ecrd: ECRD, + _reserved8: [u8; 0x2c], + midr: MIDR, +} +impl RegisterBlock { #[doc = "0x00 - Global Control Register"] - pub gctrl: GCTRL, + #[inline(always)] + pub const fn gctrl(&self) -> &GCTRL { + &self.gctrl + } #[doc = "0x04 - Global Status Register"] - pub gstat: GSTAT, + #[inline(always)] + pub const fn gstat(&self) -> &GSTAT { + &self.gstat + } #[doc = "0x08 - Global Idle Set"] - pub gidls: GIDLS, + #[inline(always)] + pub const fn gidls(&self) -> &GIDLS { + &self.gidls + } #[doc = "0x0c - Global Idle Clear"] - pub gidlc: GIDLC, + #[inline(always)] + pub const fn gidlc(&self) -> &GIDLC { + &self.gidlc + } #[doc = "0x10 - Global Channel Set"] - pub gcss: GCSS, + #[inline(always)] + pub const fn gcss(&self) -> &GCSS { + &self.gcss + } #[doc = "0x14 - Global Channel Clear"] - pub gcsc: GCSC, + #[inline(always)] + pub const fn gcsc(&self) -> &GCSC { + &self.gcsc + } #[doc = "0x18 - Global Channel Status"] - pub gcst: GCST, - _reserved7: [u8; 0x34], + #[inline(always)] + pub const fn gcst(&self) -> &GCST { + &self.gcst + } #[doc = "0x50 - Extended Capture Mode Read"] - pub ecrd: ECRD, - _reserved8: [u8; 0x2c], + #[inline(always)] + pub const fn ecrd(&self) -> &ECRD { + &self.ecrd + } #[doc = "0x80 - Module Identification"] - pub midr: MIDR, + #[inline(always)] + pub const fn midr(&self) -> &MIDR { + &self.midr + } } -#[doc = "GCTRL (rw) register accessor: an alias for `Reg`"] +#[doc = "GCTRL (rw) register accessor: Global Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gctrl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gctrl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gctrl`] +module"] pub type GCTRL = crate::Reg; #[doc = "Global Control Register"] pub mod gctrl; -#[doc = "GSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "GSTAT (r) register accessor: Global Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gstat`] +module"] pub type GSTAT = crate::Reg; #[doc = "Global Status Register"] pub mod gstat; -#[doc = "GIDLS (w) register accessor: an alias for `Reg`"] +#[doc = "GIDLS (w) register accessor: Global Idle Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gidls::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gidls`] +module"] pub type GIDLS = crate::Reg; #[doc = "Global Idle Set"] pub mod gidls; -#[doc = "GIDLC (w) register accessor: an alias for `Reg`"] +#[doc = "GIDLC (w) register accessor: Global Idle Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gidlc::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gidlc`] +module"] pub type GIDLC = crate::Reg; #[doc = "Global Idle Clear"] pub mod gidlc; -#[doc = "GCSS (w) register accessor: an alias for `Reg`"] +#[doc = "GCSS (w) register accessor: Global Channel Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gcss::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gcss`] +module"] pub type GCSS = crate::Reg; #[doc = "Global Channel Set"] pub mod gcss; -#[doc = "GCSC (w) register accessor: an alias for `Reg`"] +#[doc = "GCSC (w) register accessor: Global Channel Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gcsc::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gcsc`] +module"] pub type GCSC = crate::Reg; #[doc = "Global Channel Clear"] pub mod gcsc; -#[doc = "GCST (r) register accessor: an alias for `Reg`"] +#[doc = "GCST (r) register accessor: Global Channel Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gcst::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gcst`] +module"] pub type GCST = crate::Reg; #[doc = "Global Channel Status"] pub mod gcst; -#[doc = "ECRD (r) register accessor: an alias for `Reg`"] +#[doc = "ECRD (r) register accessor: Extended Capture Mode Read\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ecrd::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ecrd`] +module"] pub type ECRD = crate::Reg; #[doc = "Extended Capture Mode Read"] pub mod ecrd; -#[doc = "MIDR (r) register accessor: an alias for `Reg`"] +#[doc = "MIDR (r) register accessor: Module Identification\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`midr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@midr`] +module"] pub type MIDR = crate::Reg; #[doc = "Module Identification"] pub mod midr; diff --git a/src/ccu40/ecrd.rs b/src/ccu40/ecrd.rs index ae5e9a84..957230b4 100644 --- a/src/ccu40/ecrd.rs +++ b/src/ccu40/ecrd.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPV` reader - Timer Capture Value"] -pub type CAPV_R = crate::FieldReader; +pub type CAPV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Capture value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `SPTR` reader - Slice pointer"] -pub type SPTR_R = crate::FieldReader; +pub type SPTR_R = crate::FieldReader; #[doc = "Slice pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -38,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SPTR_A { + type Ux = u8; +} impl SPTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SPTR_A { + pub const fn variant(&self) -> SPTR_A { match self.bits { 0 => SPTR_A::VALUE1, 1 => SPTR_A::VALUE2, @@ -50,29 +40,29 @@ impl SPTR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CC40"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SPTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CC41"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SPTR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CC42"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SPTR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CC43"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SPTR_A::VALUE4 } } #[doc = "Field `VPTR` reader - Capture register pointer"] -pub type VPTR_R = crate::FieldReader; +pub type VPTR_R = crate::FieldReader; #[doc = "Capture register pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -92,10 +82,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for VPTR_A { + type Ux = u8; +} impl VPTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VPTR_A { + pub const fn variant(&self) -> VPTR_A { match self.bits { 0 => VPTR_A::VALUE1, 1 => VPTR_A::VALUE2, @@ -104,22 +97,22 @@ impl VPTR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Capture register 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VPTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Capture register 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VPTR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Capture register 2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == VPTR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Capture register 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == VPTR_A::VALUE4 @@ -144,18 +137,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into this register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value has been captured into this register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -188,15 +181,13 @@ impl R { FFL_R::new(((self.bits >> 24) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Extended Capture Mode Read\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ecrd::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`ecrd::R`](R) reader structure"] +impl crate::Readable for ECRD_SPEC {} #[doc = "`reset()` method sets ECRD to value 0"] impl crate::Resettable for ECRD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40/gcsc.rs b/src/ccu40/gcsc.rs index 552d8dfc..b318ec4f 100644 --- a/src/ccu40/gcsc.rs +++ b/src/ccu40/gcsc.rs @@ -1,168 +1,152 @@ #[doc = "Register `GCSC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `S0SC` writer - Slice 0 shadow transfer clear"] -pub type S0SC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0SC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0DSC` writer - Slice 0 Dither shadow transfer clear"] -pub type S0DSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0DSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0PSC` writer - Slice 0 Prescaler shadow transfer clear"] -pub type S0PSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0PSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1SC` writer - Slice 1 shadow transfer clear"] -pub type S1SC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1SC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1DSC` writer - Slice 1 Dither shadow transfer clear"] -pub type S1DSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1DSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1PSC` writer - Slice 1 Prescaler shadow transfer clear"] -pub type S1PSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1PSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2SC` writer - Slice 2 shadow transfer clear"] -pub type S2SC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2SC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2DSC` writer - Slice 2 Dither shadow transfer clear"] -pub type S2DSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2DSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2PSC` writer - Slice 2 Prescaler shadow transfer clear"] -pub type S2PSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2PSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3SC` writer - Slice 3 shadow transfer clear"] -pub type S3SC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3SC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3DSC` writer - Slice 3 Dither shadow transfer clear"] -pub type S3DSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3DSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3PSC` writer - Slice 3 Prescaler shadow transfer clear"] -pub type S3PSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3PSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0STC` writer - Slice 0 status bit clear"] -pub type S0STC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0STC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1STC` writer - Slice 1 status bit clear"] -pub type S1STC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1STC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2STC` writer - Slice 2 status bit clear"] -pub type S2STC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2STC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3STC` writer - Slice 3 status bit clear"] -pub type S3STC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3STC_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Slice 0 shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s0sc(&mut self) -> S0SC_W<0> { - S0SC_W::new(self) + pub fn s0sc(&mut self) -> S0SC_W { + S0SC_W::new(self, 0) } #[doc = "Bit 1 - Slice 0 Dither shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s0dsc(&mut self) -> S0DSC_W<1> { - S0DSC_W::new(self) + pub fn s0dsc(&mut self) -> S0DSC_W { + S0DSC_W::new(self, 1) } #[doc = "Bit 2 - Slice 0 Prescaler shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s0psc(&mut self) -> S0PSC_W<2> { - S0PSC_W::new(self) + pub fn s0psc(&mut self) -> S0PSC_W { + S0PSC_W::new(self, 2) } #[doc = "Bit 4 - Slice 1 shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s1sc(&mut self) -> S1SC_W<4> { - S1SC_W::new(self) + pub fn s1sc(&mut self) -> S1SC_W { + S1SC_W::new(self, 4) } #[doc = "Bit 5 - Slice 1 Dither shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s1dsc(&mut self) -> S1DSC_W<5> { - S1DSC_W::new(self) + pub fn s1dsc(&mut self) -> S1DSC_W { + S1DSC_W::new(self, 5) } #[doc = "Bit 6 - Slice 1 Prescaler shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s1psc(&mut self) -> S1PSC_W<6> { - S1PSC_W::new(self) + pub fn s1psc(&mut self) -> S1PSC_W { + S1PSC_W::new(self, 6) } #[doc = "Bit 8 - Slice 2 shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s2sc(&mut self) -> S2SC_W<8> { - S2SC_W::new(self) + pub fn s2sc(&mut self) -> S2SC_W { + S2SC_W::new(self, 8) } #[doc = "Bit 9 - Slice 2 Dither shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s2dsc(&mut self) -> S2DSC_W<9> { - S2DSC_W::new(self) + pub fn s2dsc(&mut self) -> S2DSC_W { + S2DSC_W::new(self, 9) } #[doc = "Bit 10 - Slice 2 Prescaler shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s2psc(&mut self) -> S2PSC_W<10> { - S2PSC_W::new(self) + pub fn s2psc(&mut self) -> S2PSC_W { + S2PSC_W::new(self, 10) } #[doc = "Bit 12 - Slice 3 shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s3sc(&mut self) -> S3SC_W<12> { - S3SC_W::new(self) + pub fn s3sc(&mut self) -> S3SC_W { + S3SC_W::new(self, 12) } #[doc = "Bit 13 - Slice 3 Dither shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s3dsc(&mut self) -> S3DSC_W<13> { - S3DSC_W::new(self) + pub fn s3dsc(&mut self) -> S3DSC_W { + S3DSC_W::new(self, 13) } #[doc = "Bit 14 - Slice 3 Prescaler shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s3psc(&mut self) -> S3PSC_W<14> { - S3PSC_W::new(self) + pub fn s3psc(&mut self) -> S3PSC_W { + S3PSC_W::new(self, 14) } #[doc = "Bit 16 - Slice 0 status bit clear"] #[inline(always)] #[must_use] - pub fn s0stc(&mut self) -> S0STC_W<16> { - S0STC_W::new(self) + pub fn s0stc(&mut self) -> S0STC_W { + S0STC_W::new(self, 16) } #[doc = "Bit 17 - Slice 1 status bit clear"] #[inline(always)] #[must_use] - pub fn s1stc(&mut self) -> S1STC_W<17> { - S1STC_W::new(self) + pub fn s1stc(&mut self) -> S1STC_W { + S1STC_W::new(self, 17) } #[doc = "Bit 18 - Slice 2 status bit clear"] #[inline(always)] #[must_use] - pub fn s2stc(&mut self) -> S2STC_W<18> { - S2STC_W::new(self) + pub fn s2stc(&mut self) -> S2STC_W { + S2STC_W::new(self, 18) } #[doc = "Bit 19 - Slice 3 status bit clear"] #[inline(always)] #[must_use] - pub fn s3stc(&mut self) -> S3STC_W<19> { - S3STC_W::new(self) + pub fn s3stc(&mut self) -> S3STC_W { + S3STC_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Channel Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gcsc::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GCSC_SPEC; impl crate::RegisterSpec for GCSC_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [gcsc::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`gcsc::W`](W) writer structure"] impl crate::Writable for GCSC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40/gcss.rs b/src/ccu40/gcss.rs index e63636f5..588c4c6a 100644 --- a/src/ccu40/gcss.rs +++ b/src/ccu40/gcss.rs @@ -1,168 +1,152 @@ #[doc = "Register `GCSS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `S0SE` writer - Slice 0 shadow transfer set enable"] -pub type S0SE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0SE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0DSE` writer - Slice 0 Dither shadow transfer set enable"] -pub type S0DSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0DSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0PSE` writer - Slice 0 Prescaler shadow transfer set enable"] -pub type S0PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0PSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1SE` writer - Slice 1 shadow transfer set enable"] -pub type S1SE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1SE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1DSE` writer - Slice 1 Dither shadow transfer set enable"] -pub type S1DSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1DSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1PSE` writer - Slice 1 Prescaler shadow transfer set enable"] -pub type S1PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1PSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2SE` writer - Slice 2 shadow transfer set enable"] -pub type S2SE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2SE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2DSE` writer - Slice 2 Dither shadow transfer set enable"] -pub type S2DSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2DSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2PSE` writer - Slice 2 Prescaler shadow transfer set enable"] -pub type S2PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2PSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3SE` writer - Slice 3 shadow transfer set enable"] -pub type S3SE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3SE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3DSE` writer - Slice 3 Dither shadow transfer set enable"] -pub type S3DSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3DSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3PSE` writer - Slice 3 Prescaler shadow transfer set enable"] -pub type S3PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3PSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0STS` writer - Slice 0 status bit set"] -pub type S0STS_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0STS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1STS` writer - Slice 1 status bit set"] -pub type S1STS_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1STS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2STS` writer - Slice 2 status bit set"] -pub type S2STS_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2STS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3STS` writer - Slice 3 status bit set"] -pub type S3STS_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3STS_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Slice 0 shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s0se(&mut self) -> S0SE_W<0> { - S0SE_W::new(self) + pub fn s0se(&mut self) -> S0SE_W { + S0SE_W::new(self, 0) } #[doc = "Bit 1 - Slice 0 Dither shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s0dse(&mut self) -> S0DSE_W<1> { - S0DSE_W::new(self) + pub fn s0dse(&mut self) -> S0DSE_W { + S0DSE_W::new(self, 1) } #[doc = "Bit 2 - Slice 0 Prescaler shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s0pse(&mut self) -> S0PSE_W<2> { - S0PSE_W::new(self) + pub fn s0pse(&mut self) -> S0PSE_W { + S0PSE_W::new(self, 2) } #[doc = "Bit 4 - Slice 1 shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s1se(&mut self) -> S1SE_W<4> { - S1SE_W::new(self) + pub fn s1se(&mut self) -> S1SE_W { + S1SE_W::new(self, 4) } #[doc = "Bit 5 - Slice 1 Dither shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s1dse(&mut self) -> S1DSE_W<5> { - S1DSE_W::new(self) + pub fn s1dse(&mut self) -> S1DSE_W { + S1DSE_W::new(self, 5) } #[doc = "Bit 6 - Slice 1 Prescaler shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s1pse(&mut self) -> S1PSE_W<6> { - S1PSE_W::new(self) + pub fn s1pse(&mut self) -> S1PSE_W { + S1PSE_W::new(self, 6) } #[doc = "Bit 8 - Slice 2 shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s2se(&mut self) -> S2SE_W<8> { - S2SE_W::new(self) + pub fn s2se(&mut self) -> S2SE_W { + S2SE_W::new(self, 8) } #[doc = "Bit 9 - Slice 2 Dither shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s2dse(&mut self) -> S2DSE_W<9> { - S2DSE_W::new(self) + pub fn s2dse(&mut self) -> S2DSE_W { + S2DSE_W::new(self, 9) } #[doc = "Bit 10 - Slice 2 Prescaler shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s2pse(&mut self) -> S2PSE_W<10> { - S2PSE_W::new(self) + pub fn s2pse(&mut self) -> S2PSE_W { + S2PSE_W::new(self, 10) } #[doc = "Bit 12 - Slice 3 shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s3se(&mut self) -> S3SE_W<12> { - S3SE_W::new(self) + pub fn s3se(&mut self) -> S3SE_W { + S3SE_W::new(self, 12) } #[doc = "Bit 13 - Slice 3 Dither shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s3dse(&mut self) -> S3DSE_W<13> { - S3DSE_W::new(self) + pub fn s3dse(&mut self) -> S3DSE_W { + S3DSE_W::new(self, 13) } #[doc = "Bit 14 - Slice 3 Prescaler shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s3pse(&mut self) -> S3PSE_W<14> { - S3PSE_W::new(self) + pub fn s3pse(&mut self) -> S3PSE_W { + S3PSE_W::new(self, 14) } #[doc = "Bit 16 - Slice 0 status bit set"] #[inline(always)] #[must_use] - pub fn s0sts(&mut self) -> S0STS_W<16> { - S0STS_W::new(self) + pub fn s0sts(&mut self) -> S0STS_W { + S0STS_W::new(self, 16) } #[doc = "Bit 17 - Slice 1 status bit set"] #[inline(always)] #[must_use] - pub fn s1sts(&mut self) -> S1STS_W<17> { - S1STS_W::new(self) + pub fn s1sts(&mut self) -> S1STS_W { + S1STS_W::new(self, 17) } #[doc = "Bit 18 - Slice 2 status bit set"] #[inline(always)] #[must_use] - pub fn s2sts(&mut self) -> S2STS_W<18> { - S2STS_W::new(self) + pub fn s2sts(&mut self) -> S2STS_W { + S2STS_W::new(self, 18) } #[doc = "Bit 19 - Slice 3 status bit set"] #[inline(always)] #[must_use] - pub fn s3sts(&mut self) -> S3STS_W<19> { - S3STS_W::new(self) + pub fn s3sts(&mut self) -> S3STS_W { + S3STS_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Channel Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gcss::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GCSS_SPEC; impl crate::RegisterSpec for GCSS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [gcss::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`gcss::W`](W) writer structure"] impl crate::Writable for GCSS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40/gcst.rs b/src/ccu40/gcst.rs index 9c1e5192..bd028697 100644 --- a/src/ccu40/gcst.rs +++ b/src/ccu40/gcst.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `S0SS` reader - Slice 0 shadow transfer status"] pub type S0SS_R = crate::BitReader; #[doc = "Slice 0 shadow transfer status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl S0SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0SS_A { + pub const fn variant(&self) -> S0SS_A { match self.bits { false => S0SS_A::VALUE1, true => S0SS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0SS_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl S0DSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0DSS_A { + pub const fn variant(&self) -> S0DSS_A { match self.bits { false => S0DSS_A::VALUE1, true => S0DSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0DSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0DSS_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl S0PSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0PSS_A { + pub const fn variant(&self) -> S0PSS_A { match self.bits { false => S0PSS_A::VALUE1, true => S0PSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0PSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0PSS_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl S1SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1SS_A { + pub const fn variant(&self) -> S1SS_A { match self.bits { false => S1SS_A::VALUE1, true => S1SS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1SS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl S1DSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1DSS_A { + pub const fn variant(&self) -> S1DSS_A { match self.bits { false => S1DSS_A::VALUE1, true => S1DSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1DSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1DSS_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl S1PSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1PSS_A { + pub const fn variant(&self) -> S1PSS_A { match self.bits { false => S1PSS_A::VALUE1, true => S1PSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1PSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1PSS_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl S2SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2SS_A { + pub const fn variant(&self) -> S2SS_A { match self.bits { false => S2SS_A::VALUE1, true => S2SS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2SS_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl S2DSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2DSS_A { + pub const fn variant(&self) -> S2DSS_A { match self.bits { false => S2DSS_A::VALUE1, true => S2DSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2DSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2DSS_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl S2PSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2PSS_A { + pub const fn variant(&self) -> S2PSS_A { match self.bits { false => S2PSS_A::VALUE1, true => S2PSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2PSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2PSS_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl S3SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3SS_A { + pub const fn variant(&self) -> S3SS_A { match self.bits { false => S3SS_A::VALUE1, true => S3SS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3SS_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl S3DSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3DSS_A { + pub const fn variant(&self) -> S3DSS_A { match self.bits { false => S3DSS_A::VALUE1, true => S3DSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3DSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3DSS_A::VALUE2 @@ -428,31 +415,31 @@ impl From for bool { impl S3PSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3PSS_A { + pub const fn variant(&self) -> S3PSS_A { match self.bits { false => S3PSS_A::VALUE1, true => S3PSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3PSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3PSS_A::VALUE2 } } #[doc = "Field `CC40ST` reader - Slice 0 status bit"] -pub type CC40ST_R = crate::BitReader; +pub type CC40ST_R = crate::BitReader; #[doc = "Field `CC41ST` reader - Slice 1 status bit"] -pub type CC41ST_R = crate::BitReader; +pub type CC41ST_R = crate::BitReader; #[doc = "Field `CC42ST` reader - Slice 2 status bit"] -pub type CC42ST_R = crate::BitReader; +pub type CC42ST_R = crate::BitReader; #[doc = "Field `CC43ST` reader - Slice 3 status bit"] -pub type CC43ST_R = crate::BitReader; +pub type CC43ST_R = crate::BitReader; impl R { #[doc = "Bit 0 - Slice 0 shadow transfer status"] #[inline(always)] @@ -535,15 +522,13 @@ impl R { CC43ST_R::new(((self.bits >> 19) & 1) != 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"] +#[doc = "Global Channel Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gcst::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`gcst::R`](R) reader structure"] +impl crate::Readable for GCST_SPEC {} #[doc = "`reset()` method sets GCST to value 0"] impl crate::Resettable for GCST_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40/gctrl.rs b/src/ccu40/gctrl.rs index 462b8184..68719b69 100644 --- a/src/ccu40/gctrl.rs +++ b/src/ccu40/gctrl.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRBC` reader - Prescaler Clear Configuration"] -pub type PRBC_R = crate::FieldReader; +pub type PRBC_R = crate::FieldReader; #[doc = "Prescaler Clear Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PRBC_A { + type Ux = u8; +} impl PRBC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PRBC_A::VALUE1), 1 => Some(PRBC_A::VALUE2), @@ -70,63 +41,67 @@ impl PRBC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "SW only"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRBC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC40 is cleared."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRBC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC41 is cleared."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PRBC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC42 is cleared."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PRBC_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC43 is cleared."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PRBC_A::VALUE5 } } #[doc = "Field `PRBC` writer - Prescaler Clear Configuration"] -pub type PRBC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GCTRL_SPEC, u8, PRBC_A, 3, O>; -impl<'a, const O: u8> PRBC_W<'a, O> { +pub type PRBC_W<'a, REG> = crate::FieldWriter<'a, REG, 3, PRBC_A>; +impl<'a, REG> PRBC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "SW only"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE1) } #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC40 is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE2) } #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC41 is cleared."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE3) } #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC42 is cleared."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE4) } #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC43 is cleared."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE5) } } #[doc = "Field `PCIS` reader - Prescaler Input Clock Selection"] -pub type PCIS_R = crate::FieldReader; +pub type PCIS_R = crate::FieldReader; #[doc = "Prescaler Input Clock Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -146,10 +121,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PCIS_A { + type Ux = u8; +} impl PCIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCIS_A { + pub const fn variant(&self) -> PCIS_A { match self.bits { 0 => PCIS_A::VALUE1, 1 => PCIS_A::VALUE2, @@ -158,53 +136,57 @@ impl PCIS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Module clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU4x.ECLKA"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCIS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU4x.ECLKB"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PCIS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU4x.ECLKC"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PCIS_A::VALUE4 } } #[doc = "Field `PCIS` writer - Prescaler Input Clock Selection"] -pub type PCIS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GCTRL_SPEC, u8, PCIS_A, 2, O>; -impl<'a, const O: u8> PCIS_W<'a, O> { +pub type PCIS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PCIS_A>; +impl<'a, REG> PCIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Module clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PCIS_A::VALUE1) } #[doc = "CCU4x.ECLKA"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PCIS_A::VALUE2) } #[doc = "CCU4x.ECLKB"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PCIS_A::VALUE3) } #[doc = "CCU4x.ECLKC"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PCIS_A::VALUE4) } } #[doc = "Field `SUSCFG` reader - Suspend Mode Configuration"] -pub type SUSCFG_R = crate::FieldReader; +pub type SUSCFG_R = crate::FieldReader; #[doc = "Suspend Mode Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -224,10 +206,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SUSCFG_A { + type Ux = u8; +} impl SUSCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SUSCFG_A { + pub const fn variant(&self) -> SUSCFG_A { match self.bits { 0 => SUSCFG_A::VALUE1, 1 => SUSCFG_A::VALUE2, @@ -236,48 +221,52 @@ impl SUSCFG_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Suspend request ignored. The module never enters in suspend"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUSCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Stops all the running slices immediately. Safe stop is not applied."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUSCFG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Stops the block immediately and clamps all the outputs to PASSIVE state. Safe stop is applied."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SUSCFG_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Waits for the roll over of each slice to stop and clamp the slices outputs. Safe stop is applied."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SUSCFG_A::VALUE4 } } #[doc = "Field `SUSCFG` writer - Suspend Mode Configuration"] -pub type SUSCFG_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GCTRL_SPEC, u8, SUSCFG_A, 2, O>; -impl<'a, const O: u8> SUSCFG_W<'a, O> { +pub type SUSCFG_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SUSCFG_A>; +impl<'a, REG> SUSCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Suspend request ignored. The module never enters in suspend"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE1) } #[doc = "Stops all the running slices immediately. Safe stop is not applied."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE2) } #[doc = "Stops the block immediately and clamps all the outputs to PASSIVE state. Safe stop is applied."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE3) } #[doc = "Waits for the roll over of each slice to stop and clamp the slices outputs. Safe stop is applied."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE4) } } @@ -300,34 +289,37 @@ impl From for bool { impl MSE0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSE0_A { + pub const fn variant(&self) -> MSE0_A { match self.bits { false => MSE0_A::VALUE1, true => MSE0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSE0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer can be requested via SW and via the CCU4x.MCSS input."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSE0_A::VALUE2 } } #[doc = "Field `MSE0` writer - Slice 0 Multi Channel shadow transfer enable"] -pub type MSE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCTRL_SPEC, MSE0_A, O>; -impl<'a, const O: u8> MSE0_W<'a, O> { +pub type MSE0_W<'a, REG> = crate::BitWriter<'a, REG, MSE0_A>; +impl<'a, REG> MSE0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSE0_A::VALUE1) } #[doc = "Shadow transfer can be requested via SW and via the CCU4x.MCSS input."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSE0_A::VALUE2) } } @@ -350,34 +342,37 @@ impl From for bool { impl MSE1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSE1_A { + pub const fn variant(&self) -> MSE1_A { match self.bits { false => MSE1_A::VALUE1, true => MSE1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSE1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer can be requested via SW and via the CCU4x.MCSS input."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSE1_A::VALUE2 } } #[doc = "Field `MSE1` writer - Slice 1 Multi Channel shadow transfer enable"] -pub type MSE1_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCTRL_SPEC, MSE1_A, O>; -impl<'a, const O: u8> MSE1_W<'a, O> { +pub type MSE1_W<'a, REG> = crate::BitWriter<'a, REG, MSE1_A>; +impl<'a, REG> MSE1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSE1_A::VALUE1) } #[doc = "Shadow transfer can be requested via SW and via the CCU4x.MCSS input."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSE1_A::VALUE2) } } @@ -400,34 +395,37 @@ impl From for bool { impl MSE2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSE2_A { + pub const fn variant(&self) -> MSE2_A { match self.bits { false => MSE2_A::VALUE1, true => MSE2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSE2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer can be requested via SW and via the CCU4x.MCSS input."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSE2_A::VALUE2 } } #[doc = "Field `MSE2` writer - Slice 2 Multi Channel shadow transfer enable"] -pub type MSE2_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCTRL_SPEC, MSE2_A, O>; -impl<'a, const O: u8> MSE2_W<'a, O> { +pub type MSE2_W<'a, REG> = crate::BitWriter<'a, REG, MSE2_A>; +impl<'a, REG> MSE2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSE2_A::VALUE1) } #[doc = "Shadow transfer can be requested via SW and via the CCU4x.MCSS input."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSE2_A::VALUE2) } } @@ -450,39 +448,42 @@ impl From for bool { impl MSE3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSE3_A { + pub const fn variant(&self) -> MSE3_A { match self.bits { false => MSE3_A::VALUE1, true => MSE3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSE3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer can be requested via SW and via the CCU4x.MCSS input."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSE3_A::VALUE2 } } #[doc = "Field `MSE3` writer - Slice 3 Multi Channel shadow transfer enable"] -pub type MSE3_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCTRL_SPEC, MSE3_A, O>; -impl<'a, const O: u8> MSE3_W<'a, O> { +pub type MSE3_W<'a, REG> = crate::BitWriter<'a, REG, MSE3_A>; +impl<'a, REG> MSE3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSE3_A::VALUE1) } #[doc = "Shadow transfer can be requested via SW and via the CCU4x.MCSS input."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSE3_A::VALUE2) } } #[doc = "Field `MSDE` reader - Multi Channel shadow transfer request configuration"] -pub type MSDE_R = crate::FieldReader; +pub type MSDE_R = crate::FieldReader; #[doc = "Multi Channel shadow transfer request configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -500,10 +501,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MSDE_A { + type Ux = u8; +} impl MSDE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(MSDE_A::VALUE1), 1 => Some(MSDE_A::VALUE2), @@ -511,38 +515,42 @@ impl MSDE_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Only the shadow transfer for period and compare values is requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSDE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer for the compare, period and prescaler compare values is requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSDE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Shadow transfer for the compare, period, prescaler and dither compare values is requested"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MSDE_A::VALUE4 } } #[doc = "Field `MSDE` writer - Multi Channel shadow transfer request configuration"] -pub type MSDE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GCTRL_SPEC, u8, MSDE_A, 2, O>; -impl<'a, const O: u8> MSDE_W<'a, O> { +pub type MSDE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, MSDE_A>; +impl<'a, REG> MSDE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Only the shadow transfer for period and compare values is requested"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSDE_A::VALUE1) } #[doc = "Shadow transfer for the compare, period and prescaler compare values is requested"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSDE_A::VALUE2) } #[doc = "Shadow transfer for the compare, period, prescaler and dither compare values is requested"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MSDE_A::VALUE4) } } @@ -592,70 +600,71 @@ impl W { #[doc = "Bits 0:2 - Prescaler Clear Configuration"] #[inline(always)] #[must_use] - pub fn prbc(&mut self) -> PRBC_W<0> { - PRBC_W::new(self) + pub fn prbc(&mut self) -> PRBC_W { + PRBC_W::new(self, 0) } #[doc = "Bits 4:5 - Prescaler Input Clock Selection"] #[inline(always)] #[must_use] - pub fn pcis(&mut self) -> PCIS_W<4> { - PCIS_W::new(self) + pub fn pcis(&mut self) -> PCIS_W { + PCIS_W::new(self, 4) } #[doc = "Bits 8:9 - Suspend Mode Configuration"] #[inline(always)] #[must_use] - pub fn suscfg(&mut self) -> SUSCFG_W<8> { - SUSCFG_W::new(self) + pub fn suscfg(&mut self) -> SUSCFG_W { + SUSCFG_W::new(self, 8) } #[doc = "Bit 10 - Slice 0 Multi Channel shadow transfer enable"] #[inline(always)] #[must_use] - pub fn mse0(&mut self) -> MSE0_W<10> { - MSE0_W::new(self) + pub fn mse0(&mut self) -> MSE0_W { + MSE0_W::new(self, 10) } #[doc = "Bit 11 - Slice 1 Multi Channel shadow transfer enable"] #[inline(always)] #[must_use] - pub fn mse1(&mut self) -> MSE1_W<11> { - MSE1_W::new(self) + pub fn mse1(&mut self) -> MSE1_W { + MSE1_W::new(self, 11) } #[doc = "Bit 12 - Slice 2 Multi Channel shadow transfer enable"] #[inline(always)] #[must_use] - pub fn mse2(&mut self) -> MSE2_W<12> { - MSE2_W::new(self) + pub fn mse2(&mut self) -> MSE2_W { + MSE2_W::new(self, 12) } #[doc = "Bit 13 - Slice 3 Multi Channel shadow transfer enable"] #[inline(always)] #[must_use] - pub fn mse3(&mut self) -> MSE3_W<13> { - MSE3_W::new(self) + pub fn mse3(&mut self) -> MSE3_W { + MSE3_W::new(self, 13) } #[doc = "Bits 14:15 - Multi Channel shadow transfer request configuration"] #[inline(always)] #[must_use] - pub fn msde(&mut self) -> MSDE_W<14> { - MSDE_W::new(self) + pub fn msde(&mut self) -> MSDE_W { + MSDE_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gctrl::R`](R) reader structure"] +impl crate::Readable for GCTRL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gctrl::W`](W) writer structure"] impl crate::Writable for GCTRL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40/gidlc.rs b/src/ccu40/gidlc.rs index 4c25f2ab..c1c5523f 100644 --- a/src/ccu40/gidlc.rs +++ b/src/ccu40/gidlc.rs @@ -1,80 +1,64 @@ #[doc = "Register `GIDLC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CS0I` writer - CC40 IDLE mode clear"] -pub type CS0I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type CS0I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CS1I` writer - CC41 IDLE mode clear"] -pub type CS1I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type CS1I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CS2I` writer - CC42 IDLE mode clear"] -pub type CS2I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type CS2I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CS3I` writer - CC43 IDLE mode clear"] -pub type CS3I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type CS3I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SPRB` writer - Prescaler Run Bit Set"] -pub type SPRB_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type SPRB_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - CC40 IDLE mode clear"] #[inline(always)] #[must_use] - pub fn cs0i(&mut self) -> CS0I_W<0> { - CS0I_W::new(self) + pub fn cs0i(&mut self) -> CS0I_W { + CS0I_W::new(self, 0) } #[doc = "Bit 1 - CC41 IDLE mode clear"] #[inline(always)] #[must_use] - pub fn cs1i(&mut self) -> CS1I_W<1> { - CS1I_W::new(self) + pub fn cs1i(&mut self) -> CS1I_W { + CS1I_W::new(self, 1) } #[doc = "Bit 2 - CC42 IDLE mode clear"] #[inline(always)] #[must_use] - pub fn cs2i(&mut self) -> CS2I_W<2> { - CS2I_W::new(self) + pub fn cs2i(&mut self) -> CS2I_W { + CS2I_W::new(self, 2) } #[doc = "Bit 3 - CC43 IDLE mode clear"] #[inline(always)] #[must_use] - pub fn cs3i(&mut self) -> CS3I_W<3> { - CS3I_W::new(self) + pub fn cs3i(&mut self) -> CS3I_W { + CS3I_W::new(self, 3) } #[doc = "Bit 8 - Prescaler Run Bit Set"] #[inline(always)] #[must_use] - pub fn sprb(&mut self) -> SPRB_W<8> { - SPRB_W::new(self) + pub fn sprb(&mut self) -> SPRB_W { + SPRB_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Idle Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gidlc::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GIDLC_SPEC; impl crate::RegisterSpec for GIDLC_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [gidlc::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`gidlc::W`](W) writer structure"] impl crate::Writable for GIDLC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40/gidls.rs b/src/ccu40/gidls.rs index 41b3074b..1ae68552 100644 --- a/src/ccu40/gidls.rs +++ b/src/ccu40/gidls.rs @@ -1,88 +1,72 @@ #[doc = "Register `GIDLS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SS0I` writer - CC40 IDLE mode set"] -pub type SS0I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type SS0I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SS1I` writer - CC41 IDLE mode set"] -pub type SS1I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type SS1I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SS2I` writer - CC42 IDLE mode set"] -pub type SS2I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type SS2I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SS3I` writer - CC43 IDLE mode set"] -pub type SS3I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type SS3I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CPRB` writer - Prescaler Run Bit Clear"] -pub type CPRB_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type CPRB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PSIC` writer - Prescaler clear"] -pub type PSIC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type PSIC_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - CC40 IDLE mode set"] #[inline(always)] #[must_use] - pub fn ss0i(&mut self) -> SS0I_W<0> { - SS0I_W::new(self) + pub fn ss0i(&mut self) -> SS0I_W { + SS0I_W::new(self, 0) } #[doc = "Bit 1 - CC41 IDLE mode set"] #[inline(always)] #[must_use] - pub fn ss1i(&mut self) -> SS1I_W<1> { - SS1I_W::new(self) + pub fn ss1i(&mut self) -> SS1I_W { + SS1I_W::new(self, 1) } #[doc = "Bit 2 - CC42 IDLE mode set"] #[inline(always)] #[must_use] - pub fn ss2i(&mut self) -> SS2I_W<2> { - SS2I_W::new(self) + pub fn ss2i(&mut self) -> SS2I_W { + SS2I_W::new(self, 2) } #[doc = "Bit 3 - CC43 IDLE mode set"] #[inline(always)] #[must_use] - pub fn ss3i(&mut self) -> SS3I_W<3> { - SS3I_W::new(self) + pub fn ss3i(&mut self) -> SS3I_W { + SS3I_W::new(self, 3) } #[doc = "Bit 8 - Prescaler Run Bit Clear"] #[inline(always)] #[must_use] - pub fn cprb(&mut self) -> CPRB_W<8> { - CPRB_W::new(self) + pub fn cprb(&mut self) -> CPRB_W { + CPRB_W::new(self, 8) } #[doc = "Bit 9 - Prescaler clear"] #[inline(always)] #[must_use] - pub fn psic(&mut self) -> PSIC_W<9> { - PSIC_W::new(self) + pub fn psic(&mut self) -> PSIC_W { + PSIC_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Idle Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gidls::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GIDLS_SPEC; impl crate::RegisterSpec for GIDLS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [gidls::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`gidls::W`](W) writer structure"] impl crate::Writable for GIDLS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40/gstat.rs b/src/ccu40/gstat.rs index a12a495e..03f6553e 100644 --- a/src/ccu40/gstat.rs +++ b/src/ccu40/gstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `S0I` reader - CC40 IDLE status"] pub type S0I_R = crate::BitReader; #[doc = "CC40 IDLE status\n\nValue on reset: 1"] @@ -32,18 +19,18 @@ impl From for bool { impl S0I_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0I_A { + pub const fn variant(&self) -> S0I_A { match self.bits { false => S0I_A::VALUE1, true => S0I_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Running"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0I_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Idle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0I_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl S1I_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1I_A { + pub const fn variant(&self) -> S1I_A { match self.bits { false => S1I_A::VALUE1, true => S1I_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Running"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1I_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Idle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1I_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl S2I_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2I_A { + pub const fn variant(&self) -> S2I_A { match self.bits { false => S2I_A::VALUE1, true => S2I_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Running"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2I_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Idle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2I_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl S3I_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3I_A { + pub const fn variant(&self) -> S3I_A { match self.bits { false => S3I_A::VALUE1, true => S3I_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Running"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3I_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Idle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3I_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl PRB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRB_A { + pub const fn variant(&self) -> PRB_A { match self.bits { false => PRB_A::VALUE1, true => PRB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler is stopped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRB_A::VALUE2 @@ -220,15 +207,13 @@ impl R { PRB_R::new(((self.bits >> 8) & 1) != 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"] +#[doc = "Global Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`gstat::R`](R) reader structure"] +impl crate::Readable for GSTAT_SPEC {} #[doc = "`reset()` method sets GSTAT to value 0x0f"] impl crate::Resettable for GSTAT_SPEC { const RESET_VALUE: Self::Ux = 0x0f; diff --git a/src/ccu40/midr.rs b/src/ccu40/midr.rs index 68803870..0a8af589 100644 --- a/src/ccu40/midr.rs +++ b/src/ccu40/midr.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MODR` reader - Module Revision"] -pub type MODR_R = crate::FieldReader; +pub type MODR_R = crate::FieldReader; #[doc = "Field `MODT` reader - Module Type"] -pub type MODT_R = crate::FieldReader; +pub type MODT_R = crate::FieldReader; #[doc = "Field `MODN` reader - Module Number"] -pub type MODN_R = crate::FieldReader; +pub type MODN_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`midr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`midr::R`](R) reader structure"] +impl crate::Readable for MIDR_SPEC {} #[doc = "`reset()` method sets MIDR to value 0x00a6_c000"] impl crate::Resettable for MIDR_SPEC { const RESET_VALUE: Self::Ux = 0x00a6_c000; diff --git a/src/ccu40_cc40.rs b/src/ccu40_cc40.rs index cee97800..25a3bbe4 100644 --- a/src/ccu40_cc40.rs +++ b/src/ccu40_cc40.rs @@ -1,162 +1,294 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + ins: INS, + cmc: CMC, + tcst: TCST, + tcset: TCSET, + tcclr: TCCLR, + tc: TC, + psl: PSL, + dit: DIT, + dits: DITS, + psc: PSC, + fpc: FPC, + fpcs: FPCS, + pr: PR, + prs: PRS, + cr: CR, + crs: CRS, + _reserved16: [u8; 0x30], + timer: TIMER, + c0v: C0V, + c1v: C1V, + c2v: C2V, + c3v: C3V, + _reserved21: [u8; 0x1c], + ints: INTS, + inte: INTE, + srs: SRS, + sws: SWS, + swr: SWR, +} +impl RegisterBlock { #[doc = "0x00 - Input Selector Configuration"] - pub ins: INS, + #[inline(always)] + pub const fn ins(&self) -> &INS { + &self.ins + } #[doc = "0x04 - Connection Matrix Control"] - pub cmc: CMC, + #[inline(always)] + pub const fn cmc(&self) -> &CMC { + &self.cmc + } #[doc = "0x08 - Slice Timer Status"] - pub tcst: TCST, + #[inline(always)] + pub const fn tcst(&self) -> &TCST { + &self.tcst + } #[doc = "0x0c - Slice Timer Run Set"] - pub tcset: TCSET, + #[inline(always)] + pub const fn tcset(&self) -> &TCSET { + &self.tcset + } #[doc = "0x10 - Slice Timer Clear"] - pub tcclr: TCCLR, + #[inline(always)] + pub const fn tcclr(&self) -> &TCCLR { + &self.tcclr + } #[doc = "0x14 - Slice Timer Control"] - pub tc: TC, + #[inline(always)] + pub const fn tc(&self) -> &TC { + &self.tc + } #[doc = "0x18 - Passive Level Config"] - pub psl: PSL, + #[inline(always)] + pub const fn psl(&self) -> &PSL { + &self.psl + } #[doc = "0x1c - Dither Config"] - pub dit: DIT, + #[inline(always)] + pub const fn dit(&self) -> &DIT { + &self.dit + } #[doc = "0x20 - Dither Shadow Register"] - pub dits: DITS, + #[inline(always)] + pub const fn dits(&self) -> &DITS { + &self.dits + } #[doc = "0x24 - Prescaler Control"] - pub psc: PSC, + #[inline(always)] + pub const fn psc(&self) -> &PSC { + &self.psc + } #[doc = "0x28 - Floating Prescaler Control"] - pub fpc: FPC, + #[inline(always)] + pub const fn fpc(&self) -> &FPC { + &self.fpc + } #[doc = "0x2c - Floating Prescaler Shadow"] - pub fpcs: FPCS, + #[inline(always)] + pub const fn fpcs(&self) -> &FPCS { + &self.fpcs + } #[doc = "0x30 - Timer Period Value"] - pub pr: PR, + #[inline(always)] + pub const fn pr(&self) -> &PR { + &self.pr + } #[doc = "0x34 - Timer Shadow Period Value"] - pub prs: PRS, + #[inline(always)] + pub const fn prs(&self) -> &PRS { + &self.prs + } #[doc = "0x38 - Timer Compare Value"] - pub cr: CR, + #[inline(always)] + pub const fn cr(&self) -> &CR { + &self.cr + } #[doc = "0x3c - Timer Shadow Compare Value"] - pub crs: CRS, - _reserved16: [u8; 0x30], + #[inline(always)] + pub const fn crs(&self) -> &CRS { + &self.crs + } #[doc = "0x70 - Timer Value"] - pub timer: TIMER, + #[inline(always)] + pub const fn timer(&self) -> &TIMER { + &self.timer + } #[doc = "0x74 - Capture Register 0"] - pub c0v: C0V, + #[inline(always)] + pub const fn c0v(&self) -> &C0V { + &self.c0v + } #[doc = "0x78 - Capture Register 1"] - pub c1v: C1V, + #[inline(always)] + pub const fn c1v(&self) -> &C1V { + &self.c1v + } #[doc = "0x7c - Capture Register 2"] - pub c2v: C2V, + #[inline(always)] + pub const fn c2v(&self) -> &C2V { + &self.c2v + } #[doc = "0x80 - Capture Register 3"] - pub c3v: C3V, - _reserved21: [u8; 0x1c], + #[inline(always)] + pub const fn c3v(&self) -> &C3V { + &self.c3v + } #[doc = "0xa0 - Interrupt Status"] - pub ints: INTS, + #[inline(always)] + pub const fn ints(&self) -> &INTS { + &self.ints + } #[doc = "0xa4 - Interrupt Enable Control"] - pub inte: INTE, + #[inline(always)] + pub const fn inte(&self) -> &INTE { + &self.inte + } #[doc = "0xa8 - Service Request Selector"] - pub srs: SRS, + #[inline(always)] + pub const fn srs(&self) -> &SRS { + &self.srs + } #[doc = "0xac - Interrupt Status Set"] - pub sws: SWS, + #[inline(always)] + pub const fn sws(&self) -> &SWS { + &self.sws + } #[doc = "0xb0 - Interrupt Status Clear"] - pub swr: SWR, + #[inline(always)] + pub const fn swr(&self) -> &SWR { + &self.swr + } } -#[doc = "INS (rw) register accessor: an alias for `Reg`"] +#[doc = "INS (rw) register accessor: Input Selector Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ins::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ins::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ins`] +module"] pub type INS = crate::Reg; #[doc = "Input Selector Configuration"] pub mod ins; -#[doc = "CMC (rw) register accessor: an alias for `Reg`"] +#[doc = "CMC (rw) register accessor: Connection Matrix Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cmc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cmc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cmc`] +module"] pub type CMC = crate::Reg; #[doc = "Connection Matrix Control"] pub mod cmc; -#[doc = "TCST (r) register accessor: an alias for `Reg`"] +#[doc = "TCST (r) register accessor: Slice Timer Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tcst::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tcst`] +module"] pub type TCST = crate::Reg; #[doc = "Slice Timer Status"] pub mod tcst; -#[doc = "TCSET (w) register accessor: an alias for `Reg`"] +#[doc = "TCSET (w) register accessor: Slice Timer Run Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tcset`] +module"] pub type TCSET = crate::Reg; #[doc = "Slice Timer Run Set"] pub mod tcset; -#[doc = "TCCLR (w) register accessor: an alias for `Reg`"] +#[doc = "TCCLR (w) register accessor: Slice Timer Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tcclr`] +module"] pub type TCCLR = crate::Reg; #[doc = "Slice Timer Clear"] pub mod tcclr; -#[doc = "TC (rw) register accessor: an alias for `Reg`"] +#[doc = "TC (rw) register accessor: Slice Timer Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tc`] +module"] pub type TC = crate::Reg; #[doc = "Slice Timer Control"] pub mod tc; -#[doc = "PSL (rw) register accessor: an alias for `Reg`"] +#[doc = "PSL (rw) register accessor: Passive Level Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psl`] +module"] pub type PSL = crate::Reg; #[doc = "Passive Level Config"] pub mod psl; -#[doc = "DIT (r) register accessor: an alias for `Reg`"] +#[doc = "DIT (r) register accessor: Dither Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dit::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dit`] +module"] pub type DIT = crate::Reg; #[doc = "Dither Config"] pub mod dit; -#[doc = "DITS (rw) register accessor: an alias for `Reg`"] +#[doc = "DITS (rw) register accessor: Dither Shadow Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dits::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dits::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dits`] +module"] pub type DITS = crate::Reg; #[doc = "Dither Shadow Register"] pub mod dits; -#[doc = "PSC (rw) register accessor: an alias for `Reg`"] +#[doc = "PSC (rw) register accessor: Prescaler Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psc`] +module"] pub type PSC = crate::Reg; #[doc = "Prescaler Control"] pub mod psc; -#[doc = "FPC (rw) register accessor: an alias for `Reg`"] +#[doc = "FPC (rw) register accessor: Floating Prescaler Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fpc`] +module"] pub type FPC = crate::Reg; #[doc = "Floating Prescaler Control"] pub mod fpc; -#[doc = "FPCS (rw) register accessor: an alias for `Reg`"] +#[doc = "FPCS (rw) register accessor: Floating Prescaler Shadow\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpcs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpcs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fpcs`] +module"] pub type FPCS = crate::Reg; #[doc = "Floating Prescaler Shadow"] pub mod fpcs; -#[doc = "PR (r) register accessor: an alias for `Reg`"] +#[doc = "PR (r) register accessor: Timer Period Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pr`] +module"] pub type PR = crate::Reg; #[doc = "Timer Period Value"] pub mod pr; -#[doc = "PRS (rw) register accessor: an alias for `Reg`"] +#[doc = "PRS (rw) register accessor: Timer Shadow Period Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prs`] +module"] pub type PRS = crate::Reg; #[doc = "Timer Shadow Period Value"] pub mod prs; -#[doc = "CR (r) register accessor: an alias for `Reg`"] +#[doc = "CR (r) register accessor: Timer Compare Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr`] +module"] pub type CR = crate::Reg; #[doc = "Timer Compare Value"] pub mod cr; -#[doc = "CRS (rw) register accessor: an alias for `Reg`"] +#[doc = "CRS (rw) register accessor: Timer Shadow Compare Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`crs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`crs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@crs`] +module"] pub type CRS = crate::Reg; #[doc = "Timer Shadow Compare Value"] pub mod crs; -#[doc = "TIMER (rw) register accessor: an alias for `Reg`"] +#[doc = "TIMER (rw) register accessor: Timer Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timer::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`timer::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@timer`] +module"] pub type TIMER = crate::Reg; #[doc = "Timer Value"] pub mod timer; -#[doc = "C0V (r) register accessor: an alias for `Reg`"] +#[doc = "C0V (r) register accessor: Capture Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c0v::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@c0v`] +module"] pub type C0V = crate::Reg; #[doc = "Capture Register 0"] pub mod c0v; -#[doc = "C1V (r) register accessor: an alias for `Reg`"] +#[doc = "C1V (r) register accessor: Capture Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c1v::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@c1v`] +module"] pub type C1V = crate::Reg; #[doc = "Capture Register 1"] pub mod c1v; -#[doc = "C2V (r) register accessor: an alias for `Reg`"] +#[doc = "C2V (r) register accessor: Capture Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c2v::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@c2v`] +module"] pub type C2V = crate::Reg; #[doc = "Capture Register 2"] pub mod c2v; -#[doc = "C3V (r) register accessor: an alias for `Reg`"] +#[doc = "C3V (r) register accessor: Capture Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c3v::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@c3v`] +module"] pub type C3V = crate::Reg; #[doc = "Capture Register 3"] pub mod c3v; -#[doc = "INTS (r) register accessor: an alias for `Reg`"] +#[doc = "INTS (r) register accessor: Interrupt Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ints::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ints`] +module"] pub type INTS = crate::Reg; #[doc = "Interrupt Status"] pub mod ints; -#[doc = "INTE (rw) register accessor: an alias for `Reg`"] +#[doc = "INTE (rw) register accessor: Interrupt Enable Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`inte::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`inte::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@inte`] +module"] pub type INTE = crate::Reg; #[doc = "Interrupt Enable Control"] pub mod inte; -#[doc = "SRS (rw) register accessor: an alias for `Reg`"] +#[doc = "SRS (rw) register accessor: Service Request Selector\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srs`] +module"] pub type SRS = crate::Reg; #[doc = "Service Request Selector"] pub mod srs; -#[doc = "SWS (w) register accessor: an alias for `Reg`"] +#[doc = "SWS (w) register accessor: Interrupt Status Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sws::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sws`] +module"] pub type SWS = crate::Reg; #[doc = "Interrupt Status Set"] pub mod sws; -#[doc = "SWR (w) register accessor: an alias for `Reg`"] +#[doc = "SWR (w) register accessor: Interrupt Status Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`swr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@swr`] +module"] 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 7c499e16..036d5409 100644 --- a/src/ccu40_cc40/c0v.rs +++ b/src/ccu40_cc40/c0v.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPTV` reader - Capture Value"] -pub type CAPTV_R = crate::FieldReader; +pub type CAPTV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `FFL` reader - Full Flag"] pub type FFL_R = crate::BitReader; #[doc = "Full Flag\n\nValue on reset: 0"] @@ -36,18 +23,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into the specific capture register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value was captured into the specific register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -70,15 +57,13 @@ impl R { FFL_R::new(((self.bits >> 20) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Capture Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c0v::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`c0v::R`](R) reader structure"] +impl crate::Readable for C0V_SPEC {} #[doc = "`reset()` method sets C0V to value 0"] impl crate::Resettable for C0V_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/c1v.rs b/src/ccu40_cc40/c1v.rs index 18de5afb..913cd147 100644 --- a/src/ccu40_cc40/c1v.rs +++ b/src/ccu40_cc40/c1v.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPTV` reader - Capture Value"] -pub type CAPTV_R = crate::FieldReader; +pub type CAPTV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `FFL` reader - Full Flag"] pub type FFL_R = crate::BitReader; #[doc = "Full Flag\n\nValue on reset: 0"] @@ -36,18 +23,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into the specific capture register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value was captured into the specific register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -70,15 +57,13 @@ impl R { FFL_R::new(((self.bits >> 20) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Capture Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c1v::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`c1v::R`](R) reader structure"] +impl crate::Readable for C1V_SPEC {} #[doc = "`reset()` method sets C1V to value 0"] impl crate::Resettable for C1V_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/c2v.rs b/src/ccu40_cc40/c2v.rs index 3a66ac3d..4bd8e5f5 100644 --- a/src/ccu40_cc40/c2v.rs +++ b/src/ccu40_cc40/c2v.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPTV` reader - Capture Value"] -pub type CAPTV_R = crate::FieldReader; +pub type CAPTV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `FFL` reader - Full Flag"] pub type FFL_R = crate::BitReader; #[doc = "Full Flag\n\nValue on reset: 0"] @@ -36,18 +23,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into the specific capture register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value was captured into the specific register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -70,15 +57,13 @@ impl R { FFL_R::new(((self.bits >> 20) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Capture Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c2v::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`c2v::R`](R) reader structure"] +impl crate::Readable for C2V_SPEC {} #[doc = "`reset()` method sets C2V to value 0"] impl crate::Resettable for C2V_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/c3v.rs b/src/ccu40_cc40/c3v.rs index f5ecdfc8..b30c41b3 100644 --- a/src/ccu40_cc40/c3v.rs +++ b/src/ccu40_cc40/c3v.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPTV` reader - Capture Value"] -pub type CAPTV_R = crate::FieldReader; +pub type CAPTV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `FFL` reader - Full Flag"] pub type FFL_R = crate::BitReader; #[doc = "Full Flag\n\nValue on reset: 0"] @@ -36,18 +23,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into the specific capture register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value was captured into the specific register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -70,15 +57,13 @@ impl R { FFL_R::new(((self.bits >> 20) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Capture Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c3v::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`c3v::R`](R) reader structure"] +impl crate::Readable for C3V_SPEC {} #[doc = "`reset()` method sets C3V to value 0"] impl crate::Resettable for C3V_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/cmc.rs b/src/ccu40_cc40/cmc.rs index 29261abf..36d4acae 100644 --- a/src/ccu40_cc40/cmc.rs +++ b/src/ccu40_cc40/cmc.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `STRTS` reader - External Start Functionality Selector"] -pub type STRTS_R = crate::FieldReader; +pub type STRTS_R = crate::FieldReader; #[doc = "External Start Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STRTS_A { + type Ux = u8; +} impl STRTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STRTS_A { + pub const fn variant(&self) -> STRTS_A { match self.bits { 0 => STRTS_A::VALUE1, 1 => STRTS_A::VALUE2, @@ -67,53 +38,57 @@ impl STRTS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Start Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STRTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Start Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STRTS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Start Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STRTS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Start Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STRTS_A::VALUE4 } } #[doc = "Field `STRTS` writer - External Start Functionality Selector"] -pub type STRTS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, STRTS_A, 2, O>; -impl<'a, const O: u8> STRTS_W<'a, O> { +pub type STRTS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, STRTS_A>; +impl<'a, REG> STRTS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Start Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STRTS_A::VALUE1) } #[doc = "External Start Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STRTS_A::VALUE2) } #[doc = "External Start Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STRTS_A::VALUE3) } #[doc = "External Start Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STRTS_A::VALUE4) } } #[doc = "Field `ENDS` reader - External Stop Functionality Selector"] -pub type ENDS_R = crate::FieldReader; +pub type ENDS_R = crate::FieldReader; #[doc = "External Stop Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ENDS_A { + type Ux = u8; +} impl ENDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENDS_A { + pub const fn variant(&self) -> ENDS_A { match self.bits { 0 => ENDS_A::VALUE1, 1 => ENDS_A::VALUE2, @@ -145,53 +123,57 @@ impl ENDS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Stop Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Stop Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENDS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Stop Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ENDS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Stop Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ENDS_A::VALUE4 } } #[doc = "Field `ENDS` writer - External Stop Functionality Selector"] -pub type ENDS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, ENDS_A, 2, O>; -impl<'a, const O: u8> ENDS_W<'a, O> { +pub type ENDS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ENDS_A>; +impl<'a, REG> ENDS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Stop Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENDS_A::VALUE1) } #[doc = "External Stop Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENDS_A::VALUE2) } #[doc = "External Stop Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ENDS_A::VALUE3) } #[doc = "External Stop Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ENDS_A::VALUE4) } } #[doc = "Field `CAP0S` reader - External Capture 0 Functionality Selector"] -pub type CAP0S_R = crate::FieldReader; +pub type CAP0S_R = crate::FieldReader; #[doc = "External Capture 0 Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CAP0S_A { + type Ux = u8; +} impl CAP0S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CAP0S_A { + pub const fn variant(&self) -> CAP0S_A { match self.bits { 0 => CAP0S_A::VALUE1, 1 => CAP0S_A::VALUE2, @@ -223,53 +208,57 @@ impl CAP0S_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Capture 0 Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CAP0S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Capture 0 Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CAP0S_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Capture 0 Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CAP0S_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Capture 0 Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CAP0S_A::VALUE4 } } #[doc = "Field `CAP0S` writer - External Capture 0 Functionality Selector"] -pub type CAP0S_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, CAP0S_A, 2, O>; -impl<'a, const O: u8> CAP0S_W<'a, O> { +pub type CAP0S_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CAP0S_A>; +impl<'a, REG> CAP0S_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Capture 0 Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CAP0S_A::VALUE1) } #[doc = "External Capture 0 Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CAP0S_A::VALUE2) } #[doc = "External Capture 0 Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CAP0S_A::VALUE3) } #[doc = "External Capture 0 Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CAP0S_A::VALUE4) } } #[doc = "Field `CAP1S` reader - External Capture 1 Functionality Selector"] -pub type CAP1S_R = crate::FieldReader; +pub type CAP1S_R = crate::FieldReader; #[doc = "External Capture 1 Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CAP1S_A { + type Ux = u8; +} impl CAP1S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CAP1S_A { + pub const fn variant(&self) -> CAP1S_A { match self.bits { 0 => CAP1S_A::VALUE1, 1 => CAP1S_A::VALUE2, @@ -301,53 +293,57 @@ impl CAP1S_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Capture 1 Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CAP1S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Capture 1 Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CAP1S_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Capture 1 Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CAP1S_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Capture 1 Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CAP1S_A::VALUE4 } } #[doc = "Field `CAP1S` writer - External Capture 1 Functionality Selector"] -pub type CAP1S_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, CAP1S_A, 2, O>; -impl<'a, const O: u8> CAP1S_W<'a, O> { +pub type CAP1S_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CAP1S_A>; +impl<'a, REG> CAP1S_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Capture 1 Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CAP1S_A::VALUE1) } #[doc = "External Capture 1 Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CAP1S_A::VALUE2) } #[doc = "External Capture 1 Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CAP1S_A::VALUE3) } #[doc = "External Capture 1 Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CAP1S_A::VALUE4) } } #[doc = "Field `GATES` reader - External Gate Functionality Selector"] -pub type GATES_R = crate::FieldReader; +pub type GATES_R = crate::FieldReader; #[doc = "External Gate Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for GATES_A { + type Ux = u8; +} impl GATES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GATES_A { + pub const fn variant(&self) -> GATES_A { match self.bits { 0 => GATES_A::VALUE1, 1 => GATES_A::VALUE2, @@ -379,53 +378,57 @@ impl GATES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Gating Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GATES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Gating Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GATES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Gating Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == GATES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Gating Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == GATES_A::VALUE4 } } #[doc = "Field `GATES` writer - External Gate Functionality Selector"] -pub type GATES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, GATES_A, 2, O>; -impl<'a, const O: u8> GATES_W<'a, O> { +pub type GATES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, GATES_A>; +impl<'a, REG> GATES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Gating Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GATES_A::VALUE1) } #[doc = "External Gating Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GATES_A::VALUE2) } #[doc = "External Gating Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(GATES_A::VALUE3) } #[doc = "External Gating Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(GATES_A::VALUE4) } } #[doc = "Field `UDS` reader - External Up/Down Functionality Selector"] -pub type UDS_R = crate::FieldReader; +pub type UDS_R = crate::FieldReader; #[doc = "External Up/Down Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for UDS_A { + type Ux = u8; +} impl UDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UDS_A { + pub const fn variant(&self) -> UDS_A { match self.bits { 0 => UDS_A::VALUE1, 1 => UDS_A::VALUE2, @@ -457,57 +463,61 @@ impl UDS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Up/Down Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Up/Down Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UDS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Up/Down Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == UDS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Up/Down Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == UDS_A::VALUE4 } } #[doc = "Field `UDS` writer - External Up/Down Functionality Selector"] -pub type UDS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, UDS_A, 2, O>; -impl<'a, const O: u8> UDS_W<'a, O> { +pub type UDS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, UDS_A>; +impl<'a, REG> UDS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Up/Down Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UDS_A::VALUE1) } #[doc = "External Up/Down Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UDS_A::VALUE2) } #[doc = "External Up/Down Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(UDS_A::VALUE3) } #[doc = "External Up/Down Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(UDS_A::VALUE4) } } #[doc = "Field `LDS` reader - External Timer Load Functionality Selector"] -pub type LDS_R = crate::FieldReader; +pub type LDS_R = crate::FieldReader; #[doc = "Field `LDS` writer - External Timer Load Functionality Selector"] -pub type LDS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMC_SPEC, u8, u8, 2, O>; +pub type LDS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `CNTS` reader - External Count Selector"] -pub type CNTS_R = crate::FieldReader; +pub type CNTS_R = crate::FieldReader; #[doc = "External Count Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -527,10 +537,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CNTS_A { + type Ux = u8; +} impl CNTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CNTS_A { + pub const fn variant(&self) -> CNTS_A { match self.bits { 0 => CNTS_A::VALUE1, 1 => CNTS_A::VALUE2, @@ -539,48 +552,52 @@ impl CNTS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Count Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CNTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Count Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CNTS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Count Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CNTS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Count Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CNTS_A::VALUE4 } } #[doc = "Field `CNTS` writer - External Count Selector"] -pub type CNTS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, CNTS_A, 2, O>; -impl<'a, const O: u8> CNTS_W<'a, O> { +pub type CNTS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CNTS_A>; +impl<'a, REG> CNTS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Count Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CNTS_A::VALUE1) } #[doc = "External Count Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CNTS_A::VALUE2) } #[doc = "External Count Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CNTS_A::VALUE3) } #[doc = "External Count Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CNTS_A::VALUE4) } } @@ -603,34 +620,37 @@ impl From for bool { impl OFS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OFS_A { + pub const fn variant(&self) -> OFS_A { match self.bits { false => OFS_A::VALUE1, true => OFS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Override functionality disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OFS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Status bit trigger override connected to Event 1; Status bit value override connected to Event 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OFS_A::VALUE2 } } #[doc = "Field `OFS` writer - Override Function Selector"] -pub type OFS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMC_SPEC, OFS_A, O>; -impl<'a, const O: u8> OFS_W<'a, O> { +pub type OFS_W<'a, REG> = crate::BitWriter<'a, REG, OFS_A>; +impl<'a, REG> OFS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Override functionality disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OFS_A::VALUE1) } #[doc = "Status bit trigger override connected to Event 1; Status bit value override connected to Event 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OFS_A::VALUE2) } } @@ -653,41 +673,44 @@ impl From for bool { impl TS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TS_A { + pub const fn variant(&self) -> TS_A { match self.bits { false => TS_A::VALUE1, true => TS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap function disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TRAP function connected to Event 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TS_A::VALUE2 } } #[doc = "Field `TS` writer - Trap Function Selector"] -pub type TS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMC_SPEC, TS_A, O>; -impl<'a, const O: u8> TS_W<'a, O> { +pub type TS_W<'a, REG> = crate::BitWriter<'a, REG, TS_A>; +impl<'a, REG> TS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap function disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TS_A::VALUE1) } #[doc = "TRAP function connected to Event 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TS_A::VALUE2) } } #[doc = "Field `MOS` reader - External Modulation Functionality Selector"] -pub type MOS_R = crate::FieldReader; +pub type MOS_R = crate::FieldReader; #[doc = "Field `MOS` writer - External Modulation Functionality Selector"] -pub type MOS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMC_SPEC, u8, u8, 2, O>; +pub type MOS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `TCE` reader - Timer Concatenation Enable"] pub type TCE_R = crate::BitReader; #[doc = "Timer Concatenation Enable\n\nValue on reset: 0"] @@ -707,34 +730,37 @@ impl From for bool { impl TCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TCE_A { + pub const fn variant(&self) -> TCE_A { match self.bits { false => TCE_A::VALUE1, true => TCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer concatenation is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer concatenation is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TCE_A::VALUE2 } } #[doc = "Field `TCE` writer - Timer Concatenation Enable"] -pub type TCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMC_SPEC, TCE_A, O>; -impl<'a, const O: u8> TCE_W<'a, O> { +pub type TCE_W<'a, REG> = crate::BitWriter<'a, REG, TCE_A>; +impl<'a, REG> TCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Timer concatenation is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TCE_A::VALUE1) } #[doc = "Timer concatenation is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TCE_A::VALUE2) } } @@ -804,94 +830,95 @@ impl W { #[doc = "Bits 0:1 - External Start Functionality Selector"] #[inline(always)] #[must_use] - pub fn strts(&mut self) -> STRTS_W<0> { - STRTS_W::new(self) + pub fn strts(&mut self) -> STRTS_W { + STRTS_W::new(self, 0) } #[doc = "Bits 2:3 - External Stop Functionality Selector"] #[inline(always)] #[must_use] - pub fn ends(&mut self) -> ENDS_W<2> { - ENDS_W::new(self) + pub fn ends(&mut self) -> ENDS_W { + ENDS_W::new(self, 2) } #[doc = "Bits 4:5 - External Capture 0 Functionality Selector"] #[inline(always)] #[must_use] - pub fn cap0s(&mut self) -> CAP0S_W<4> { - CAP0S_W::new(self) + pub fn cap0s(&mut self) -> CAP0S_W { + CAP0S_W::new(self, 4) } #[doc = "Bits 6:7 - External Capture 1 Functionality Selector"] #[inline(always)] #[must_use] - pub fn cap1s(&mut self) -> CAP1S_W<6> { - CAP1S_W::new(self) + pub fn cap1s(&mut self) -> CAP1S_W { + CAP1S_W::new(self, 6) } #[doc = "Bits 8:9 - External Gate Functionality Selector"] #[inline(always)] #[must_use] - pub fn gates(&mut self) -> GATES_W<8> { - GATES_W::new(self) + pub fn gates(&mut self) -> GATES_W { + GATES_W::new(self, 8) } #[doc = "Bits 10:11 - External Up/Down Functionality Selector"] #[inline(always)] #[must_use] - pub fn uds(&mut self) -> UDS_W<10> { - UDS_W::new(self) + pub fn uds(&mut self) -> UDS_W { + UDS_W::new(self, 10) } #[doc = "Bits 12:13 - External Timer Load Functionality Selector"] #[inline(always)] #[must_use] - pub fn lds(&mut self) -> LDS_W<12> { - LDS_W::new(self) + pub fn lds(&mut self) -> LDS_W { + LDS_W::new(self, 12) } #[doc = "Bits 14:15 - External Count Selector"] #[inline(always)] #[must_use] - pub fn cnts(&mut self) -> CNTS_W<14> { - CNTS_W::new(self) + pub fn cnts(&mut self) -> CNTS_W { + CNTS_W::new(self, 14) } #[doc = "Bit 16 - Override Function Selector"] #[inline(always)] #[must_use] - pub fn ofs(&mut self) -> OFS_W<16> { - OFS_W::new(self) + pub fn ofs(&mut self) -> OFS_W { + OFS_W::new(self, 16) } #[doc = "Bit 17 - Trap Function Selector"] #[inline(always)] #[must_use] - pub fn ts(&mut self) -> TS_W<17> { - TS_W::new(self) + pub fn ts(&mut self) -> TS_W { + TS_W::new(self, 17) } #[doc = "Bits 18:19 - External Modulation Functionality Selector"] #[inline(always)] #[must_use] - pub fn mos(&mut self) -> MOS_W<18> { - MOS_W::new(self) + pub fn mos(&mut self) -> MOS_W { + MOS_W::new(self, 18) } #[doc = "Bit 20 - Timer Concatenation Enable"] #[inline(always)] #[must_use] - pub fn tce(&mut self) -> TCE_W<20> { - TCE_W::new(self) + pub fn tce(&mut self) -> TCE_W { + TCE_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Connection Matrix Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cmc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cmc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cmc::R`](R) reader structure"] +impl crate::Readable for CMC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cmc::W`](W) writer structure"] impl crate::Writable for CMC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/cr.rs b/src/ccu40_cc40/cr.rs index c26303c2..203ff092 100644 --- a/src/ccu40_cc40/cr.rs +++ b/src/ccu40_cc40/cr.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CR` reader - Compare Register"] -pub type CR_R = crate::FieldReader; +pub type CR_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Compare Register"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Timer Compare Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cr::R`](R) reader structure"] +impl crate::Readable for CR_SPEC {} #[doc = "`reset()` method sets CR to value 0"] impl crate::Resettable for CR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/crs.rs b/src/ccu40_cc40/crs.rs index 3263105f..086aab58 100644 --- a/src/ccu40_cc40/crs.rs +++ b/src/ccu40_cc40/crs.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CRS` reader - Compare Register"] -pub type CRS_R = crate::FieldReader; +pub type CRS_R = crate::FieldReader; #[doc = "Field `CRS` writer - Compare Register"] -pub type CRS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CRS_SPEC, u16, u16, 16, O>; +pub type CRS_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Compare Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Compare Register"] #[inline(always)] #[must_use] - pub fn crs(&mut self) -> CRS_W<0> { - CRS_W::new(self) + pub fn crs(&mut self) -> CRS_W { + CRS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Timer Shadow Compare Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`crs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`crs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`crs::R`](R) reader structure"] +impl crate::Readable for CRS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`crs::W`](W) writer structure"] impl crate::Writable for CRS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/dit.rs b/src/ccu40_cc40/dit.rs index 54188751..124d573b 100644 --- a/src/ccu40_cc40/dit.rs +++ b/src/ccu40_cc40/dit.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DCV` reader - Dither compare Value"] -pub type DCV_R = crate::FieldReader; +pub type DCV_R = crate::FieldReader; #[doc = "Field `DCNT` reader - Dither counter actual value"] -pub type DCNT_R = crate::FieldReader; +pub type DCNT_R = crate::FieldReader; impl R { #[doc = "Bits 0:3 - Dither compare Value"] #[inline(always)] @@ -29,15 +16,13 @@ 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"] +#[doc = "Dither Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dit::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dit::R`](R) reader structure"] +impl crate::Readable for DIT_SPEC {} #[doc = "`reset()` method sets DIT to value 0"] impl crate::Resettable for DIT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/dits.rs b/src/ccu40_cc40/dits.rs index 6140699b..3b095fd1 100644 --- a/src/ccu40_cc40/dits.rs +++ b/src/ccu40_cc40/dits.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DCVS` reader - Dither Shadow Compare Value"] -pub type DCVS_R = crate::FieldReader; +pub type DCVS_R = crate::FieldReader; #[doc = "Field `DCVS` writer - Dither Shadow Compare Value"] -pub type DCVS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DITS_SPEC, u8, u8, 4, O>; +pub type DCVS_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Dither Shadow Compare Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:3 - Dither Shadow Compare Value"] #[inline(always)] #[must_use] - pub fn dcvs(&mut self) -> DCVS_W<0> { - DCVS_W::new(self) + pub fn dcvs(&mut self) -> DCVS_W { + DCVS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Dither Shadow Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dits::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dits::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dits::R`](R) reader structure"] +impl crate::Readable for DITS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dits::W`](W) writer structure"] impl crate::Writable for DITS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/fpc.rs b/src/ccu40_cc40/fpc.rs index 473bdaef..c4e2abbf 100644 --- a/src/ccu40_cc40/fpc.rs +++ b/src/ccu40_cc40/fpc.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PCMP` reader - Floating Prescaler Compare Value"] -pub type PCMP_R = crate::FieldReader; +pub type PCMP_R = crate::FieldReader; #[doc = "Field `PVAL` reader - Actual Prescaler Value"] -pub type PVAL_R = crate::FieldReader; +pub type PVAL_R = crate::FieldReader; #[doc = "Field `PVAL` writer - Actual Prescaler Value"] -pub type PVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FPC_SPEC, u8, u8, 4, O>; +pub type PVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Floating Prescaler Compare Value"] #[inline(always)] @@ -56,28 +24,29 @@ impl W { #[doc = "Bits 8:11 - Actual Prescaler Value"] #[inline(always)] #[must_use] - pub fn pval(&mut self) -> PVAL_W<8> { - PVAL_W::new(self) + pub fn pval(&mut self) -> PVAL_W { + PVAL_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Floating Prescaler Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fpc::R`](R) reader structure"] +impl crate::Readable for FPC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fpc::W`](W) writer structure"] impl crate::Writable for FPC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/fpcs.rs b/src/ccu40_cc40/fpcs.rs index 9b0187ef..83b6b1d3 100644 --- a/src/ccu40_cc40/fpcs.rs +++ b/src/ccu40_cc40/fpcs.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PCMP` reader - Floating Prescaler Shadow Compare Value"] -pub type PCMP_R = crate::FieldReader; +pub type PCMP_R = crate::FieldReader; #[doc = "Field `PCMP` writer - Floating Prescaler Shadow Compare Value"] -pub type PCMP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FPCS_SPEC, u8, u8, 4, O>; +pub type PCMP_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Floating Prescaler Shadow Compare Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:3 - Floating Prescaler Shadow Compare Value"] #[inline(always)] #[must_use] - pub fn pcmp(&mut self) -> PCMP_W<0> { - PCMP_W::new(self) + pub fn pcmp(&mut self) -> PCMP_W { + PCMP_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Floating Prescaler Shadow\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpcs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpcs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fpcs::R`](R) reader structure"] +impl crate::Readable for FPCS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fpcs::W`](W) writer structure"] impl crate::Writable for FPCS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/ins.rs b/src/ccu40_cc40/ins.rs index fe31bc07..c1985295 100644 --- a/src/ccu40_cc40/ins.rs +++ b/src/ccu40_cc40/ins.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `EV0IS` reader - Event 0 signal selection"] -pub type EV0IS_R = crate::FieldReader; +pub type EV0IS_R = crate::FieldReader; #[doc = "Event 0 signal selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -79,10 +47,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV0IS_A { + type Ux = u8; +} impl EV0IS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV0IS_A { + pub const fn variant(&self) -> EV0IS_A { match self.bits { 0 => EV0IS_A::VALUE1, 1 => EV0IS_A::VALUE2, @@ -103,173 +74,177 @@ impl EV0IS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CCU4x.INyA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV0IS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU4x.INyB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV0IS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU4x.INyC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV0IS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU4x.INyD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV0IS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "CCU4x.INyE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == EV0IS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "CCU4x.INyF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == EV0IS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "CCU4x.INyG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == EV0IS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "CCU4x.INyH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == EV0IS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "CCU4x.INyI"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == EV0IS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "CCU4x.INyJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == EV0IS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "CCU4x.INyK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == EV0IS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "CCU4x.INyL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == EV0IS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "CCU4x.INyM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == EV0IS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "CCU4x.INyN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == EV0IS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "CCU4x.INyO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == EV0IS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "CCU4x.INyP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == EV0IS_A::VALUE16 } } #[doc = "Field `EV0IS` writer - Event 0 signal selection"] -pub type EV0IS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV0IS_A, 4, O>; -impl<'a, const O: u8> EV0IS_W<'a, O> { +pub type EV0IS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, EV0IS_A>; +impl<'a, REG> EV0IS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CCU4x.INyA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE1) } #[doc = "CCU4x.INyB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE2) } #[doc = "CCU4x.INyC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE3) } #[doc = "CCU4x.INyD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE4) } #[doc = "CCU4x.INyE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE5) } #[doc = "CCU4x.INyF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE6) } #[doc = "CCU4x.INyG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE7) } #[doc = "CCU4x.INyH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE8) } #[doc = "CCU4x.INyI"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE9) } #[doc = "CCU4x.INyJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE10) } #[doc = "CCU4x.INyK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE11) } #[doc = "CCU4x.INyL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE12) } #[doc = "CCU4x.INyM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE13) } #[doc = "CCU4x.INyN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE14) } #[doc = "CCU4x.INyO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE15) } #[doc = "CCU4x.INyP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE16) } } #[doc = "Field `EV1IS` reader - Event 1 signal selection"] -pub type EV1IS_R = crate::FieldReader; +pub type EV1IS_R = crate::FieldReader; #[doc = "Event 1 signal selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +288,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV1IS_A { + type Ux = u8; +} impl EV1IS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV1IS_A { + pub const fn variant(&self) -> EV1IS_A { match self.bits { 0 => EV1IS_A::VALUE1, 1 => EV1IS_A::VALUE2, @@ -337,173 +315,177 @@ impl EV1IS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CCU4x.INyA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV1IS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU4x.INyB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV1IS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU4x.INyC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV1IS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU4x.INyD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV1IS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "CCU4x.INyE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == EV1IS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "CCU4x.INyF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == EV1IS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "CCU4x.INyG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == EV1IS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "CCU4x.INyH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == EV1IS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "CCU4x.INyI"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == EV1IS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "CCU4x.INyJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == EV1IS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "CCU4x.INyK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == EV1IS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "CCU4x.INyL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == EV1IS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "CCU4x.INyM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == EV1IS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "CCU4x.INyN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == EV1IS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "CCU4x.INyO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == EV1IS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "CCU4x.INyP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == EV1IS_A::VALUE16 } } #[doc = "Field `EV1IS` writer - Event 1 signal selection"] -pub type EV1IS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV1IS_A, 4, O>; -impl<'a, const O: u8> EV1IS_W<'a, O> { +pub type EV1IS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, EV1IS_A>; +impl<'a, REG> EV1IS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CCU4x.INyA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE1) } #[doc = "CCU4x.INyB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE2) } #[doc = "CCU4x.INyC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE3) } #[doc = "CCU4x.INyD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE4) } #[doc = "CCU4x.INyE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE5) } #[doc = "CCU4x.INyF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE6) } #[doc = "CCU4x.INyG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE7) } #[doc = "CCU4x.INyH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE8) } #[doc = "CCU4x.INyI"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE9) } #[doc = "CCU4x.INyJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE10) } #[doc = "CCU4x.INyK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE11) } #[doc = "CCU4x.INyL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE12) } #[doc = "CCU4x.INyM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE13) } #[doc = "CCU4x.INyN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE14) } #[doc = "CCU4x.INyO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE15) } #[doc = "CCU4x.INyP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE16) } } #[doc = "Field `EV2IS` reader - Event 2 signal selection"] -pub type EV2IS_R = crate::FieldReader; +pub type EV2IS_R = crate::FieldReader; #[doc = "Event 2 signal selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -547,10 +529,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV2IS_A { + type Ux = u8; +} impl EV2IS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV2IS_A { + pub const fn variant(&self) -> EV2IS_A { match self.bits { 0 => EV2IS_A::VALUE1, 1 => EV2IS_A::VALUE2, @@ -571,173 +556,177 @@ impl EV2IS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CCU4x.INyA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV2IS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU4x.INyB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV2IS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU4x.INyC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV2IS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU4x.INyD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV2IS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "CCU4x.INyE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == EV2IS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "CCU4x.INyF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == EV2IS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "CCU4x.INyG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == EV2IS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "CCU4x.INyH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == EV2IS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "CCU4x.INyI"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == EV2IS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "CCU4x.INyJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == EV2IS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "CCU4x.INyK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == EV2IS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "CCU4x.INyL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == EV2IS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "CCU4x.INyM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == EV2IS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "CCU4x.INyN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == EV2IS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "CCU4x.INyO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == EV2IS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "CCU4x.INyP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == EV2IS_A::VALUE16 } } #[doc = "Field `EV2IS` writer - Event 2 signal selection"] -pub type EV2IS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV2IS_A, 4, O>; -impl<'a, const O: u8> EV2IS_W<'a, O> { +pub type EV2IS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, EV2IS_A>; +impl<'a, REG> EV2IS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CCU4x.INyA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE1) } #[doc = "CCU4x.INyB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE2) } #[doc = "CCU4x.INyC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE3) } #[doc = "CCU4x.INyD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE4) } #[doc = "CCU4x.INyE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE5) } #[doc = "CCU4x.INyF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE6) } #[doc = "CCU4x.INyG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE7) } #[doc = "CCU4x.INyH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE8) } #[doc = "CCU4x.INyI"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE9) } #[doc = "CCU4x.INyJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE10) } #[doc = "CCU4x.INyK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE11) } #[doc = "CCU4x.INyL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE12) } #[doc = "CCU4x.INyM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE13) } #[doc = "CCU4x.INyN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE14) } #[doc = "CCU4x.INyO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE15) } #[doc = "CCU4x.INyP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE16) } } #[doc = "Field `EV0EM` reader - Event 0 Edge Selection"] -pub type EV0EM_R = crate::FieldReader; +pub type EV0EM_R = crate::FieldReader; #[doc = "Event 0 Edge Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -757,10 +746,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV0EM_A { + type Ux = u8; +} impl EV0EM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV0EM_A { + pub const fn variant(&self) -> EV0EM_A { match self.bits { 0 => EV0EM_A::VALUE1, 1 => EV0EM_A::VALUE2, @@ -769,53 +761,57 @@ impl EV0EM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No action"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV0EM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV0EM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Signal active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV0EM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Signal active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV0EM_A::VALUE4 } } #[doc = "Field `EV0EM` writer - Event 0 Edge Selection"] -pub type EV0EM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV0EM_A, 2, O>; -impl<'a, const O: u8> EV0EM_W<'a, O> { +pub type EV0EM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EV0EM_A>; +impl<'a, REG> EV0EM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV0EM_A::VALUE1) } #[doc = "Signal active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV0EM_A::VALUE2) } #[doc = "Signal active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV0EM_A::VALUE3) } #[doc = "Signal active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV0EM_A::VALUE4) } } #[doc = "Field `EV1EM` reader - Event 1 Edge Selection"] -pub type EV1EM_R = crate::FieldReader; +pub type EV1EM_R = crate::FieldReader; #[doc = "Event 1 Edge Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -835,10 +831,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV1EM_A { + type Ux = u8; +} impl EV1EM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV1EM_A { + pub const fn variant(&self) -> EV1EM_A { match self.bits { 0 => EV1EM_A::VALUE1, 1 => EV1EM_A::VALUE2, @@ -847,53 +846,57 @@ impl EV1EM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No action"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV1EM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV1EM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Signal active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV1EM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Signal active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV1EM_A::VALUE4 } } #[doc = "Field `EV1EM` writer - Event 1 Edge Selection"] -pub type EV1EM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV1EM_A, 2, O>; -impl<'a, const O: u8> EV1EM_W<'a, O> { +pub type EV1EM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EV1EM_A>; +impl<'a, REG> EV1EM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV1EM_A::VALUE1) } #[doc = "Signal active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV1EM_A::VALUE2) } #[doc = "Signal active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV1EM_A::VALUE3) } #[doc = "Signal active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV1EM_A::VALUE4) } } #[doc = "Field `EV2EM` reader - Event 2 Edge Selection"] -pub type EV2EM_R = crate::FieldReader; +pub type EV2EM_R = crate::FieldReader; #[doc = "Event 2 Edge Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -913,10 +916,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV2EM_A { + type Ux = u8; +} impl EV2EM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV2EM_A { + pub const fn variant(&self) -> EV2EM_A { match self.bits { 0 => EV2EM_A::VALUE1, 1 => EV2EM_A::VALUE2, @@ -925,48 +931,52 @@ impl EV2EM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No action"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV2EM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV2EM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Signal active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV2EM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Signal active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV2EM_A::VALUE4 } } #[doc = "Field `EV2EM` writer - Event 2 Edge Selection"] -pub type EV2EM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV2EM_A, 2, O>; -impl<'a, const O: u8> EV2EM_W<'a, O> { +pub type EV2EM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EV2EM_A>; +impl<'a, REG> EV2EM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV2EM_A::VALUE1) } #[doc = "Signal active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV2EM_A::VALUE2) } #[doc = "Signal active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV2EM_A::VALUE3) } #[doc = "Signal active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV2EM_A::VALUE4) } } @@ -989,34 +999,37 @@ impl From for bool { impl EV0LM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV0LM_A { + pub const fn variant(&self) -> EV0LM_A { match self.bits { false => EV0LM_A::VALUE1, true => EV0LM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active on HIGH level"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV0LM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on LOW level"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV0LM_A::VALUE2 } } #[doc = "Field `EV0LM` writer - Event 0 Level Selection"] -pub type EV0LM_W<'a, const O: u8> = crate::BitWriter<'a, u32, INS_SPEC, EV0LM_A, O>; -impl<'a, const O: u8> EV0LM_W<'a, O> { +pub type EV0LM_W<'a, REG> = crate::BitWriter<'a, REG, EV0LM_A>; +impl<'a, REG> EV0LM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active on HIGH level"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV0LM_A::VALUE1) } #[doc = "Active on LOW level"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV0LM_A::VALUE2) } } @@ -1039,34 +1052,37 @@ impl From for bool { impl EV1LM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV1LM_A { + pub const fn variant(&self) -> EV1LM_A { match self.bits { false => EV1LM_A::VALUE1, true => EV1LM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active on HIGH level"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV1LM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on LOW level"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV1LM_A::VALUE2 } } #[doc = "Field `EV1LM` writer - Event 1 Level Selection"] -pub type EV1LM_W<'a, const O: u8> = crate::BitWriter<'a, u32, INS_SPEC, EV1LM_A, O>; -impl<'a, const O: u8> EV1LM_W<'a, O> { +pub type EV1LM_W<'a, REG> = crate::BitWriter<'a, REG, EV1LM_A>; +impl<'a, REG> EV1LM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active on HIGH level"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV1LM_A::VALUE1) } #[doc = "Active on LOW level"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV1LM_A::VALUE2) } } @@ -1089,39 +1105,42 @@ impl From for bool { impl EV2LM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV2LM_A { + pub const fn variant(&self) -> EV2LM_A { match self.bits { false => EV2LM_A::VALUE1, true => EV2LM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active on HIGH level"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV2LM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on LOW level"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV2LM_A::VALUE2 } } #[doc = "Field `EV2LM` writer - Event 2 Level Selection"] -pub type EV2LM_W<'a, const O: u8> = crate::BitWriter<'a, u32, INS_SPEC, EV2LM_A, O>; -impl<'a, const O: u8> EV2LM_W<'a, O> { +pub type EV2LM_W<'a, REG> = crate::BitWriter<'a, REG, EV2LM_A>; +impl<'a, REG> EV2LM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active on HIGH level"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV2LM_A::VALUE1) } #[doc = "Active on LOW level"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV2LM_A::VALUE2) } } #[doc = "Field `LPF0M` reader - Event 0 Low Pass Filter Configuration"] -pub type LPF0M_R = crate::FieldReader; +pub type LPF0M_R = crate::FieldReader; #[doc = "Event 0 Low Pass Filter Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1141,10 +1160,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LPF0M_A { + type Ux = u8; +} impl LPF0M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPF0M_A { + pub const fn variant(&self) -> LPF0M_A { match self.bits { 0 => LPF0M_A::VALUE1, 1 => LPF0M_A::VALUE2, @@ -1153,53 +1175,57 @@ impl LPF0M_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "LPF is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPF0M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "3 clock cycles of fCCU4"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPF0M_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "5 clock cycles of fCCU4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LPF0M_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "7 clock cycles of fCCU4"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == LPF0M_A::VALUE4 } } #[doc = "Field `LPF0M` writer - Event 0 Low Pass Filter Configuration"] -pub type LPF0M_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, LPF0M_A, 2, O>; -impl<'a, const O: u8> LPF0M_W<'a, O> { +pub type LPF0M_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, LPF0M_A>; +impl<'a, REG> LPF0M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "LPF is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPF0M_A::VALUE1) } #[doc = "3 clock cycles of fCCU4"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPF0M_A::VALUE2) } #[doc = "5 clock cycles of fCCU4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LPF0M_A::VALUE3) } #[doc = "7 clock cycles of fCCU4"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(LPF0M_A::VALUE4) } } #[doc = "Field `LPF1M` reader - Event 1 Low Pass Filter Configuration"] -pub type LPF1M_R = crate::FieldReader; +pub type LPF1M_R = crate::FieldReader; #[doc = "Event 1 Low Pass Filter Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1219,10 +1245,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LPF1M_A { + type Ux = u8; +} impl LPF1M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPF1M_A { + pub const fn variant(&self) -> LPF1M_A { match self.bits { 0 => LPF1M_A::VALUE1, 1 => LPF1M_A::VALUE2, @@ -1231,53 +1260,57 @@ impl LPF1M_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "LPF is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPF1M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "3 clock cycles of fCCU4"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPF1M_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "5 clock cycles of fCCU4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LPF1M_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "7 clock cycles of fCCU4"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == LPF1M_A::VALUE4 } } #[doc = "Field `LPF1M` writer - Event 1 Low Pass Filter Configuration"] -pub type LPF1M_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, LPF1M_A, 2, O>; -impl<'a, const O: u8> LPF1M_W<'a, O> { +pub type LPF1M_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, LPF1M_A>; +impl<'a, REG> LPF1M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "LPF is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPF1M_A::VALUE1) } #[doc = "3 clock cycles of fCCU4"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPF1M_A::VALUE2) } #[doc = "5 clock cycles of fCCU4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LPF1M_A::VALUE3) } #[doc = "7 clock cycles of fCCU4"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(LPF1M_A::VALUE4) } } #[doc = "Field `LPF2M` reader - Event 2 Low Pass Filter Configuration"] -pub type LPF2M_R = crate::FieldReader; +pub type LPF2M_R = crate::FieldReader; #[doc = "Event 2 Low Pass Filter Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1297,10 +1330,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LPF2M_A { + type Ux = u8; +} impl LPF2M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPF2M_A { + pub const fn variant(&self) -> LPF2M_A { match self.bits { 0 => LPF2M_A::VALUE1, 1 => LPF2M_A::VALUE2, @@ -1309,48 +1345,52 @@ impl LPF2M_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "LPF is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPF2M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "3 clock cycles of fCCU4"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPF2M_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "5 clock cycles of fCCU4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LPF2M_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "7 clock cycles of fCCU4"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == LPF2M_A::VALUE4 } } #[doc = "Field `LPF2M` writer - Event 2 Low Pass Filter Configuration"] -pub type LPF2M_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, LPF2M_A, 2, O>; -impl<'a, const O: u8> LPF2M_W<'a, O> { +pub type LPF2M_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, LPF2M_A>; +impl<'a, REG> LPF2M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "LPF is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPF2M_A::VALUE1) } #[doc = "3 clock cycles of fCCU4"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPF2M_A::VALUE2) } #[doc = "5 clock cycles of fCCU4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LPF2M_A::VALUE3) } #[doc = "7 clock cycles of fCCU4"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(LPF2M_A::VALUE4) } } @@ -1420,94 +1460,95 @@ impl W { #[doc = "Bits 0:3 - Event 0 signal selection"] #[inline(always)] #[must_use] - pub fn ev0is(&mut self) -> EV0IS_W<0> { - EV0IS_W::new(self) + pub fn ev0is(&mut self) -> EV0IS_W { + EV0IS_W::new(self, 0) } #[doc = "Bits 4:7 - Event 1 signal selection"] #[inline(always)] #[must_use] - pub fn ev1is(&mut self) -> EV1IS_W<4> { - EV1IS_W::new(self) + pub fn ev1is(&mut self) -> EV1IS_W { + EV1IS_W::new(self, 4) } #[doc = "Bits 8:11 - Event 2 signal selection"] #[inline(always)] #[must_use] - pub fn ev2is(&mut self) -> EV2IS_W<8> { - EV2IS_W::new(self) + pub fn ev2is(&mut self) -> EV2IS_W { + EV2IS_W::new(self, 8) } #[doc = "Bits 16:17 - Event 0 Edge Selection"] #[inline(always)] #[must_use] - pub fn ev0em(&mut self) -> EV0EM_W<16> { - EV0EM_W::new(self) + pub fn ev0em(&mut self) -> EV0EM_W { + EV0EM_W::new(self, 16) } #[doc = "Bits 18:19 - Event 1 Edge Selection"] #[inline(always)] #[must_use] - pub fn ev1em(&mut self) -> EV1EM_W<18> { - EV1EM_W::new(self) + pub fn ev1em(&mut self) -> EV1EM_W { + EV1EM_W::new(self, 18) } #[doc = "Bits 20:21 - Event 2 Edge Selection"] #[inline(always)] #[must_use] - pub fn ev2em(&mut self) -> EV2EM_W<20> { - EV2EM_W::new(self) + pub fn ev2em(&mut self) -> EV2EM_W { + EV2EM_W::new(self, 20) } #[doc = "Bit 22 - Event 0 Level Selection"] #[inline(always)] #[must_use] - pub fn ev0lm(&mut self) -> EV0LM_W<22> { - EV0LM_W::new(self) + pub fn ev0lm(&mut self) -> EV0LM_W { + EV0LM_W::new(self, 22) } #[doc = "Bit 23 - Event 1 Level Selection"] #[inline(always)] #[must_use] - pub fn ev1lm(&mut self) -> EV1LM_W<23> { - EV1LM_W::new(self) + pub fn ev1lm(&mut self) -> EV1LM_W { + EV1LM_W::new(self, 23) } #[doc = "Bit 24 - Event 2 Level Selection"] #[inline(always)] #[must_use] - pub fn ev2lm(&mut self) -> EV2LM_W<24> { - EV2LM_W::new(self) + pub fn ev2lm(&mut self) -> EV2LM_W { + EV2LM_W::new(self, 24) } #[doc = "Bits 25:26 - Event 0 Low Pass Filter Configuration"] #[inline(always)] #[must_use] - pub fn lpf0m(&mut self) -> LPF0M_W<25> { - LPF0M_W::new(self) + pub fn lpf0m(&mut self) -> LPF0M_W { + LPF0M_W::new(self, 25) } #[doc = "Bits 27:28 - Event 1 Low Pass Filter Configuration"] #[inline(always)] #[must_use] - pub fn lpf1m(&mut self) -> LPF1M_W<27> { - LPF1M_W::new(self) + pub fn lpf1m(&mut self) -> LPF1M_W { + LPF1M_W::new(self, 27) } #[doc = "Bits 29:30 - Event 2 Low Pass Filter Configuration"] #[inline(always)] #[must_use] - pub fn lpf2m(&mut self) -> LPF2M_W<29> { - LPF2M_W::new(self) + pub fn lpf2m(&mut self) -> LPF2M_W { + LPF2M_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Selector Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ins::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ins::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ins::R`](R) reader structure"] +impl crate::Readable for INS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ins::W`](W) writer structure"] impl crate::Writable for INS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/inte.rs b/src/ccu40_cc40/inte.rs index 6536296d..f4f16cdf 100644 --- a/src/ccu40_cc40/inte.rs +++ b/src/ccu40_cc40/inte.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PME` reader - Period match while counting up enable"] pub type PME_R = crate::BitReader; #[doc = "Period match while counting up enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PME_A { + pub const fn variant(&self) -> PME_A { match self.bits { false => PME_A::VALUE1, true => PME_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Period Match interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Period Match interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PME_A::VALUE2 } } #[doc = "Field `PME` writer - Period match while counting up enable"] -pub type PME_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, PME_A, O>; -impl<'a, const O: u8> PME_W<'a, O> { +pub type PME_W<'a, REG> = crate::BitWriter<'a, REG, PME_A>; +impl<'a, REG> PME_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Period Match interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PME_A::VALUE1) } #[doc = "Period Match interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PME_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl OME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OME_A { + pub const fn variant(&self) -> OME_A { match self.bits { false => OME_A::VALUE1, true => OME_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "One Match interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "One Match interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OME_A::VALUE2 } } #[doc = "Field `OME` writer - One match while counting down enable"] -pub type OME_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, OME_A, O>; -impl<'a, const O: u8> OME_W<'a, O> { +pub type OME_W<'a, REG> = crate::BitWriter<'a, REG, OME_A>; +impl<'a, REG> OME_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "One Match interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OME_A::VALUE1) } #[doc = "One Match interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OME_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CMUE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMUE_A { + pub const fn variant(&self) -> CMUE_A { match self.bits { false => CMUE_A::VALUE1, true => CMUE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMUE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare Match while counting up interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMUE_A::VALUE2 } } #[doc = "Field `CMUE` writer - Compare match while counting up enable"] -pub type CMUE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, CMUE_A, O>; -impl<'a, const O: u8> CMUE_W<'a, O> { +pub type CMUE_W<'a, REG> = crate::BitWriter<'a, REG, CMUE_A>; +impl<'a, REG> CMUE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMUE_A::VALUE1) } #[doc = "Compare Match while counting up interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMUE_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CMDE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMDE_A { + pub const fn variant(&self) -> CMDE_A { match self.bits { false => CMDE_A::VALUE1, true => CMDE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMDE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare Match while counting down interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMDE_A::VALUE2 } } #[doc = "Field `CMDE` writer - Compare match while counting down enable"] -pub type CMDE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, CMDE_A, O>; -impl<'a, const O: u8> CMDE_W<'a, O> { +pub type CMDE_W<'a, REG> = crate::BitWriter<'a, REG, CMDE_A>; +impl<'a, REG> CMDE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMDE_A::VALUE1) } #[doc = "Compare Match while counting down interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMDE_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl E0AE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E0AE_A { + pub const fn variant(&self) -> E0AE_A { match self.bits { false => E0AE_A::VALUE1, true => E0AE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 0 detection interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E0AE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 0 detection interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E0AE_A::VALUE2 } } #[doc = "Field `E0AE` writer - Event 0 interrupt enable"] -pub type E0AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, E0AE_A, O>; -impl<'a, const O: u8> E0AE_W<'a, O> { +pub type E0AE_W<'a, REG> = crate::BitWriter<'a, REG, E0AE_A>; +impl<'a, REG> E0AE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Event 0 detection interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E0AE_A::VALUE1) } #[doc = "Event 0 detection interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E0AE_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl E1AE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E1AE_A { + pub const fn variant(&self) -> E1AE_A { match self.bits { false => E1AE_A::VALUE1, true => E1AE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 1 detection interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E1AE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 1 detection interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E1AE_A::VALUE2 } } #[doc = "Field `E1AE` writer - Event 1 interrupt enable"] -pub type E1AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, E1AE_A, O>; -impl<'a, const O: u8> E1AE_W<'a, O> { +pub type E1AE_W<'a, REG> = crate::BitWriter<'a, REG, E1AE_A>; +impl<'a, REG> E1AE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Event 1 detection interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E1AE_A::VALUE1) } #[doc = "Event 1 detection interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E1AE_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl E2AE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E2AE_A { + pub const fn variant(&self) -> E2AE_A { match self.bits { false => E2AE_A::VALUE1, true => E2AE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 2 detection interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E2AE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 2 detection interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E2AE_A::VALUE2 } } #[doc = "Field `E2AE` writer - Event 2 interrupt enable"] -pub type E2AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, E2AE_A, O>; -impl<'a, const O: u8> E2AE_W<'a, O> { +pub type E2AE_W<'a, REG> = crate::BitWriter<'a, REG, E2AE_A>; +impl<'a, REG> E2AE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Event 2 detection interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E2AE_A::VALUE1) } #[doc = "Event 2 detection interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E2AE_A::VALUE2) } } @@ -425,64 +414,65 @@ impl W { #[doc = "Bit 0 - Period match while counting up enable"] #[inline(always)] #[must_use] - pub fn pme(&mut self) -> PME_W<0> { - PME_W::new(self) + pub fn pme(&mut self) -> PME_W { + PME_W::new(self, 0) } #[doc = "Bit 1 - One match while counting down enable"] #[inline(always)] #[must_use] - pub fn ome(&mut self) -> OME_W<1> { - OME_W::new(self) + pub fn ome(&mut self) -> OME_W { + OME_W::new(self, 1) } #[doc = "Bit 2 - Compare match while counting up enable"] #[inline(always)] #[must_use] - pub fn cmue(&mut self) -> CMUE_W<2> { - CMUE_W::new(self) + pub fn cmue(&mut self) -> CMUE_W { + CMUE_W::new(self, 2) } #[doc = "Bit 3 - Compare match while counting down enable"] #[inline(always)] #[must_use] - pub fn cmde(&mut self) -> CMDE_W<3> { - CMDE_W::new(self) + pub fn cmde(&mut self) -> CMDE_W { + CMDE_W::new(self, 3) } #[doc = "Bit 8 - Event 0 interrupt enable"] #[inline(always)] #[must_use] - pub fn e0ae(&mut self) -> E0AE_W<8> { - E0AE_W::new(self) + pub fn e0ae(&mut self) -> E0AE_W { + E0AE_W::new(self, 8) } #[doc = "Bit 9 - Event 1 interrupt enable"] #[inline(always)] #[must_use] - pub fn e1ae(&mut self) -> E1AE_W<9> { - E1AE_W::new(self) + pub fn e1ae(&mut self) -> E1AE_W { + E1AE_W::new(self, 9) } #[doc = "Bit 10 - Event 2 interrupt enable"] #[inline(always)] #[must_use] - pub fn e2ae(&mut self) -> E2AE_W<10> { - E2AE_W::new(self) + pub fn e2ae(&mut self) -> E2AE_W { + E2AE_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Enable Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`inte::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`inte::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`inte::R`](R) reader structure"] +impl crate::Readable for INTE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`inte::W`](W) writer structure"] impl crate::Writable for INTE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/ints.rs b/src/ccu40_cc40/ints.rs index 33fa09a2..24a6afdb 100644 --- a/src/ccu40_cc40/ints.rs +++ b/src/ccu40_cc40/ints.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PMUS` reader - Period Match while Counting Up"] pub type PMUS_R = crate::BitReader; #[doc = "Period Match while Counting Up\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl PMUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PMUS_A { + pub const fn variant(&self) -> PMUS_A { match self.bits { false => PMUS_A::VALUE1, true => PMUS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Period match while counting up not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PMUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Period match while counting up detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PMUS_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl OMDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OMDS_A { + pub const fn variant(&self) -> OMDS_A { match self.bits { false => OMDS_A::VALUE1, true => OMDS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "One match while counting down not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OMDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "One match while counting down detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OMDS_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl CMUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMUS_A { + pub const fn variant(&self) -> CMUS_A { match self.bits { false => CMUS_A::VALUE1, true => CMUS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare match while counting up not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare match while counting up detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMUS_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl CMDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMDS_A { + pub const fn variant(&self) -> CMDS_A { match self.bits { false => CMDS_A::VALUE1, true => CMDS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare match while counting down not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare match while counting down detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMDS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl E0AS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E0AS_A { + pub const fn variant(&self) -> E0AS_A { match self.bits { false => E0AS_A::VALUE1, true => E0AS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 0 not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E0AS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 0 detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E0AS_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl E1AS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E1AS_A { + pub const fn variant(&self) -> E1AS_A { match self.bits { false => E1AS_A::VALUE1, true => E1AS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 1 not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E1AS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 1 detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E1AS_A::VALUE2 @@ -248,25 +235,25 @@ impl From for bool { impl E2AS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E2AS_A { + pub const fn variant(&self) -> E2AS_A { match self.bits { false => E2AS_A::VALUE1, true => E2AS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 2 not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E2AS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 2 detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E2AS_A::VALUE2 } } #[doc = "Field `TRPF` reader - Trap Flag Status"] -pub type TRPF_R = crate::BitReader; +pub type TRPF_R = crate::BitReader; impl R { #[doc = "Bit 0 - Period Match while Counting Up"] #[inline(always)] @@ -309,15 +296,13 @@ impl R { TRPF_R::new(((self.bits >> 11) & 1) != 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"] +#[doc = "Interrupt Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ints::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`ints::R`](R) reader structure"] +impl crate::Readable for INTS_SPEC {} #[doc = "`reset()` method sets INTS to value 0"] impl crate::Resettable for INTS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/pr.rs b/src/ccu40_cc40/pr.rs index 5b834e9e..0c5cb46f 100644 --- a/src/ccu40_cc40/pr.rs +++ b/src/ccu40_cc40/pr.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PR` reader - Period Register"] -pub type PR_R = crate::FieldReader; +pub type PR_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Period Register"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Timer Period Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pr::R`](R) reader structure"] +impl crate::Readable for PR_SPEC {} #[doc = "`reset()` method sets PR to value 0"] impl crate::Resettable for PR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/prs.rs b/src/ccu40_cc40/prs.rs index d3b07079..06dd30c4 100644 --- a/src/ccu40_cc40/prs.rs +++ b/src/ccu40_cc40/prs.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRS` reader - Period Register"] -pub type PRS_R = crate::FieldReader; +pub type PRS_R = crate::FieldReader; #[doc = "Field `PRS` writer - Period Register"] -pub type PRS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRS_SPEC, u16, u16, 16, O>; +pub type PRS_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Period Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Period Register"] #[inline(always)] #[must_use] - pub fn prs(&mut self) -> PRS_W<0> { - PRS_W::new(self) + pub fn prs(&mut self) -> PRS_W { + PRS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Timer Shadow Period Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`prs::R`](R) reader structure"] +impl crate::Readable for PRS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`prs::W`](W) writer structure"] impl crate::Writable for PRS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/psc.rs b/src/ccu40_cc40/psc.rs index e8231deb..2021519b 100644 --- a/src/ccu40_cc40/psc.rs +++ b/src/ccu40_cc40/psc.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PSIV` reader - Prescaler Initial Value"] -pub type PSIV_R = crate::FieldReader; +pub type PSIV_R = crate::FieldReader; #[doc = "Field `PSIV` writer - Prescaler Initial Value"] -pub type PSIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PSC_SPEC, u8, u8, 4, O>; +pub type PSIV_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Prescaler Initial Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:3 - Prescaler Initial Value"] #[inline(always)] #[must_use] - pub fn psiv(&mut self) -> PSIV_W<0> { - PSIV_W::new(self) + pub fn psiv(&mut self) -> PSIV_W { + PSIV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Prescaler Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psc::R`](R) reader structure"] +impl crate::Readable for PSC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psc::W`](W) writer structure"] impl crate::Writable for PSC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/psl.rs b/src/ccu40_cc40/psl.rs index 18adc77d..38ecb7be 100644 --- a/src/ccu40_cc40/psl.rs +++ b/src/ccu40_cc40/psl.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PSL` reader - Output Passive Level"] pub type PSL_R = crate::BitReader; #[doc = "Output Passive Level\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PSL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSL_A { + pub const fn variant(&self) -> PSL_A { match self.bits { false => PSL_A::VALUE1, true => PSL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive Level is LOW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Passive Level is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSL_A::VALUE2 } } #[doc = "Field `PSL` writer - Output Passive Level"] -pub type PSL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSL_SPEC, PSL_A, O>; -impl<'a, const O: u8> PSL_W<'a, O> { +pub type PSL_W<'a, REG> = crate::BitWriter<'a, REG, PSL_A>; +impl<'a, REG> PSL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Passive Level is LOW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSL_A::VALUE1) } #[doc = "Passive Level is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSL_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - Output Passive Level"] #[inline(always)] #[must_use] - pub fn psl(&mut self) -> PSL_W<0> { - PSL_W::new(self) + pub fn psl(&mut self) -> PSL_W { + PSL_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Passive Level Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psl::R`](R) reader structure"] +impl crate::Readable for PSL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psl::W`](W) writer structure"] impl crate::Writable for PSL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/srs.rs b/src/ccu40_cc40/srs.rs index 2b86a03d..c0e85ba0 100644 --- a/src/ccu40_cc40/srs.rs +++ b/src/ccu40_cc40/srs.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `POSR` reader - Period/One match Service request selector"] -pub type POSR_R = crate::FieldReader; +pub type POSR_R = crate::FieldReader; #[doc = "Period/One match Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for POSR_A { + type Ux = u8; +} impl POSR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> POSR_A { + pub const fn variant(&self) -> POSR_A { match self.bits { 0 => POSR_A::VALUE1, 1 => POSR_A::VALUE2, @@ -67,53 +38,57 @@ impl POSR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC4ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == POSR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC4ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == POSR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC4ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == POSR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC4ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == POSR_A::VALUE4 } } #[doc = "Field `POSR` writer - Period/One match Service request selector"] -pub type POSR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, POSR_A, 2, O>; -impl<'a, const O: u8> POSR_W<'a, O> { +pub type POSR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, POSR_A>; +impl<'a, REG> POSR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC4ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSR_A::VALUE1) } #[doc = "Forward to CC4ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSR_A::VALUE2) } #[doc = "Forward to CC4ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(POSR_A::VALUE3) } #[doc = "Forward to CC4ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(POSR_A::VALUE4) } } #[doc = "Field `CMSR` reader - Compare match Service request selector"] -pub type CMSR_R = crate::FieldReader; +pub type CMSR_R = crate::FieldReader; #[doc = "Compare match Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CMSR_A { + type Ux = u8; +} impl CMSR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMSR_A { + pub const fn variant(&self) -> CMSR_A { match self.bits { 0 => CMSR_A::VALUE1, 1 => CMSR_A::VALUE2, @@ -145,53 +123,57 @@ impl CMSR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC4ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMSR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC4ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMSR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC4ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CMSR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC4ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CMSR_A::VALUE4 } } #[doc = "Field `CMSR` writer - Compare match Service request selector"] -pub type CMSR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, CMSR_A, 2, O>; -impl<'a, const O: u8> CMSR_W<'a, O> { +pub type CMSR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CMSR_A>; +impl<'a, REG> CMSR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC4ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMSR_A::VALUE1) } #[doc = "Forward to CC4ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMSR_A::VALUE2) } #[doc = "Forward to CC4ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CMSR_A::VALUE3) } #[doc = "Forward to CC4ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CMSR_A::VALUE4) } } #[doc = "Field `E0SR` reader - Event 0 Service request selector"] -pub type E0SR_R = crate::FieldReader; +pub type E0SR_R = crate::FieldReader; #[doc = "Event 0 Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for E0SR_A { + type Ux = u8; +} impl E0SR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E0SR_A { + pub const fn variant(&self) -> E0SR_A { match self.bits { 0 => E0SR_A::VALUE1, 1 => E0SR_A::VALUE2, @@ -223,53 +208,57 @@ impl E0SR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC4ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E0SR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC4ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E0SR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC4ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == E0SR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC4ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == E0SR_A::VALUE4 } } #[doc = "Field `E0SR` writer - Event 0 Service request selector"] -pub type E0SR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, E0SR_A, 2, O>; -impl<'a, const O: u8> E0SR_W<'a, O> { +pub type E0SR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, E0SR_A>; +impl<'a, REG> E0SR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC4ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E0SR_A::VALUE1) } #[doc = "Forward to CC4ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E0SR_A::VALUE2) } #[doc = "Forward to CC4ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(E0SR_A::VALUE3) } #[doc = "Forward to CC4ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(E0SR_A::VALUE4) } } #[doc = "Field `E1SR` reader - Event 1 Service request selector"] -pub type E1SR_R = crate::FieldReader; +pub type E1SR_R = crate::FieldReader; #[doc = "Event 1 Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for E1SR_A { + type Ux = u8; +} impl E1SR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E1SR_A { + pub const fn variant(&self) -> E1SR_A { match self.bits { 0 => E1SR_A::VALUE1, 1 => E1SR_A::VALUE2, @@ -301,53 +293,57 @@ impl E1SR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC4ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E1SR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC4ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E1SR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC4ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == E1SR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC4ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == E1SR_A::VALUE4 } } #[doc = "Field `E1SR` writer - Event 1 Service request selector"] -pub type E1SR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, E1SR_A, 2, O>; -impl<'a, const O: u8> E1SR_W<'a, O> { +pub type E1SR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, E1SR_A>; +impl<'a, REG> E1SR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC4ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E1SR_A::VALUE1) } #[doc = "Forward to CC4ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E1SR_A::VALUE2) } #[doc = "Forward to CC4ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(E1SR_A::VALUE3) } #[doc = "Forward to CC4ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(E1SR_A::VALUE4) } } #[doc = "Field `E2SR` reader - Event 2 Service request selector"] -pub type E2SR_R = crate::FieldReader; +pub type E2SR_R = crate::FieldReader; #[doc = "Event 2 Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for E2SR_A { + type Ux = u8; +} impl E2SR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E2SR_A { + pub const fn variant(&self) -> E2SR_A { match self.bits { 0 => E2SR_A::VALUE1, 1 => E2SR_A::VALUE2, @@ -379,48 +378,52 @@ impl E2SR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC4ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E2SR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC4ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E2SR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC4ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == E2SR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC4ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == E2SR_A::VALUE4 } } #[doc = "Field `E2SR` writer - Event 2 Service request selector"] -pub type E2SR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, E2SR_A, 2, O>; -impl<'a, const O: u8> E2SR_W<'a, O> { +pub type E2SR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, E2SR_A>; +impl<'a, REG> E2SR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC4ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E2SR_A::VALUE1) } #[doc = "Forward to CC4ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E2SR_A::VALUE2) } #[doc = "Forward to CC4ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(E2SR_A::VALUE3) } #[doc = "Forward to CC4ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(E2SR_A::VALUE4) } } @@ -455,52 +458,53 @@ impl W { #[doc = "Bits 0:1 - Period/One match Service request selector"] #[inline(always)] #[must_use] - pub fn posr(&mut self) -> POSR_W<0> { - POSR_W::new(self) + pub fn posr(&mut self) -> POSR_W { + POSR_W::new(self, 0) } #[doc = "Bits 2:3 - Compare match Service request selector"] #[inline(always)] #[must_use] - pub fn cmsr(&mut self) -> CMSR_W<2> { - CMSR_W::new(self) + pub fn cmsr(&mut self) -> CMSR_W { + CMSR_W::new(self, 2) } #[doc = "Bits 8:9 - Event 0 Service request selector"] #[inline(always)] #[must_use] - pub fn e0sr(&mut self) -> E0SR_W<8> { - E0SR_W::new(self) + pub fn e0sr(&mut self) -> E0SR_W { + E0SR_W::new(self, 8) } #[doc = "Bits 10:11 - Event 1 Service request selector"] #[inline(always)] #[must_use] - pub fn e1sr(&mut self) -> E1SR_W<10> { - E1SR_W::new(self) + pub fn e1sr(&mut self) -> E1SR_W { + E1SR_W::new(self, 10) } #[doc = "Bits 12:13 - Event 2 Service request selector"] #[inline(always)] #[must_use] - pub fn e2sr(&mut self) -> E2SR_W<12> { - E2SR_W::new(self) + pub fn e2sr(&mut self) -> E2SR_W { + E2SR_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Selector\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`srs::R`](R) reader structure"] +impl crate::Readable for SRS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`srs::W`](W) writer structure"] impl crate::Writable for SRS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/swr.rs b/src/ccu40_cc40/swr.rs index efd242d5..9c8203f3 100644 --- a/src/ccu40_cc40/swr.rs +++ b/src/ccu40_cc40/swr.rs @@ -1,104 +1,88 @@ #[doc = "Register `SWR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RPM` writer - Period match while counting up clear"] -pub type RPM_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RPM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ROM` writer - One match while counting down clear"] -pub type ROM_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type ROM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RCMU` writer - Compare match while counting up clear"] -pub type RCMU_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RCMU_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RCMD` writer - Compare match while counting down clear"] -pub type RCMD_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RCMD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RE0A` writer - Event 0 detection clear"] -pub type RE0A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RE0A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RE1A` writer - Event 1 detection clear"] -pub type RE1A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RE1A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RE2A` writer - Event 2 detection clear"] -pub type RE2A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RE2A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RTRPF` writer - Trap Flag status clear"] -pub type RTRPF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RTRPF_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Period match while counting up clear"] #[inline(always)] #[must_use] - pub fn rpm(&mut self) -> RPM_W<0> { - RPM_W::new(self) + pub fn rpm(&mut self) -> RPM_W { + RPM_W::new(self, 0) } #[doc = "Bit 1 - One match while counting down clear"] #[inline(always)] #[must_use] - pub fn rom(&mut self) -> ROM_W<1> { - ROM_W::new(self) + pub fn rom(&mut self) -> ROM_W { + ROM_W::new(self, 1) } #[doc = "Bit 2 - Compare match while counting up clear"] #[inline(always)] #[must_use] - pub fn rcmu(&mut self) -> RCMU_W<2> { - RCMU_W::new(self) + pub fn rcmu(&mut self) -> RCMU_W { + RCMU_W::new(self, 2) } #[doc = "Bit 3 - Compare match while counting down clear"] #[inline(always)] #[must_use] - pub fn rcmd(&mut self) -> RCMD_W<3> { - RCMD_W::new(self) + pub fn rcmd(&mut self) -> RCMD_W { + RCMD_W::new(self, 3) } #[doc = "Bit 8 - Event 0 detection clear"] #[inline(always)] #[must_use] - pub fn re0a(&mut self) -> RE0A_W<8> { - RE0A_W::new(self) + pub fn re0a(&mut self) -> RE0A_W { + RE0A_W::new(self, 8) } #[doc = "Bit 9 - Event 1 detection clear"] #[inline(always)] #[must_use] - pub fn re1a(&mut self) -> RE1A_W<9> { - RE1A_W::new(self) + pub fn re1a(&mut self) -> RE1A_W { + RE1A_W::new(self, 9) } #[doc = "Bit 10 - Event 2 detection clear"] #[inline(always)] #[must_use] - pub fn re2a(&mut self) -> RE2A_W<10> { - RE2A_W::new(self) + pub fn re2a(&mut self) -> RE2A_W { + RE2A_W::new(self, 10) } #[doc = "Bit 11 - Trap Flag status clear"] #[inline(always)] #[must_use] - pub fn rtrpf(&mut self) -> RTRPF_W<11> { - RTRPF_W::new(self) + pub fn rtrpf(&mut self) -> RTRPF_W { + RTRPF_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Status Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`swr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SWR_SPEC; impl crate::RegisterSpec for SWR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [swr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`swr::W`](W) writer structure"] impl crate::Writable for SWR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/sws.rs b/src/ccu40_cc40/sws.rs index db24039d..8d5e9b8e 100644 --- a/src/ccu40_cc40/sws.rs +++ b/src/ccu40_cc40/sws.rs @@ -1,104 +1,88 @@ #[doc = "Register `SWS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SPM` writer - Period match while counting up set"] -pub type SPM_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SPM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SOM` writer - One match while counting down set"] -pub type SOM_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SOM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCMU` writer - Compare match while counting up set"] -pub type SCMU_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCMU_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCMD` writer - Compare match while counting down set"] -pub type SCMD_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCMD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SE0A` writer - Event 0 detection set"] -pub type SE0A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SE0A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SE1A` writer - Event 1 detection set"] -pub type SE1A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SE1A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SE2A` writer - Event 2 detection set"] -pub type SE2A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SE2A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STRPF` writer - Trap Flag status set"] -pub type STRPF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type STRPF_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Period match while counting up set"] #[inline(always)] #[must_use] - pub fn spm(&mut self) -> SPM_W<0> { - SPM_W::new(self) + pub fn spm(&mut self) -> SPM_W { + SPM_W::new(self, 0) } #[doc = "Bit 1 - One match while counting down set"] #[inline(always)] #[must_use] - pub fn som(&mut self) -> SOM_W<1> { - SOM_W::new(self) + pub fn som(&mut self) -> SOM_W { + SOM_W::new(self, 1) } #[doc = "Bit 2 - Compare match while counting up set"] #[inline(always)] #[must_use] - pub fn scmu(&mut self) -> SCMU_W<2> { - SCMU_W::new(self) + pub fn scmu(&mut self) -> SCMU_W { + SCMU_W::new(self, 2) } #[doc = "Bit 3 - Compare match while counting down set"] #[inline(always)] #[must_use] - pub fn scmd(&mut self) -> SCMD_W<3> { - SCMD_W::new(self) + pub fn scmd(&mut self) -> SCMD_W { + SCMD_W::new(self, 3) } #[doc = "Bit 8 - Event 0 detection set"] #[inline(always)] #[must_use] - pub fn se0a(&mut self) -> SE0A_W<8> { - SE0A_W::new(self) + pub fn se0a(&mut self) -> SE0A_W { + SE0A_W::new(self, 8) } #[doc = "Bit 9 - Event 1 detection set"] #[inline(always)] #[must_use] - pub fn se1a(&mut self) -> SE1A_W<9> { - SE1A_W::new(self) + pub fn se1a(&mut self) -> SE1A_W { + SE1A_W::new(self, 9) } #[doc = "Bit 10 - Event 2 detection set"] #[inline(always)] #[must_use] - pub fn se2a(&mut self) -> SE2A_W<10> { - SE2A_W::new(self) + pub fn se2a(&mut self) -> SE2A_W { + SE2A_W::new(self, 10) } #[doc = "Bit 11 - Trap Flag status set"] #[inline(always)] #[must_use] - pub fn strpf(&mut self) -> STRPF_W<11> { - STRPF_W::new(self) + pub fn strpf(&mut self) -> STRPF_W { + STRPF_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Status Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sws::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SWS_SPEC; impl crate::RegisterSpec for SWS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [sws::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`sws::W`](W) writer structure"] impl crate::Writable for SWS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/tc.rs b/src/ccu40_cc40/tc.rs index 24fa7beb..14135257 100644 --- a/src/ccu40_cc40/tc.rs +++ b/src/ccu40_cc40/tc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TCM` reader - Timer Counting Mode"] pub type TCM_R = crate::BitReader; #[doc = "Timer Counting Mode\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl TCM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TCM_A { + pub const fn variant(&self) -> TCM_A { match self.bits { false => TCM_A::VALUE1, true => TCM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Edge aligned mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TCM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Center aligned mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TCM_A::VALUE2 } } #[doc = "Field `TCM` writer - Timer Counting Mode"] -pub type TCM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TCM_A, O>; -impl<'a, const O: u8> TCM_W<'a, O> { +pub type TCM_W<'a, REG> = crate::BitWriter<'a, REG, TCM_A>; +impl<'a, REG> TCM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Edge aligned mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TCM_A::VALUE1) } #[doc = "Center aligned mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TCM_A::VALUE2) } } @@ -103,41 +74,44 @@ impl From for bool { impl TSSM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSSM_A { + pub const fn variant(&self) -> TSSM_A { match self.bits { false => TSSM_A::VALUE1, true => TSSM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Single shot mode is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSSM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Single shot mode is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSSM_A::VALUE2 } } #[doc = "Field `TSSM` writer - Timer Single Shot Mode"] -pub type TSSM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TSSM_A, O>; -impl<'a, const O: u8> TSSM_W<'a, O> { +pub type TSSM_W<'a, REG> = crate::BitWriter<'a, REG, TSSM_A>; +impl<'a, REG> TSSM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Single shot mode is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSSM_A::VALUE1) } #[doc = "Single shot mode is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSSM_A::VALUE2) } } #[doc = "Field `CLST` reader - Shadow Transfer on Clear"] -pub type CLST_R = crate::BitReader; +pub type CLST_R = crate::BitReader; #[doc = "Field `CLST` writer - Shadow Transfer on Clear"] -pub type CLST_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, bool, O>; +pub type CLST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CMOD` reader - Capture Compare Mode"] pub type CMOD_R = crate::BitReader; #[doc = "Capture Compare Mode\n\nValue on reset: 0"] @@ -157,18 +131,18 @@ impl From for bool { impl CMOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMOD_A { + pub const fn variant(&self) -> CMOD_A { match self.bits { false => CMOD_A::VALUE1, true => CMOD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare Mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Capture Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMOD_A::VALUE2 @@ -193,39 +167,42 @@ impl From for bool { impl ECM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ECM_A { + pub const fn variant(&self) -> ECM_A { match self.bits { false => ECM_A::VALUE1, true => ECM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ECM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Extended Capture Mode. Clear of the Full Flag of each capture register is done not only by accessing the individual registers but also by accessing the ECRD register. When reading the ECRD register, only the capture register register full flag pointed by the VPTR is cleared"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ECM_A::VALUE2 } } #[doc = "Field `ECM` writer - Extended Capture Mode"] -pub type ECM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, ECM_A, O>; -impl<'a, const O: u8> ECM_W<'a, O> { +pub type ECM_W<'a, REG> = crate::BitWriter<'a, REG, ECM_A>; +impl<'a, REG> ECM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ECM_A::VALUE1) } #[doc = "Extended Capture Mode. Clear of the Full Flag of each capture register is done not only by accessing the individual registers but also by accessing the ECRD register. When reading the ECRD register, only the capture register register full flag pointed by the VPTR is cleared"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ECM_A::VALUE2) } } #[doc = "Field `CAPC` reader - Clear on Capture Control"] -pub type CAPC_R = crate::FieldReader; +pub type CAPC_R = crate::FieldReader; #[doc = "Clear on Capture Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -245,10 +222,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CAPC_A { + type Ux = u8; +} impl CAPC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CAPC_A { + pub const fn variant(&self) -> CAPC_A { match self.bits { 0 => CAPC_A::VALUE1, 1 => CAPC_A::VALUE2, @@ -257,53 +237,57 @@ impl CAPC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer is never cleared on a capture event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CAPC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer is cleared on a capture event into capture registers 2 and 3. (When SCE = 1#, Timer is always cleared in a capture event)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CAPC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Timer is cleared on a capture event into capture registers 0 and 1. (When SCE = 1#, Timer is always cleared in a capture event)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CAPC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Timer is always cleared in a capture event."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CAPC_A::VALUE4 } } #[doc = "Field `CAPC` writer - Clear on Capture Control"] -pub type CAPC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, TC_SPEC, u8, CAPC_A, 2, O>; -impl<'a, const O: u8> CAPC_W<'a, O> { +pub type CAPC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CAPC_A>; +impl<'a, REG> CAPC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Timer is never cleared on a capture event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CAPC_A::VALUE1) } #[doc = "Timer is cleared on a capture event into capture registers 2 and 3. (When SCE = 1#, Timer is always cleared in a capture event)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CAPC_A::VALUE2) } #[doc = "Timer is cleared on a capture event into capture registers 0 and 1. (When SCE = 1#, Timer is always cleared in a capture event)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CAPC_A::VALUE3) } #[doc = "Timer is always cleared in a capture event."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CAPC_A::VALUE4) } } #[doc = "Field `ENDM` reader - Extended Stop Function Control"] -pub type ENDM_R = crate::FieldReader; +pub type ENDM_R = crate::FieldReader; #[doc = "Extended Stop Function Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -321,10 +305,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ENDM_A { + type Ux = u8; +} impl ENDM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ENDM_A::VALUE1), 1 => Some(ENDM_A::VALUE2), @@ -332,38 +319,42 @@ impl ENDM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clears the timer run bit only (default stop)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENDM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clears the timer only (flush)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENDM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Clears the timer and run bit (flush/stop)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ENDM_A::VALUE3 } } #[doc = "Field `ENDM` writer - Extended Stop Function Control"] -pub type ENDM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TC_SPEC, u8, ENDM_A, 2, O>; -impl<'a, const O: u8> ENDM_W<'a, O> { +pub type ENDM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ENDM_A>; +impl<'a, REG> ENDM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Clears the timer run bit only (default stop)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENDM_A::VALUE1) } #[doc = "Clears the timer only (flush)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENDM_A::VALUE2) } #[doc = "Clears the timer and run bit (flush/stop)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ENDM_A::VALUE3) } } @@ -386,34 +377,37 @@ impl From for bool { impl STRM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STRM_A { + pub const fn variant(&self) -> STRM_A { match self.bits { false => STRM_A::VALUE1, true => STRM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Sets run bit only (default start)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STRM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clears the timer and sets run bit (flush/start)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STRM_A::VALUE2 } } #[doc = "Field `STRM` writer - Extended Start Function Control"] -pub type STRM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, STRM_A, O>; -impl<'a, const O: u8> STRM_W<'a, O> { +pub type STRM_W<'a, REG> = crate::BitWriter<'a, REG, STRM_A>; +impl<'a, REG> STRM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Sets run bit only (default start)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STRM_A::VALUE1) } #[doc = "Clears the timer and sets run bit (flush/start)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STRM_A::VALUE2) } } @@ -436,34 +430,37 @@ impl From for bool { impl SCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCE_A { + pub const fn variant(&self) -> SCE_A { match self.bits { false => SCE_A::VALUE1, true => SCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == SCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[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. and 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)] pub fn is_value2(&self) -> bool { *self == SCE_A::VALUE2 } } #[doc = "Field `SCE` writer - Equal Capture Event enable"] -pub type SCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, SCE_A, O>; -impl<'a, const O: u8> SCE_W<'a, O> { +pub type SCE_W<'a, REG> = crate::BitWriter<'a, REG, SCE_A>; +impl<'a, REG> SCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCE_A::VALUE1) } #[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. and 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)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCE_A::VALUE2) } } @@ -486,39 +483,42 @@ impl From for bool { impl CCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCS_A { + pub const fn variant(&self) -> CCS_A { match self.bits { false => CCS_A::VALUE1, true => CCS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The capture into a specific capture register is done with the rules linked with the full flags, described at ."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The capture into the capture registers is always done regardless of the full flag status (even if the register has not been read back)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCS_A::VALUE2 } } #[doc = "Field `CCS` writer - Continuous Capture Enable"] -pub type CCS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, CCS_A, O>; -impl<'a, const O: u8> CCS_W<'a, O> { +pub type CCS_W<'a, REG> = crate::BitWriter<'a, REG, CCS_A>; +impl<'a, REG> CCS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The capture into a specific capture register is done with the rules linked with the full flags, described at ."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCS_A::VALUE1) } #[doc = "The capture into the capture registers is always done regardless of the full flag status (even if the register has not been read back)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCS_A::VALUE2) } } #[doc = "Field `DITHE` reader - Dither Enable"] -pub type DITHE_R = crate::FieldReader; +pub type DITHE_R = crate::FieldReader; #[doc = "Dither Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -538,10 +538,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DITHE_A { + type Ux = u8; +} impl DITHE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DITHE_A { + pub const fn variant(&self) -> DITHE_A { match self.bits { 0 => DITHE_A::VALUE1, 1 => DITHE_A::VALUE2, @@ -550,48 +553,52 @@ impl DITHE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DITHE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither is applied to the Period"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DITHE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Dither is applied to the Compare"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DITHE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Dither is applied to the Period and Compare"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DITHE_A::VALUE4 } } #[doc = "Field `DITHE` writer - Dither Enable"] -pub type DITHE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, TC_SPEC, u8, DITHE_A, 2, O>; -impl<'a, const O: u8> DITHE_W<'a, O> { +pub type DITHE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, DITHE_A>; +impl<'a, REG> DITHE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Dither is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DITHE_A::VALUE1) } #[doc = "Dither is applied to the Period"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DITHE_A::VALUE2) } #[doc = "Dither is applied to the Compare"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DITHE_A::VALUE3) } #[doc = "Dither is applied to the Period and Compare"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DITHE_A::VALUE4) } } @@ -614,34 +621,37 @@ impl From for bool { impl DIM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIM_A { + pub const fn variant(&self) -> DIM_A { match self.bits { false => DIM_A::VALUE1, true => DIM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Slice is using its own dither unit"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Slice is connected to the dither unit of slice 0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIM_A::VALUE2 } } #[doc = "Field `DIM` writer - Dither input selector"] -pub type DIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, DIM_A, O>; -impl<'a, const O: u8> DIM_W<'a, O> { +pub type DIM_W<'a, REG> = crate::BitWriter<'a, REG, DIM_A>; +impl<'a, REG> DIM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Slice is using its own dither unit"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIM_A::VALUE1) } #[doc = "Slice is connected to the dither unit of slice 0."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIM_A::VALUE2) } } @@ -664,34 +674,37 @@ impl From for bool { impl FPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FPE_A { + pub const fn variant(&self) -> FPE_A { match self.bits { false => FPE_A::VALUE1, true => FPE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Floating prescaler mode is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FPE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Floating prescaler mode is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FPE_A::VALUE2 } } #[doc = "Field `FPE` writer - Floating Prescaler enable"] -pub type FPE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, FPE_A, O>; -impl<'a, const O: u8> FPE_W<'a, O> { +pub type FPE_W<'a, REG> = crate::BitWriter<'a, REG, FPE_A>; +impl<'a, REG> FPE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Floating prescaler mode is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FPE_A::VALUE1) } #[doc = "Floating prescaler mode is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FPE_A::VALUE2) } } @@ -714,34 +727,37 @@ impl From for bool { impl TRAPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRAPE_A { + pub const fn variant(&self) -> TRAPE_A { match self.bits { false => TRAPE_A::VALUE1, true => TRAPE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "TRAP functionality has no effect on the output"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRAPE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TRAP functionality affects the output"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRAPE_A::VALUE2 } } #[doc = "Field `TRAPE` writer - TRAP enable"] -pub type TRAPE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TRAPE_A, O>; -impl<'a, const O: u8> TRAPE_W<'a, O> { +pub type TRAPE_W<'a, REG> = crate::BitWriter<'a, REG, TRAPE_A>; +impl<'a, REG> TRAPE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "TRAP functionality has no effect on the output"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRAPE_A::VALUE1) } #[doc = "TRAP functionality affects the output"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRAPE_A::VALUE2) } } @@ -764,34 +780,37 @@ impl From for bool { impl TRPSE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRPSE_A { + pub const fn variant(&self) -> TRPSE_A { match self.bits { false => TRPSE_A::VALUE1, true => TRPSE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Exiting from TRAP state isn't synchronized with the PWM signal"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRPSE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Exiting from TRAP state is synchronized with the PWM signal"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRPSE_A::VALUE2 } } #[doc = "Field `TRPSE` writer - TRAP Synchronization Enable"] -pub type TRPSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TRPSE_A, O>; -impl<'a, const O: u8> TRPSE_W<'a, O> { +pub type TRPSE_W<'a, REG> = crate::BitWriter<'a, REG, TRPSE_A>; +impl<'a, REG> TRPSE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Exiting from TRAP state isn't synchronized with the PWM signal"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRPSE_A::VALUE1) } #[doc = "Exiting from TRAP state is synchronized with the PWM signal"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRPSE_A::VALUE2) } } @@ -814,34 +833,37 @@ impl From for bool { impl TRPSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRPSW_A { + pub const fn variant(&self) -> TRPSW_A { match self.bits { false => TRPSW_A::VALUE1, true => TRPSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The slice exits the TRAP state automatically when the TRAP condition is not present"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRPSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The TRAP state can only be exited by a SW request."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRPSW_A::VALUE2 } } #[doc = "Field `TRPSW` writer - TRAP State Clear Control"] -pub type TRPSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TRPSW_A, O>; -impl<'a, const O: u8> TRPSW_W<'a, O> { +pub type TRPSW_W<'a, REG> = crate::BitWriter<'a, REG, TRPSW_A>; +impl<'a, REG> TRPSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The slice exits the TRAP state automatically when the TRAP condition is not present"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRPSW_A::VALUE1) } #[doc = "The TRAP state can only be exited by a SW request."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRPSW_A::VALUE2) } } @@ -864,34 +886,37 @@ impl From for bool { impl EMS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMS_A { + pub const fn variant(&self) -> EMS_A { match self.bits { false => EMS_A::VALUE1, true => EMS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Modulation functionality is not synchronized with the PWM signal"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Modulation functionality is synchronized with the PWM signal"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMS_A::VALUE2 } } #[doc = "Field `EMS` writer - External Modulation Synchronization"] -pub type EMS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, EMS_A, O>; -impl<'a, const O: u8> EMS_W<'a, O> { +pub type EMS_W<'a, REG> = crate::BitWriter<'a, REG, EMS_A>; +impl<'a, REG> EMS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External Modulation functionality is not synchronized with the PWM signal"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMS_A::VALUE1) } #[doc = "External Modulation functionality is synchronized with the PWM signal"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMS_A::VALUE2) } } @@ -914,34 +939,37 @@ impl From for bool { impl EMT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMT_A { + pub const fn variant(&self) -> EMT_A { match self.bits { false => EMT_A::VALUE1, true => EMT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Modulation functionality is clearing the CC4yST bit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Modulation functionality is gating the outputs."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMT_A::VALUE2 } } #[doc = "Field `EMT` writer - External Modulation Type"] -pub type EMT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, EMT_A, O>; -impl<'a, const O: u8> EMT_W<'a, O> { +pub type EMT_W<'a, REG> = crate::BitWriter<'a, REG, EMT_A>; +impl<'a, REG> EMT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External Modulation functionality is clearing the CC4yST bit."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMT_A::VALUE1) } #[doc = "External Modulation functionality is gating the outputs."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMT_A::VALUE2) } } @@ -964,34 +992,37 @@ impl From for bool { impl MCME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCME_A { + pub const fn variant(&self) -> MCME_A { match self.bits { false => MCME_A::VALUE1, true => MCME_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Multi Channel Mode is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Multi Channel Mode is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCME_A::VALUE2 } } #[doc = "Field `MCME` writer - Multi Channel Mode Enable"] -pub type MCME_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, MCME_A, O>; -impl<'a, const O: u8> MCME_W<'a, O> { +pub type MCME_W<'a, REG> = crate::BitWriter<'a, REG, MCME_A>; +impl<'a, REG> MCME_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Multi Channel Mode is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCME_A::VALUE1) } #[doc = "Multi Channel Mode is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCME_A::VALUE2) } } @@ -1096,130 +1127,131 @@ impl W { #[doc = "Bit 0 - Timer Counting Mode"] #[inline(always)] #[must_use] - pub fn tcm(&mut self) -> TCM_W<0> { - TCM_W::new(self) + pub fn tcm(&mut self) -> TCM_W { + TCM_W::new(self, 0) } #[doc = "Bit 1 - Timer Single Shot Mode"] #[inline(always)] #[must_use] - pub fn tssm(&mut self) -> TSSM_W<1> { - TSSM_W::new(self) + pub fn tssm(&mut self) -> TSSM_W { + TSSM_W::new(self, 1) } #[doc = "Bit 2 - Shadow Transfer on Clear"] #[inline(always)] #[must_use] - pub fn clst(&mut self) -> CLST_W<2> { - CLST_W::new(self) + pub fn clst(&mut self) -> CLST_W { + CLST_W::new(self, 2) } #[doc = "Bit 4 - Extended Capture Mode"] #[inline(always)] #[must_use] - pub fn ecm(&mut self) -> ECM_W<4> { - ECM_W::new(self) + pub fn ecm(&mut self) -> ECM_W { + ECM_W::new(self, 4) } #[doc = "Bits 5:6 - Clear on Capture Control"] #[inline(always)] #[must_use] - pub fn capc(&mut self) -> CAPC_W<5> { - CAPC_W::new(self) + pub fn capc(&mut self) -> CAPC_W { + CAPC_W::new(self, 5) } #[doc = "Bits 8:9 - Extended Stop Function Control"] #[inline(always)] #[must_use] - pub fn endm(&mut self) -> ENDM_W<8> { - ENDM_W::new(self) + pub fn endm(&mut self) -> ENDM_W { + ENDM_W::new(self, 8) } #[doc = "Bit 10 - Extended Start Function Control"] #[inline(always)] #[must_use] - pub fn strm(&mut self) -> STRM_W<10> { - STRM_W::new(self) + pub fn strm(&mut self) -> STRM_W { + STRM_W::new(self, 10) } #[doc = "Bit 11 - Equal Capture Event enable"] #[inline(always)] #[must_use] - pub fn sce(&mut self) -> SCE_W<11> { - SCE_W::new(self) + pub fn sce(&mut self) -> SCE_W { + SCE_W::new(self, 11) } #[doc = "Bit 12 - Continuous Capture Enable"] #[inline(always)] #[must_use] - pub fn ccs(&mut self) -> CCS_W<12> { - CCS_W::new(self) + pub fn ccs(&mut self) -> CCS_W { + CCS_W::new(self, 12) } #[doc = "Bits 13:14 - Dither Enable"] #[inline(always)] #[must_use] - pub fn dithe(&mut self) -> DITHE_W<13> { - DITHE_W::new(self) + pub fn dithe(&mut self) -> DITHE_W { + DITHE_W::new(self, 13) } #[doc = "Bit 15 - Dither input selector"] #[inline(always)] #[must_use] - pub fn dim(&mut self) -> DIM_W<15> { - DIM_W::new(self) + pub fn dim(&mut self) -> DIM_W { + DIM_W::new(self, 15) } #[doc = "Bit 16 - Floating Prescaler enable"] #[inline(always)] #[must_use] - pub fn fpe(&mut self) -> FPE_W<16> { - FPE_W::new(self) + pub fn fpe(&mut self) -> FPE_W { + FPE_W::new(self, 16) } #[doc = "Bit 17 - TRAP enable"] #[inline(always)] #[must_use] - pub fn trape(&mut self) -> TRAPE_W<17> { - TRAPE_W::new(self) + pub fn trape(&mut self) -> TRAPE_W { + TRAPE_W::new(self, 17) } #[doc = "Bit 21 - TRAP Synchronization Enable"] #[inline(always)] #[must_use] - pub fn trpse(&mut self) -> TRPSE_W<21> { - TRPSE_W::new(self) + pub fn trpse(&mut self) -> TRPSE_W { + TRPSE_W::new(self, 21) } #[doc = "Bit 22 - TRAP State Clear Control"] #[inline(always)] #[must_use] - pub fn trpsw(&mut self) -> TRPSW_W<22> { - TRPSW_W::new(self) + pub fn trpsw(&mut self) -> TRPSW_W { + TRPSW_W::new(self, 22) } #[doc = "Bit 23 - External Modulation Synchronization"] #[inline(always)] #[must_use] - pub fn ems(&mut self) -> EMS_W<23> { - EMS_W::new(self) + pub fn ems(&mut self) -> EMS_W { + EMS_W::new(self, 23) } #[doc = "Bit 24 - External Modulation Type"] #[inline(always)] #[must_use] - pub fn emt(&mut self) -> EMT_W<24> { - EMT_W::new(self) + pub fn emt(&mut self) -> EMT_W { + EMT_W::new(self, 24) } #[doc = "Bit 25 - Multi Channel Mode Enable"] #[inline(always)] #[must_use] - pub fn mcme(&mut self) -> MCME_W<25> { - MCME_W::new(self) + pub fn mcme(&mut self) -> MCME_W { + MCME_W::new(self, 25) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Slice Timer Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tc::R`](R) reader structure"] +impl crate::Readable for TC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tc::W`](W) writer structure"] impl crate::Writable for TC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/tcclr.rs b/src/ccu40_cc40/tcclr.rs index 176fa5a0..5471827c 100644 --- a/src/ccu40_cc40/tcclr.rs +++ b/src/ccu40_cc40/tcclr.rs @@ -1,64 +1,48 @@ #[doc = "Register `TCCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TRBC` writer - Timer Run Bit Clear"] -pub type TRBC_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCCLR_SPEC, bool, O>; +pub type TRBC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TCC` writer - Timer Clear"] -pub type TCC_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCCLR_SPEC, bool, O>; +pub type TCC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DITC` writer - Dither Counter Clear"] -pub type DITC_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCCLR_SPEC, bool, O>; +pub type DITC_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Timer Run Bit Clear"] #[inline(always)] #[must_use] - pub fn trbc(&mut self) -> TRBC_W<0> { - TRBC_W::new(self) + pub fn trbc(&mut self) -> TRBC_W { + TRBC_W::new(self, 0) } #[doc = "Bit 1 - Timer Clear"] #[inline(always)] #[must_use] - pub fn tcc(&mut self) -> TCC_W<1> { - TCC_W::new(self) + pub fn tcc(&mut self) -> TCC_W { + TCC_W::new(self, 1) } #[doc = "Bit 2 - Dither Counter Clear"] #[inline(always)] #[must_use] - pub fn ditc(&mut self) -> DITC_W<2> { - DITC_W::new(self) + pub fn ditc(&mut self) -> DITC_W { + DITC_W::new(self, 2) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Slice Timer Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TCCLR_SPEC; impl crate::RegisterSpec for TCCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [tcclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`tcclr::W`](W) writer structure"] impl crate::Writable for TCCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/tcset.rs b/src/ccu40_cc40/tcset.rs index 6e234fa7..9681d83d 100644 --- a/src/ccu40_cc40/tcset.rs +++ b/src/ccu40_cc40/tcset.rs @@ -1,48 +1,32 @@ #[doc = "Register `TCSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TRBS` writer - Timer Run Bit set"] -pub type TRBS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSET_SPEC, bool, O>; +pub type TRBS_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Timer Run Bit set"] #[inline(always)] #[must_use] - pub fn trbs(&mut self) -> TRBS_W<0> { - TRBS_W::new(self) + pub fn trbs(&mut self) -> TRBS_W { + TRBS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Slice Timer Run Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TCSET_SPEC; impl crate::RegisterSpec for TCSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [tcset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`tcset::W`](W) writer structure"] impl crate::Writable for TCSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu40_cc40/tcst.rs b/src/ccu40_cc40/tcst.rs index e3f1956a..c7999613 100644 --- a/src/ccu40_cc40/tcst.rs +++ b/src/ccu40_cc40/tcst.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `TRB` reader - Timer Run Bit"] pub type TRB_R = crate::BitReader; #[doc = "Timer Run Bit\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl TRB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRB_A { + pub const fn variant(&self) -> TRB_A { match self.bits { false => TRB_A::VALUE1, true => TRB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer is stopped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRB_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl CDIR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CDIR_A { + pub const fn variant(&self) -> CDIR_A { match self.bits { false => CDIR_A::VALUE1, true => CDIR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer is counting up"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CDIR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer is counting down"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CDIR_A::VALUE2 @@ -97,15 +84,13 @@ impl R { CDIR_R::new(((self.bits >> 1) & 1) != 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"] +#[doc = "Slice Timer Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tcst::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`tcst::R`](R) reader structure"] +impl crate::Readable for TCST_SPEC {} #[doc = "`reset()` method sets TCST to value 0"] impl crate::Resettable for TCST_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu40_cc40/timer.rs b/src/ccu40_cc40/timer.rs index b54e18b8..456ff2cf 100644 --- a/src/ccu40_cc40/timer.rs +++ b/src/ccu40_cc40/timer.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TVAL` reader - Timer Value"] -pub type TVAL_R = crate::FieldReader; +pub type TVAL_R = crate::FieldReader; #[doc = "Field `TVAL` writer - Timer Value"] -pub type TVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIMER_SPEC, u16, u16, 16, O>; +pub type TVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Timer Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Timer Value"] #[inline(always)] #[must_use] - pub fn tval(&mut self) -> TVAL_W<0> { - TVAL_W::new(self) + pub fn tval(&mut self) -> TVAL_W { + TVAL_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Timer Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timer::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`timer::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`timer::R`](R) reader structure"] +impl crate::Readable for TIMER_SPEC {} +#[doc = "`write(|w| ..)` method takes [`timer::W`](W) writer structure"] impl crate::Writable for TIMER_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80.rs b/src/ccu80.rs index fd4b92c9..a1f5b72f 100644 --- a/src/ccu80.rs +++ b/src/ccu80.rs @@ -1,66 +1,118 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + gctrl: GCTRL, + gstat: GSTAT, + gidls: GIDLS, + gidlc: GIDLC, + gcss: GCSS, + gcsc: GCSC, + gcst: GCST, + gpchk: GPCHK, + _reserved8: [u8; 0x30], + ecrd: ECRD, + _reserved9: [u8; 0x2c], + midr: MIDR, +} +impl RegisterBlock { #[doc = "0x00 - Global Control Register"] - pub gctrl: GCTRL, + #[inline(always)] + pub const fn gctrl(&self) -> &GCTRL { + &self.gctrl + } #[doc = "0x04 - Global Status Register"] - pub gstat: GSTAT, + #[inline(always)] + pub const fn gstat(&self) -> &GSTAT { + &self.gstat + } #[doc = "0x08 - Global Idle Set"] - pub gidls: GIDLS, + #[inline(always)] + pub const fn gidls(&self) -> &GIDLS { + &self.gidls + } #[doc = "0x0c - Global Idle Clear"] - pub gidlc: GIDLC, + #[inline(always)] + pub const fn gidlc(&self) -> &GIDLC { + &self.gidlc + } #[doc = "0x10 - Global Channel Set"] - pub gcss: GCSS, + #[inline(always)] + pub const fn gcss(&self) -> &GCSS { + &self.gcss + } #[doc = "0x14 - Global Channel Clear"] - pub gcsc: GCSC, + #[inline(always)] + pub const fn gcsc(&self) -> &GCSC { + &self.gcsc + } #[doc = "0x18 - Global Channel status"] - pub gcst: GCST, + #[inline(always)] + pub const fn gcst(&self) -> &GCST { + &self.gcst + } #[doc = "0x1c - Parity Checker Configuration"] - pub gpchk: GPCHK, - _reserved8: [u8; 0x30], + #[inline(always)] + pub const fn gpchk(&self) -> &GPCHK { + &self.gpchk + } #[doc = "0x50 - Extended Capture Mode Read"] - pub ecrd: ECRD, - _reserved9: [u8; 0x2c], + #[inline(always)] + pub const fn ecrd(&self) -> &ECRD { + &self.ecrd + } #[doc = "0x80 - Module Identification"] - pub midr: MIDR, + #[inline(always)] + pub const fn midr(&self) -> &MIDR { + &self.midr + } } -#[doc = "GCTRL (rw) register accessor: an alias for `Reg`"] +#[doc = "GCTRL (rw) register accessor: Global Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gctrl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gctrl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gctrl`] +module"] pub type GCTRL = crate::Reg; #[doc = "Global Control Register"] pub mod gctrl; -#[doc = "GSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "GSTAT (r) register accessor: Global Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gstat`] +module"] pub type GSTAT = crate::Reg; #[doc = "Global Status Register"] pub mod gstat; -#[doc = "GIDLS (w) register accessor: an alias for `Reg`"] +#[doc = "GIDLS (w) register accessor: Global Idle Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gidls::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gidls`] +module"] pub type GIDLS = crate::Reg; #[doc = "Global Idle Set"] pub mod gidls; -#[doc = "GIDLC (w) register accessor: an alias for `Reg`"] +#[doc = "GIDLC (w) register accessor: Global Idle Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gidlc::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gidlc`] +module"] pub type GIDLC = crate::Reg; #[doc = "Global Idle Clear"] pub mod gidlc; -#[doc = "GCSS (w) register accessor: an alias for `Reg`"] +#[doc = "GCSS (w) register accessor: Global Channel Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gcss::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gcss`] +module"] pub type GCSS = crate::Reg; #[doc = "Global Channel Set"] pub mod gcss; -#[doc = "GCSC (w) register accessor: an alias for `Reg`"] +#[doc = "GCSC (w) register accessor: Global Channel Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gcsc::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gcsc`] +module"] pub type GCSC = crate::Reg; #[doc = "Global Channel Clear"] pub mod gcsc; -#[doc = "GCST (r) register accessor: an alias for `Reg`"] +#[doc = "GCST (r) register accessor: Global Channel status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gcst::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gcst`] +module"] pub type GCST = crate::Reg; #[doc = "Global Channel status"] pub mod gcst; -#[doc = "GPCHK (rw) register accessor: an alias for `Reg`"] +#[doc = "GPCHK (rw) register accessor: Parity Checker Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gpchk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gpchk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gpchk`] +module"] pub type GPCHK = crate::Reg; #[doc = "Parity Checker Configuration"] pub mod gpchk; -#[doc = "ECRD (r) register accessor: an alias for `Reg`"] +#[doc = "ECRD (r) register accessor: Extended Capture Mode Read\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ecrd::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ecrd`] +module"] pub type ECRD = crate::Reg; #[doc = "Extended Capture Mode Read"] pub mod ecrd; -#[doc = "MIDR (r) register accessor: an alias for `Reg`"] +#[doc = "MIDR (r) register accessor: Module Identification\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`midr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@midr`] +module"] pub type MIDR = crate::Reg; #[doc = "Module Identification"] pub mod midr; diff --git a/src/ccu80/ecrd.rs b/src/ccu80/ecrd.rs index 50ed81ab..5ae72f7a 100644 --- a/src/ccu80/ecrd.rs +++ b/src/ccu80/ecrd.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPV` reader - Timer Capture Value"] -pub type CAPV_R = crate::FieldReader; +pub type CAPV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Capture value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `SPTR` reader - Slice pointer"] -pub type SPTR_R = crate::FieldReader; +pub type SPTR_R = crate::FieldReader; #[doc = "Slice pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -38,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SPTR_A { + type Ux = u8; +} impl SPTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SPTR_A { + pub const fn variant(&self) -> SPTR_A { match self.bits { 0 => SPTR_A::VALUE1, 1 => SPTR_A::VALUE2, @@ -50,29 +40,29 @@ impl SPTR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CC80"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SPTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CC81"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SPTR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CC82"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SPTR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CC83"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SPTR_A::VALUE4 } } #[doc = "Field `VPTR` reader - Capture register pointer"] -pub type VPTR_R = crate::FieldReader; +pub type VPTR_R = crate::FieldReader; #[doc = "Capture register pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -92,10 +82,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for VPTR_A { + type Ux = u8; +} impl VPTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VPTR_A { + pub const fn variant(&self) -> VPTR_A { match self.bits { 0 => VPTR_A::VALUE1, 1 => VPTR_A::VALUE2, @@ -104,22 +97,22 @@ impl VPTR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Capture register 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VPTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Capture register 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VPTR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Capture register 2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == VPTR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Capture register 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == VPTR_A::VALUE4 @@ -144,18 +137,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into this register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value has been captured into this register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -188,15 +181,13 @@ impl R { FFL_R::new(((self.bits >> 24) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Extended Capture Mode Read\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ecrd::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`ecrd::R`](R) reader structure"] +impl crate::Readable for ECRD_SPEC {} #[doc = "`reset()` method sets ECRD to value 0"] impl crate::Resettable for ECRD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80/gcsc.rs b/src/ccu80/gcsc.rs index 45c8bddd..3fe8e49d 100644 --- a/src/ccu80/gcsc.rs +++ b/src/ccu80/gcsc.rs @@ -1,200 +1,184 @@ #[doc = "Register `GCSC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `S0SC` writer - Slice 0 shadow transfer request clear"] -pub type S0SC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0SC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0DSC` writer - Slice 0 Dither shadow transfer clear"] -pub type S0DSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0DSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0PSC` writer - Slice 0 Prescaler shadow transfer clear"] -pub type S0PSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0PSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1SC` writer - Slice 1 shadow transfer clear"] -pub type S1SC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1SC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1DSC` writer - Slice 1 Dither shadow transfer clear"] -pub type S1DSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1DSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1PSC` writer - Slice 1 Prescaler shadow transfer clear"] -pub type S1PSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1PSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2SC` writer - Slice 2 shadow transfer clear"] -pub type S2SC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2SC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2DSC` writer - Slice 2 Dither shadow transfer clear"] -pub type S2DSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2DSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2PSC` writer - Slice 2 Prescaler shadow transfer clear"] -pub type S2PSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2PSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3SC` writer - Slice 3 shadow transfer clear"] -pub type S3SC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3SC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3DSC` writer - Slice 3 Dither shadow transfer clear"] -pub type S3DSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3DSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3PSC` writer - Slice 3 Prescaler shadow transfer clear"] -pub type S3PSC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3PSC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0ST1C` writer - Slice 0 status bit 1 clear"] -pub type S0ST1C_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0ST1C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1ST1C` writer - Slice 1 status bit 1 clear"] -pub type S1ST1C_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1ST1C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2ST1C` writer - Slice 2 status bit 1 clear"] -pub type S2ST1C_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2ST1C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3ST1C` writer - Slice 3 status bit 1 clear"] -pub type S3ST1C_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3ST1C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0ST2C` writer - Slice 0 status bit 2 clear"] -pub type S0ST2C_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S0ST2C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1ST2C` writer - Slice 1 status bit 2 clear"] -pub type S1ST2C_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S1ST2C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2ST2C` writer - Slice 2 status bit 2 clear"] -pub type S2ST2C_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S2ST2C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3ST2C` writer - Slice 3 status bit 2 clear"] -pub type S3ST2C_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSC_SPEC, bool, O>; +pub type S3ST2C_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Slice 0 shadow transfer request clear"] #[inline(always)] #[must_use] - pub fn s0sc(&mut self) -> S0SC_W<0> { - S0SC_W::new(self) + pub fn s0sc(&mut self) -> S0SC_W { + S0SC_W::new(self, 0) } #[doc = "Bit 1 - Slice 0 Dither shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s0dsc(&mut self) -> S0DSC_W<1> { - S0DSC_W::new(self) + pub fn s0dsc(&mut self) -> S0DSC_W { + S0DSC_W::new(self, 1) } #[doc = "Bit 2 - Slice 0 Prescaler shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s0psc(&mut self) -> S0PSC_W<2> { - S0PSC_W::new(self) + pub fn s0psc(&mut self) -> S0PSC_W { + S0PSC_W::new(self, 2) } #[doc = "Bit 4 - Slice 1 shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s1sc(&mut self) -> S1SC_W<4> { - S1SC_W::new(self) + pub fn s1sc(&mut self) -> S1SC_W { + S1SC_W::new(self, 4) } #[doc = "Bit 5 - Slice 1 Dither shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s1dsc(&mut self) -> S1DSC_W<5> { - S1DSC_W::new(self) + pub fn s1dsc(&mut self) -> S1DSC_W { + S1DSC_W::new(self, 5) } #[doc = "Bit 6 - Slice 1 Prescaler shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s1psc(&mut self) -> S1PSC_W<6> { - S1PSC_W::new(self) + pub fn s1psc(&mut self) -> S1PSC_W { + S1PSC_W::new(self, 6) } #[doc = "Bit 8 - Slice 2 shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s2sc(&mut self) -> S2SC_W<8> { - S2SC_W::new(self) + pub fn s2sc(&mut self) -> S2SC_W { + S2SC_W::new(self, 8) } #[doc = "Bit 9 - Slice 2 Dither shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s2dsc(&mut self) -> S2DSC_W<9> { - S2DSC_W::new(self) + pub fn s2dsc(&mut self) -> S2DSC_W { + S2DSC_W::new(self, 9) } #[doc = "Bit 10 - Slice 2 Prescaler shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s2psc(&mut self) -> S2PSC_W<10> { - S2PSC_W::new(self) + pub fn s2psc(&mut self) -> S2PSC_W { + S2PSC_W::new(self, 10) } #[doc = "Bit 12 - Slice 3 shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s3sc(&mut self) -> S3SC_W<12> { - S3SC_W::new(self) + pub fn s3sc(&mut self) -> S3SC_W { + S3SC_W::new(self, 12) } #[doc = "Bit 13 - Slice 3 Dither shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s3dsc(&mut self) -> S3DSC_W<13> { - S3DSC_W::new(self) + pub fn s3dsc(&mut self) -> S3DSC_W { + S3DSC_W::new(self, 13) } #[doc = "Bit 14 - Slice 3 Prescaler shadow transfer clear"] #[inline(always)] #[must_use] - pub fn s3psc(&mut self) -> S3PSC_W<14> { - S3PSC_W::new(self) + pub fn s3psc(&mut self) -> S3PSC_W { + S3PSC_W::new(self, 14) } #[doc = "Bit 16 - Slice 0 status bit 1 clear"] #[inline(always)] #[must_use] - pub fn s0st1c(&mut self) -> S0ST1C_W<16> { - S0ST1C_W::new(self) + pub fn s0st1c(&mut self) -> S0ST1C_W { + S0ST1C_W::new(self, 16) } #[doc = "Bit 17 - Slice 1 status bit 1 clear"] #[inline(always)] #[must_use] - pub fn s1st1c(&mut self) -> S1ST1C_W<17> { - S1ST1C_W::new(self) + pub fn s1st1c(&mut self) -> S1ST1C_W { + S1ST1C_W::new(self, 17) } #[doc = "Bit 18 - Slice 2 status bit 1 clear"] #[inline(always)] #[must_use] - pub fn s2st1c(&mut self) -> S2ST1C_W<18> { - S2ST1C_W::new(self) + pub fn s2st1c(&mut self) -> S2ST1C_W { + S2ST1C_W::new(self, 18) } #[doc = "Bit 19 - Slice 3 status bit 1 clear"] #[inline(always)] #[must_use] - pub fn s3st1c(&mut self) -> S3ST1C_W<19> { - S3ST1C_W::new(self) + pub fn s3st1c(&mut self) -> S3ST1C_W { + S3ST1C_W::new(self, 19) } #[doc = "Bit 20 - Slice 0 status bit 2 clear"] #[inline(always)] #[must_use] - pub fn s0st2c(&mut self) -> S0ST2C_W<20> { - S0ST2C_W::new(self) + pub fn s0st2c(&mut self) -> S0ST2C_W { + S0ST2C_W::new(self, 20) } #[doc = "Bit 21 - Slice 1 status bit 2 clear"] #[inline(always)] #[must_use] - pub fn s1st2c(&mut self) -> S1ST2C_W<21> { - S1ST2C_W::new(self) + pub fn s1st2c(&mut self) -> S1ST2C_W { + S1ST2C_W::new(self, 21) } #[doc = "Bit 22 - Slice 2 status bit 2 clear"] #[inline(always)] #[must_use] - pub fn s2st2c(&mut self) -> S2ST2C_W<22> { - S2ST2C_W::new(self) + pub fn s2st2c(&mut self) -> S2ST2C_W { + S2ST2C_W::new(self, 22) } #[doc = "Bit 23 - Slice 3 status bit 2 clear"] #[inline(always)] #[must_use] - pub fn s3st2c(&mut self) -> S3ST2C_W<23> { - S3ST2C_W::new(self) + pub fn s3st2c(&mut self) -> S3ST2C_W { + S3ST2C_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Channel Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gcsc::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GCSC_SPEC; impl crate::RegisterSpec for GCSC_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [gcsc::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`gcsc::W`](W) writer structure"] impl crate::Writable for GCSC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80/gcss.rs b/src/ccu80/gcss.rs index 24b63aec..16490bac 100644 --- a/src/ccu80/gcss.rs +++ b/src/ccu80/gcss.rs @@ -1,200 +1,184 @@ #[doc = "Register `GCSS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `S0SE` writer - Slice 0 shadow transfer set enable"] -pub type S0SE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0SE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0DSE` writer - Slice 0 Dither shadow transfer set enable"] -pub type S0DSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0DSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0PSE` writer - Slice 0 Prescaler shadow transfer set enable"] -pub type S0PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0PSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1SE` writer - Slice 1 shadow transfer set enable"] -pub type S1SE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1SE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1DSE` writer - Slice 1 Dither shadow transfer set enable"] -pub type S1DSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1DSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1PSE` writer - Slice 1 Prescaler shadow transfer set enable"] -pub type S1PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1PSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2SE` writer - Slice 2 shadow transfer set enable"] -pub type S2SE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2SE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2DSE` writer - Slice 2 Dither shadow transfer set enable"] -pub type S2DSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2DSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2PSE` writer - Slice 2 Prescaler shadow transfer set enable"] -pub type S2PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2PSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3SE` writer - Slice 3 shadow transfer set enable"] -pub type S3SE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3SE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3DSE` writer - Slice 3 Dither shadow transfer set enable"] -pub type S3DSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3DSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3PSE` writer - Slice 3 Prescaler shadow transfer set enable"] -pub type S3PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3PSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0ST1S` writer - Slice 0 status bit 1 set"] -pub type S0ST1S_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0ST1S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1ST1S` writer - Slice 1 status bit 1 set"] -pub type S1ST1S_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1ST1S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2ST1S` writer - Slice 2 status bit 1 set"] -pub type S2ST1S_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2ST1S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3ST1S` writer - Slice 3 status bit 1 set"] -pub type S3ST1S_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3ST1S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0ST2S` writer - Slice 0 status bit 2 set"] -pub type S0ST2S_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S0ST2S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1ST2S` writer - Slice 1 status bit 2 set"] -pub type S1ST2S_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S1ST2S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2ST2S` writer - Slice 2 status bit 2 set"] -pub type S2ST2S_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S2ST2S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S3ST2S` writer - Slice 3 status bit 2 set"] -pub type S3ST2S_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCSS_SPEC, bool, O>; +pub type S3ST2S_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Slice 0 shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s0se(&mut self) -> S0SE_W<0> { - S0SE_W::new(self) + pub fn s0se(&mut self) -> S0SE_W { + S0SE_W::new(self, 0) } #[doc = "Bit 1 - Slice 0 Dither shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s0dse(&mut self) -> S0DSE_W<1> { - S0DSE_W::new(self) + pub fn s0dse(&mut self) -> S0DSE_W { + S0DSE_W::new(self, 1) } #[doc = "Bit 2 - Slice 0 Prescaler shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s0pse(&mut self) -> S0PSE_W<2> { - S0PSE_W::new(self) + pub fn s0pse(&mut self) -> S0PSE_W { + S0PSE_W::new(self, 2) } #[doc = "Bit 4 - Slice 1 shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s1se(&mut self) -> S1SE_W<4> { - S1SE_W::new(self) + pub fn s1se(&mut self) -> S1SE_W { + S1SE_W::new(self, 4) } #[doc = "Bit 5 - Slice 1 Dither shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s1dse(&mut self) -> S1DSE_W<5> { - S1DSE_W::new(self) + pub fn s1dse(&mut self) -> S1DSE_W { + S1DSE_W::new(self, 5) } #[doc = "Bit 6 - Slice 1 Prescaler shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s1pse(&mut self) -> S1PSE_W<6> { - S1PSE_W::new(self) + pub fn s1pse(&mut self) -> S1PSE_W { + S1PSE_W::new(self, 6) } #[doc = "Bit 8 - Slice 2 shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s2se(&mut self) -> S2SE_W<8> { - S2SE_W::new(self) + pub fn s2se(&mut self) -> S2SE_W { + S2SE_W::new(self, 8) } #[doc = "Bit 9 - Slice 2 Dither shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s2dse(&mut self) -> S2DSE_W<9> { - S2DSE_W::new(self) + pub fn s2dse(&mut self) -> S2DSE_W { + S2DSE_W::new(self, 9) } #[doc = "Bit 10 - Slice 2 Prescaler shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s2pse(&mut self) -> S2PSE_W<10> { - S2PSE_W::new(self) + pub fn s2pse(&mut self) -> S2PSE_W { + S2PSE_W::new(self, 10) } #[doc = "Bit 12 - Slice 3 shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s3se(&mut self) -> S3SE_W<12> { - S3SE_W::new(self) + pub fn s3se(&mut self) -> S3SE_W { + S3SE_W::new(self, 12) } #[doc = "Bit 13 - Slice 3 Dither shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s3dse(&mut self) -> S3DSE_W<13> { - S3DSE_W::new(self) + pub fn s3dse(&mut self) -> S3DSE_W { + S3DSE_W::new(self, 13) } #[doc = "Bit 14 - Slice 3 Prescaler shadow transfer set enable"] #[inline(always)] #[must_use] - pub fn s3pse(&mut self) -> S3PSE_W<14> { - S3PSE_W::new(self) + pub fn s3pse(&mut self) -> S3PSE_W { + S3PSE_W::new(self, 14) } #[doc = "Bit 16 - Slice 0 status bit 1 set"] #[inline(always)] #[must_use] - pub fn s0st1s(&mut self) -> S0ST1S_W<16> { - S0ST1S_W::new(self) + pub fn s0st1s(&mut self) -> S0ST1S_W { + S0ST1S_W::new(self, 16) } #[doc = "Bit 17 - Slice 1 status bit 1 set"] #[inline(always)] #[must_use] - pub fn s1st1s(&mut self) -> S1ST1S_W<17> { - S1ST1S_W::new(self) + pub fn s1st1s(&mut self) -> S1ST1S_W { + S1ST1S_W::new(self, 17) } #[doc = "Bit 18 - Slice 2 status bit 1 set"] #[inline(always)] #[must_use] - pub fn s2st1s(&mut self) -> S2ST1S_W<18> { - S2ST1S_W::new(self) + pub fn s2st1s(&mut self) -> S2ST1S_W { + S2ST1S_W::new(self, 18) } #[doc = "Bit 19 - Slice 3 status bit 1 set"] #[inline(always)] #[must_use] - pub fn s3st1s(&mut self) -> S3ST1S_W<19> { - S3ST1S_W::new(self) + pub fn s3st1s(&mut self) -> S3ST1S_W { + S3ST1S_W::new(self, 19) } #[doc = "Bit 20 - Slice 0 status bit 2 set"] #[inline(always)] #[must_use] - pub fn s0st2s(&mut self) -> S0ST2S_W<20> { - S0ST2S_W::new(self) + pub fn s0st2s(&mut self) -> S0ST2S_W { + S0ST2S_W::new(self, 20) } #[doc = "Bit 21 - Slice 1 status bit 2 set"] #[inline(always)] #[must_use] - pub fn s1st2s(&mut self) -> S1ST2S_W<21> { - S1ST2S_W::new(self) + pub fn s1st2s(&mut self) -> S1ST2S_W { + S1ST2S_W::new(self, 21) } #[doc = "Bit 22 - Slice 2 status bit 2 set"] #[inline(always)] #[must_use] - pub fn s2st2s(&mut self) -> S2ST2S_W<22> { - S2ST2S_W::new(self) + pub fn s2st2s(&mut self) -> S2ST2S_W { + S2ST2S_W::new(self, 22) } #[doc = "Bit 23 - Slice 3 status bit 2 set"] #[inline(always)] #[must_use] - pub fn s3st2s(&mut self) -> S3ST2S_W<23> { - S3ST2S_W::new(self) + pub fn s3st2s(&mut self) -> S3ST2S_W { + S3ST2S_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Channel Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gcss::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GCSS_SPEC; impl crate::RegisterSpec for GCSS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [gcss::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`gcss::W`](W) writer structure"] impl crate::Writable for GCSS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80/gcst.rs b/src/ccu80/gcst.rs index 00af5d81..910aa452 100644 --- a/src/ccu80/gcst.rs +++ b/src/ccu80/gcst.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `S0SS` reader - Slice 0 shadow transfer status"] pub type S0SS_R = crate::BitReader; #[doc = "Slice 0 shadow transfer status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl S0SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0SS_A { + pub const fn variant(&self) -> S0SS_A { match self.bits { false => S0SS_A::VALUE1, true => S0SS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0SS_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl S0DSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0DSS_A { + pub const fn variant(&self) -> S0DSS_A { match self.bits { false => S0DSS_A::VALUE1, true => S0DSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0DSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0DSS_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl S0PSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0PSS_A { + pub const fn variant(&self) -> S0PSS_A { match self.bits { false => S0PSS_A::VALUE1, true => S0PSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0PSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0PSS_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl S1SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1SS_A { + pub const fn variant(&self) -> S1SS_A { match self.bits { false => S1SS_A::VALUE1, true => S1SS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1SS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl S1DSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1DSS_A { + pub const fn variant(&self) -> S1DSS_A { match self.bits { false => S1DSS_A::VALUE1, true => S1DSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1DSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1DSS_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl S1PSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1PSS_A { + pub const fn variant(&self) -> S1PSS_A { match self.bits { false => S1PSS_A::VALUE1, true => S1PSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1PSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1PSS_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl S2SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2SS_A { + pub const fn variant(&self) -> S2SS_A { match self.bits { false => S2SS_A::VALUE1, true => S2SS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2SS_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl S2DSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2DSS_A { + pub const fn variant(&self) -> S2DSS_A { match self.bits { false => S2DSS_A::VALUE1, true => S2DSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2DSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2DSS_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl S2PSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2PSS_A { + pub const fn variant(&self) -> S2PSS_A { match self.bits { false => S2PSS_A::VALUE1, true => S2PSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2PSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2PSS_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl S3SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3SS_A { + pub const fn variant(&self) -> S3SS_A { match self.bits { false => S3SS_A::VALUE1, true => S3SS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3SS_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl S3DSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3DSS_A { + pub const fn variant(&self) -> S3DSS_A { match self.bits { false => S3DSS_A::VALUE1, true => S3DSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3DSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3DSS_A::VALUE2 @@ -428,39 +415,39 @@ impl From for bool { impl S3PSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3PSS_A { + pub const fn variant(&self) -> S3PSS_A { match self.bits { false => S3PSS_A::VALUE1, true => S3PSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler shadow transfer has not been requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3PSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler shadow transfer has been requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3PSS_A::VALUE2 } } #[doc = "Field `CC80ST1` reader - Slice 0 compare channel 1 status bit"] -pub type CC80ST1_R = crate::BitReader; +pub type CC80ST1_R = crate::BitReader; #[doc = "Field `CC81ST1` reader - Slice 1 compare channel 1 status bit"] -pub type CC81ST1_R = crate::BitReader; +pub type CC81ST1_R = crate::BitReader; #[doc = "Field `CC82ST1` reader - Slice 2 compare channel 1 status bit"] -pub type CC82ST1_R = crate::BitReader; +pub type CC82ST1_R = crate::BitReader; #[doc = "Field `CC83ST1` reader - Slice 3 compare channel 1 status bit"] -pub type CC83ST1_R = crate::BitReader; +pub type CC83ST1_R = crate::BitReader; #[doc = "Field `CC80ST2` reader - Slice 0 compare channel 2 status bit"] -pub type CC80ST2_R = crate::BitReader; +pub type CC80ST2_R = crate::BitReader; #[doc = "Field `CC81ST2` reader - Slice 1 compare channel 2 status bit"] -pub type CC81ST2_R = crate::BitReader; +pub type CC81ST2_R = crate::BitReader; #[doc = "Field `CC82ST2` reader - Slice 2 compare channel 2 status bit"] -pub type CC82ST2_R = crate::BitReader; +pub type CC82ST2_R = crate::BitReader; #[doc = "Field `CC83ST2` reader - Slice 3 compare channel 2 status bit"] -pub type CC83ST2_R = crate::BitReader; +pub type CC83ST2_R = crate::BitReader; impl R { #[doc = "Bit 0 - Slice 0 shadow transfer status"] #[inline(always)] @@ -563,15 +550,13 @@ impl R { CC83ST2_R::new(((self.bits >> 23) & 1) != 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"] +#[doc = "Global Channel status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gcst::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`gcst::R`](R) reader structure"] +impl crate::Readable for GCST_SPEC {} #[doc = "`reset()` method sets GCST to value 0"] impl crate::Resettable for GCST_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80/gctrl.rs b/src/ccu80/gctrl.rs index 9ec58c7c..7f54039c 100644 --- a/src/ccu80/gctrl.rs +++ b/src/ccu80/gctrl.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRBC` reader - Prescaler Clear Configuration"] -pub type PRBC_R = crate::FieldReader; +pub type PRBC_R = crate::FieldReader; #[doc = "Prescaler Clear Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PRBC_A { + type Ux = u8; +} impl PRBC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PRBC_A::VALUE1), 1 => Some(PRBC_A::VALUE2), @@ -70,63 +41,67 @@ impl PRBC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "SW only"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRBC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC80 is cleared."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRBC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC81 is cleared."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PRBC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC82 is cleared."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PRBC_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC83 is cleared."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PRBC_A::VALUE5 } } #[doc = "Field `PRBC` writer - Prescaler Clear Configuration"] -pub type PRBC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GCTRL_SPEC, u8, PRBC_A, 3, O>; -impl<'a, const O: u8> PRBC_W<'a, O> { +pub type PRBC_W<'a, REG> = crate::FieldWriter<'a, REG, 3, PRBC_A>; +impl<'a, REG> PRBC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "SW only"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE1) } #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC80 is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE2) } #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC81 is cleared."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE3) } #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC82 is cleared."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE4) } #[doc = "GSTATThe register contains the status of the prescaler and each timer slice (idle mode or running)..PRB and prescaler registers are cleared when the Run Bit of CC83 is cleared."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PRBC_A::VALUE5) } } #[doc = "Field `PCIS` reader - Prescaler Input Clock Selection"] -pub type PCIS_R = crate::FieldReader; +pub type PCIS_R = crate::FieldReader; #[doc = "Prescaler Input Clock Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -146,10 +121,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PCIS_A { + type Ux = u8; +} impl PCIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCIS_A { + pub const fn variant(&self) -> PCIS_A { match self.bits { 0 => PCIS_A::VALUE1, 1 => PCIS_A::VALUE2, @@ -158,53 +136,57 @@ impl PCIS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Module clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU8x.ECLKA"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCIS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU8x.ECLKB"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PCIS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU8x.ECLKC"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PCIS_A::VALUE4 } } #[doc = "Field `PCIS` writer - Prescaler Input Clock Selection"] -pub type PCIS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GCTRL_SPEC, u8, PCIS_A, 2, O>; -impl<'a, const O: u8> PCIS_W<'a, O> { +pub type PCIS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PCIS_A>; +impl<'a, REG> PCIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Module clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PCIS_A::VALUE1) } #[doc = "CCU8x.ECLKA"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PCIS_A::VALUE2) } #[doc = "CCU8x.ECLKB"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PCIS_A::VALUE3) } #[doc = "CCU8x.ECLKC"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PCIS_A::VALUE4) } } #[doc = "Field `SUSCFG` reader - Suspend Mode Configuration"] -pub type SUSCFG_R = crate::FieldReader; +pub type SUSCFG_R = crate::FieldReader; #[doc = "Suspend Mode Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -224,10 +206,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SUSCFG_A { + type Ux = u8; +} impl SUSCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SUSCFG_A { + pub const fn variant(&self) -> SUSCFG_A { match self.bits { 0 => SUSCFG_A::VALUE1, 1 => SUSCFG_A::VALUE2, @@ -236,48 +221,52 @@ impl SUSCFG_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Suspend request ignored. The module never enters in suspend"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUSCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Stops all the running slices immediately. Safe stop is not applied."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUSCFG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Stops the block immediately and clamps all the outputs to PASSIVE state. Safe stop is applied."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SUSCFG_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Waits for the roll over of each slice to stop and clamp the slices outputs. Safe stop is applied."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SUSCFG_A::VALUE4 } } #[doc = "Field `SUSCFG` writer - Suspend Mode Configuration"] -pub type SUSCFG_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GCTRL_SPEC, u8, SUSCFG_A, 2, O>; -impl<'a, const O: u8> SUSCFG_W<'a, O> { +pub type SUSCFG_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SUSCFG_A>; +impl<'a, REG> SUSCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Suspend request ignored. The module never enters in suspend"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE1) } #[doc = "Stops all the running slices immediately. Safe stop is not applied."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE2) } #[doc = "Stops the block immediately and clamps all the outputs to PASSIVE state. Safe stop is applied."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE3) } #[doc = "Waits for the roll over of each slice to stop and clamp the slices outputs. Safe stop is applied."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE4) } } @@ -300,34 +289,37 @@ impl From for bool { impl MSE0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSE0_A { + pub const fn variant(&self) -> MSE0_A { match self.bits { false => MSE0_A::VALUE1, true => MSE0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSE0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer can be requested via SW and via the CCU8x.MCSS input."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSE0_A::VALUE2 } } #[doc = "Field `MSE0` writer - Slice 0 Multi Channel shadow transfer enable"] -pub type MSE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCTRL_SPEC, MSE0_A, O>; -impl<'a, const O: u8> MSE0_W<'a, O> { +pub type MSE0_W<'a, REG> = crate::BitWriter<'a, REG, MSE0_A>; +impl<'a, REG> MSE0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSE0_A::VALUE1) } #[doc = "Shadow transfer can be requested via SW and via the CCU8x.MCSS input."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSE0_A::VALUE2) } } @@ -350,34 +342,37 @@ impl From for bool { impl MSE1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSE1_A { + pub const fn variant(&self) -> MSE1_A { match self.bits { false => MSE1_A::VALUE1, true => MSE1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSE1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer can be requested via SW and via the CCU8x.MCSS input."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSE1_A::VALUE2 } } #[doc = "Field `MSE1` writer - Slice 1 Multi Channel shadow transfer enable"] -pub type MSE1_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCTRL_SPEC, MSE1_A, O>; -impl<'a, const O: u8> MSE1_W<'a, O> { +pub type MSE1_W<'a, REG> = crate::BitWriter<'a, REG, MSE1_A>; +impl<'a, REG> MSE1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSE1_A::VALUE1) } #[doc = "Shadow transfer can be requested via SW and via the CCU8x.MCSS input."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSE1_A::VALUE2) } } @@ -400,34 +395,37 @@ impl From for bool { impl MSE2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSE2_A { + pub const fn variant(&self) -> MSE2_A { match self.bits { false => MSE2_A::VALUE1, true => MSE2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSE2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer can be requested via SW and via the CCU8xMCSS input."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSE2_A::VALUE2 } } #[doc = "Field `MSE2` writer - Slice 2 Multi Channel shadow transfer enable"] -pub type MSE2_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCTRL_SPEC, MSE2_A, O>; -impl<'a, const O: u8> MSE2_W<'a, O> { +pub type MSE2_W<'a, REG> = crate::BitWriter<'a, REG, MSE2_A>; +impl<'a, REG> MSE2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSE2_A::VALUE1) } #[doc = "Shadow transfer can be requested via SW and via the CCU8xMCSS input."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSE2_A::VALUE2) } } @@ -450,39 +448,42 @@ impl From for bool { impl MSE3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSE3_A { + pub const fn variant(&self) -> MSE3_A { match self.bits { false => MSE3_A::VALUE1, true => MSE3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSE3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer can be requested via SW and via the CCU8x.MCSS input."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSE3_A::VALUE2 } } #[doc = "Field `MSE3` writer - Slice 3 Multi Channel shadow transfer enable"] -pub type MSE3_W<'a, const O: u8> = crate::BitWriter<'a, u32, GCTRL_SPEC, MSE3_A, O>; -impl<'a, const O: u8> MSE3_W<'a, O> { +pub type MSE3_W<'a, REG> = crate::BitWriter<'a, REG, MSE3_A>; +impl<'a, REG> MSE3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer can only be requested by SW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSE3_A::VALUE1) } #[doc = "Shadow transfer can be requested via SW and via the CCU8x.MCSS input."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSE3_A::VALUE2) } } #[doc = "Field `MSDE` reader - Multi Channel shadow transfer request configuration"] -pub type MSDE_R = crate::FieldReader; +pub type MSDE_R = crate::FieldReader; #[doc = "Multi Channel shadow transfer request configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -500,10 +501,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MSDE_A { + type Ux = u8; +} impl MSDE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(MSDE_A::VALUE1), 1 => Some(MSDE_A::VALUE2), @@ -511,38 +515,42 @@ impl MSDE_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Only the shadow transfer for period and compare values is requested"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSDE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer for the compare, period and prescaler compare values is requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSDE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Shadow transfer for the compare, period, prescaler and dither compare values is requested"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MSDE_A::VALUE4 } } #[doc = "Field `MSDE` writer - Multi Channel shadow transfer request configuration"] -pub type MSDE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GCTRL_SPEC, u8, MSDE_A, 2, O>; -impl<'a, const O: u8> MSDE_W<'a, O> { +pub type MSDE_W<'a, REG> = crate::FieldWriter<'a, REG, 2, MSDE_A>; +impl<'a, REG> MSDE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Only the shadow transfer for period and compare values is requested"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSDE_A::VALUE1) } #[doc = "Shadow transfer for the compare, period and prescaler compare values is requested"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSDE_A::VALUE2) } #[doc = "Shadow transfer for the compare, period, prescaler and dither compare values is requested"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MSDE_A::VALUE4) } } @@ -592,70 +600,71 @@ impl W { #[doc = "Bits 0:2 - Prescaler Clear Configuration"] #[inline(always)] #[must_use] - pub fn prbc(&mut self) -> PRBC_W<0> { - PRBC_W::new(self) + pub fn prbc(&mut self) -> PRBC_W { + PRBC_W::new(self, 0) } #[doc = "Bits 4:5 - Prescaler Input Clock Selection"] #[inline(always)] #[must_use] - pub fn pcis(&mut self) -> PCIS_W<4> { - PCIS_W::new(self) + pub fn pcis(&mut self) -> PCIS_W { + PCIS_W::new(self, 4) } #[doc = "Bits 8:9 - Suspend Mode Configuration"] #[inline(always)] #[must_use] - pub fn suscfg(&mut self) -> SUSCFG_W<8> { - SUSCFG_W::new(self) + pub fn suscfg(&mut self) -> SUSCFG_W { + SUSCFG_W::new(self, 8) } #[doc = "Bit 10 - Slice 0 Multi Channel shadow transfer enable"] #[inline(always)] #[must_use] - pub fn mse0(&mut self) -> MSE0_W<10> { - MSE0_W::new(self) + pub fn mse0(&mut self) -> MSE0_W { + MSE0_W::new(self, 10) } #[doc = "Bit 11 - Slice 1 Multi Channel shadow transfer enable"] #[inline(always)] #[must_use] - pub fn mse1(&mut self) -> MSE1_W<11> { - MSE1_W::new(self) + pub fn mse1(&mut self) -> MSE1_W { + MSE1_W::new(self, 11) } #[doc = "Bit 12 - Slice 2 Multi Channel shadow transfer enable"] #[inline(always)] #[must_use] - pub fn mse2(&mut self) -> MSE2_W<12> { - MSE2_W::new(self) + pub fn mse2(&mut self) -> MSE2_W { + MSE2_W::new(self, 12) } #[doc = "Bit 13 - Slice 3 Multi Channel shadow transfer enable"] #[inline(always)] #[must_use] - pub fn mse3(&mut self) -> MSE3_W<13> { - MSE3_W::new(self) + pub fn mse3(&mut self) -> MSE3_W { + MSE3_W::new(self, 13) } #[doc = "Bits 14:15 - Multi Channel shadow transfer request configuration"] #[inline(always)] #[must_use] - pub fn msde(&mut self) -> MSDE_W<14> { - MSDE_W::new(self) + pub fn msde(&mut self) -> MSDE_W { + MSDE_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gctrl::R`](R) reader structure"] +impl crate::Readable for GCTRL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gctrl::W`](W) writer structure"] impl crate::Writable for GCTRL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80/gidlc.rs b/src/ccu80/gidlc.rs index 7cee6c9c..0f916b5b 100644 --- a/src/ccu80/gidlc.rs +++ b/src/ccu80/gidlc.rs @@ -1,88 +1,72 @@ #[doc = "Register `GIDLC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CS0I` writer - CC80 IDLE mode clear"] -pub type CS0I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type CS0I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CS1I` writer - CC81 IDLE mode clear"] -pub type CS1I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type CS1I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CS2I` writer - CC82 IDLE mode clear"] -pub type CS2I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type CS2I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CS3I` writer - CC83 IDLE mode clear"] -pub type CS3I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type CS3I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SPRB` writer - Prescaler Run Bit Set"] -pub type SPRB_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type SPRB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SPCH` writer - Parity Checker run bit set"] -pub type SPCH_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLC_SPEC, bool, O>; +pub type SPCH_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - CC80 IDLE mode clear"] #[inline(always)] #[must_use] - pub fn cs0i(&mut self) -> CS0I_W<0> { - CS0I_W::new(self) + pub fn cs0i(&mut self) -> CS0I_W { + CS0I_W::new(self, 0) } #[doc = "Bit 1 - CC81 IDLE mode clear"] #[inline(always)] #[must_use] - pub fn cs1i(&mut self) -> CS1I_W<1> { - CS1I_W::new(self) + pub fn cs1i(&mut self) -> CS1I_W { + CS1I_W::new(self, 1) } #[doc = "Bit 2 - CC82 IDLE mode clear"] #[inline(always)] #[must_use] - pub fn cs2i(&mut self) -> CS2I_W<2> { - CS2I_W::new(self) + pub fn cs2i(&mut self) -> CS2I_W { + CS2I_W::new(self, 2) } #[doc = "Bit 3 - CC83 IDLE mode clear"] #[inline(always)] #[must_use] - pub fn cs3i(&mut self) -> CS3I_W<3> { - CS3I_W::new(self) + pub fn cs3i(&mut self) -> CS3I_W { + CS3I_W::new(self, 3) } #[doc = "Bit 8 - Prescaler Run Bit Set"] #[inline(always)] #[must_use] - pub fn sprb(&mut self) -> SPRB_W<8> { - SPRB_W::new(self) + pub fn sprb(&mut self) -> SPRB_W { + SPRB_W::new(self, 8) } #[doc = "Bit 10 - Parity Checker run bit set"] #[inline(always)] #[must_use] - pub fn spch(&mut self) -> SPCH_W<10> { - SPCH_W::new(self) + pub fn spch(&mut self) -> SPCH_W { + SPCH_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Idle Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gidlc::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GIDLC_SPEC; impl crate::RegisterSpec for GIDLC_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [gidlc::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`gidlc::W`](W) writer structure"] impl crate::Writable for GIDLC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80/gidls.rs b/src/ccu80/gidls.rs index c2ed83f3..73f2fda6 100644 --- a/src/ccu80/gidls.rs +++ b/src/ccu80/gidls.rs @@ -1,96 +1,80 @@ #[doc = "Register `GIDLS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SS0I` writer - CC80 IDLE mode set"] -pub type SS0I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type SS0I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SS1I` writer - CC81 IDLE mode set"] -pub type SS1I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type SS1I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SS2I` writer - CC82 IDLE mode set"] -pub type SS2I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type SS2I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SS3I` writer - CC83 IDLE mode set"] -pub type SS3I_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type SS3I_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CPRB` writer - Prescaler# Run Bit Clear"] -pub type CPRB_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type CPRB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PSIC` writer - Prescaler clear"] -pub type PSIC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type PSIC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CPCH` writer - Parity Checker Run bit clear"] -pub type CPCH_W<'a, const O: u8> = crate::BitWriter<'a, u32, GIDLS_SPEC, bool, O>; +pub type CPCH_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - CC80 IDLE mode set"] #[inline(always)] #[must_use] - pub fn ss0i(&mut self) -> SS0I_W<0> { - SS0I_W::new(self) + pub fn ss0i(&mut self) -> SS0I_W { + SS0I_W::new(self, 0) } #[doc = "Bit 1 - CC81 IDLE mode set"] #[inline(always)] #[must_use] - pub fn ss1i(&mut self) -> SS1I_W<1> { - SS1I_W::new(self) + pub fn ss1i(&mut self) -> SS1I_W { + SS1I_W::new(self, 1) } #[doc = "Bit 2 - CC82 IDLE mode set"] #[inline(always)] #[must_use] - pub fn ss2i(&mut self) -> SS2I_W<2> { - SS2I_W::new(self) + pub fn ss2i(&mut self) -> SS2I_W { + SS2I_W::new(self, 2) } #[doc = "Bit 3 - CC83 IDLE mode set"] #[inline(always)] #[must_use] - pub fn ss3i(&mut self) -> SS3I_W<3> { - SS3I_W::new(self) + pub fn ss3i(&mut self) -> SS3I_W { + SS3I_W::new(self, 3) } #[doc = "Bit 8 - Prescaler# Run Bit Clear"] #[inline(always)] #[must_use] - pub fn cprb(&mut self) -> CPRB_W<8> { - CPRB_W::new(self) + pub fn cprb(&mut self) -> CPRB_W { + CPRB_W::new(self, 8) } #[doc = "Bit 9 - Prescaler clear"] #[inline(always)] #[must_use] - pub fn psic(&mut self) -> PSIC_W<9> { - PSIC_W::new(self) + pub fn psic(&mut self) -> PSIC_W { + PSIC_W::new(self, 9) } #[doc = "Bit 10 - Parity Checker Run bit clear"] #[inline(always)] #[must_use] - pub fn cpch(&mut self) -> CPCH_W<10> { - CPCH_W::new(self) + pub fn cpch(&mut self) -> CPCH_W { + CPCH_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Idle Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gidls::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GIDLS_SPEC; impl crate::RegisterSpec for GIDLS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [gidls::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`gidls::W`](W) writer structure"] impl crate::Writable for GIDLS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80/gpchk.rs b/src/ccu80/gpchk.rs index 2a1b7552..5971f0c3 100644 --- a/src/ccu80/gpchk.rs +++ b/src/ccu80/gpchk.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PASE` reader - Parity Checker Automatic start/stop"] -pub type PASE_R = crate::BitReader; +pub type PASE_R = crate::BitReader; #[doc = "Field `PASE` writer - Parity Checker Automatic start/stop"] -pub type PASE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPCHK_SPEC, bool, O>; +pub type PASE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PACS` reader - Parity Checker Automatic start/stop selector"] -pub type PACS_R = crate::FieldReader; +pub type PACS_R = crate::FieldReader; #[doc = "Parity Checker Automatic start/stop selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PACS_A { + type Ux = u8; +} impl PACS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PACS_A { + pub const fn variant(&self) -> PACS_A { match self.bits { 0 => PACS_A::VALUE1, 1 => PACS_A::VALUE2, @@ -71,53 +42,57 @@ impl PACS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CC80"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PACS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CC81"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PACS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CC82"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PACS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CC83"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PACS_A::VALUE4 } } #[doc = "Field `PACS` writer - Parity Checker Automatic start/stop selector"] -pub type PACS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GPCHK_SPEC, u8, PACS_A, 2, O>; -impl<'a, const O: u8> PACS_W<'a, O> { +pub type PACS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PACS_A>; +impl<'a, REG> PACS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CC80"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PACS_A::VALUE1) } #[doc = "CC81"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PACS_A::VALUE2) } #[doc = "CC82"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PACS_A::VALUE3) } #[doc = "CC83"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PACS_A::VALUE4) } } #[doc = "Field `PISEL` reader - Driver Input signal selector"] -pub type PISEL_R = crate::FieldReader; +pub type PISEL_R = crate::FieldReader; #[doc = "Driver Input signal selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -137,10 +112,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PISEL_A { + type Ux = u8; +} impl PISEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PISEL_A { + pub const fn variant(&self) -> PISEL_A { match self.bits { 0 => PISEL_A::VALUE1, 1 => PISEL_A::VALUE2, @@ -149,53 +127,57 @@ impl PISEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CC8x.GP01 - driver output is connected to event 1 of slice 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PISEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CC8x.GP11 - drive output is connected to event 1 of slice 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PISEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CC8x.GP21 - driver output is connected to event 1 of slice 2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PISEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CC8x.GP31 - driver output is connected to event 1 of slice 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PISEL_A::VALUE4 } } #[doc = "Field `PISEL` writer - Driver Input signal selector"] -pub type PISEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GPCHK_SPEC, u8, PISEL_A, 2, O>; -impl<'a, const O: u8> PISEL_W<'a, O> { +pub type PISEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PISEL_A>; +impl<'a, REG> PISEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CC8x.GP01 - driver output is connected to event 1 of slice 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PISEL_A::VALUE1) } #[doc = "CC8x.GP11 - drive output is connected to event 1 of slice 1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PISEL_A::VALUE2) } #[doc = "CC8x.GP21 - driver output is connected to event 1 of slice 2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PISEL_A::VALUE3) } #[doc = "CC8x.GP31 - driver output is connected to event 1 of slice 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PISEL_A::VALUE4) } } #[doc = "Field `PCDS` reader - Parity Checker Delay Input Selector"] -pub type PCDS_R = crate::FieldReader; +pub type PCDS_R = crate::FieldReader; #[doc = "Parity Checker Delay Input Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -215,10 +197,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PCDS_A { + type Ux = u8; +} impl PCDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCDS_A { + pub const fn variant(&self) -> PCDS_A { match self.bits { 0 => PCDS_A::VALUE1, 1 => PCDS_A::VALUE2, @@ -227,48 +212,52 @@ impl PCDS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CCU8x.IGBTA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU8x.IGBTB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCDS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU8x.IGBTC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PCDS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU8x.IGBTD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PCDS_A::VALUE4 } } #[doc = "Field `PCDS` writer - Parity Checker Delay Input Selector"] -pub type PCDS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GPCHK_SPEC, u8, PCDS_A, 2, O>; -impl<'a, const O: u8> PCDS_W<'a, O> { +pub type PCDS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PCDS_A>; +impl<'a, REG> PCDS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CCU8x.IGBTA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PCDS_A::VALUE1) } #[doc = "CCU8x.IGBTB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PCDS_A::VALUE2) } #[doc = "CCU8x.IGBTC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PCDS_A::VALUE3) } #[doc = "CCU8x.IGBTD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PCDS_A::VALUE4) } } @@ -291,55 +280,58 @@ impl From for bool { impl PCTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCTS_A { + pub const fn variant(&self) -> PCTS_A { match self.bits { false => PCTS_A::VALUE1, true => PCTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Even parity enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Odd parity enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCTS_A::VALUE2 } } #[doc = "Field `PCTS` writer - Parity Checker type selector"] -pub type PCTS_W<'a, const O: u8> = crate::BitWriter<'a, u32, GPCHK_SPEC, PCTS_A, O>; -impl<'a, const O: u8> PCTS_W<'a, O> { +pub type PCTS_W<'a, REG> = crate::BitWriter<'a, REG, PCTS_A>; +impl<'a, REG> PCTS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Even parity enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PCTS_A::VALUE1) } #[doc = "Odd parity enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PCTS_A::VALUE2) } } #[doc = "Field `PCST` reader - Parity Checker XOR status"] -pub type PCST_R = crate::BitReader; +pub type PCST_R = crate::BitReader; #[doc = "Field `PCSEL0` reader - Parity Checker Slice 0 output selection"] -pub type PCSEL0_R = crate::FieldReader; +pub type PCSEL0_R = crate::FieldReader; #[doc = "Field `PCSEL0` writer - Parity Checker Slice 0 output selection"] -pub type PCSEL0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GPCHK_SPEC, u8, u8, 4, O>; +pub type PCSEL0_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `PCSEL1` reader - Parity Checker Slice 1 output selection"] -pub type PCSEL1_R = crate::FieldReader; +pub type PCSEL1_R = crate::FieldReader; #[doc = "Field `PCSEL1` writer - Parity Checker Slice 1 output selection"] -pub type PCSEL1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GPCHK_SPEC, u8, u8, 4, O>; +pub type PCSEL1_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `PCSEL2` reader - Parity Checker Slice 2 output selection"] -pub type PCSEL2_R = crate::FieldReader; +pub type PCSEL2_R = crate::FieldReader; #[doc = "Field `PCSEL2` writer - Parity Checker Slice 2 output selection"] -pub type PCSEL2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GPCHK_SPEC, u8, u8, 4, O>; +pub type PCSEL2_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `PCSEL3` reader - Parity Checker Slice 3 output selection"] -pub type PCSEL3_R = crate::FieldReader; +pub type PCSEL3_R = crate::FieldReader; #[doc = "Field `PCSEL3` writer - Parity Checker Slice 3 output selection"] -pub type PCSEL3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GPCHK_SPEC, u8, u8, 4, O>; +pub type PCSEL3_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bit 0 - Parity Checker Automatic start/stop"] #[inline(always)] @@ -396,76 +388,77 @@ impl W { #[doc = "Bit 0 - Parity Checker Automatic start/stop"] #[inline(always)] #[must_use] - pub fn pase(&mut self) -> PASE_W<0> { - PASE_W::new(self) + pub fn pase(&mut self) -> PASE_W { + PASE_W::new(self, 0) } #[doc = "Bits 1:2 - Parity Checker Automatic start/stop selector"] #[inline(always)] #[must_use] - pub fn pacs(&mut self) -> PACS_W<1> { - PACS_W::new(self) + pub fn pacs(&mut self) -> PACS_W { + PACS_W::new(self, 1) } #[doc = "Bits 3:4 - Driver Input signal selector"] #[inline(always)] #[must_use] - pub fn pisel(&mut self) -> PISEL_W<3> { - PISEL_W::new(self) + pub fn pisel(&mut self) -> PISEL_W { + PISEL_W::new(self, 3) } #[doc = "Bits 5:6 - Parity Checker Delay Input Selector"] #[inline(always)] #[must_use] - pub fn pcds(&mut self) -> PCDS_W<5> { - PCDS_W::new(self) + pub fn pcds(&mut self) -> PCDS_W { + PCDS_W::new(self, 5) } #[doc = "Bit 7 - Parity Checker type selector"] #[inline(always)] #[must_use] - pub fn pcts(&mut self) -> PCTS_W<7> { - PCTS_W::new(self) + pub fn pcts(&mut self) -> PCTS_W { + PCTS_W::new(self, 7) } #[doc = "Bits 16:19 - Parity Checker Slice 0 output selection"] #[inline(always)] #[must_use] - pub fn pcsel0(&mut self) -> PCSEL0_W<16> { - PCSEL0_W::new(self) + pub fn pcsel0(&mut self) -> PCSEL0_W { + PCSEL0_W::new(self, 16) } #[doc = "Bits 20:23 - Parity Checker Slice 1 output selection"] #[inline(always)] #[must_use] - pub fn pcsel1(&mut self) -> PCSEL1_W<20> { - PCSEL1_W::new(self) + pub fn pcsel1(&mut self) -> PCSEL1_W { + PCSEL1_W::new(self, 20) } #[doc = "Bits 24:27 - Parity Checker Slice 2 output selection"] #[inline(always)] #[must_use] - pub fn pcsel2(&mut self) -> PCSEL2_W<24> { - PCSEL2_W::new(self) + pub fn pcsel2(&mut self) -> PCSEL2_W { + PCSEL2_W::new(self, 24) } #[doc = "Bits 28:31 - Parity Checker Slice 3 output selection"] #[inline(always)] #[must_use] - pub fn pcsel3(&mut self) -> PCSEL3_W<28> { - PCSEL3_W::new(self) + pub fn pcsel3(&mut self) -> PCSEL3_W { + PCSEL3_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Parity Checker Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gpchk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gpchk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gpchk::R`](R) reader structure"] +impl crate::Readable for GPCHK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gpchk::W`](W) writer structure"] impl crate::Writable for GPCHK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80/gstat.rs b/src/ccu80/gstat.rs index dd72f522..630fb5c1 100644 --- a/src/ccu80/gstat.rs +++ b/src/ccu80/gstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `S0I` reader - CC80 IDLE status"] pub type S0I_R = crate::BitReader; #[doc = "CC80 IDLE status\n\nValue on reset: 1"] @@ -32,18 +19,18 @@ impl From for bool { impl S0I_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0I_A { + pub const fn variant(&self) -> S0I_A { match self.bits { false => S0I_A::VALUE1, true => S0I_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Running"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0I_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Idle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0I_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl S1I_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1I_A { + pub const fn variant(&self) -> S1I_A { match self.bits { false => S1I_A::VALUE1, true => S1I_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Running"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1I_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Idle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1I_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl S2I_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2I_A { + pub const fn variant(&self) -> S2I_A { match self.bits { false => S2I_A::VALUE1, true => S2I_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Running"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2I_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Idle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2I_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl S3I_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3I_A { + pub const fn variant(&self) -> S3I_A { match self.bits { false => S3I_A::VALUE1, true => S3I_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Running"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3I_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Idle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3I_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl PRB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRB_A { + pub const fn variant(&self) -> PRB_A { match self.bits { false => PRB_A::VALUE1, true => PRB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler is stopped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRB_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PCRB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCRB_A { + pub const fn variant(&self) -> PCRB_A { match self.bits { false => PCRB_A::VALUE1, true => PCRB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Parity Checker is stopped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCRB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity Checker is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCRB_A::VALUE2 @@ -261,15 +248,13 @@ impl R { PCRB_R::new(((self.bits >> 10) & 1) != 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"] +#[doc = "Global Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`gstat::R`](R) reader structure"] +impl crate::Readable for GSTAT_SPEC {} #[doc = "`reset()` method sets GSTAT to value 0x0f"] impl crate::Resettable for GSTAT_SPEC { const RESET_VALUE: Self::Ux = 0x0f; diff --git a/src/ccu80/midr.rs b/src/ccu80/midr.rs index 0d459b8a..cb849160 100644 --- a/src/ccu80/midr.rs +++ b/src/ccu80/midr.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MODR` reader - Module Revision"] -pub type MODR_R = crate::FieldReader; +pub type MODR_R = crate::FieldReader; #[doc = "Field `MODT` reader - Module Type"] -pub type MODT_R = crate::FieldReader; +pub type MODT_R = crate::FieldReader; #[doc = "Field `MODN` reader - Module Number"] -pub type MODN_R = crate::FieldReader; +pub type MODN_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`midr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`midr::R`](R) reader structure"] +impl crate::Readable for MIDR_SPEC {} #[doc = "`reset()` method sets MIDR to value 0x00a7_c000"] impl crate::Resettable for MIDR_SPEC { const RESET_VALUE: Self::Ux = 0x00a7_c000; diff --git a/src/ccu80_cc80.rs b/src/ccu80_cc80.rs index fa3f8b9f..9d95bfd2 100644 --- a/src/ccu80_cc80.rs +++ b/src/ccu80_cc80.rs @@ -1,204 +1,371 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + ins: INS, + cmc: CMC, + tcst: TCST, + tcset: TCSET, + tcclr: TCCLR, + tc: TC, + psl: PSL, + dit: DIT, + dits: DITS, + psc: PSC, + fpc: FPC, + fpcs: FPCS, + pr: PR, + prs: PRS, + cr1: CR1, + cr1s: CR1S, + cr2: CR2, + cr2s: CR2S, + chc: CHC, + dtc: DTC, + dc1r: DC1R, + dc2r: DC2R, + _reserved22: [u8; 0x18], + timer: TIMER, + c0v: C0V, + c1v: C1V, + c2v: C2V, + c3v: C3V, + _reserved27: [u8; 0x1c], + ints: INTS, + inte: INTE, + srs: SRS, + sws: SWS, + swr: SWR, + stc: STC, +} +impl RegisterBlock { #[doc = "0x00 - Input Selector Configuration"] - pub ins: INS, + #[inline(always)] + pub const fn ins(&self) -> &INS { + &self.ins + } #[doc = "0x04 - Connection Matrix Control"] - pub cmc: CMC, + #[inline(always)] + pub const fn cmc(&self) -> &CMC { + &self.cmc + } #[doc = "0x08 - Slice Timer Status"] - pub tcst: TCST, + #[inline(always)] + pub const fn tcst(&self) -> &TCST { + &self.tcst + } #[doc = "0x0c - Slice Timer Run Set"] - pub tcset: TCSET, + #[inline(always)] + pub const fn tcset(&self) -> &TCSET { + &self.tcset + } #[doc = "0x10 - Slice Timer Clear"] - pub tcclr: TCCLR, + #[inline(always)] + pub const fn tcclr(&self) -> &TCCLR { + &self.tcclr + } #[doc = "0x14 - Slice Timer Control"] - pub tc: TC, + #[inline(always)] + pub const fn tc(&self) -> &TC { + &self.tc + } #[doc = "0x18 - Passive Level Config"] - pub psl: PSL, + #[inline(always)] + pub const fn psl(&self) -> &PSL { + &self.psl + } #[doc = "0x1c - Dither Config"] - pub dit: DIT, + #[inline(always)] + pub const fn dit(&self) -> &DIT { + &self.dit + } #[doc = "0x20 - Dither Shadow Register"] - pub dits: DITS, + #[inline(always)] + pub const fn dits(&self) -> &DITS { + &self.dits + } #[doc = "0x24 - Prescaler Control"] - pub psc: PSC, + #[inline(always)] + pub const fn psc(&self) -> &PSC { + &self.psc + } #[doc = "0x28 - Floating Prescaler Control"] - pub fpc: FPC, + #[inline(always)] + pub const fn fpc(&self) -> &FPC { + &self.fpc + } #[doc = "0x2c - Floating Prescaler Shadow"] - pub fpcs: FPCS, + #[inline(always)] + pub const fn fpcs(&self) -> &FPCS { + &self.fpcs + } #[doc = "0x30 - Timer Period Value"] - pub pr: PR, + #[inline(always)] + pub const fn pr(&self) -> &PR { + &self.pr + } #[doc = "0x34 - Timer Shadow Period Value"] - pub prs: PRS, + #[inline(always)] + pub const fn prs(&self) -> &PRS { + &self.prs + } #[doc = "0x38 - Channel 1 Compare Value"] - pub cr1: CR1, + #[inline(always)] + pub const fn cr1(&self) -> &CR1 { + &self.cr1 + } #[doc = "0x3c - Channel 1 Compare Shadow Value"] - pub cr1s: CR1S, + #[inline(always)] + pub const fn cr1s(&self) -> &CR1S { + &self.cr1s + } #[doc = "0x40 - Channel 2 Compare Value"] - pub cr2: CR2, + #[inline(always)] + pub const fn cr2(&self) -> &CR2 { + &self.cr2 + } #[doc = "0x44 - Channel 2 Compare Shadow Value"] - pub cr2s: CR2S, + #[inline(always)] + pub const fn cr2s(&self) -> &CR2S { + &self.cr2s + } #[doc = "0x48 - Channel Control"] - pub chc: CHC, + #[inline(always)] + pub const fn chc(&self) -> &CHC { + &self.chc + } #[doc = "0x4c - Dead Time Control"] - pub dtc: DTC, + #[inline(always)] + pub const fn dtc(&self) -> &DTC { + &self.dtc + } #[doc = "0x50 - Channel 1 Dead Time Values"] - pub dc1r: DC1R, + #[inline(always)] + pub const fn dc1r(&self) -> &DC1R { + &self.dc1r + } #[doc = "0x54 - Channel 2 Dead Time Values"] - pub dc2r: DC2R, - _reserved22: [u8; 0x18], + #[inline(always)] + pub const fn dc2r(&self) -> &DC2R { + &self.dc2r + } #[doc = "0x70 - Timer Value"] - pub timer: TIMER, + #[inline(always)] + pub const fn timer(&self) -> &TIMER { + &self.timer + } #[doc = "0x74 - Capture Register 0"] - pub c0v: C0V, + #[inline(always)] + pub const fn c0v(&self) -> &C0V { + &self.c0v + } #[doc = "0x78 - Capture Register 1"] - pub c1v: C1V, + #[inline(always)] + pub const fn c1v(&self) -> &C1V { + &self.c1v + } #[doc = "0x7c - Capture Register 2"] - pub c2v: C2V, + #[inline(always)] + pub const fn c2v(&self) -> &C2V { + &self.c2v + } #[doc = "0x80 - Capture Register 3"] - pub c3v: C3V, - _reserved27: [u8; 0x1c], + #[inline(always)] + pub const fn c3v(&self) -> &C3V { + &self.c3v + } #[doc = "0xa0 - Interrupt Status"] - pub ints: INTS, + #[inline(always)] + pub const fn ints(&self) -> &INTS { + &self.ints + } #[doc = "0xa4 - Interrupt Enable Control"] - pub inte: INTE, + #[inline(always)] + pub const fn inte(&self) -> &INTE { + &self.inte + } #[doc = "0xa8 - Service Request Selector"] - pub srs: SRS, + #[inline(always)] + pub const fn srs(&self) -> &SRS { + &self.srs + } #[doc = "0xac - Interrupt Status Set"] - pub sws: SWS, + #[inline(always)] + pub const fn sws(&self) -> &SWS { + &self.sws + } #[doc = "0xb0 - Interrupt Status Clear"] - pub swr: SWR, + #[inline(always)] + pub const fn swr(&self) -> &SWR { + &self.swr + } #[doc = "0xb4 - Shadow transfer control"] - pub stc: STC, + #[inline(always)] + pub const fn stc(&self) -> &STC { + &self.stc + } } -#[doc = "INS (rw) register accessor: an alias for `Reg`"] +#[doc = "INS (rw) register accessor: Input Selector Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ins::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ins::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ins`] +module"] pub type INS = crate::Reg; #[doc = "Input Selector Configuration"] pub mod ins; -#[doc = "CMC (rw) register accessor: an alias for `Reg`"] +#[doc = "CMC (rw) register accessor: Connection Matrix Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cmc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cmc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cmc`] +module"] pub type CMC = crate::Reg; #[doc = "Connection Matrix Control"] pub mod cmc; -#[doc = "TCST (r) register accessor: an alias for `Reg`"] +#[doc = "TCST (r) register accessor: Slice Timer Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tcst::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tcst`] +module"] pub type TCST = crate::Reg; #[doc = "Slice Timer Status"] pub mod tcst; -#[doc = "TCSET (w) register accessor: an alias for `Reg`"] +#[doc = "TCSET (w) register accessor: Slice Timer Run Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tcset`] +module"] pub type TCSET = crate::Reg; #[doc = "Slice Timer Run Set"] pub mod tcset; -#[doc = "TCCLR (w) register accessor: an alias for `Reg`"] +#[doc = "TCCLR (w) register accessor: Slice Timer Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tcclr`] +module"] pub type TCCLR = crate::Reg; #[doc = "Slice Timer Clear"] pub mod tcclr; -#[doc = "TC (rw) register accessor: an alias for `Reg`"] +#[doc = "TC (rw) register accessor: Slice Timer Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tc`] +module"] pub type TC = crate::Reg; #[doc = "Slice Timer Control"] pub mod tc; -#[doc = "PSL (rw) register accessor: an alias for `Reg`"] +#[doc = "PSL (rw) register accessor: Passive Level Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psl`] +module"] pub type PSL = crate::Reg; #[doc = "Passive Level Config"] pub mod psl; -#[doc = "DIT (r) register accessor: an alias for `Reg`"] +#[doc = "DIT (r) register accessor: Dither Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dit::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dit`] +module"] pub type DIT = crate::Reg; #[doc = "Dither Config"] pub mod dit; -#[doc = "DITS (rw) register accessor: an alias for `Reg`"] +#[doc = "DITS (rw) register accessor: Dither Shadow Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dits::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dits::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dits`] +module"] pub type DITS = crate::Reg; #[doc = "Dither Shadow Register"] pub mod dits; -#[doc = "PSC (rw) register accessor: an alias for `Reg`"] +#[doc = "PSC (rw) register accessor: Prescaler Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psc`] +module"] pub type PSC = crate::Reg; #[doc = "Prescaler Control"] pub mod psc; -#[doc = "FPC (rw) register accessor: an alias for `Reg`"] +#[doc = "FPC (rw) register accessor: Floating Prescaler Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fpc`] +module"] pub type FPC = crate::Reg; #[doc = "Floating Prescaler Control"] pub mod fpc; -#[doc = "FPCS (rw) register accessor: an alias for `Reg`"] +#[doc = "FPCS (rw) register accessor: Floating Prescaler Shadow\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpcs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpcs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fpcs`] +module"] pub type FPCS = crate::Reg; #[doc = "Floating Prescaler Shadow"] pub mod fpcs; -#[doc = "PR (r) register accessor: an alias for `Reg`"] +#[doc = "PR (r) register accessor: Timer Period Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pr`] +module"] pub type PR = crate::Reg; #[doc = "Timer Period Value"] pub mod pr; -#[doc = "PRS (rw) register accessor: an alias for `Reg`"] +#[doc = "PRS (rw) register accessor: Timer Shadow Period Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prs`] +module"] pub type PRS = crate::Reg; #[doc = "Timer Shadow Period Value"] pub mod prs; -#[doc = "CR1 (r) register accessor: an alias for `Reg`"] +#[doc = "CR1 (r) register accessor: Channel 1 Compare Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr1`] +module"] pub type CR1 = crate::Reg; #[doc = "Channel 1 Compare Value"] pub mod cr1; -#[doc = "CR1S (rw) register accessor: an alias for `Reg`"] +#[doc = "CR1S (rw) register accessor: Channel 1 Compare Shadow Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr1s::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cr1s::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr1s`] +module"] pub type CR1S = crate::Reg; #[doc = "Channel 1 Compare Shadow Value"] pub mod cr1s; -#[doc = "CR2 (r) register accessor: an alias for `Reg`"] +#[doc = "CR2 (r) register accessor: Channel 2 Compare Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr2::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr2`] +module"] pub type CR2 = crate::Reg; #[doc = "Channel 2 Compare Value"] pub mod cr2; -#[doc = "CR2S (rw) register accessor: an alias for `Reg`"] +#[doc = "CR2S (rw) register accessor: Channel 2 Compare Shadow Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr2s::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cr2s::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr2s`] +module"] pub type CR2S = crate::Reg; #[doc = "Channel 2 Compare Shadow Value"] pub mod cr2s; -#[doc = "CHC (rw) register accessor: an alias for `Reg`"] +#[doc = "CHC (rw) register accessor: Channel Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@chc`] +module"] pub type CHC = crate::Reg; #[doc = "Channel Control"] pub mod chc; -#[doc = "DTC (rw) register accessor: an alias for `Reg`"] +#[doc = "DTC (rw) register accessor: Dead Time Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dtc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dtc`] +module"] pub type DTC = crate::Reg; #[doc = "Dead Time Control"] pub mod dtc; -#[doc = "DC1R (rw) register accessor: an alias for `Reg`"] +#[doc = "DC1R (rw) register accessor: Channel 1 Dead Time Values\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dc1r::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dc1r::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dc1r`] +module"] pub type DC1R = crate::Reg; #[doc = "Channel 1 Dead Time Values"] pub mod dc1r; -#[doc = "DC2R (rw) register accessor: an alias for `Reg`"] +#[doc = "DC2R (rw) register accessor: Channel 2 Dead Time Values\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dc2r::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dc2r::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dc2r`] +module"] pub type DC2R = crate::Reg; #[doc = "Channel 2 Dead Time Values"] pub mod dc2r; -#[doc = "TIMER (rw) register accessor: an alias for `Reg`"] +#[doc = "TIMER (rw) register accessor: Timer Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timer::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`timer::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@timer`] +module"] pub type TIMER = crate::Reg; #[doc = "Timer Value"] pub mod timer; -#[doc = "C0V (r) register accessor: an alias for `Reg`"] +#[doc = "C0V (r) register accessor: Capture Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c0v::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@c0v`] +module"] pub type C0V = crate::Reg; #[doc = "Capture Register 0"] pub mod c0v; -#[doc = "C1V (r) register accessor: an alias for `Reg`"] +#[doc = "C1V (r) register accessor: Capture Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c1v::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@c1v`] +module"] pub type C1V = crate::Reg; #[doc = "Capture Register 1"] pub mod c1v; -#[doc = "C2V (r) register accessor: an alias for `Reg`"] +#[doc = "C2V (r) register accessor: Capture Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c2v::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@c2v`] +module"] pub type C2V = crate::Reg; #[doc = "Capture Register 2"] pub mod c2v; -#[doc = "C3V (r) register accessor: an alias for `Reg`"] +#[doc = "C3V (r) register accessor: Capture Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c3v::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@c3v`] +module"] pub type C3V = crate::Reg; #[doc = "Capture Register 3"] pub mod c3v; -#[doc = "INTS (r) register accessor: an alias for `Reg`"] +#[doc = "INTS (r) register accessor: Interrupt Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ints::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ints`] +module"] pub type INTS = crate::Reg; #[doc = "Interrupt Status"] pub mod ints; -#[doc = "INTE (rw) register accessor: an alias for `Reg`"] +#[doc = "INTE (rw) register accessor: Interrupt Enable Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`inte::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`inte::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@inte`] +module"] pub type INTE = crate::Reg; #[doc = "Interrupt Enable Control"] pub mod inte; -#[doc = "SRS (rw) register accessor: an alias for `Reg`"] +#[doc = "SRS (rw) register accessor: Service Request Selector\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srs`] +module"] pub type SRS = crate::Reg; #[doc = "Service Request Selector"] pub mod srs; -#[doc = "SWS (w) register accessor: an alias for `Reg`"] +#[doc = "SWS (w) register accessor: Interrupt Status Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sws::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sws`] +module"] pub type SWS = crate::Reg; #[doc = "Interrupt Status Set"] pub mod sws; -#[doc = "SWR (w) register accessor: an alias for `Reg`"] +#[doc = "SWR (w) register accessor: Interrupt Status Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`swr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@swr`] +module"] pub type SWR = crate::Reg; #[doc = "Interrupt Status Clear"] pub mod swr; -#[doc = "STC (rw) register accessor: an alias for `Reg`"] +#[doc = "STC (rw) register accessor: Shadow transfer control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`stc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`stc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@stc`] +module"] 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 7c499e16..036d5409 100644 --- a/src/ccu80_cc80/c0v.rs +++ b/src/ccu80_cc80/c0v.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPTV` reader - Capture Value"] -pub type CAPTV_R = crate::FieldReader; +pub type CAPTV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `FFL` reader - Full Flag"] pub type FFL_R = crate::BitReader; #[doc = "Full Flag\n\nValue on reset: 0"] @@ -36,18 +23,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into the specific capture register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value was captured into the specific register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -70,15 +57,13 @@ impl R { FFL_R::new(((self.bits >> 20) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Capture Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c0v::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`c0v::R`](R) reader structure"] +impl crate::Readable for C0V_SPEC {} #[doc = "`reset()` method sets C0V to value 0"] impl crate::Resettable for C0V_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/c1v.rs b/src/ccu80_cc80/c1v.rs index 18de5afb..913cd147 100644 --- a/src/ccu80_cc80/c1v.rs +++ b/src/ccu80_cc80/c1v.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPTV` reader - Capture Value"] -pub type CAPTV_R = crate::FieldReader; +pub type CAPTV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `FFL` reader - Full Flag"] pub type FFL_R = crate::BitReader; #[doc = "Full Flag\n\nValue on reset: 0"] @@ -36,18 +23,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into the specific capture register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value was captured into the specific register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -70,15 +57,13 @@ impl R { FFL_R::new(((self.bits >> 20) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Capture Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c1v::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`c1v::R`](R) reader structure"] +impl crate::Readable for C1V_SPEC {} #[doc = "`reset()` method sets C1V to value 0"] impl crate::Resettable for C1V_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/c2v.rs b/src/ccu80_cc80/c2v.rs index 3a66ac3d..4bd8e5f5 100644 --- a/src/ccu80_cc80/c2v.rs +++ b/src/ccu80_cc80/c2v.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPTV` reader - Capture Value"] -pub type CAPTV_R = crate::FieldReader; +pub type CAPTV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `FFL` reader - Full Flag"] pub type FFL_R = crate::BitReader; #[doc = "Full Flag\n\nValue on reset: 0"] @@ -36,18 +23,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into the specific capture register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value was captured into the specific register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -70,15 +57,13 @@ impl R { FFL_R::new(((self.bits >> 20) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Capture Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c2v::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`c2v::R`](R) reader structure"] +impl crate::Readable for C2V_SPEC {} #[doc = "`reset()` method sets C2V to value 0"] impl crate::Resettable for C2V_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/c3v.rs b/src/ccu80_cc80/c3v.rs index f5ecdfc8..b30c41b3 100644 --- a/src/ccu80_cc80/c3v.rs +++ b/src/ccu80_cc80/c3v.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CAPTV` reader - Capture Value"] -pub type CAPTV_R = crate::FieldReader; +pub type CAPTV_R = crate::FieldReader; #[doc = "Field `FPCV` reader - Prescaler Value"] -pub type FPCV_R = crate::FieldReader; +pub type FPCV_R = crate::FieldReader; #[doc = "Field `FFL` reader - Full Flag"] pub type FFL_R = crate::BitReader; #[doc = "Full Flag\n\nValue on reset: 0"] @@ -36,18 +23,18 @@ impl From for bool { impl FFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFL_A { + pub const fn variant(&self) -> FFL_A { match self.bits { false => FFL_A::VALUE1, true => FFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new value was captured into the specific capture register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new value was captured into the specific register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFL_A::VALUE2 @@ -70,15 +57,13 @@ impl R { FFL_R::new(((self.bits >> 20) & 1) != 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Capture Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`c3v::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`c3v::R`](R) reader structure"] +impl crate::Readable for C3V_SPEC {} #[doc = "`reset()` method sets C3V to value 0"] impl crate::Resettable for C3V_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/chc.rs b/src/ccu80_cc80/chc.rs index f399c79e..cf686bda 100644 --- a/src/ccu80_cc80/chc.rs +++ b/src/ccu80_cc80/chc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ASE` reader - Asymmetric PWM mode Enable"] pub type ASE_R = crate::BitReader; #[doc = "Asymmetric PWM mode Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl ASE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASE_A { + pub const fn variant(&self) -> ASE_A { match self.bits { false => ASE_A::VALUE1, true => ASE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Asymmetric PWM is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Asymmetric PWM is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASE_A::VALUE2 } } #[doc = "Field `ASE` writer - Asymmetric PWM mode Enable"] -pub type ASE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHC_SPEC, ASE_A, O>; -impl<'a, const O: u8> ASE_W<'a, O> { +pub type ASE_W<'a, REG> = crate::BitWriter<'a, REG, ASE_A>; +impl<'a, REG> ASE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Asymmetric PWM is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASE_A::VALUE1) } #[doc = "Asymmetric PWM is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASE_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl OCS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OCS1_A { + pub const fn variant(&self) -> OCS1_A { match self.bits { false => OCS1_A::VALUE1, true => OCS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OCS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OCS1_A::VALUE2 } } #[doc = "Field `OCS1` writer - Output selector for CCU8x.OUTy0"] -pub type OCS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHC_SPEC, OCS1_A, O>; -impl<'a, const O: u8> OCS1_W<'a, O> { +pub type OCS1_W<'a, REG> = crate::BitWriter<'a, REG, OCS1_A>; +impl<'a, REG> OCS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OCS1_A::VALUE1) } #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OCS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl OCS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OCS2_A { + pub const fn variant(&self) -> OCS2_A { match self.bits { false => OCS2_A::VALUE1, true => OCS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OCS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OCS2_A::VALUE2 } } #[doc = "Field `OCS2` writer - Output selector for CCU8x.OUTy1"] -pub type OCS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHC_SPEC, OCS2_A, O>; -impl<'a, const O: u8> OCS2_W<'a, O> { +pub type OCS2_W<'a, REG> = crate::BitWriter<'a, REG, OCS2_A>; +impl<'a, REG> OCS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Inverted CC8yST1 signal path is connected to the CCU8x.OUTy1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OCS2_A::VALUE1) } #[doc = "CC8yST1 signal path is connected to the CCU8x.OUTy1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OCS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl OCS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OCS3_A { + pub const fn variant(&self) -> OCS3_A { match self.bits { false => OCS3_A::VALUE1, true => OCS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy2"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OCS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Inverted CCST2 signal path is connected to the CCU8x.OUTy2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OCS3_A::VALUE2 } } #[doc = "Field `OCS3` writer - Output selector for CCU8x.OUTy2"] -pub type OCS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHC_SPEC, OCS3_A, O>; -impl<'a, const O: u8> OCS3_W<'a, O> { +pub type OCS3_W<'a, REG> = crate::BitWriter<'a, REG, OCS3_A>; +impl<'a, REG> OCS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy2"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OCS3_A::VALUE1) } #[doc = "Inverted CCST2 signal path is connected to the CCU8x.OUTy2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OCS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl OCS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OCS4_A { + pub const fn variant(&self) -> OCS4_A { match self.bits { false => OCS4_A::VALUE1, true => OCS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Inverted CC8yST2 signal path is connected to the CCU8x.OUTy3"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OCS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy3"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OCS4_A::VALUE2 } } #[doc = "Field `OCS4` writer - Output selector for CCU8x.OUTy3"] -pub type OCS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHC_SPEC, OCS4_A, O>; -impl<'a, const O: u8> OCS4_W<'a, O> { +pub type OCS4_W<'a, REG> = crate::BitWriter<'a, REG, OCS4_A>; +impl<'a, REG> OCS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Inverted CC8yST2 signal path is connected to the CCU8x.OUTy3"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OCS4_A::VALUE1) } #[doc = "CC8yST2 signal path is connected to the CCU8x.OUTy3"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OCS4_A::VALUE2) } } @@ -315,52 +298,53 @@ impl W { #[doc = "Bit 0 - Asymmetric PWM mode Enable"] #[inline(always)] #[must_use] - pub fn ase(&mut self) -> ASE_W<0> { - ASE_W::new(self) + pub fn ase(&mut self) -> ASE_W { + ASE_W::new(self, 0) } #[doc = "Bit 1 - Output selector for CCU8x.OUTy0"] #[inline(always)] #[must_use] - pub fn ocs1(&mut self) -> OCS1_W<1> { - OCS1_W::new(self) + pub fn ocs1(&mut self) -> OCS1_W { + OCS1_W::new(self, 1) } #[doc = "Bit 2 - Output selector for CCU8x.OUTy1"] #[inline(always)] #[must_use] - pub fn ocs2(&mut self) -> OCS2_W<2> { - OCS2_W::new(self) + pub fn ocs2(&mut self) -> OCS2_W { + OCS2_W::new(self, 2) } #[doc = "Bit 3 - Output selector for CCU8x.OUTy2"] #[inline(always)] #[must_use] - pub fn ocs3(&mut self) -> OCS3_W<3> { - OCS3_W::new(self) + pub fn ocs3(&mut self) -> OCS3_W { + OCS3_W::new(self, 3) } #[doc = "Bit 4 - Output selector for CCU8x.OUTy3"] #[inline(always)] #[must_use] - pub fn ocs4(&mut self) -> OCS4_W<4> { - OCS4_W::new(self) + pub fn ocs4(&mut self) -> OCS4_W { + OCS4_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`chc::R`](R) reader structure"] +impl crate::Readable for CHC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`chc::W`](W) writer structure"] impl crate::Writable for CHC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/cmc.rs b/src/ccu80_cc80/cmc.rs index 29261abf..36d4acae 100644 --- a/src/ccu80_cc80/cmc.rs +++ b/src/ccu80_cc80/cmc.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `STRTS` reader - External Start Functionality Selector"] -pub type STRTS_R = crate::FieldReader; +pub type STRTS_R = crate::FieldReader; #[doc = "External Start Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STRTS_A { + type Ux = u8; +} impl STRTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STRTS_A { + pub const fn variant(&self) -> STRTS_A { match self.bits { 0 => STRTS_A::VALUE1, 1 => STRTS_A::VALUE2, @@ -67,53 +38,57 @@ impl STRTS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Start Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STRTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Start Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STRTS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Start Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STRTS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Start Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STRTS_A::VALUE4 } } #[doc = "Field `STRTS` writer - External Start Functionality Selector"] -pub type STRTS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, STRTS_A, 2, O>; -impl<'a, const O: u8> STRTS_W<'a, O> { +pub type STRTS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, STRTS_A>; +impl<'a, REG> STRTS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Start Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STRTS_A::VALUE1) } #[doc = "External Start Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STRTS_A::VALUE2) } #[doc = "External Start Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STRTS_A::VALUE3) } #[doc = "External Start Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STRTS_A::VALUE4) } } #[doc = "Field `ENDS` reader - External Stop Functionality Selector"] -pub type ENDS_R = crate::FieldReader; +pub type ENDS_R = crate::FieldReader; #[doc = "External Stop Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ENDS_A { + type Ux = u8; +} impl ENDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENDS_A { + pub const fn variant(&self) -> ENDS_A { match self.bits { 0 => ENDS_A::VALUE1, 1 => ENDS_A::VALUE2, @@ -145,53 +123,57 @@ impl ENDS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Stop Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Stop Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENDS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Stop Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ENDS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Stop Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ENDS_A::VALUE4 } } #[doc = "Field `ENDS` writer - External Stop Functionality Selector"] -pub type ENDS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, ENDS_A, 2, O>; -impl<'a, const O: u8> ENDS_W<'a, O> { +pub type ENDS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ENDS_A>; +impl<'a, REG> ENDS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Stop Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENDS_A::VALUE1) } #[doc = "External Stop Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENDS_A::VALUE2) } #[doc = "External Stop Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ENDS_A::VALUE3) } #[doc = "External Stop Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ENDS_A::VALUE4) } } #[doc = "Field `CAP0S` reader - External Capture 0 Functionality Selector"] -pub type CAP0S_R = crate::FieldReader; +pub type CAP0S_R = crate::FieldReader; #[doc = "External Capture 0 Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CAP0S_A { + type Ux = u8; +} impl CAP0S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CAP0S_A { + pub const fn variant(&self) -> CAP0S_A { match self.bits { 0 => CAP0S_A::VALUE1, 1 => CAP0S_A::VALUE2, @@ -223,53 +208,57 @@ impl CAP0S_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Capture 0 Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CAP0S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Capture 0 Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CAP0S_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Capture 0 Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CAP0S_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Capture 0 Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CAP0S_A::VALUE4 } } #[doc = "Field `CAP0S` writer - External Capture 0 Functionality Selector"] -pub type CAP0S_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, CAP0S_A, 2, O>; -impl<'a, const O: u8> CAP0S_W<'a, O> { +pub type CAP0S_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CAP0S_A>; +impl<'a, REG> CAP0S_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Capture 0 Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CAP0S_A::VALUE1) } #[doc = "External Capture 0 Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CAP0S_A::VALUE2) } #[doc = "External Capture 0 Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CAP0S_A::VALUE3) } #[doc = "External Capture 0 Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CAP0S_A::VALUE4) } } #[doc = "Field `CAP1S` reader - External Capture 1 Functionality Selector"] -pub type CAP1S_R = crate::FieldReader; +pub type CAP1S_R = crate::FieldReader; #[doc = "External Capture 1 Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CAP1S_A { + type Ux = u8; +} impl CAP1S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CAP1S_A { + pub const fn variant(&self) -> CAP1S_A { match self.bits { 0 => CAP1S_A::VALUE1, 1 => CAP1S_A::VALUE2, @@ -301,53 +293,57 @@ impl CAP1S_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Capture 1 Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CAP1S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Capture 1 Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CAP1S_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Capture 1 Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CAP1S_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Capture 1 Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CAP1S_A::VALUE4 } } #[doc = "Field `CAP1S` writer - External Capture 1 Functionality Selector"] -pub type CAP1S_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, CAP1S_A, 2, O>; -impl<'a, const O: u8> CAP1S_W<'a, O> { +pub type CAP1S_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CAP1S_A>; +impl<'a, REG> CAP1S_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Capture 1 Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CAP1S_A::VALUE1) } #[doc = "External Capture 1 Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CAP1S_A::VALUE2) } #[doc = "External Capture 1 Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CAP1S_A::VALUE3) } #[doc = "External Capture 1 Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CAP1S_A::VALUE4) } } #[doc = "Field `GATES` reader - External Gate Functionality Selector"] -pub type GATES_R = crate::FieldReader; +pub type GATES_R = crate::FieldReader; #[doc = "External Gate Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for GATES_A { + type Ux = u8; +} impl GATES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GATES_A { + pub const fn variant(&self) -> GATES_A { match self.bits { 0 => GATES_A::VALUE1, 1 => GATES_A::VALUE2, @@ -379,53 +378,57 @@ impl GATES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Gating Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GATES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Gating Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GATES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Gating Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == GATES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Gating Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == GATES_A::VALUE4 } } #[doc = "Field `GATES` writer - External Gate Functionality Selector"] -pub type GATES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, GATES_A, 2, O>; -impl<'a, const O: u8> GATES_W<'a, O> { +pub type GATES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, GATES_A>; +impl<'a, REG> GATES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Gating Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GATES_A::VALUE1) } #[doc = "External Gating Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GATES_A::VALUE2) } #[doc = "External Gating Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(GATES_A::VALUE3) } #[doc = "External Gating Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(GATES_A::VALUE4) } } #[doc = "Field `UDS` reader - External Up/Down Functionality Selector"] -pub type UDS_R = crate::FieldReader; +pub type UDS_R = crate::FieldReader; #[doc = "External Up/Down Functionality Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for UDS_A { + type Ux = u8; +} impl UDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UDS_A { + pub const fn variant(&self) -> UDS_A { match self.bits { 0 => UDS_A::VALUE1, 1 => UDS_A::VALUE2, @@ -457,57 +463,61 @@ impl UDS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Up/Down Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Up/Down Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UDS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Up/Down Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == UDS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Up/Down Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == UDS_A::VALUE4 } } #[doc = "Field `UDS` writer - External Up/Down Functionality Selector"] -pub type UDS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, UDS_A, 2, O>; -impl<'a, const O: u8> UDS_W<'a, O> { +pub type UDS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, UDS_A>; +impl<'a, REG> UDS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Up/Down Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UDS_A::VALUE1) } #[doc = "External Up/Down Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UDS_A::VALUE2) } #[doc = "External Up/Down Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(UDS_A::VALUE3) } #[doc = "External Up/Down Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(UDS_A::VALUE4) } } #[doc = "Field `LDS` reader - External Timer Load Functionality Selector"] -pub type LDS_R = crate::FieldReader; +pub type LDS_R = crate::FieldReader; #[doc = "Field `LDS` writer - External Timer Load Functionality Selector"] -pub type LDS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMC_SPEC, u8, u8, 2, O>; +pub type LDS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `CNTS` reader - External Count Selector"] -pub type CNTS_R = crate::FieldReader; +pub type CNTS_R = crate::FieldReader; #[doc = "External Count Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -527,10 +537,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CNTS_A { + type Ux = u8; +} impl CNTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CNTS_A { + pub const fn variant(&self) -> CNTS_A { match self.bits { 0 => CNTS_A::VALUE1, 1 => CNTS_A::VALUE2, @@ -539,48 +552,52 @@ impl CNTS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Count Function deactivated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CNTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Count Function triggered by Event 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CNTS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Count Function triggered by Event 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CNTS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Count Function triggered by Event 2"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CNTS_A::VALUE4 } } #[doc = "Field `CNTS` writer - External Count Selector"] -pub type CNTS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CMC_SPEC, u8, CNTS_A, 2, O>; -impl<'a, const O: u8> CNTS_W<'a, O> { +pub type CNTS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CNTS_A>; +impl<'a, REG> CNTS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Count Function deactivated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CNTS_A::VALUE1) } #[doc = "External Count Function triggered by Event 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CNTS_A::VALUE2) } #[doc = "External Count Function triggered by Event 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CNTS_A::VALUE3) } #[doc = "External Count Function triggered by Event 2"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CNTS_A::VALUE4) } } @@ -603,34 +620,37 @@ impl From for bool { impl OFS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OFS_A { + pub const fn variant(&self) -> OFS_A { match self.bits { false => OFS_A::VALUE1, true => OFS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Override functionality disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OFS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Status bit trigger override connected to Event 1; Status bit value override connected to Event 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OFS_A::VALUE2 } } #[doc = "Field `OFS` writer - Override Function Selector"] -pub type OFS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMC_SPEC, OFS_A, O>; -impl<'a, const O: u8> OFS_W<'a, O> { +pub type OFS_W<'a, REG> = crate::BitWriter<'a, REG, OFS_A>; +impl<'a, REG> OFS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Override functionality disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OFS_A::VALUE1) } #[doc = "Status bit trigger override connected to Event 1; Status bit value override connected to Event 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OFS_A::VALUE2) } } @@ -653,41 +673,44 @@ impl From for bool { impl TS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TS_A { + pub const fn variant(&self) -> TS_A { match self.bits { false => TS_A::VALUE1, true => TS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap function disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TRAP function connected to Event 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TS_A::VALUE2 } } #[doc = "Field `TS` writer - Trap Function Selector"] -pub type TS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMC_SPEC, TS_A, O>; -impl<'a, const O: u8> TS_W<'a, O> { +pub type TS_W<'a, REG> = crate::BitWriter<'a, REG, TS_A>; +impl<'a, REG> TS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap function disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TS_A::VALUE1) } #[doc = "TRAP function connected to Event 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TS_A::VALUE2) } } #[doc = "Field `MOS` reader - External Modulation Functionality Selector"] -pub type MOS_R = crate::FieldReader; +pub type MOS_R = crate::FieldReader; #[doc = "Field `MOS` writer - External Modulation Functionality Selector"] -pub type MOS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMC_SPEC, u8, u8, 2, O>; +pub type MOS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `TCE` reader - Timer Concatenation Enable"] pub type TCE_R = crate::BitReader; #[doc = "Timer Concatenation Enable\n\nValue on reset: 0"] @@ -707,34 +730,37 @@ impl From for bool { impl TCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TCE_A { + pub const fn variant(&self) -> TCE_A { match self.bits { false => TCE_A::VALUE1, true => TCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer concatenation is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer concatenation is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TCE_A::VALUE2 } } #[doc = "Field `TCE` writer - Timer Concatenation Enable"] -pub type TCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CMC_SPEC, TCE_A, O>; -impl<'a, const O: u8> TCE_W<'a, O> { +pub type TCE_W<'a, REG> = crate::BitWriter<'a, REG, TCE_A>; +impl<'a, REG> TCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Timer concatenation is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TCE_A::VALUE1) } #[doc = "Timer concatenation is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TCE_A::VALUE2) } } @@ -804,94 +830,95 @@ impl W { #[doc = "Bits 0:1 - External Start Functionality Selector"] #[inline(always)] #[must_use] - pub fn strts(&mut self) -> STRTS_W<0> { - STRTS_W::new(self) + pub fn strts(&mut self) -> STRTS_W { + STRTS_W::new(self, 0) } #[doc = "Bits 2:3 - External Stop Functionality Selector"] #[inline(always)] #[must_use] - pub fn ends(&mut self) -> ENDS_W<2> { - ENDS_W::new(self) + pub fn ends(&mut self) -> ENDS_W { + ENDS_W::new(self, 2) } #[doc = "Bits 4:5 - External Capture 0 Functionality Selector"] #[inline(always)] #[must_use] - pub fn cap0s(&mut self) -> CAP0S_W<4> { - CAP0S_W::new(self) + pub fn cap0s(&mut self) -> CAP0S_W { + CAP0S_W::new(self, 4) } #[doc = "Bits 6:7 - External Capture 1 Functionality Selector"] #[inline(always)] #[must_use] - pub fn cap1s(&mut self) -> CAP1S_W<6> { - CAP1S_W::new(self) + pub fn cap1s(&mut self) -> CAP1S_W { + CAP1S_W::new(self, 6) } #[doc = "Bits 8:9 - External Gate Functionality Selector"] #[inline(always)] #[must_use] - pub fn gates(&mut self) -> GATES_W<8> { - GATES_W::new(self) + pub fn gates(&mut self) -> GATES_W { + GATES_W::new(self, 8) } #[doc = "Bits 10:11 - External Up/Down Functionality Selector"] #[inline(always)] #[must_use] - pub fn uds(&mut self) -> UDS_W<10> { - UDS_W::new(self) + pub fn uds(&mut self) -> UDS_W { + UDS_W::new(self, 10) } #[doc = "Bits 12:13 - External Timer Load Functionality Selector"] #[inline(always)] #[must_use] - pub fn lds(&mut self) -> LDS_W<12> { - LDS_W::new(self) + pub fn lds(&mut self) -> LDS_W { + LDS_W::new(self, 12) } #[doc = "Bits 14:15 - External Count Selector"] #[inline(always)] #[must_use] - pub fn cnts(&mut self) -> CNTS_W<14> { - CNTS_W::new(self) + pub fn cnts(&mut self) -> CNTS_W { + CNTS_W::new(self, 14) } #[doc = "Bit 16 - Override Function Selector"] #[inline(always)] #[must_use] - pub fn ofs(&mut self) -> OFS_W<16> { - OFS_W::new(self) + pub fn ofs(&mut self) -> OFS_W { + OFS_W::new(self, 16) } #[doc = "Bit 17 - Trap Function Selector"] #[inline(always)] #[must_use] - pub fn ts(&mut self) -> TS_W<17> { - TS_W::new(self) + pub fn ts(&mut self) -> TS_W { + TS_W::new(self, 17) } #[doc = "Bits 18:19 - External Modulation Functionality Selector"] #[inline(always)] #[must_use] - pub fn mos(&mut self) -> MOS_W<18> { - MOS_W::new(self) + pub fn mos(&mut self) -> MOS_W { + MOS_W::new(self, 18) } #[doc = "Bit 20 - Timer Concatenation Enable"] #[inline(always)] #[must_use] - pub fn tce(&mut self) -> TCE_W<20> { - TCE_W::new(self) + pub fn tce(&mut self) -> TCE_W { + TCE_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Connection Matrix Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cmc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cmc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cmc::R`](R) reader structure"] +impl crate::Readable for CMC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cmc::W`](W) writer structure"] impl crate::Writable for CMC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/cr1.rs b/src/ccu80_cc80/cr1.rs index f44eee57..59eb5813 100644 --- a/src/ccu80_cc80/cr1.rs +++ b/src/ccu80_cc80/cr1.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CR1` reader - Compare Register for Channel 1"] -pub type CR1_R = crate::FieldReader; +pub type CR1_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Compare Register for Channel 1"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Channel 1 Compare Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cr1::R`](R) reader structure"] +impl crate::Readable for CR1_SPEC {} #[doc = "`reset()` method sets CR1 to value 0"] impl crate::Resettable for CR1_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/cr1s.rs b/src/ccu80_cc80/cr1s.rs index edb95cba..cc84d653 100644 --- a/src/ccu80_cc80/cr1s.rs +++ b/src/ccu80_cc80/cr1s.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CR1S` reader - Shadow Compare Register for Channel 1"] -pub type CR1S_R = crate::FieldReader; +pub type CR1S_R = crate::FieldReader; #[doc = "Field `CR1S` writer - Shadow Compare Register for Channel 1"] -pub type CR1S_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR1S_SPEC, u16, u16, 16, O>; +pub type CR1S_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Shadow Compare Register for Channel 1"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Shadow Compare Register for Channel 1"] #[inline(always)] #[must_use] - pub fn cr1s(&mut self) -> CR1S_W<0> { - CR1S_W::new(self) + pub fn cr1s(&mut self) -> CR1S_W { + CR1S_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel 1 Compare Shadow Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr1s::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cr1s::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cr1s::R`](R) reader structure"] +impl crate::Readable for CR1S_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cr1s::W`](W) writer structure"] impl crate::Writable for CR1S_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/cr2.rs b/src/ccu80_cc80/cr2.rs index 89f874c0..cc8cb0ba 100644 --- a/src/ccu80_cc80/cr2.rs +++ b/src/ccu80_cc80/cr2.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CR2` reader - Compare Register for Channel 2"] -pub type CR2_R = crate::FieldReader; +pub type CR2_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Compare Register for Channel 2"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Channel 2 Compare Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cr2::R`](R) reader structure"] +impl crate::Readable for CR2_SPEC {} #[doc = "`reset()` method sets CR2 to value 0"] impl crate::Resettable for CR2_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/cr2s.rs b/src/ccu80_cc80/cr2s.rs index 57781ae5..b1e1f990 100644 --- a/src/ccu80_cc80/cr2s.rs +++ b/src/ccu80_cc80/cr2s.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CR2S` reader - Shadow Compare Register for Channel 2"] -pub type CR2S_R = crate::FieldReader; +pub type CR2S_R = crate::FieldReader; #[doc = "Field `CR2S` writer - Shadow Compare Register for Channel 2"] -pub type CR2S_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CR2S_SPEC, u16, u16, 16, O>; +pub type CR2S_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Shadow Compare Register for Channel 2"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Shadow Compare Register for Channel 2"] #[inline(always)] #[must_use] - pub fn cr2s(&mut self) -> CR2S_W<0> { - CR2S_W::new(self) + pub fn cr2s(&mut self) -> CR2S_W { + CR2S_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel 2 Compare Shadow Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr2s::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cr2s::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cr2s::R`](R) reader structure"] +impl crate::Readable for CR2S_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cr2s::W`](W) writer structure"] impl crate::Writable for CR2S_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/dc1r.rs b/src/ccu80_cc80/dc1r.rs index 52c4eb6a..95284e1f 100644 --- a/src/ccu80_cc80/dc1r.rs +++ b/src/ccu80_cc80/dc1r.rs @@ -1,47 +1,15 @@ #[doc = "Register `DC1R` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DT1R` reader - Rise Value for Dead Time of Channel 1"] -pub type DT1R_R = crate::FieldReader; +pub type DT1R_R = crate::FieldReader; #[doc = "Field `DT1R` writer - Rise Value for Dead Time of Channel 1"] -pub type DT1R_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DC1R_SPEC, u8, u8, 8, O>; +pub type DT1R_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `DT1F` reader - Fall Value for Dead Time of Channel 1"] -pub type DT1F_R = crate::FieldReader; +pub type DT1F_R = crate::FieldReader; #[doc = "Field `DT1F` writer - Fall Value for Dead Time of Channel 1"] -pub type DT1F_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DC1R_SPEC, u8, u8, 8, O>; +pub type DT1F_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Rise Value for Dead Time of Channel 1"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:7 - Rise Value for Dead Time of Channel 1"] #[inline(always)] #[must_use] - pub fn dt1r(&mut self) -> DT1R_W<0> { - DT1R_W::new(self) + pub fn dt1r(&mut self) -> DT1R_W { + DT1R_W::new(self, 0) } #[doc = "Bits 8:15 - Fall Value for Dead Time of Channel 1"] #[inline(always)] #[must_use] - pub fn dt1f(&mut self) -> DT1F_W<8> { - DT1F_W::new(self) + pub fn dt1f(&mut self) -> DT1F_W { + DT1F_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel 1 Dead Time Values\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dc1r::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dc1r::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dc1r::R`](R) reader structure"] +impl crate::Readable for DC1R_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dc1r::W`](W) writer structure"] impl crate::Writable for DC1R_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/dc2r.rs b/src/ccu80_cc80/dc2r.rs index 96c6e177..729f6c78 100644 --- a/src/ccu80_cc80/dc2r.rs +++ b/src/ccu80_cc80/dc2r.rs @@ -1,47 +1,15 @@ #[doc = "Register `DC2R` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DT2R` reader - Rise Value for Dead Time of Channel 2"] -pub type DT2R_R = crate::FieldReader; +pub type DT2R_R = crate::FieldReader; #[doc = "Field `DT2R` writer - Rise Value for Dead Time of Channel 2"] -pub type DT2R_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DC2R_SPEC, u8, u8, 8, O>; +pub type DT2R_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `DT2F` reader - Fall Value for Dead Time of Channel 2"] -pub type DT2F_R = crate::FieldReader; +pub type DT2F_R = crate::FieldReader; #[doc = "Field `DT2F` writer - Fall Value for Dead Time of Channel 2"] -pub type DT2F_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DC2R_SPEC, u8, u8, 8, O>; +pub type DT2F_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Rise Value for Dead Time of Channel 2"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:7 - Rise Value for Dead Time of Channel 2"] #[inline(always)] #[must_use] - pub fn dt2r(&mut self) -> DT2R_W<0> { - DT2R_W::new(self) + pub fn dt2r(&mut self) -> DT2R_W { + DT2R_W::new(self, 0) } #[doc = "Bits 8:15 - Fall Value for Dead Time of Channel 2"] #[inline(always)] #[must_use] - pub fn dt2f(&mut self) -> DT2F_W<8> { - DT2F_W::new(self) + pub fn dt2f(&mut self) -> DT2F_W { + DT2F_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel 2 Dead Time Values\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dc2r::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dc2r::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dc2r::R`](R) reader structure"] +impl crate::Readable for DC2R_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dc2r::W`](W) writer structure"] impl crate::Writable for DC2R_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/dit.rs b/src/ccu80_cc80/dit.rs index 54188751..124d573b 100644 --- a/src/ccu80_cc80/dit.rs +++ b/src/ccu80_cc80/dit.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DCV` reader - Dither compare Value"] -pub type DCV_R = crate::FieldReader; +pub type DCV_R = crate::FieldReader; #[doc = "Field `DCNT` reader - Dither counter actual value"] -pub type DCNT_R = crate::FieldReader; +pub type DCNT_R = crate::FieldReader; impl R { #[doc = "Bits 0:3 - Dither compare Value"] #[inline(always)] @@ -29,15 +16,13 @@ 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"] +#[doc = "Dither Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dit::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dit::R`](R) reader structure"] +impl crate::Readable for DIT_SPEC {} #[doc = "`reset()` method sets DIT to value 0"] impl crate::Resettable for DIT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/dits.rs b/src/ccu80_cc80/dits.rs index 6140699b..3b095fd1 100644 --- a/src/ccu80_cc80/dits.rs +++ b/src/ccu80_cc80/dits.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DCVS` reader - Dither Shadow Compare Value"] -pub type DCVS_R = crate::FieldReader; +pub type DCVS_R = crate::FieldReader; #[doc = "Field `DCVS` writer - Dither Shadow Compare Value"] -pub type DCVS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DITS_SPEC, u8, u8, 4, O>; +pub type DCVS_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Dither Shadow Compare Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:3 - Dither Shadow Compare Value"] #[inline(always)] #[must_use] - pub fn dcvs(&mut self) -> DCVS_W<0> { - DCVS_W::new(self) + pub fn dcvs(&mut self) -> DCVS_W { + DCVS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Dither Shadow Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dits::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dits::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dits::R`](R) reader structure"] +impl crate::Readable for DITS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dits::W`](W) writer structure"] impl crate::Writable for DITS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/dtc.rs b/src/ccu80_cc80/dtc.rs index efda374e..618504d0 100644 --- a/src/ccu80_cc80/dtc.rs +++ b/src/ccu80_cc80/dtc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DTE1` reader - Dead Time Enable for Channel 1"] pub type DTE1_R = crate::BitReader; #[doc = "Dead Time Enable for Channel 1\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl DTE1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DTE1_A { + pub const fn variant(&self) -> DTE1_A { match self.bits { false => DTE1_A::VALUE1, true => DTE1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead Time for channel 1 is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DTE1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead Time for channel 1 is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DTE1_A::VALUE2 } } #[doc = "Field `DTE1` writer - Dead Time Enable for Channel 1"] -pub type DTE1_W<'a, const O: u8> = crate::BitWriter<'a, u32, DTC_SPEC, DTE1_A, O>; -impl<'a, const O: u8> DTE1_W<'a, O> { +pub type DTE1_W<'a, REG> = crate::BitWriter<'a, REG, DTE1_A>; +impl<'a, REG> DTE1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Dead Time for channel 1 is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DTE1_A::VALUE1) } #[doc = "Dead Time for channel 1 is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DTE1_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl DTE2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DTE2_A { + pub const fn variant(&self) -> DTE2_A { match self.bits { false => DTE2_A::VALUE1, true => DTE2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead Time for channel 2 is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DTE2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead Time for channel 2 is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DTE2_A::VALUE2 } } #[doc = "Field `DTE2` writer - Dead Time Enable for Channel 2"] -pub type DTE2_W<'a, const O: u8> = crate::BitWriter<'a, u32, DTC_SPEC, DTE2_A, O>; -impl<'a, const O: u8> DTE2_W<'a, O> { +pub type DTE2_W<'a, REG> = crate::BitWriter<'a, REG, DTE2_A>; +impl<'a, REG> DTE2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Dead Time for channel 2 is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DTE2_A::VALUE1) } #[doc = "Dead Time for channel 2 is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DTE2_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl DCEN1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DCEN1_A { + pub const fn variant(&self) -> DCEN1_A { match self.bits { false => DCEN1_A::VALUE1, true => DCEN1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead Time for CC8yST1 path is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DCEN1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead Time for CC8yST1 path is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DCEN1_A::VALUE2 } } #[doc = "Field `DCEN1` writer - Dead Time Enable for CC8yST1"] -pub type DCEN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, DTC_SPEC, DCEN1_A, O>; -impl<'a, const O: u8> DCEN1_W<'a, O> { +pub type DCEN1_W<'a, REG> = crate::BitWriter<'a, REG, DCEN1_A>; +impl<'a, REG> DCEN1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Dead Time for CC8yST1 path is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DCEN1_A::VALUE1) } #[doc = "Dead Time for CC8yST1 path is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DCEN1_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl DCEN2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DCEN2_A { + pub const fn variant(&self) -> DCEN2_A { match self.bits { false => DCEN2_A::VALUE1, true => DCEN2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead Time for inverted CC8yST1 path is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DCEN2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead Time for inverted CC8yST1 path is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DCEN2_A::VALUE2 } } #[doc = "Field `DCEN2` writer - Dead Time Enable for inverted CC8yST1"] -pub type DCEN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, DTC_SPEC, DCEN2_A, O>; -impl<'a, const O: u8> DCEN2_W<'a, O> { +pub type DCEN2_W<'a, REG> = crate::BitWriter<'a, REG, DCEN2_A>; +impl<'a, REG> DCEN2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Dead Time for inverted CC8yST1 path is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DCEN2_A::VALUE1) } #[doc = "Dead Time for inverted CC8yST1 path is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DCEN2_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl DCEN3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DCEN3_A { + pub const fn variant(&self) -> DCEN3_A { match self.bits { false => DCEN3_A::VALUE1, true => DCEN3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead Time for CC8yST2 path is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DCEN3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead Time for CC8yST2 path is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DCEN3_A::VALUE2 } } #[doc = "Field `DCEN3` writer - Dead Time Enable for CC8yST2"] -pub type DCEN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, DTC_SPEC, DCEN3_A, O>; -impl<'a, const O: u8> DCEN3_W<'a, O> { +pub type DCEN3_W<'a, REG> = crate::BitWriter<'a, REG, DCEN3_A>; +impl<'a, REG> DCEN3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Dead Time for CC8yST2 path is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DCEN3_A::VALUE1) } #[doc = "Dead Time for CC8yST2 path is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DCEN3_A::VALUE2) } } @@ -303,39 +286,42 @@ impl From for bool { impl DCEN4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DCEN4_A { + pub const fn variant(&self) -> DCEN4_A { match self.bits { false => DCEN4_A::VALUE1, true => DCEN4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead Time for inverted CC8yST2 path is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DCEN4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead Time for inverted CC8yST2 path is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DCEN4_A::VALUE2 } } #[doc = "Field `DCEN4` writer - Dead Time Enable for inverted CC8yST2"] -pub type DCEN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, DTC_SPEC, DCEN4_A, O>; -impl<'a, const O: u8> DCEN4_W<'a, O> { +pub type DCEN4_W<'a, REG> = crate::BitWriter<'a, REG, DCEN4_A>; +impl<'a, REG> DCEN4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Dead Time for inverted CC8yST2 path is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DCEN4_A::VALUE1) } #[doc = "Dead Time for inverted CC8yST2 path is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DCEN4_A::VALUE2) } } #[doc = "Field `DTCC` reader - Dead Time clock control"] -pub type DTCC_R = crate::FieldReader; +pub type DTCC_R = crate::FieldReader; #[doc = "Dead Time clock control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -355,10 +341,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DTCC_A { + type Ux = u8; +} impl DTCC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DTCC_A { + pub const fn variant(&self) -> DTCC_A { match self.bits { 0 => DTCC_A::VALUE1, 1 => DTCC_A::VALUE2, @@ -367,48 +356,52 @@ impl DTCC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "ftclk"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DTCC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ftclk/2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DTCC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "ftclk/4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DTCC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "ftclk/8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DTCC_A::VALUE4 } } #[doc = "Field `DTCC` writer - Dead Time clock control"] -pub type DTCC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DTC_SPEC, u8, DTCC_A, 2, O>; -impl<'a, const O: u8> DTCC_W<'a, O> { +pub type DTCC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, DTCC_A>; +impl<'a, REG> DTCC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "ftclk"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DTCC_A::VALUE1) } #[doc = "ftclk/2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DTCC_A::VALUE2) } #[doc = "ftclk/4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DTCC_A::VALUE3) } #[doc = "ftclk/8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DTCC_A::VALUE4) } } @@ -453,64 +446,65 @@ impl W { #[doc = "Bit 0 - Dead Time Enable for Channel 1"] #[inline(always)] #[must_use] - pub fn dte1(&mut self) -> DTE1_W<0> { - DTE1_W::new(self) + pub fn dte1(&mut self) -> DTE1_W { + DTE1_W::new(self, 0) } #[doc = "Bit 1 - Dead Time Enable for Channel 2"] #[inline(always)] #[must_use] - pub fn dte2(&mut self) -> DTE2_W<1> { - DTE2_W::new(self) + pub fn dte2(&mut self) -> DTE2_W { + DTE2_W::new(self, 1) } #[doc = "Bit 2 - Dead Time Enable for CC8yST1"] #[inline(always)] #[must_use] - pub fn dcen1(&mut self) -> DCEN1_W<2> { - DCEN1_W::new(self) + pub fn dcen1(&mut self) -> DCEN1_W { + DCEN1_W::new(self, 2) } #[doc = "Bit 3 - Dead Time Enable for inverted CC8yST1"] #[inline(always)] #[must_use] - pub fn dcen2(&mut self) -> DCEN2_W<3> { - DCEN2_W::new(self) + pub fn dcen2(&mut self) -> DCEN2_W { + DCEN2_W::new(self, 3) } #[doc = "Bit 4 - Dead Time Enable for CC8yST2"] #[inline(always)] #[must_use] - pub fn dcen3(&mut self) -> DCEN3_W<4> { - DCEN3_W::new(self) + pub fn dcen3(&mut self) -> DCEN3_W { + DCEN3_W::new(self, 4) } #[doc = "Bit 5 - Dead Time Enable for inverted CC8yST2"] #[inline(always)] #[must_use] - pub fn dcen4(&mut self) -> DCEN4_W<5> { - DCEN4_W::new(self) + pub fn dcen4(&mut self) -> DCEN4_W { + DCEN4_W::new(self, 5) } #[doc = "Bits 6:7 - Dead Time clock control"] #[inline(always)] #[must_use] - pub fn dtcc(&mut self) -> DTCC_W<6> { - DTCC_W::new(self) + pub fn dtcc(&mut self) -> DTCC_W { + DTCC_W::new(self, 6) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Dead Time Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dtc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dtc::R`](R) reader structure"] +impl crate::Readable for DTC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dtc::W`](W) writer structure"] impl crate::Writable for DTC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/fpc.rs b/src/ccu80_cc80/fpc.rs index 473bdaef..c4e2abbf 100644 --- a/src/ccu80_cc80/fpc.rs +++ b/src/ccu80_cc80/fpc.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PCMP` reader - Floating Prescaler Compare Value"] -pub type PCMP_R = crate::FieldReader; +pub type PCMP_R = crate::FieldReader; #[doc = "Field `PVAL` reader - Actual Prescaler Value"] -pub type PVAL_R = crate::FieldReader; +pub type PVAL_R = crate::FieldReader; #[doc = "Field `PVAL` writer - Actual Prescaler Value"] -pub type PVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FPC_SPEC, u8, u8, 4, O>; +pub type PVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Floating Prescaler Compare Value"] #[inline(always)] @@ -56,28 +24,29 @@ impl W { #[doc = "Bits 8:11 - Actual Prescaler Value"] #[inline(always)] #[must_use] - pub fn pval(&mut self) -> PVAL_W<8> { - PVAL_W::new(self) + pub fn pval(&mut self) -> PVAL_W { + PVAL_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Floating Prescaler Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fpc::R`](R) reader structure"] +impl crate::Readable for FPC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fpc::W`](W) writer structure"] impl crate::Writable for FPC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/fpcs.rs b/src/ccu80_cc80/fpcs.rs index 9b0187ef..83b6b1d3 100644 --- a/src/ccu80_cc80/fpcs.rs +++ b/src/ccu80_cc80/fpcs.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PCMP` reader - Floating Prescaler Shadow Compare Value"] -pub type PCMP_R = crate::FieldReader; +pub type PCMP_R = crate::FieldReader; #[doc = "Field `PCMP` writer - Floating Prescaler Shadow Compare Value"] -pub type PCMP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FPCS_SPEC, u8, u8, 4, O>; +pub type PCMP_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Floating Prescaler Shadow Compare Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:3 - Floating Prescaler Shadow Compare Value"] #[inline(always)] #[must_use] - pub fn pcmp(&mut self) -> PCMP_W<0> { - PCMP_W::new(self) + pub fn pcmp(&mut self) -> PCMP_W { + PCMP_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Floating Prescaler Shadow\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpcs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpcs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fpcs::R`](R) reader structure"] +impl crate::Readable for FPCS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fpcs::W`](W) writer structure"] impl crate::Writable for FPCS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/ins.rs b/src/ccu80_cc80/ins.rs index 7cc41d71..eea1b75a 100644 --- a/src/ccu80_cc80/ins.rs +++ b/src/ccu80_cc80/ins.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `EV0IS` reader - Event 0 signal selection"] -pub type EV0IS_R = crate::FieldReader; +pub type EV0IS_R = crate::FieldReader; #[doc = "Event 0 signal selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -79,10 +47,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV0IS_A { + type Ux = u8; +} impl EV0IS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV0IS_A { + pub const fn variant(&self) -> EV0IS_A { match self.bits { 0 => EV0IS_A::VALUE1, 1 => EV0IS_A::VALUE2, @@ -103,173 +74,177 @@ impl EV0IS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CCU8x.INyA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV0IS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU8x.INyB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV0IS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU8x.INyC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV0IS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU8x.INyD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV0IS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "CCU8x.INyE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == EV0IS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "CCU8x.INyF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == EV0IS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "CCU8x.INyG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == EV0IS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "CCU8x.INyH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == EV0IS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "CCU8x.INyI"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == EV0IS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "CCU8x.INyJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == EV0IS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "CCU8x.INyK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == EV0IS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "CCU8x.INyL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == EV0IS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "CCU8x.INyM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == EV0IS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "CCU8x.INyN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == EV0IS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "CCU8x.INyO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == EV0IS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "CCU8x.INyP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == EV0IS_A::VALUE16 } } #[doc = "Field `EV0IS` writer - Event 0 signal selection"] -pub type EV0IS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV0IS_A, 4, O>; -impl<'a, const O: u8> EV0IS_W<'a, O> { +pub type EV0IS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, EV0IS_A>; +impl<'a, REG> EV0IS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CCU8x.INyA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE1) } #[doc = "CCU8x.INyB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE2) } #[doc = "CCU8x.INyC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE3) } #[doc = "CCU8x.INyD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE4) } #[doc = "CCU8x.INyE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE5) } #[doc = "CCU8x.INyF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE6) } #[doc = "CCU8x.INyG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE7) } #[doc = "CCU8x.INyH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE8) } #[doc = "CCU8x.INyI"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE9) } #[doc = "CCU8x.INyJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE10) } #[doc = "CCU8x.INyK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE11) } #[doc = "CCU8x.INyL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE12) } #[doc = "CCU8x.INyM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE13) } #[doc = "CCU8x.INyN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE14) } #[doc = "CCU8x.INyO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE15) } #[doc = "CCU8x.INyP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(EV0IS_A::VALUE16) } } #[doc = "Field `EV1IS` reader - Event 1 signal selection"] -pub type EV1IS_R = crate::FieldReader; +pub type EV1IS_R = crate::FieldReader; #[doc = "Event 1 signal selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +288,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV1IS_A { + type Ux = u8; +} impl EV1IS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV1IS_A { + pub const fn variant(&self) -> EV1IS_A { match self.bits { 0 => EV1IS_A::VALUE1, 1 => EV1IS_A::VALUE2, @@ -337,173 +315,177 @@ impl EV1IS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CCU8x.INyA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV1IS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU8x.INyB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV1IS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU8x.INyC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV1IS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU8x.INyD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV1IS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "CCU8x.INyE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == EV1IS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "CCU8x.INyF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == EV1IS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "CCU8x.INyG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == EV1IS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "CCU8x.INyH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == EV1IS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "CCU8x.INyI"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == EV1IS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "CCU8x.INyJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == EV1IS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "CCU8x.INyK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == EV1IS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "CCU8x.INyL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == EV1IS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "CCU8x.INyM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == EV1IS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "CCU8x.INyN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == EV1IS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "CCU8x.INyO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == EV1IS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "CCU8x.INyP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == EV1IS_A::VALUE16 } } #[doc = "Field `EV1IS` writer - Event 1 signal selection"] -pub type EV1IS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV1IS_A, 4, O>; -impl<'a, const O: u8> EV1IS_W<'a, O> { +pub type EV1IS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, EV1IS_A>; +impl<'a, REG> EV1IS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CCU8x.INyA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE1) } #[doc = "CCU8x.INyB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE2) } #[doc = "CCU8x.INyC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE3) } #[doc = "CCU8x.INyD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE4) } #[doc = "CCU8x.INyE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE5) } #[doc = "CCU8x.INyF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE6) } #[doc = "CCU8x.INyG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE7) } #[doc = "CCU8x.INyH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE8) } #[doc = "CCU8x.INyI"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE9) } #[doc = "CCU8x.INyJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE10) } #[doc = "CCU8x.INyK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE11) } #[doc = "CCU8x.INyL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE12) } #[doc = "CCU8x.INyM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE13) } #[doc = "CCU8x.INyN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE14) } #[doc = "CCU8x.INyO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE15) } #[doc = "CCU8x.INyP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(EV1IS_A::VALUE16) } } #[doc = "Field `EV2IS` reader - Event 2 signal selection"] -pub type EV2IS_R = crate::FieldReader; +pub type EV2IS_R = crate::FieldReader; #[doc = "Event 2 signal selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -547,10 +529,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV2IS_A { + type Ux = u8; +} impl EV2IS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV2IS_A { + pub const fn variant(&self) -> EV2IS_A { match self.bits { 0 => EV2IS_A::VALUE1, 1 => EV2IS_A::VALUE2, @@ -571,173 +556,177 @@ impl EV2IS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CCU8x.INyA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV2IS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CCU8x.INyB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV2IS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CCU8x.INyC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV2IS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CCU8x.INyD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV2IS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "CCU8x.INyE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == EV2IS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "CCU8x.INyF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == EV2IS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "CCU8x.INyG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == EV2IS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "CCU8x.INyH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == EV2IS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "CCU8x.INyI"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == EV2IS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "CCU8x.INyJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == EV2IS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "CCU8x.INyK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == EV2IS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "CCU8x.INyL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == EV2IS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "CCU8x.INyM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == EV2IS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "CCU8x.INyN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == EV2IS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "CCU8x.INyO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == EV2IS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "CCU8x.INyP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == EV2IS_A::VALUE16 } } #[doc = "Field `EV2IS` writer - Event 2 signal selection"] -pub type EV2IS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV2IS_A, 4, O>; -impl<'a, const O: u8> EV2IS_W<'a, O> { +pub type EV2IS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, EV2IS_A>; +impl<'a, REG> EV2IS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CCU8x.INyA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE1) } #[doc = "CCU8x.INyB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE2) } #[doc = "CCU8x.INyC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE3) } #[doc = "CCU8x.INyD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE4) } #[doc = "CCU8x.INyE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE5) } #[doc = "CCU8x.INyF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE6) } #[doc = "CCU8x.INyG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE7) } #[doc = "CCU8x.INyH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE8) } #[doc = "CCU8x.INyI"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE9) } #[doc = "CCU8x.INyJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE10) } #[doc = "CCU8x.INyK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE11) } #[doc = "CCU8x.INyL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE12) } #[doc = "CCU8x.INyM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE13) } #[doc = "CCU8x.INyN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE14) } #[doc = "CCU8x.INyO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE15) } #[doc = "CCU8x.INyP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(EV2IS_A::VALUE16) } } #[doc = "Field `EV0EM` reader - Event 0 Edge Selection"] -pub type EV0EM_R = crate::FieldReader; +pub type EV0EM_R = crate::FieldReader; #[doc = "Event 0 Edge Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -757,10 +746,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV0EM_A { + type Ux = u8; +} impl EV0EM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV0EM_A { + pub const fn variant(&self) -> EV0EM_A { match self.bits { 0 => EV0EM_A::VALUE1, 1 => EV0EM_A::VALUE2, @@ -769,53 +761,57 @@ impl EV0EM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No action"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV0EM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV0EM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Signal active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV0EM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Signal active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV0EM_A::VALUE4 } } #[doc = "Field `EV0EM` writer - Event 0 Edge Selection"] -pub type EV0EM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV0EM_A, 2, O>; -impl<'a, const O: u8> EV0EM_W<'a, O> { +pub type EV0EM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EV0EM_A>; +impl<'a, REG> EV0EM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV0EM_A::VALUE1) } #[doc = "Signal active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV0EM_A::VALUE2) } #[doc = "Signal active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV0EM_A::VALUE3) } #[doc = "Signal active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV0EM_A::VALUE4) } } #[doc = "Field `EV1EM` reader - Event 1 Edge Selection"] -pub type EV1EM_R = crate::FieldReader; +pub type EV1EM_R = crate::FieldReader; #[doc = "Event 1 Edge Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -835,10 +831,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV1EM_A { + type Ux = u8; +} impl EV1EM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV1EM_A { + pub const fn variant(&self) -> EV1EM_A { match self.bits { 0 => EV1EM_A::VALUE1, 1 => EV1EM_A::VALUE2, @@ -847,53 +846,57 @@ impl EV1EM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No action"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV1EM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV1EM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Signal active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV1EM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Signal active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV1EM_A::VALUE4 } } #[doc = "Field `EV1EM` writer - Event 1 Edge Selection"] -pub type EV1EM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV1EM_A, 2, O>; -impl<'a, const O: u8> EV1EM_W<'a, O> { +pub type EV1EM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EV1EM_A>; +impl<'a, REG> EV1EM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV1EM_A::VALUE1) } #[doc = "Signal active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV1EM_A::VALUE2) } #[doc = "Signal active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV1EM_A::VALUE3) } #[doc = "Signal active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV1EM_A::VALUE4) } } #[doc = "Field `EV2EM` reader - Event 2 Edge Selection"] -pub type EV2EM_R = crate::FieldReader; +pub type EV2EM_R = crate::FieldReader; #[doc = "Event 2 Edge Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -913,10 +916,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EV2EM_A { + type Ux = u8; +} impl EV2EM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV2EM_A { + pub const fn variant(&self) -> EV2EM_A { match self.bits { 0 => EV2EM_A::VALUE1, 1 => EV2EM_A::VALUE2, @@ -925,48 +931,52 @@ impl EV2EM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No action"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV2EM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV2EM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Signal active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EV2EM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Signal active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EV2EM_A::VALUE4 } } #[doc = "Field `EV2EM` writer - Event 2 Edge Selection"] -pub type EV2EM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, EV2EM_A, 2, O>; -impl<'a, const O: u8> EV2EM_W<'a, O> { +pub type EV2EM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EV2EM_A>; +impl<'a, REG> EV2EM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV2EM_A::VALUE1) } #[doc = "Signal active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV2EM_A::VALUE2) } #[doc = "Signal active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EV2EM_A::VALUE3) } #[doc = "Signal active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EV2EM_A::VALUE4) } } @@ -989,34 +999,37 @@ impl From for bool { impl EV0LM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV0LM_A { + pub const fn variant(&self) -> EV0LM_A { match self.bits { false => EV0LM_A::VALUE1, true => EV0LM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active on HIGH level"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV0LM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on LOW level"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV0LM_A::VALUE2 } } #[doc = "Field `EV0LM` writer - Event 0 Level Selection"] -pub type EV0LM_W<'a, const O: u8> = crate::BitWriter<'a, u32, INS_SPEC, EV0LM_A, O>; -impl<'a, const O: u8> EV0LM_W<'a, O> { +pub type EV0LM_W<'a, REG> = crate::BitWriter<'a, REG, EV0LM_A>; +impl<'a, REG> EV0LM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active on HIGH level"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV0LM_A::VALUE1) } #[doc = "Active on LOW level"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV0LM_A::VALUE2) } } @@ -1039,34 +1052,37 @@ impl From for bool { impl EV1LM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV1LM_A { + pub const fn variant(&self) -> EV1LM_A { match self.bits { false => EV1LM_A::VALUE1, true => EV1LM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active on HIGH level"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV1LM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on LOW level"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV1LM_A::VALUE2 } } #[doc = "Field `EV1LM` writer - Event 1 Level Selection"] -pub type EV1LM_W<'a, const O: u8> = crate::BitWriter<'a, u32, INS_SPEC, EV1LM_A, O>; -impl<'a, const O: u8> EV1LM_W<'a, O> { +pub type EV1LM_W<'a, REG> = crate::BitWriter<'a, REG, EV1LM_A>; +impl<'a, REG> EV1LM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active on HIGH level"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV1LM_A::VALUE1) } #[doc = "Active on LOW level"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV1LM_A::VALUE2) } } @@ -1089,39 +1105,42 @@ impl From for bool { impl EV2LM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV2LM_A { + pub const fn variant(&self) -> EV2LM_A { match self.bits { false => EV2LM_A::VALUE1, true => EV2LM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active on HIGH level"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV2LM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on LOW level"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV2LM_A::VALUE2 } } #[doc = "Field `EV2LM` writer - Event 2 Level Selection"] -pub type EV2LM_W<'a, const O: u8> = crate::BitWriter<'a, u32, INS_SPEC, EV2LM_A, O>; -impl<'a, const O: u8> EV2LM_W<'a, O> { +pub type EV2LM_W<'a, REG> = crate::BitWriter<'a, REG, EV2LM_A>; +impl<'a, REG> EV2LM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active on HIGH level"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EV2LM_A::VALUE1) } #[doc = "Active on LOW level"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EV2LM_A::VALUE2) } } #[doc = "Field `LPF0M` reader - Event 0 Low Pass Filter Configuration"] -pub type LPF0M_R = crate::FieldReader; +pub type LPF0M_R = crate::FieldReader; #[doc = "Event 0 Low Pass Filter Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1141,10 +1160,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LPF0M_A { + type Ux = u8; +} impl LPF0M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPF0M_A { + pub const fn variant(&self) -> LPF0M_A { match self.bits { 0 => LPF0M_A::VALUE1, 1 => LPF0M_A::VALUE2, @@ -1153,53 +1175,57 @@ impl LPF0M_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "LPF is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPF0M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "3 clock cycles of fCCU8"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPF0M_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "5 clock cycles of fCCU8"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LPF0M_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "7 clock cycles of fCCU8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == LPF0M_A::VALUE4 } } #[doc = "Field `LPF0M` writer - Event 0 Low Pass Filter Configuration"] -pub type LPF0M_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, LPF0M_A, 2, O>; -impl<'a, const O: u8> LPF0M_W<'a, O> { +pub type LPF0M_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, LPF0M_A>; +impl<'a, REG> LPF0M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "LPF is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPF0M_A::VALUE1) } #[doc = "3 clock cycles of fCCU8"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPF0M_A::VALUE2) } #[doc = "5 clock cycles of fCCU8"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LPF0M_A::VALUE3) } #[doc = "7 clock cycles of fCCU8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(LPF0M_A::VALUE4) } } #[doc = "Field `LPF1M` reader - Event 1 Low Pass Filter Configuration"] -pub type LPF1M_R = crate::FieldReader; +pub type LPF1M_R = crate::FieldReader; #[doc = "Event 1 Low Pass Filter Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1219,10 +1245,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LPF1M_A { + type Ux = u8; +} impl LPF1M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPF1M_A { + pub const fn variant(&self) -> LPF1M_A { match self.bits { 0 => LPF1M_A::VALUE1, 1 => LPF1M_A::VALUE2, @@ -1231,53 +1260,57 @@ impl LPF1M_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "LPF is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPF1M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "3 clock cycles of fCCU8"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPF1M_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "5 clock cycles of fCCU8"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LPF1M_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "7 clock cycles of fCCU8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == LPF1M_A::VALUE4 } } #[doc = "Field `LPF1M` writer - Event 1 Low Pass Filter Configuration"] -pub type LPF1M_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, LPF1M_A, 2, O>; -impl<'a, const O: u8> LPF1M_W<'a, O> { +pub type LPF1M_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, LPF1M_A>; +impl<'a, REG> LPF1M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "LPF is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPF1M_A::VALUE1) } #[doc = "3 clock cycles of fCCU8"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPF1M_A::VALUE2) } #[doc = "5 clock cycles of fCCU8"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LPF1M_A::VALUE3) } #[doc = "7 clock cycles of fCCU8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(LPF1M_A::VALUE4) } } #[doc = "Field `LPF2M` reader - Event 2 Low Pass Filter Configuration"] -pub type LPF2M_R = crate::FieldReader; +pub type LPF2M_R = crate::FieldReader; #[doc = "Event 2 Low Pass Filter Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1297,10 +1330,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LPF2M_A { + type Ux = u8; +} impl LPF2M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPF2M_A { + pub const fn variant(&self) -> LPF2M_A { match self.bits { 0 => LPF2M_A::VALUE1, 1 => LPF2M_A::VALUE2, @@ -1309,48 +1345,52 @@ impl LPF2M_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "LPF is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPF2M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "3 clock cycles of fCCU8"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPF2M_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "5 clock cycles of fCCU8"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LPF2M_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "7 clock cycles of fCCU8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == LPF2M_A::VALUE4 } } #[doc = "Field `LPF2M` writer - Event 2 Low Pass Filter Configuration"] -pub type LPF2M_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, INS_SPEC, u8, LPF2M_A, 2, O>; -impl<'a, const O: u8> LPF2M_W<'a, O> { +pub type LPF2M_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, LPF2M_A>; +impl<'a, REG> LPF2M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "LPF is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPF2M_A::VALUE1) } #[doc = "3 clock cycles of fCCU8"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPF2M_A::VALUE2) } #[doc = "5 clock cycles of fCCU8"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LPF2M_A::VALUE3) } #[doc = "7 clock cycles of fCCU8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(LPF2M_A::VALUE4) } } @@ -1420,94 +1460,95 @@ impl W { #[doc = "Bits 0:3 - Event 0 signal selection"] #[inline(always)] #[must_use] - pub fn ev0is(&mut self) -> EV0IS_W<0> { - EV0IS_W::new(self) + pub fn ev0is(&mut self) -> EV0IS_W { + EV0IS_W::new(self, 0) } #[doc = "Bits 4:7 - Event 1 signal selection"] #[inline(always)] #[must_use] - pub fn ev1is(&mut self) -> EV1IS_W<4> { - EV1IS_W::new(self) + pub fn ev1is(&mut self) -> EV1IS_W { + EV1IS_W::new(self, 4) } #[doc = "Bits 8:11 - Event 2 signal selection"] #[inline(always)] #[must_use] - pub fn ev2is(&mut self) -> EV2IS_W<8> { - EV2IS_W::new(self) + pub fn ev2is(&mut self) -> EV2IS_W { + EV2IS_W::new(self, 8) } #[doc = "Bits 16:17 - Event 0 Edge Selection"] #[inline(always)] #[must_use] - pub fn ev0em(&mut self) -> EV0EM_W<16> { - EV0EM_W::new(self) + pub fn ev0em(&mut self) -> EV0EM_W { + EV0EM_W::new(self, 16) } #[doc = "Bits 18:19 - Event 1 Edge Selection"] #[inline(always)] #[must_use] - pub fn ev1em(&mut self) -> EV1EM_W<18> { - EV1EM_W::new(self) + pub fn ev1em(&mut self) -> EV1EM_W { + EV1EM_W::new(self, 18) } #[doc = "Bits 20:21 - Event 2 Edge Selection"] #[inline(always)] #[must_use] - pub fn ev2em(&mut self) -> EV2EM_W<20> { - EV2EM_W::new(self) + pub fn ev2em(&mut self) -> EV2EM_W { + EV2EM_W::new(self, 20) } #[doc = "Bit 22 - Event 0 Level Selection"] #[inline(always)] #[must_use] - pub fn ev0lm(&mut self) -> EV0LM_W<22> { - EV0LM_W::new(self) + pub fn ev0lm(&mut self) -> EV0LM_W { + EV0LM_W::new(self, 22) } #[doc = "Bit 23 - Event 1 Level Selection"] #[inline(always)] #[must_use] - pub fn ev1lm(&mut self) -> EV1LM_W<23> { - EV1LM_W::new(self) + pub fn ev1lm(&mut self) -> EV1LM_W { + EV1LM_W::new(self, 23) } #[doc = "Bit 24 - Event 2 Level Selection"] #[inline(always)] #[must_use] - pub fn ev2lm(&mut self) -> EV2LM_W<24> { - EV2LM_W::new(self) + pub fn ev2lm(&mut self) -> EV2LM_W { + EV2LM_W::new(self, 24) } #[doc = "Bits 25:26 - Event 0 Low Pass Filter Configuration"] #[inline(always)] #[must_use] - pub fn lpf0m(&mut self) -> LPF0M_W<25> { - LPF0M_W::new(self) + pub fn lpf0m(&mut self) -> LPF0M_W { + LPF0M_W::new(self, 25) } #[doc = "Bits 27:28 - Event 1 Low Pass Filter Configuration"] #[inline(always)] #[must_use] - pub fn lpf1m(&mut self) -> LPF1M_W<27> { - LPF1M_W::new(self) + pub fn lpf1m(&mut self) -> LPF1M_W { + LPF1M_W::new(self, 27) } #[doc = "Bits 29:30 - Event 2 Low Pass Filter Configuration"] #[inline(always)] #[must_use] - pub fn lpf2m(&mut self) -> LPF2M_W<29> { - LPF2M_W::new(self) + pub fn lpf2m(&mut self) -> LPF2M_W { + LPF2M_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Selector Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ins::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ins::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ins::R`](R) reader structure"] +impl crate::Readable for INS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ins::W`](W) writer structure"] impl crate::Writable for INS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/inte.rs b/src/ccu80_cc80/inte.rs index cfdf86ba..3a28a6a5 100644 --- a/src/ccu80_cc80/inte.rs +++ b/src/ccu80_cc80/inte.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PME` reader - Period match while counting up enable"] pub type PME_R = crate::BitReader; #[doc = "Period match while counting up enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PME_A { + pub const fn variant(&self) -> PME_A { match self.bits { false => PME_A::VALUE1, true => PME_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Period Match interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Period Match interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PME_A::VALUE2 } } #[doc = "Field `PME` writer - Period match while counting up enable"] -pub type PME_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, PME_A, O>; -impl<'a, const O: u8> PME_W<'a, O> { +pub type PME_W<'a, REG> = crate::BitWriter<'a, REG, PME_A>; +impl<'a, REG> PME_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Period Match interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PME_A::VALUE1) } #[doc = "Period Match interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PME_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl OME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OME_A { + pub const fn variant(&self) -> OME_A { match self.bits { false => OME_A::VALUE1, true => OME_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "One Match interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "One Match interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OME_A::VALUE2 } } #[doc = "Field `OME` writer - One match while counting down enable"] -pub type OME_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, OME_A, O>; -impl<'a, const O: u8> OME_W<'a, O> { +pub type OME_W<'a, REG> = crate::BitWriter<'a, REG, OME_A>; +impl<'a, REG> OME_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "One Match interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OME_A::VALUE1) } #[doc = "One Match interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OME_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CMU1E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMU1E_A { + pub const fn variant(&self) -> CMU1E_A { match self.bits { false => CMU1E_A::VALUE1, true => CMU1E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMU1E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare Match while counting up interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMU1E_A::VALUE2 } } #[doc = "Field `CMU1E` writer - Channel 1 Compare match while counting up enable"] -pub type CMU1E_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, CMU1E_A, O>; -impl<'a, const O: u8> CMU1E_W<'a, O> { +pub type CMU1E_W<'a, REG> = crate::BitWriter<'a, REG, CMU1E_A>; +impl<'a, REG> CMU1E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMU1E_A::VALUE1) } #[doc = "Compare Match while counting up interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMU1E_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CMD1E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMD1E_A { + pub const fn variant(&self) -> CMD1E_A { match self.bits { false => CMD1E_A::VALUE1, true => CMD1E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMD1E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare Match while counting down interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMD1E_A::VALUE2 } } #[doc = "Field `CMD1E` writer - Channel 1 Compare match while counting down enable"] -pub type CMD1E_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, CMD1E_A, O>; -impl<'a, const O: u8> CMD1E_W<'a, O> { +pub type CMD1E_W<'a, REG> = crate::BitWriter<'a, REG, CMD1E_A>; +impl<'a, REG> CMD1E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMD1E_A::VALUE1) } #[doc = "Compare Match while counting down interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMD1E_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CMU2E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMU2E_A { + pub const fn variant(&self) -> CMU2E_A { match self.bits { false => CMU2E_A::VALUE1, true => CMU2E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMU2E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare Match while counting up interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMU2E_A::VALUE2 } } #[doc = "Field `CMU2E` writer - Channel 2 Compare match while counting up enable"] -pub type CMU2E_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, CMU2E_A, O>; -impl<'a, const O: u8> CMU2E_W<'a, O> { +pub type CMU2E_W<'a, REG> = crate::BitWriter<'a, REG, CMU2E_A>; +impl<'a, REG> CMU2E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Compare Match while counting up interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMU2E_A::VALUE1) } #[doc = "Compare Match while counting up interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMU2E_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CMD2E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMD2E_A { + pub const fn variant(&self) -> CMD2E_A { match self.bits { false => CMD2E_A::VALUE1, true => CMD2E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMD2E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare Match while counting down interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMD2E_A::VALUE2 } } #[doc = "Field `CMD2E` writer - Channel 2 Compare match while counting down enable"] -pub type CMD2E_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, CMD2E_A, O>; -impl<'a, const O: u8> CMD2E_W<'a, O> { +pub type CMD2E_W<'a, REG> = crate::BitWriter<'a, REG, CMD2E_A>; +impl<'a, REG> CMD2E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Compare Match while counting down interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMD2E_A::VALUE1) } #[doc = "Compare Match while counting down interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMD2E_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl E0AE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E0AE_A { + pub const fn variant(&self) -> E0AE_A { match self.bits { false => E0AE_A::VALUE1, true => E0AE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 0 detection interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E0AE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 0 detection interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E0AE_A::VALUE2 } } #[doc = "Field `E0AE` writer - Event 0 interrupt enable"] -pub type E0AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, E0AE_A, O>; -impl<'a, const O: u8> E0AE_W<'a, O> { +pub type E0AE_W<'a, REG> = crate::BitWriter<'a, REG, E0AE_A>; +impl<'a, REG> E0AE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Event 0 detection interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E0AE_A::VALUE1) } #[doc = "Event 0 detection interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E0AE_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl E1AE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E1AE_A { + pub const fn variant(&self) -> E1AE_A { match self.bits { false => E1AE_A::VALUE1, true => E1AE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 1 detection interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E1AE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 1 detection interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E1AE_A::VALUE2 } } #[doc = "Field `E1AE` writer - Event 1 interrupt enable"] -pub type E1AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, E1AE_A, O>; -impl<'a, const O: u8> E1AE_W<'a, O> { +pub type E1AE_W<'a, REG> = crate::BitWriter<'a, REG, E1AE_A>; +impl<'a, REG> E1AE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Event 1 detection interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E1AE_A::VALUE1) } #[doc = "Event 1 detection interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E1AE_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl E2AE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E2AE_A { + pub const fn variant(&self) -> E2AE_A { match self.bits { false => E2AE_A::VALUE1, true => E2AE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 2 detection interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E2AE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 2 detection interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E2AE_A::VALUE2 } } #[doc = "Field `E2AE` writer - Event 2 interrupt enable"] -pub type E2AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTE_SPEC, E2AE_A, O>; -impl<'a, const O: u8> E2AE_W<'a, O> { +pub type E2AE_W<'a, REG> = crate::BitWriter<'a, REG, E2AE_A>; +impl<'a, REG> E2AE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Event 2 detection interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E2AE_A::VALUE1) } #[doc = "Event 2 detection interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E2AE_A::VALUE2) } } @@ -535,76 +530,77 @@ impl W { #[doc = "Bit 0 - Period match while counting up enable"] #[inline(always)] #[must_use] - pub fn pme(&mut self) -> PME_W<0> { - PME_W::new(self) + pub fn pme(&mut self) -> PME_W { + PME_W::new(self, 0) } #[doc = "Bit 1 - One match while counting down enable"] #[inline(always)] #[must_use] - pub fn ome(&mut self) -> OME_W<1> { - OME_W::new(self) + pub fn ome(&mut self) -> OME_W { + OME_W::new(self, 1) } #[doc = "Bit 2 - Channel 1 Compare match while counting up enable"] #[inline(always)] #[must_use] - pub fn cmu1e(&mut self) -> CMU1E_W<2> { - CMU1E_W::new(self) + pub fn cmu1e(&mut self) -> CMU1E_W { + CMU1E_W::new(self, 2) } #[doc = "Bit 3 - Channel 1 Compare match while counting down enable"] #[inline(always)] #[must_use] - pub fn cmd1e(&mut self) -> CMD1E_W<3> { - CMD1E_W::new(self) + pub fn cmd1e(&mut self) -> CMD1E_W { + CMD1E_W::new(self, 3) } #[doc = "Bit 4 - Channel 2 Compare match while counting up enable"] #[inline(always)] #[must_use] - pub fn cmu2e(&mut self) -> CMU2E_W<4> { - CMU2E_W::new(self) + pub fn cmu2e(&mut self) -> CMU2E_W { + CMU2E_W::new(self, 4) } #[doc = "Bit 5 - Channel 2 Compare match while counting down enable"] #[inline(always)] #[must_use] - pub fn cmd2e(&mut self) -> CMD2E_W<5> { - CMD2E_W::new(self) + pub fn cmd2e(&mut self) -> CMD2E_W { + CMD2E_W::new(self, 5) } #[doc = "Bit 8 - Event 0 interrupt enable"] #[inline(always)] #[must_use] - pub fn e0ae(&mut self) -> E0AE_W<8> { - E0AE_W::new(self) + pub fn e0ae(&mut self) -> E0AE_W { + E0AE_W::new(self, 8) } #[doc = "Bit 9 - Event 1 interrupt enable"] #[inline(always)] #[must_use] - pub fn e1ae(&mut self) -> E1AE_W<9> { - E1AE_W::new(self) + pub fn e1ae(&mut self) -> E1AE_W { + E1AE_W::new(self, 9) } #[doc = "Bit 10 - Event 2 interrupt enable"] #[inline(always)] #[must_use] - pub fn e2ae(&mut self) -> E2AE_W<10> { - E2AE_W::new(self) + pub fn e2ae(&mut self) -> E2AE_W { + E2AE_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Enable Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`inte::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`inte::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`inte::R`](R) reader structure"] +impl crate::Readable for INTE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`inte::W`](W) writer structure"] impl crate::Writable for INTE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/ints.rs b/src/ccu80_cc80/ints.rs index 69887f0a..d5b19727 100644 --- a/src/ccu80_cc80/ints.rs +++ b/src/ccu80_cc80/ints.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PMUS` reader - Period Match while Counting Up"] pub type PMUS_R = crate::BitReader; #[doc = "Period Match while Counting Up\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl PMUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PMUS_A { + pub const fn variant(&self) -> PMUS_A { match self.bits { false => PMUS_A::VALUE1, true => PMUS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Period match while counting up not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PMUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Period match while counting up detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PMUS_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl OMDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OMDS_A { + pub const fn variant(&self) -> OMDS_A { match self.bits { false => OMDS_A::VALUE1, true => OMDS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "One match while counting down not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OMDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "One match while counting down detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OMDS_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl CMU1S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMU1S_A { + pub const fn variant(&self) -> CMU1S_A { match self.bits { false => CMU1S_A::VALUE1, true => CMU1S_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare match while counting up not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMU1S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare match while counting up detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMU1S_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl CMD1S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMD1S_A { + pub const fn variant(&self) -> CMD1S_A { match self.bits { false => CMD1S_A::VALUE1, true => CMD1S_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare match while counting down not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMD1S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare match while counting down detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMD1S_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl CMU2S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMU2S_A { + pub const fn variant(&self) -> CMU2S_A { match self.bits { false => CMU2S_A::VALUE1, true => CMU2S_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare match while counting up not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMU2S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare match while counting up detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMU2S_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl CMD2S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMD2S_A { + pub const fn variant(&self) -> CMD2S_A { match self.bits { false => CMD2S_A::VALUE1, true => CMD2S_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare match while counting down not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMD2S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare match while counting down detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMD2S_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl E0AS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E0AS_A { + pub const fn variant(&self) -> E0AS_A { match self.bits { false => E0AS_A::VALUE1, true => E0AS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 0 not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E0AS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 0 detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E0AS_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl E1AS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E1AS_A { + pub const fn variant(&self) -> E1AS_A { match self.bits { false => E1AS_A::VALUE1, true => E1AS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 1 not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E1AS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 1 detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E1AS_A::VALUE2 @@ -320,25 +307,25 @@ impl From for bool { impl E2AS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E2AS_A { + pub const fn variant(&self) -> E2AS_A { match self.bits { false => E2AS_A::VALUE1, true => E2AS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Event 2 not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E2AS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Event 2 detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E2AS_A::VALUE2 } } #[doc = "Field `TRPF` reader - Trap Flag Status"] -pub type TRPF_R = crate::BitReader; +pub type TRPF_R = crate::BitReader; impl R { #[doc = "Bit 0 - Period Match while Counting Up"] #[inline(always)] @@ -391,15 +378,13 @@ impl R { TRPF_R::new(((self.bits >> 11) & 1) != 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"] +#[doc = "Interrupt Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ints::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`ints::R`](R) reader structure"] +impl crate::Readable for INTS_SPEC {} #[doc = "`reset()` method sets INTS to value 0"] impl crate::Resettable for INTS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/pr.rs b/src/ccu80_cc80/pr.rs index 5b834e9e..0c5cb46f 100644 --- a/src/ccu80_cc80/pr.rs +++ b/src/ccu80_cc80/pr.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PR` reader - Period Register"] -pub type PR_R = crate::FieldReader; +pub type PR_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Period Register"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Timer Period Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pr::R`](R) reader structure"] +impl crate::Readable for PR_SPEC {} #[doc = "`reset()` method sets PR to value 0"] impl crate::Resettable for PR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/prs.rs b/src/ccu80_cc80/prs.rs index d3b07079..06dd30c4 100644 --- a/src/ccu80_cc80/prs.rs +++ b/src/ccu80_cc80/prs.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRS` reader - Period Register"] -pub type PRS_R = crate::FieldReader; +pub type PRS_R = crate::FieldReader; #[doc = "Field `PRS` writer - Period Register"] -pub type PRS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PRS_SPEC, u16, u16, 16, O>; +pub type PRS_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Period Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Period Register"] #[inline(always)] #[must_use] - pub fn prs(&mut self) -> PRS_W<0> { - PRS_W::new(self) + pub fn prs(&mut self) -> PRS_W { + PRS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Timer Shadow Period Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`prs::R`](R) reader structure"] +impl crate::Readable for PRS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`prs::W`](W) writer structure"] impl crate::Writable for PRS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/psc.rs b/src/ccu80_cc80/psc.rs index e8231deb..2021519b 100644 --- a/src/ccu80_cc80/psc.rs +++ b/src/ccu80_cc80/psc.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PSIV` reader - Prescaler Initial Value"] -pub type PSIV_R = crate::FieldReader; +pub type PSIV_R = crate::FieldReader; #[doc = "Field `PSIV` writer - Prescaler Initial Value"] -pub type PSIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PSC_SPEC, u8, u8, 4, O>; +pub type PSIV_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Prescaler Initial Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:3 - Prescaler Initial Value"] #[inline(always)] #[must_use] - pub fn psiv(&mut self) -> PSIV_W<0> { - PSIV_W::new(self) + pub fn psiv(&mut self) -> PSIV_W { + PSIV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Prescaler Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psc::R`](R) reader structure"] +impl crate::Readable for PSC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psc::W`](W) writer structure"] impl crate::Writable for PSC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/psl.rs b/src/ccu80_cc80/psl.rs index 7f27f672..7cce80fe 100644 --- a/src/ccu80_cc80/psl.rs +++ b/src/ccu80_cc80/psl.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PSL11` reader - Output Passive Level for CCU8x.OUTy0"] pub type PSL11_R = crate::BitReader; #[doc = "Output Passive Level for CCU8x.OUTy0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PSL11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSL11_A { + pub const fn variant(&self) -> PSL11_A { match self.bits { false => PSL11_A::VALUE1, true => PSL11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive Level is LOW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSL11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Passive Level is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSL11_A::VALUE2 } } #[doc = "Field `PSL11` writer - Output Passive Level for CCU8x.OUTy0"] -pub type PSL11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSL_SPEC, PSL11_A, O>; -impl<'a, const O: u8> PSL11_W<'a, O> { +pub type PSL11_W<'a, REG> = crate::BitWriter<'a, REG, PSL11_A>; +impl<'a, REG> PSL11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Passive Level is LOW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSL11_A::VALUE1) } #[doc = "Passive Level is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSL11_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PSL12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSL12_A { + pub const fn variant(&self) -> PSL12_A { match self.bits { false => PSL12_A::VALUE1, true => PSL12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive Level is LOW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSL12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Passive Level is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSL12_A::VALUE2 } } #[doc = "Field `PSL12` writer - Output Passive Level for CCU8x.OUTy1"] -pub type PSL12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSL_SPEC, PSL12_A, O>; -impl<'a, const O: u8> PSL12_W<'a, O> { +pub type PSL12_W<'a, REG> = crate::BitWriter<'a, REG, PSL12_A>; +impl<'a, REG> PSL12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Passive Level is LOW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSL12_A::VALUE1) } #[doc = "Passive Level is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSL12_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PSL21_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSL21_A { + pub const fn variant(&self) -> PSL21_A { match self.bits { false => PSL21_A::VALUE1, true => PSL21_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive Level is LOW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSL21_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Passive Level is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSL21_A::VALUE2 } } #[doc = "Field `PSL21` writer - Output Passive Level for CCU8x.OUTy2"] -pub type PSL21_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSL_SPEC, PSL21_A, O>; -impl<'a, const O: u8> PSL21_W<'a, O> { +pub type PSL21_W<'a, REG> = crate::BitWriter<'a, REG, PSL21_A>; +impl<'a, REG> PSL21_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Passive Level is LOW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSL21_A::VALUE1) } #[doc = "Passive Level is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSL21_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PSL22_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSL22_A { + pub const fn variant(&self) -> PSL22_A { match self.bits { false => PSL22_A::VALUE1, true => PSL22_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive Level is LOW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSL22_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Passive Level is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSL22_A::VALUE2 } } #[doc = "Field `PSL22` writer - Output Passive Level for CCU8x.OUTy3"] -pub type PSL22_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSL_SPEC, PSL22_A, O>; -impl<'a, const O: u8> PSL22_W<'a, O> { +pub type PSL22_W<'a, REG> = crate::BitWriter<'a, REG, PSL22_A>; +impl<'a, REG> PSL22_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Passive Level is LOW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSL22_A::VALUE1) } #[doc = "Passive Level is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSL22_A::VALUE2) } } @@ -260,46 +240,47 @@ impl W { #[doc = "Bit 0 - Output Passive Level for CCU8x.OUTy0"] #[inline(always)] #[must_use] - pub fn psl11(&mut self) -> PSL11_W<0> { - PSL11_W::new(self) + pub fn psl11(&mut self) -> PSL11_W { + PSL11_W::new(self, 0) } #[doc = "Bit 1 - Output Passive Level for CCU8x.OUTy1"] #[inline(always)] #[must_use] - pub fn psl12(&mut self) -> PSL12_W<1> { - PSL12_W::new(self) + pub fn psl12(&mut self) -> PSL12_W { + PSL12_W::new(self, 1) } #[doc = "Bit 2 - Output Passive Level for CCU8x.OUTy2"] #[inline(always)] #[must_use] - pub fn psl21(&mut self) -> PSL21_W<2> { - PSL21_W::new(self) + pub fn psl21(&mut self) -> PSL21_W { + PSL21_W::new(self, 2) } #[doc = "Bit 3 - Output Passive Level for CCU8x.OUTy3"] #[inline(always)] #[must_use] - pub fn psl22(&mut self) -> PSL22_W<3> { - PSL22_W::new(self) + pub fn psl22(&mut self) -> PSL22_W { + PSL22_W::new(self, 3) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Passive Level Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psl::R`](R) reader structure"] +impl crate::Readable for PSL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psl::W`](W) writer structure"] impl crate::Writable for PSL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/srs.rs b/src/ccu80_cc80/srs.rs index ee0f4f3b..055f31c0 100644 --- a/src/ccu80_cc80/srs.rs +++ b/src/ccu80_cc80/srs.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `POSR` reader - Period/One match Service request selector"] -pub type POSR_R = crate::FieldReader; +pub type POSR_R = crate::FieldReader; #[doc = "Period/One match Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for POSR_A { + type Ux = u8; +} impl POSR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> POSR_A { + pub const fn variant(&self) -> POSR_A { match self.bits { 0 => POSR_A::VALUE1, 1 => POSR_A::VALUE2, @@ -67,53 +38,57 @@ impl POSR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC8ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == POSR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC8ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == POSR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC8ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == POSR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC8ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == POSR_A::VALUE4 } } #[doc = "Field `POSR` writer - Period/One match Service request selector"] -pub type POSR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, POSR_A, 2, O>; -impl<'a, const O: u8> POSR_W<'a, O> { +pub type POSR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, POSR_A>; +impl<'a, REG> POSR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC8ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSR_A::VALUE1) } #[doc = "Forward to CC8ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSR_A::VALUE2) } #[doc = "Forward to CC8ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(POSR_A::VALUE3) } #[doc = "Forward to CC8ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(POSR_A::VALUE4) } } #[doc = "Field `CM1SR` reader - Channel 1 Compare match Service request selector"] -pub type CM1SR_R = crate::FieldReader; +pub type CM1SR_R = crate::FieldReader; #[doc = "Channel 1 Compare match Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CM1SR_A { + type Ux = u8; +} impl CM1SR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CM1SR_A { + pub const fn variant(&self) -> CM1SR_A { match self.bits { 0 => CM1SR_A::VALUE1, 1 => CM1SR_A::VALUE2, @@ -145,53 +123,57 @@ impl CM1SR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC8ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CM1SR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC8ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CM1SR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC8ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CM1SR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC8ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CM1SR_A::VALUE4 } } #[doc = "Field `CM1SR` writer - Channel 1 Compare match Service request selector"] -pub type CM1SR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, CM1SR_A, 2, O>; -impl<'a, const O: u8> CM1SR_W<'a, O> { +pub type CM1SR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CM1SR_A>; +impl<'a, REG> CM1SR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC8ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CM1SR_A::VALUE1) } #[doc = "Forward to CC8ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CM1SR_A::VALUE2) } #[doc = "Forward to CC8ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CM1SR_A::VALUE3) } #[doc = "Forward to CC8ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CM1SR_A::VALUE4) } } #[doc = "Field `CM2SR` reader - Channel 2 Compare match Service request selector"] -pub type CM2SR_R = crate::FieldReader; +pub type CM2SR_R = crate::FieldReader; #[doc = "Channel 2 Compare match Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CM2SR_A { + type Ux = u8; +} impl CM2SR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CM2SR_A { + pub const fn variant(&self) -> CM2SR_A { match self.bits { 0 => CM2SR_A::VALUE1, 1 => CM2SR_A::VALUE2, @@ -223,53 +208,57 @@ impl CM2SR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC8ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CM2SR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC8ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CM2SR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC8ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CM2SR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC8ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CM2SR_A::VALUE4 } } #[doc = "Field `CM2SR` writer - Channel 2 Compare match Service request selector"] -pub type CM2SR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, CM2SR_A, 2, O>; -impl<'a, const O: u8> CM2SR_W<'a, O> { +pub type CM2SR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CM2SR_A>; +impl<'a, REG> CM2SR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC8ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CM2SR_A::VALUE1) } #[doc = "Forward to CC8ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CM2SR_A::VALUE2) } #[doc = "Forward to CC8ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CM2SR_A::VALUE3) } #[doc = "Forward to CC8ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CM2SR_A::VALUE4) } } #[doc = "Field `E0SR` reader - Event 0 Service request selector"] -pub type E0SR_R = crate::FieldReader; +pub type E0SR_R = crate::FieldReader; #[doc = "Event 0 Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for E0SR_A { + type Ux = u8; +} impl E0SR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E0SR_A { + pub const fn variant(&self) -> E0SR_A { match self.bits { 0 => E0SR_A::VALUE1, 1 => E0SR_A::VALUE2, @@ -301,53 +293,57 @@ impl E0SR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CCvySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E0SR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC8ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E0SR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC8ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == E0SR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC8ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == E0SR_A::VALUE4 } } #[doc = "Field `E0SR` writer - Event 0 Service request selector"] -pub type E0SR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, E0SR_A, 2, O>; -impl<'a, const O: u8> E0SR_W<'a, O> { +pub type E0SR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, E0SR_A>; +impl<'a, REG> E0SR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CCvySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E0SR_A::VALUE1) } #[doc = "Forward to CC8ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E0SR_A::VALUE2) } #[doc = "Forward to CC8ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(E0SR_A::VALUE3) } #[doc = "Forward to CC8ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(E0SR_A::VALUE4) } } #[doc = "Field `E1SR` reader - Event 1 Service request selector"] -pub type E1SR_R = crate::FieldReader; +pub type E1SR_R = crate::FieldReader; #[doc = "Event 1 Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for E1SR_A { + type Ux = u8; +} impl E1SR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E1SR_A { + pub const fn variant(&self) -> E1SR_A { match self.bits { 0 => E1SR_A::VALUE1, 1 => E1SR_A::VALUE2, @@ -379,53 +378,57 @@ impl E1SR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC8ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E1SR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CC8ySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E1SR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC8ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == E1SR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC8ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == E1SR_A::VALUE4 } } #[doc = "Field `E1SR` writer - Event 1 Service request selector"] -pub type E1SR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, E1SR_A, 2, O>; -impl<'a, const O: u8> E1SR_W<'a, O> { +pub type E1SR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, E1SR_A>; +impl<'a, REG> E1SR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC8ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E1SR_A::VALUE1) } #[doc = "Forward to CC8ySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E1SR_A::VALUE2) } #[doc = "Forward to CC8ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(E1SR_A::VALUE3) } #[doc = "Forward to CC8ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(E1SR_A::VALUE4) } } #[doc = "Field `E2SR` reader - Event 2 Service request selector"] -pub type E2SR_R = crate::FieldReader; +pub type E2SR_R = crate::FieldReader; #[doc = "Event 2 Service request selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for E2SR_A { + type Ux = u8; +} impl E2SR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> E2SR_A { + pub const fn variant(&self) -> E2SR_A { match self.bits { 0 => E2SR_A::VALUE1, 1 => E2SR_A::VALUE2, @@ -457,48 +463,52 @@ impl E2SR_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Forward to CC8ySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == E2SR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Forward to CCvySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == E2SR_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Forward to CC8ySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == E2SR_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Forward to CC8ySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == E2SR_A::VALUE4 } } #[doc = "Field `E2SR` writer - Event 2 Service request selector"] -pub type E2SR_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, E2SR_A, 2, O>; -impl<'a, const O: u8> E2SR_W<'a, O> { +pub type E2SR_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, E2SR_A>; +impl<'a, REG> E2SR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Forward to CC8ySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(E2SR_A::VALUE1) } #[doc = "Forward to CCvySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(E2SR_A::VALUE2) } #[doc = "Forward to CC8ySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(E2SR_A::VALUE3) } #[doc = "Forward to CC8ySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(E2SR_A::VALUE4) } } @@ -538,58 +548,59 @@ impl W { #[doc = "Bits 0:1 - Period/One match Service request selector"] #[inline(always)] #[must_use] - pub fn posr(&mut self) -> POSR_W<0> { - POSR_W::new(self) + pub fn posr(&mut self) -> POSR_W { + POSR_W::new(self, 0) } #[doc = "Bits 2:3 - Channel 1 Compare match Service request selector"] #[inline(always)] #[must_use] - pub fn cm1sr(&mut self) -> CM1SR_W<2> { - CM1SR_W::new(self) + pub fn cm1sr(&mut self) -> CM1SR_W { + CM1SR_W::new(self, 2) } #[doc = "Bits 4:5 - Channel 2 Compare match Service request selector"] #[inline(always)] #[must_use] - pub fn cm2sr(&mut self) -> CM2SR_W<4> { - CM2SR_W::new(self) + pub fn cm2sr(&mut self) -> CM2SR_W { + CM2SR_W::new(self, 4) } #[doc = "Bits 8:9 - Event 0 Service request selector"] #[inline(always)] #[must_use] - pub fn e0sr(&mut self) -> E0SR_W<8> { - E0SR_W::new(self) + pub fn e0sr(&mut self) -> E0SR_W { + E0SR_W::new(self, 8) } #[doc = "Bits 10:11 - Event 1 Service request selector"] #[inline(always)] #[must_use] - pub fn e1sr(&mut self) -> E1SR_W<10> { - E1SR_W::new(self) + pub fn e1sr(&mut self) -> E1SR_W { + E1SR_W::new(self, 10) } #[doc = "Bits 12:13 - Event 2 Service request selector"] #[inline(always)] #[must_use] - pub fn e2sr(&mut self) -> E2SR_W<12> { - E2SR_W::new(self) + pub fn e2sr(&mut self) -> E2SR_W { + E2SR_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Selector\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`srs::R`](R) reader structure"] +impl crate::Readable for SRS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`srs::W`](W) writer structure"] impl crate::Writable for SRS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/stc.rs b/src/ccu80_cc80/stc.rs index 57f433bb..2976e0aa 100644 --- a/src/ccu80_cc80/stc.rs +++ b/src/ccu80_cc80/stc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CSE` reader - Cascaded shadow transfer enable"] pub type CSE_R = crate::BitReader; #[doc = "Cascaded shadow transfer enable\n\nValue on reset: 0"] @@ -53,39 +21,42 @@ impl From for bool { impl CSE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CSE_A { + pub const fn variant(&self) -> CSE_A { match self.bits { false => CSE_A::VALUE1, true => CSE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Cascaded shadow transfer disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CSE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Cascaded shadow transfer enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CSE_A::VALUE2 } } #[doc = "Field `CSE` writer - Cascaded shadow transfer enable"] -pub type CSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, STC_SPEC, CSE_A, O>; -impl<'a, const O: u8> CSE_W<'a, O> { +pub type CSE_W<'a, REG> = crate::BitWriter<'a, REG, CSE_A>; +impl<'a, REG> CSE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Cascaded shadow transfer disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CSE_A::VALUE1) } #[doc = "Cascaded shadow transfer enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CSE_A::VALUE2) } } #[doc = "Field `STM` reader - Shadow transfer mode"] -pub type STM_R = crate::FieldReader; +pub type STM_R = crate::FieldReader; #[doc = "Shadow transfer mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -103,10 +74,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STM_A { + type Ux = u8; +} impl STM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(STM_A::VALUE1), 1 => Some(STM_A::VALUE2), @@ -114,38 +88,42 @@ impl STM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer is done in Period Match and One match."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer is done only in Period Match."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Shadow transfer is done only in One Match."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STM_A::VALUE3 } } #[doc = "Field `STM` writer - Shadow transfer mode"] -pub type STM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, STC_SPEC, u8, STM_A, 2, O>; -impl<'a, const O: u8> STM_W<'a, O> { +pub type STM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STM_A>; +impl<'a, REG> STM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Shadow transfer is done in Period Match and One match."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STM_A::VALUE1) } #[doc = "Shadow transfer is done only in Period Match."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STM_A::VALUE2) } #[doc = "Shadow transfer is done only in One Match."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STM_A::VALUE3) } } @@ -165,34 +143,35 @@ impl W { #[doc = "Bit 0 - Cascaded shadow transfer enable"] #[inline(always)] #[must_use] - pub fn cse(&mut self) -> CSE_W<0> { - CSE_W::new(self) + pub fn cse(&mut self) -> CSE_W { + CSE_W::new(self, 0) } #[doc = "Bits 1:2 - Shadow transfer mode"] #[inline(always)] #[must_use] - pub fn stm(&mut self) -> STM_W<1> { - STM_W::new(self) + pub fn stm(&mut self) -> STM_W { + STM_W::new(self, 1) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Shadow transfer control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`stc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`stc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`stc::R`](R) reader structure"] +impl crate::Readable for STC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`stc::W`](W) writer structure"] impl crate::Writable for STC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/swr.rs b/src/ccu80_cc80/swr.rs index 0ae4dde4..c7c8eac3 100644 --- a/src/ccu80_cc80/swr.rs +++ b/src/ccu80_cc80/swr.rs @@ -1,120 +1,104 @@ #[doc = "Register `SWR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RPM` writer - Period match while counting up clear"] -pub type RPM_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RPM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ROM` writer - One match while counting down clear"] -pub type ROM_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type ROM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RCM1U` writer - Channel 1 Compare match while counting up clear"] -pub type RCM1U_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RCM1U_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RCM1D` writer - Channel 1 Compare match while counting down clear"] -pub type RCM1D_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RCM1D_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RCM2U` writer - Channel 2 Compare match while counting up clear"] -pub type RCM2U_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RCM2U_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RCM2D` writer - Channel 2 Compare match while counting down clear"] -pub type RCM2D_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RCM2D_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RE0A` writer - Event 0 detection clear"] -pub type RE0A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RE0A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RE1A` writer - Event 1 detection clear"] -pub type RE1A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RE1A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RE2A` writer - Event 2 detection clear"] -pub type RE2A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RE2A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RTRPF` writer - Trap Flag status clear"] -pub type RTRPF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWR_SPEC, bool, O>; +pub type RTRPF_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Period match while counting up clear"] #[inline(always)] #[must_use] - pub fn rpm(&mut self) -> RPM_W<0> { - RPM_W::new(self) + pub fn rpm(&mut self) -> RPM_W { + RPM_W::new(self, 0) } #[doc = "Bit 1 - One match while counting down clear"] #[inline(always)] #[must_use] - pub fn rom(&mut self) -> ROM_W<1> { - ROM_W::new(self) + pub fn rom(&mut self) -> ROM_W { + ROM_W::new(self, 1) } #[doc = "Bit 2 - Channel 1 Compare match while counting up clear"] #[inline(always)] #[must_use] - pub fn rcm1u(&mut self) -> RCM1U_W<2> { - RCM1U_W::new(self) + pub fn rcm1u(&mut self) -> RCM1U_W { + RCM1U_W::new(self, 2) } #[doc = "Bit 3 - Channel 1 Compare match while counting down clear"] #[inline(always)] #[must_use] - pub fn rcm1d(&mut self) -> RCM1D_W<3> { - RCM1D_W::new(self) + pub fn rcm1d(&mut self) -> RCM1D_W { + RCM1D_W::new(self, 3) } #[doc = "Bit 4 - Channel 2 Compare match while counting up clear"] #[inline(always)] #[must_use] - pub fn rcm2u(&mut self) -> RCM2U_W<4> { - RCM2U_W::new(self) + pub fn rcm2u(&mut self) -> RCM2U_W { + RCM2U_W::new(self, 4) } #[doc = "Bit 5 - Channel 2 Compare match while counting down clear"] #[inline(always)] #[must_use] - pub fn rcm2d(&mut self) -> RCM2D_W<5> { - RCM2D_W::new(self) + pub fn rcm2d(&mut self) -> RCM2D_W { + RCM2D_W::new(self, 5) } #[doc = "Bit 8 - Event 0 detection clear"] #[inline(always)] #[must_use] - pub fn re0a(&mut self) -> RE0A_W<8> { - RE0A_W::new(self) + pub fn re0a(&mut self) -> RE0A_W { + RE0A_W::new(self, 8) } #[doc = "Bit 9 - Event 1 detection clear"] #[inline(always)] #[must_use] - pub fn re1a(&mut self) -> RE1A_W<9> { - RE1A_W::new(self) + pub fn re1a(&mut self) -> RE1A_W { + RE1A_W::new(self, 9) } #[doc = "Bit 10 - Event 2 detection clear"] #[inline(always)] #[must_use] - pub fn re2a(&mut self) -> RE2A_W<10> { - RE2A_W::new(self) + pub fn re2a(&mut self) -> RE2A_W { + RE2A_W::new(self, 10) } #[doc = "Bit 11 - Trap Flag status clear"] #[inline(always)] #[must_use] - pub fn rtrpf(&mut self) -> RTRPF_W<11> { - RTRPF_W::new(self) + pub fn rtrpf(&mut self) -> RTRPF_W { + RTRPF_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Status Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`swr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SWR_SPEC; impl crate::RegisterSpec for SWR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [swr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`swr::W`](W) writer structure"] impl crate::Writable for SWR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/sws.rs b/src/ccu80_cc80/sws.rs index 5f8d8337..9247dd2b 100644 --- a/src/ccu80_cc80/sws.rs +++ b/src/ccu80_cc80/sws.rs @@ -1,120 +1,104 @@ #[doc = "Register `SWS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SPM` writer - Period match while counting up set"] -pub type SPM_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SPM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SOM` writer - One match while counting down set"] -pub type SOM_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SOM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCM1U` writer - Channel 1 Compare match while counting up set"] -pub type SCM1U_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCM1U_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCM1D` writer - Channel 1 Compare match while counting down set"] -pub type SCM1D_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCM1D_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCM2U` writer - Compare match while counting up set"] -pub type SCM2U_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCM2U_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCM2D` writer - Compare match while counting down set"] -pub type SCM2D_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCM2D_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SE0A` writer - Event 0 detection set"] -pub type SE0A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SE0A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SE1A` writer - Event 1 detection set"] -pub type SE1A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SE1A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SE2A` writer - Event 2 detection set"] -pub type SE2A_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SE2A_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STRPF` writer - Trap Flag status set"] -pub type STRPF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type STRPF_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Period match while counting up set"] #[inline(always)] #[must_use] - pub fn spm(&mut self) -> SPM_W<0> { - SPM_W::new(self) + pub fn spm(&mut self) -> SPM_W { + SPM_W::new(self, 0) } #[doc = "Bit 1 - One match while counting down set"] #[inline(always)] #[must_use] - pub fn som(&mut self) -> SOM_W<1> { - SOM_W::new(self) + pub fn som(&mut self) -> SOM_W { + SOM_W::new(self, 1) } #[doc = "Bit 2 - Channel 1 Compare match while counting up set"] #[inline(always)] #[must_use] - pub fn scm1u(&mut self) -> SCM1U_W<2> { - SCM1U_W::new(self) + pub fn scm1u(&mut self) -> SCM1U_W { + SCM1U_W::new(self, 2) } #[doc = "Bit 3 - Channel 1 Compare match while counting down set"] #[inline(always)] #[must_use] - pub fn scm1d(&mut self) -> SCM1D_W<3> { - SCM1D_W::new(self) + pub fn scm1d(&mut self) -> SCM1D_W { + SCM1D_W::new(self, 3) } #[doc = "Bit 4 - Compare match while counting up set"] #[inline(always)] #[must_use] - pub fn scm2u(&mut self) -> SCM2U_W<4> { - SCM2U_W::new(self) + pub fn scm2u(&mut self) -> SCM2U_W { + SCM2U_W::new(self, 4) } #[doc = "Bit 5 - Compare match while counting down set"] #[inline(always)] #[must_use] - pub fn scm2d(&mut self) -> SCM2D_W<5> { - SCM2D_W::new(self) + pub fn scm2d(&mut self) -> SCM2D_W { + SCM2D_W::new(self, 5) } #[doc = "Bit 8 - Event 0 detection set"] #[inline(always)] #[must_use] - pub fn se0a(&mut self) -> SE0A_W<8> { - SE0A_W::new(self) + pub fn se0a(&mut self) -> SE0A_W { + SE0A_W::new(self, 8) } #[doc = "Bit 9 - Event 1 detection set"] #[inline(always)] #[must_use] - pub fn se1a(&mut self) -> SE1A_W<9> { - SE1A_W::new(self) + pub fn se1a(&mut self) -> SE1A_W { + SE1A_W::new(self, 9) } #[doc = "Bit 10 - Event 2 detection set"] #[inline(always)] #[must_use] - pub fn se2a(&mut self) -> SE2A_W<10> { - SE2A_W::new(self) + pub fn se2a(&mut self) -> SE2A_W { + SE2A_W::new(self, 10) } #[doc = "Bit 11 - Trap Flag status set"] #[inline(always)] #[must_use] - pub fn strpf(&mut self) -> STRPF_W<11> { - STRPF_W::new(self) + pub fn strpf(&mut self) -> STRPF_W { + STRPF_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Status Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sws::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SWS_SPEC; impl crate::RegisterSpec for SWS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [sws::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`sws::W`](W) writer structure"] impl crate::Writable for SWS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/tc.rs b/src/ccu80_cc80/tc.rs index 657126a4..df55b7b0 100644 --- a/src/ccu80_cc80/tc.rs +++ b/src/ccu80_cc80/tc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TCM` reader - Timer Counting Mode"] pub type TCM_R = crate::BitReader; #[doc = "Timer Counting Mode\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl TCM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TCM_A { + pub const fn variant(&self) -> TCM_A { match self.bits { false => TCM_A::VALUE1, true => TCM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Edge aligned mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TCM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Center aligned mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TCM_A::VALUE2 } } #[doc = "Field `TCM` writer - Timer Counting Mode"] -pub type TCM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TCM_A, O>; -impl<'a, const O: u8> TCM_W<'a, O> { +pub type TCM_W<'a, REG> = crate::BitWriter<'a, REG, TCM_A>; +impl<'a, REG> TCM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Edge aligned mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TCM_A::VALUE1) } #[doc = "Center aligned mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TCM_A::VALUE2) } } @@ -103,41 +74,44 @@ impl From for bool { impl TSSM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSSM_A { + pub const fn variant(&self) -> TSSM_A { match self.bits { false => TSSM_A::VALUE1, true => TSSM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Single shot mode is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSSM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Single shot mode is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSSM_A::VALUE2 } } #[doc = "Field `TSSM` writer - Timer Single Shot Mode"] -pub type TSSM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TSSM_A, O>; -impl<'a, const O: u8> TSSM_W<'a, O> { +pub type TSSM_W<'a, REG> = crate::BitWriter<'a, REG, TSSM_A>; +impl<'a, REG> TSSM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Single shot mode is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSSM_A::VALUE1) } #[doc = "Single shot mode is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSSM_A::VALUE2) } } #[doc = "Field `CLST` reader - Shadow Transfer on Clear"] -pub type CLST_R = crate::BitReader; +pub type CLST_R = crate::BitReader; #[doc = "Field `CLST` writer - Shadow Transfer on Clear"] -pub type CLST_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, bool, O>; +pub type CLST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CMOD` reader - Capture Compare Mode"] pub type CMOD_R = crate::BitReader; #[doc = "Capture Compare Mode\n\nValue on reset: 0"] @@ -157,18 +131,18 @@ impl From for bool { impl CMOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMOD_A { + pub const fn variant(&self) -> CMOD_A { match self.bits { false => CMOD_A::VALUE1, true => CMOD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Compare Mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Capture Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMOD_A::VALUE2 @@ -193,39 +167,42 @@ impl From for bool { impl ECM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ECM_A { + pub const fn variant(&self) -> ECM_A { match self.bits { false => ECM_A::VALUE1, true => ECM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ECM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Extended Capture Mode. Clear of the Full Flag of each capture register is done not only by accessing the individual registers but also by accessing the ECRDThis register holds the information related to the extended capture mode. register. When reading the ECRDThis register holds the information related to the extended capture mode. register, only the capture register register full flag pointed by the ECRDThis register holds the information related to the extended capture mode..VPTR is cleared"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ECM_A::VALUE2 } } #[doc = "Field `ECM` writer - Extended Capture Mode"] -pub type ECM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, ECM_A, O>; -impl<'a, const O: u8> ECM_W<'a, O> { +pub type ECM_W<'a, REG> = crate::BitWriter<'a, REG, ECM_A>; +impl<'a, REG> ECM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal Capture Mode. Clear of the Full Flag of each capture register is done by accessing the registers individually only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ECM_A::VALUE1) } #[doc = "Extended Capture Mode. Clear of the Full Flag of each capture register is done not only by accessing the individual registers but also by accessing the ECRDThis register holds the information related to the extended capture mode. register. When reading the ECRDThis register holds the information related to the extended capture mode. register, only the capture register register full flag pointed by the ECRDThis register holds the information related to the extended capture mode..VPTR is cleared"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ECM_A::VALUE2) } } #[doc = "Field `CAPC` reader - Clear on Capture Control"] -pub type CAPC_R = crate::FieldReader; +pub type CAPC_R = crate::FieldReader; #[doc = "Clear on Capture Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -245,10 +222,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CAPC_A { + type Ux = u8; +} impl CAPC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CAPC_A { + pub const fn variant(&self) -> CAPC_A { match self.bits { 0 => CAPC_A::VALUE1, 1 => CAPC_A::VALUE2, @@ -257,48 +237,52 @@ impl CAPC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer is never cleared on a capture event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CAPC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer is cleared on a capture event into capture registers 2 and 3. (When SCE = 1#, Timer is always cleared in a capture event)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CAPC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Timer is cleared on a capture event into capture registers 0 and 1. (When SCE = 1#, Timer is always cleared in a capture event)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CAPC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Timer is always cleared in a capture event."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CAPC_A::VALUE4 } } #[doc = "Field `CAPC` writer - Clear on Capture Control"] -pub type CAPC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, TC_SPEC, u8, CAPC_A, 2, O>; -impl<'a, const O: u8> CAPC_W<'a, O> { +pub type CAPC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CAPC_A>; +impl<'a, REG> CAPC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Timer is never cleared on a capture event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CAPC_A::VALUE1) } #[doc = "Timer is cleared on a capture event into capture registers 2 and 3. (When SCE = 1#, Timer is always cleared in a capture event)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CAPC_A::VALUE2) } #[doc = "Timer is cleared on a capture event into capture registers 0 and 1. (When SCE = 1#, Timer is always cleared in a capture event)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CAPC_A::VALUE3) } #[doc = "Timer is always cleared in a capture event."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CAPC_A::VALUE4) } } @@ -321,39 +305,42 @@ impl From for bool { impl TLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TLS_A { + pub const fn variant(&self) -> TLS_A { match self.bits { false => TLS_A::VALUE1, true => TLS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer is loaded with the value of CR1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer is loaded with the value of CR2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TLS_A::VALUE2 } } #[doc = "Field `TLS` writer - Timer Load selector"] -pub type TLS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TLS_A, O>; -impl<'a, const O: u8> TLS_W<'a, O> { +pub type TLS_W<'a, REG> = crate::BitWriter<'a, REG, TLS_A>; +impl<'a, REG> TLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Timer is loaded with the value of CR1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TLS_A::VALUE1) } #[doc = "Timer is loaded with the value of CR2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TLS_A::VALUE2) } } #[doc = "Field `ENDM` reader - Extended Stop Function Control"] -pub type ENDM_R = crate::FieldReader; +pub type ENDM_R = crate::FieldReader; #[doc = "Extended Stop Function Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -371,10 +358,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ENDM_A { + type Ux = u8; +} impl ENDM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ENDM_A::VALUE1), 1 => Some(ENDM_A::VALUE2), @@ -382,38 +372,42 @@ impl ENDM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clears the timer run bit only (default stop)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENDM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clears the timer only (flush)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENDM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Clears the timer and run bit (flush/stop)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ENDM_A::VALUE3 } } #[doc = "Field `ENDM` writer - Extended Stop Function Control"] -pub type ENDM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TC_SPEC, u8, ENDM_A, 2, O>; -impl<'a, const O: u8> ENDM_W<'a, O> { +pub type ENDM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ENDM_A>; +impl<'a, REG> ENDM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Clears the timer run bit only (default stop)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENDM_A::VALUE1) } #[doc = "Clears the timer only (flush)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENDM_A::VALUE2) } #[doc = "Clears the timer and run bit (flush/stop)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ENDM_A::VALUE3) } } @@ -436,34 +430,37 @@ impl From for bool { impl STRM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STRM_A { + pub const fn variant(&self) -> STRM_A { match self.bits { false => STRM_A::VALUE1, true => STRM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Sets run bit only (default start)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STRM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clears the timer and sets run bit, if not set (flush/start)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STRM_A::VALUE2 } } #[doc = "Field `STRM` writer - Extended Start Function Control"] -pub type STRM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, STRM_A, O>; -impl<'a, const O: u8> STRM_W<'a, O> { +pub type STRM_W<'a, REG> = crate::BitWriter<'a, REG, STRM_A>; +impl<'a, REG> STRM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Sets run bit only (default start)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STRM_A::VALUE1) } #[doc = "Clears the timer and sets run bit, if not set (flush/start)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STRM_A::VALUE2) } } @@ -486,34 +483,37 @@ impl From for bool { impl SCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCE_A { + pub const fn variant(&self) -> SCE_A { match self.bits { false => SCE_A::VALUE1, true => SCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == SCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[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. and 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)] pub fn is_value2(&self) -> bool { *self == SCE_A::VALUE2 } } #[doc = "Field `SCE` writer - Equal Capture Event enable"] -pub type SCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, SCE_A, O>; -impl<'a, const O: u8> SCE_W<'a, O> { +pub type SCE_W<'a, REG> = crate::BitWriter<'a, REG, SCE_A>; +impl<'a, REG> SCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCE_A::VALUE1) } #[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. and 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)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCE_A::VALUE2) } } @@ -536,39 +536,42 @@ impl From for bool { impl CCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCS_A { + pub const fn variant(&self) -> CCS_A { match self.bits { false => CCS_A::VALUE1, true => CCS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The capture into a specific capture register is done with the rules linked with the full flags, described at ."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The capture into the capture registers is always done regardless of the full flag status (even if the register has not been read back)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCS_A::VALUE2 } } #[doc = "Field `CCS` writer - Continuous Capture Enable"] -pub type CCS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, CCS_A, O>; -impl<'a, const O: u8> CCS_W<'a, O> { +pub type CCS_W<'a, REG> = crate::BitWriter<'a, REG, CCS_A>; +impl<'a, REG> CCS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The capture into a specific capture register is done with the rules linked with the full flags, described at ."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCS_A::VALUE1) } #[doc = "The capture into the capture registers is always done regardless of the full flag status (even if the register has not been read back)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCS_A::VALUE2) } } #[doc = "Field `DITHE` reader - Dither Enable"] -pub type DITHE_R = crate::FieldReader; +pub type DITHE_R = crate::FieldReader; #[doc = "Dither Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -588,10 +591,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DITHE_A { + type Ux = u8; +} impl DITHE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DITHE_A { + pub const fn variant(&self) -> DITHE_A { match self.bits { 0 => DITHE_A::VALUE1, 1 => DITHE_A::VALUE2, @@ -600,48 +606,52 @@ impl DITHE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dither is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DITHE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dither is applied to the Period"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DITHE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Dither is applied to the Compare"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DITHE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Dither is applied to the Period and Compare"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DITHE_A::VALUE4 } } #[doc = "Field `DITHE` writer - Dither Enable"] -pub type DITHE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, TC_SPEC, u8, DITHE_A, 2, O>; -impl<'a, const O: u8> DITHE_W<'a, O> { +pub type DITHE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, DITHE_A>; +impl<'a, REG> DITHE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Dither is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DITHE_A::VALUE1) } #[doc = "Dither is applied to the Period"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DITHE_A::VALUE2) } #[doc = "Dither is applied to the Compare"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DITHE_A::VALUE3) } #[doc = "Dither is applied to the Period and Compare"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DITHE_A::VALUE4) } } @@ -664,34 +674,37 @@ impl From for bool { impl DIM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIM_A { + pub const fn variant(&self) -> DIM_A { match self.bits { false => DIM_A::VALUE1, true => DIM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Slice is using it own dither unit"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Slice is connected to the dither unit of slice 0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIM_A::VALUE2 } } #[doc = "Field `DIM` writer - Dither input selector"] -pub type DIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, DIM_A, O>; -impl<'a, const O: u8> DIM_W<'a, O> { +pub type DIM_W<'a, REG> = crate::BitWriter<'a, REG, DIM_A>; +impl<'a, REG> DIM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Slice is using it own dither unit"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIM_A::VALUE1) } #[doc = "Slice is connected to the dither unit of slice 0."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIM_A::VALUE2) } } @@ -714,34 +727,37 @@ impl From for bool { impl FPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FPE_A { + pub const fn variant(&self) -> FPE_A { match self.bits { false => FPE_A::VALUE1, true => FPE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Floating prescaler mode is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FPE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Floating prescaler mode is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FPE_A::VALUE2 } } #[doc = "Field `FPE` writer - Floating Prescaler enable"] -pub type FPE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, FPE_A, O>; -impl<'a, const O: u8> FPE_W<'a, O> { +pub type FPE_W<'a, REG> = crate::BitWriter<'a, REG, FPE_A>; +impl<'a, REG> FPE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Floating prescaler mode is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FPE_A::VALUE1) } #[doc = "Floating prescaler mode is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FPE_A::VALUE2) } } @@ -764,49 +780,52 @@ impl From for bool { impl TRAPE0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRAPE0_A { + pub const fn variant(&self) -> TRAPE0_A { match self.bits { false => TRAPE0_A::VALUE1, true => TRAPE0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "TRAP functionality has no effect on the CCU8x.OUTy0 output"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRAPE0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TRAP functionality affects the CCU8x.OUTy0 output"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRAPE0_A::VALUE2 } } #[doc = "Field `TRAPE0` writer - TRAP enable for CCU8x.OUTy0"] -pub type TRAPE0_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TRAPE0_A, O>; -impl<'a, const O: u8> TRAPE0_W<'a, O> { +pub type TRAPE0_W<'a, REG> = crate::BitWriter<'a, REG, TRAPE0_A>; +impl<'a, REG> TRAPE0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "TRAP functionality has no effect on the CCU8x.OUTy0 output"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRAPE0_A::VALUE1) } #[doc = "TRAP functionality affects the CCU8x.OUTy0 output"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRAPE0_A::VALUE2) } } #[doc = "Field `TRAPE1` reader - TRAP enable for CCU8x.OUTy1"] -pub type TRAPE1_R = crate::BitReader; +pub type TRAPE1_R = crate::BitReader; #[doc = "Field `TRAPE1` writer - TRAP enable for CCU8x.OUTy1"] -pub type TRAPE1_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, bool, O>; +pub type TRAPE1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TRAPE2` reader - TRAP enable for CCU8x.OUTy2"] -pub type TRAPE2_R = crate::BitReader; +pub type TRAPE2_R = crate::BitReader; #[doc = "Field `TRAPE2` writer - TRAP enable for CCU8x.OUTy2"] -pub type TRAPE2_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, bool, O>; +pub type TRAPE2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TRAPE3` reader - TRAP enable for CCU8x.OUTy3"] -pub type TRAPE3_R = crate::BitReader; +pub type TRAPE3_R = crate::BitReader; #[doc = "Field `TRAPE3` writer - TRAP enable for CCU8x.OUTy3"] -pub type TRAPE3_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, bool, O>; +pub type TRAPE3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TRPSE` reader - TRAP Synchronization Enable"] pub type TRPSE_R = crate::BitReader; #[doc = "TRAP Synchronization Enable\n\nValue on reset: 0"] @@ -826,34 +845,37 @@ impl From for bool { impl TRPSE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRPSE_A { + pub const fn variant(&self) -> TRPSE_A { match self.bits { false => TRPSE_A::VALUE1, true => TRPSE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Exiting from TRAP state isn't synchronized with the PWM signal"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRPSE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Exiting from TRAP state is synchronized with the PWM signal"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRPSE_A::VALUE2 } } #[doc = "Field `TRPSE` writer - TRAP Synchronization Enable"] -pub type TRPSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TRPSE_A, O>; -impl<'a, const O: u8> TRPSE_W<'a, O> { +pub type TRPSE_W<'a, REG> = crate::BitWriter<'a, REG, TRPSE_A>; +impl<'a, REG> TRPSE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Exiting from TRAP state isn't synchronized with the PWM signal"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRPSE_A::VALUE1) } #[doc = "Exiting from TRAP state is synchronized with the PWM signal"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRPSE_A::VALUE2) } } @@ -876,34 +898,37 @@ impl From for bool { impl TRPSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRPSW_A { + pub const fn variant(&self) -> TRPSW_A { match self.bits { false => TRPSW_A::VALUE1, true => TRPSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The slice exits the TRAP state automatically when the TRAP condition is not present (Trap state cleared by HW and SW)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRPSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The TRAP state can only be exited by a SW request."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRPSW_A::VALUE2 } } #[doc = "Field `TRPSW` writer - TRAP State Clear Control"] -pub type TRPSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, TRPSW_A, O>; -impl<'a, const O: u8> TRPSW_W<'a, O> { +pub type TRPSW_W<'a, REG> = crate::BitWriter<'a, REG, TRPSW_A>; +impl<'a, REG> TRPSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The slice exits the TRAP state automatically when the TRAP condition is not present (Trap state cleared by HW and SW)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRPSW_A::VALUE1) } #[doc = "The TRAP state can only be exited by a SW request."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRPSW_A::VALUE2) } } @@ -926,34 +951,37 @@ impl From for bool { impl EMS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMS_A { + pub const fn variant(&self) -> EMS_A { match self.bits { false => EMS_A::VALUE1, true => EMS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Modulation functionality is not synchronized with the PWM signal"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Modulation functionality is synchronized with the PWM signal"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMS_A::VALUE2 } } #[doc = "Field `EMS` writer - External Modulation Synchronization"] -pub type EMS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, EMS_A, O>; -impl<'a, const O: u8> EMS_W<'a, O> { +pub type EMS_W<'a, REG> = crate::BitWriter<'a, REG, EMS_A>; +impl<'a, REG> EMS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External Modulation functionality is not synchronized with the PWM signal"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMS_A::VALUE1) } #[doc = "External Modulation functionality is synchronized with the PWM signal"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMS_A::VALUE2) } } @@ -976,34 +1004,37 @@ impl From for bool { impl EMT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMT_A { + pub const fn variant(&self) -> EMT_A { match self.bits { false => EMT_A::VALUE1, true => EMT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Modulation functionality is clearing the CC8ySTx bits."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Modulation functionality is gating the outputs."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMT_A::VALUE2 } } #[doc = "Field `EMT` writer - External Modulation Type"] -pub type EMT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, EMT_A, O>; -impl<'a, const O: u8> EMT_W<'a, O> { +pub type EMT_W<'a, REG> = crate::BitWriter<'a, REG, EMT_A>; +impl<'a, REG> EMT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External Modulation functionality is clearing the CC8ySTx bits."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMT_A::VALUE1) } #[doc = "External Modulation functionality is gating the outputs."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMT_A::VALUE2) } } @@ -1026,34 +1057,37 @@ impl From for bool { impl MCME1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCME1_A { + pub const fn variant(&self) -> MCME1_A { match self.bits { false => MCME1_A::VALUE1, true => MCME1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Multi Channel Mode in Channel 1 is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCME1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Multi Channel Mode in Channel 1 is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCME1_A::VALUE2 } } #[doc = "Field `MCME1` writer - Multi Channel Mode Enable for Channel 1"] -pub type MCME1_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, MCME1_A, O>; -impl<'a, const O: u8> MCME1_W<'a, O> { +pub type MCME1_W<'a, REG> = crate::BitWriter<'a, REG, MCME1_A>; +impl<'a, REG> MCME1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Multi Channel Mode in Channel 1 is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCME1_A::VALUE1) } #[doc = "Multi Channel Mode in Channel 1 is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCME1_A::VALUE2) } } @@ -1076,39 +1110,42 @@ impl From for bool { impl MCME2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCME2_A { + pub const fn variant(&self) -> MCME2_A { match self.bits { false => MCME2_A::VALUE1, true => MCME2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Multi Channel Mode in Channel 2 is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCME2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Multi Channel Mode in Channel 2 is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCME2_A::VALUE2 } } #[doc = "Field `MCME2` writer - Multi Channel Mode Enable for Channel 2"] -pub type MCME2_W<'a, const O: u8> = crate::BitWriter<'a, u32, TC_SPEC, MCME2_A, O>; -impl<'a, const O: u8> MCME2_W<'a, O> { +pub type MCME2_W<'a, REG> = crate::BitWriter<'a, REG, MCME2_A>; +impl<'a, REG> MCME2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Multi Channel Mode in Channel 2 is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCME2_A::VALUE1) } #[doc = "Multi Channel Mode in Channel 2 is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCME2_A::VALUE2) } } #[doc = "Field `EME` reader - External Modulation Channel enable"] -pub type EME_R = crate::FieldReader; +pub type EME_R = crate::FieldReader; #[doc = "External Modulation Channel enable\n\nValue on reset: 3"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1128,10 +1165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EME_A { + type Ux = u8; +} impl EME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EME_A { + pub const fn variant(&self) -> EME_A { match self.bits { 0 => EME_A::VALUE1, 1 => EME_A::VALUE2, @@ -1140,53 +1180,57 @@ impl EME_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Modulation functionality doesn't affect any channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External Modulation only applied on channel 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EME_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Modulation only applied on channel 2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EME_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External Modulation applied on both channels"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EME_A::VALUE4 } } #[doc = "Field `EME` writer - External Modulation Channel enable"] -pub type EME_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, TC_SPEC, u8, EME_A, 2, O>; -impl<'a, const O: u8> EME_W<'a, O> { +pub type EME_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EME_A>; +impl<'a, REG> EME_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Modulation functionality doesn't affect any channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EME_A::VALUE1) } #[doc = "External Modulation only applied on channel 1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EME_A::VALUE2) } #[doc = "External Modulation only applied on channel 2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EME_A::VALUE3) } #[doc = "External Modulation applied on both channels"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EME_A::VALUE4) } } #[doc = "Field `STOS` reader - Status bit output selector"] -pub type STOS_R = crate::FieldReader; +pub type STOS_R = crate::FieldReader; #[doc = "Status bit output selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1204,10 +1248,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STOS_A { + type Ux = u8; +} impl STOS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(STOS_A::VALUE1), 1 => Some(STOS_A::VALUE2), @@ -1215,38 +1262,42 @@ impl STOS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CC8yST1 forward to CCU8x.STy"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STOS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CC8yST2 forward to CCU8x.STy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STOS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CC8yST1 AND CC8yST2 forward to CCU8x.STy"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STOS_A::VALUE3 } } #[doc = "Field `STOS` writer - Status bit output selector"] -pub type STOS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TC_SPEC, u8, STOS_A, 2, O>; -impl<'a, const O: u8> STOS_W<'a, O> { +pub type STOS_W<'a, REG> = crate::FieldWriter<'a, REG, 2, STOS_A>; +impl<'a, REG> STOS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CC8yST1 forward to CCU8x.STy"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STOS_A::VALUE1) } #[doc = "CC8yST2 forward to CCU8x.STy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STOS_A::VALUE2) } #[doc = "CC8yST1 AND CC8yST2 forward to CCU8x.STy"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STOS_A::VALUE3) } } @@ -1386,172 +1437,173 @@ impl W { #[doc = "Bit 0 - Timer Counting Mode"] #[inline(always)] #[must_use] - pub fn tcm(&mut self) -> TCM_W<0> { - TCM_W::new(self) + pub fn tcm(&mut self) -> TCM_W { + TCM_W::new(self, 0) } #[doc = "Bit 1 - Timer Single Shot Mode"] #[inline(always)] #[must_use] - pub fn tssm(&mut self) -> TSSM_W<1> { - TSSM_W::new(self) + pub fn tssm(&mut self) -> TSSM_W { + TSSM_W::new(self, 1) } #[doc = "Bit 2 - Shadow Transfer on Clear"] #[inline(always)] #[must_use] - pub fn clst(&mut self) -> CLST_W<2> { - CLST_W::new(self) + pub fn clst(&mut self) -> CLST_W { + CLST_W::new(self, 2) } #[doc = "Bit 4 - Extended Capture Mode"] #[inline(always)] #[must_use] - pub fn ecm(&mut self) -> ECM_W<4> { - ECM_W::new(self) + pub fn ecm(&mut self) -> ECM_W { + ECM_W::new(self, 4) } #[doc = "Bits 5:6 - Clear on Capture Control"] #[inline(always)] #[must_use] - pub fn capc(&mut self) -> CAPC_W<5> { - CAPC_W::new(self) + pub fn capc(&mut self) -> CAPC_W { + CAPC_W::new(self, 5) } #[doc = "Bit 7 - Timer Load selector"] #[inline(always)] #[must_use] - pub fn tls(&mut self) -> TLS_W<7> { - TLS_W::new(self) + pub fn tls(&mut self) -> TLS_W { + TLS_W::new(self, 7) } #[doc = "Bits 8:9 - Extended Stop Function Control"] #[inline(always)] #[must_use] - pub fn endm(&mut self) -> ENDM_W<8> { - ENDM_W::new(self) + pub fn endm(&mut self) -> ENDM_W { + ENDM_W::new(self, 8) } #[doc = "Bit 10 - Extended Start Function Control"] #[inline(always)] #[must_use] - pub fn strm(&mut self) -> STRM_W<10> { - STRM_W::new(self) + pub fn strm(&mut self) -> STRM_W { + STRM_W::new(self, 10) } #[doc = "Bit 11 - Equal Capture Event enable"] #[inline(always)] #[must_use] - pub fn sce(&mut self) -> SCE_W<11> { - SCE_W::new(self) + pub fn sce(&mut self) -> SCE_W { + SCE_W::new(self, 11) } #[doc = "Bit 12 - Continuous Capture Enable"] #[inline(always)] #[must_use] - pub fn ccs(&mut self) -> CCS_W<12> { - CCS_W::new(self) + pub fn ccs(&mut self) -> CCS_W { + CCS_W::new(self, 12) } #[doc = "Bits 13:14 - Dither Enable"] #[inline(always)] #[must_use] - pub fn dithe(&mut self) -> DITHE_W<13> { - DITHE_W::new(self) + pub fn dithe(&mut self) -> DITHE_W { + DITHE_W::new(self, 13) } #[doc = "Bit 15 - Dither input selector"] #[inline(always)] #[must_use] - pub fn dim(&mut self) -> DIM_W<15> { - DIM_W::new(self) + pub fn dim(&mut self) -> DIM_W { + DIM_W::new(self, 15) } #[doc = "Bit 16 - Floating Prescaler enable"] #[inline(always)] #[must_use] - pub fn fpe(&mut self) -> FPE_W<16> { - FPE_W::new(self) + pub fn fpe(&mut self) -> FPE_W { + FPE_W::new(self, 16) } #[doc = "Bit 17 - TRAP enable for CCU8x.OUTy0"] #[inline(always)] #[must_use] - pub fn trape0(&mut self) -> TRAPE0_W<17> { - TRAPE0_W::new(self) + pub fn trape0(&mut self) -> TRAPE0_W { + TRAPE0_W::new(self, 17) } #[doc = "Bit 18 - TRAP enable for CCU8x.OUTy1"] #[inline(always)] #[must_use] - pub fn trape1(&mut self) -> TRAPE1_W<18> { - TRAPE1_W::new(self) + pub fn trape1(&mut self) -> TRAPE1_W { + TRAPE1_W::new(self, 18) } #[doc = "Bit 19 - TRAP enable for CCU8x.OUTy2"] #[inline(always)] #[must_use] - pub fn trape2(&mut self) -> TRAPE2_W<19> { - TRAPE2_W::new(self) + pub fn trape2(&mut self) -> TRAPE2_W { + TRAPE2_W::new(self, 19) } #[doc = "Bit 20 - TRAP enable for CCU8x.OUTy3"] #[inline(always)] #[must_use] - pub fn trape3(&mut self) -> TRAPE3_W<20> { - TRAPE3_W::new(self) + pub fn trape3(&mut self) -> TRAPE3_W { + TRAPE3_W::new(self, 20) } #[doc = "Bit 21 - TRAP Synchronization Enable"] #[inline(always)] #[must_use] - pub fn trpse(&mut self) -> TRPSE_W<21> { - TRPSE_W::new(self) + pub fn trpse(&mut self) -> TRPSE_W { + TRPSE_W::new(self, 21) } #[doc = "Bit 22 - TRAP State Clear Control"] #[inline(always)] #[must_use] - pub fn trpsw(&mut self) -> TRPSW_W<22> { - TRPSW_W::new(self) + pub fn trpsw(&mut self) -> TRPSW_W { + TRPSW_W::new(self, 22) } #[doc = "Bit 23 - External Modulation Synchronization"] #[inline(always)] #[must_use] - pub fn ems(&mut self) -> EMS_W<23> { - EMS_W::new(self) + pub fn ems(&mut self) -> EMS_W { + EMS_W::new(self, 23) } #[doc = "Bit 24 - External Modulation Type"] #[inline(always)] #[must_use] - pub fn emt(&mut self) -> EMT_W<24> { - EMT_W::new(self) + pub fn emt(&mut self) -> EMT_W { + EMT_W::new(self, 24) } #[doc = "Bit 25 - Multi Channel Mode Enable for Channel 1"] #[inline(always)] #[must_use] - pub fn mcme1(&mut self) -> MCME1_W<25> { - MCME1_W::new(self) + pub fn mcme1(&mut self) -> MCME1_W { + MCME1_W::new(self, 25) } #[doc = "Bit 26 - Multi Channel Mode Enable for Channel 2"] #[inline(always)] #[must_use] - pub fn mcme2(&mut self) -> MCME2_W<26> { - MCME2_W::new(self) + pub fn mcme2(&mut self) -> MCME2_W { + MCME2_W::new(self, 26) } #[doc = "Bits 27:28 - External Modulation Channel enable"] #[inline(always)] #[must_use] - pub fn eme(&mut self) -> EME_W<27> { - EME_W::new(self) + pub fn eme(&mut self) -> EME_W { + EME_W::new(self, 27) } #[doc = "Bits 29:30 - Status bit output selector"] #[inline(always)] #[must_use] - pub fn stos(&mut self) -> STOS_W<29> { - STOS_W::new(self) + pub fn stos(&mut self) -> STOS_W { + STOS_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Slice Timer Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tc::R`](R) reader structure"] +impl crate::Readable for TC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tc::W`](W) writer structure"] impl crate::Writable for TC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/tcclr.rs b/src/ccu80_cc80/tcclr.rs index 309a4cb7..bfa6e851 100644 --- a/src/ccu80_cc80/tcclr.rs +++ b/src/ccu80_cc80/tcclr.rs @@ -1,80 +1,64 @@ #[doc = "Register `TCCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TRBC` writer - Timer Run Bit Clear"] -pub type TRBC_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCCLR_SPEC, bool, O>; +pub type TRBC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TCC` writer - Timer Clear"] -pub type TCC_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCCLR_SPEC, bool, O>; +pub type TCC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DITC` writer - Dither Counter Clear"] -pub type DITC_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCCLR_SPEC, bool, O>; +pub type DITC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DTC1C` writer - Dead Time Counter 1 Clear"] -pub type DTC1C_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCCLR_SPEC, bool, O>; +pub type DTC1C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DTC2C` writer - Dead Time Counter 2 Clear"] -pub type DTC2C_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCCLR_SPEC, bool, O>; +pub type DTC2C_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Timer Run Bit Clear"] #[inline(always)] #[must_use] - pub fn trbc(&mut self) -> TRBC_W<0> { - TRBC_W::new(self) + pub fn trbc(&mut self) -> TRBC_W { + TRBC_W::new(self, 0) } #[doc = "Bit 1 - Timer Clear"] #[inline(always)] #[must_use] - pub fn tcc(&mut self) -> TCC_W<1> { - TCC_W::new(self) + pub fn tcc(&mut self) -> TCC_W { + TCC_W::new(self, 1) } #[doc = "Bit 2 - Dither Counter Clear"] #[inline(always)] #[must_use] - pub fn ditc(&mut self) -> DITC_W<2> { - DITC_W::new(self) + pub fn ditc(&mut self) -> DITC_W { + DITC_W::new(self, 2) } #[doc = "Bit 3 - Dead Time Counter 1 Clear"] #[inline(always)] #[must_use] - pub fn dtc1c(&mut self) -> DTC1C_W<3> { - DTC1C_W::new(self) + pub fn dtc1c(&mut self) -> DTC1C_W { + DTC1C_W::new(self, 3) } #[doc = "Bit 4 - Dead Time Counter 2 Clear"] #[inline(always)] #[must_use] - pub fn dtc2c(&mut self) -> DTC2C_W<4> { - DTC2C_W::new(self) + pub fn dtc2c(&mut self) -> DTC2C_W { + DTC2C_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Slice Timer Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TCCLR_SPEC; impl crate::RegisterSpec for TCCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [tcclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`tcclr::W`](W) writer structure"] impl crate::Writable for TCCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/tcset.rs b/src/ccu80_cc80/tcset.rs index 6e234fa7..9681d83d 100644 --- a/src/ccu80_cc80/tcset.rs +++ b/src/ccu80_cc80/tcset.rs @@ -1,48 +1,32 @@ #[doc = "Register `TCSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TRBS` writer - Timer Run Bit set"] -pub type TRBS_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSET_SPEC, bool, O>; +pub type TRBS_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Timer Run Bit set"] #[inline(always)] #[must_use] - pub fn trbs(&mut self) -> TRBS_W<0> { - TRBS_W::new(self) + pub fn trbs(&mut self) -> TRBS_W { + TRBS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Slice Timer Run Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TCSET_SPEC; impl crate::RegisterSpec for TCSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [tcset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`tcset::W`](W) writer structure"] impl crate::Writable for TCSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ccu80_cc80/tcst.rs b/src/ccu80_cc80/tcst.rs index cba30302..4d68fef4 100644 --- a/src/ccu80_cc80/tcst.rs +++ b/src/ccu80_cc80/tcst.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `TRB` reader - Timer Run Bit"] pub type TRB_R = crate::BitReader; #[doc = "Timer Run Bit\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl TRB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRB_A { + pub const fn variant(&self) -> TRB_A { match self.bits { false => TRB_A::VALUE1, true => TRB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer is stopped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRB_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl CDIR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CDIR_A { + pub const fn variant(&self) -> CDIR_A { match self.bits { false => CDIR_A::VALUE1, true => CDIR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timer is counting up"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CDIR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer is counting down"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CDIR_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl DTR1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DTR1_A { + pub const fn variant(&self) -> DTR1_A { match self.bits { false => DTR1_A::VALUE1, true => DTR1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead Time counter is idle"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DTR1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead Time counter is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DTR1_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl DTR2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DTR2_A { + pub const fn variant(&self) -> DTR2_A { match self.bits { false => DTR2_A::VALUE1, true => DTR2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead Time counter is idle"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DTR2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead Time counter is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DTR2_A::VALUE2 @@ -179,15 +166,13 @@ impl R { DTR2_R::new(((self.bits >> 4) & 1) != 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"] +#[doc = "Slice Timer Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tcst::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`tcst::R`](R) reader structure"] +impl crate::Readable for TCST_SPEC {} #[doc = "`reset()` method sets TCST to value 0"] impl crate::Resettable for TCST_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/ccu80_cc80/timer.rs b/src/ccu80_cc80/timer.rs index b54e18b8..456ff2cf 100644 --- a/src/ccu80_cc80/timer.rs +++ b/src/ccu80_cc80/timer.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TVAL` reader - Timer Value"] -pub type TVAL_R = crate::FieldReader; +pub type TVAL_R = crate::FieldReader; #[doc = "Field `TVAL` writer - Timer Value"] -pub type TVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIMER_SPEC, u16, u16, 16, O>; +pub type TVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Timer Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Timer Value"] #[inline(always)] #[must_use] - pub fn tval(&mut self) -> TVAL_W<0> { - TVAL_W::new(self) + pub fn tval(&mut self) -> TVAL_W { + TVAL_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Timer Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timer::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`timer::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`timer::R`](R) reader structure"] +impl crate::Readable for TIMER_SPEC {} +#[doc = "`write(|w| ..)` method takes [`timer::W`](W) writer structure"] impl crate::Writable for TIMER_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac.rs b/src/dac.rs index 185709c2..b4c0b705 100644 --- a/src/dac.rs +++ b/src/dac.rs @@ -1,76 +1,138 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + id: ID, + dac0cfg0: DAC0CFG0, + dac0cfg1: DAC0CFG1, + dac1cfg0: DAC1CFG0, + dac1cfg1: DAC1CFG1, + dac0data: DAC0DATA, + dac1data: DAC1DATA, + dac01data: DAC01DATA, + dac0patl: DAC0PATL, + dac0path: DAC0PATH, + dac1patl: DAC1PATL, + dac1path: DAC1PATH, +} +impl RegisterBlock { #[doc = "0x00 - Module Identification Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } #[doc = "0x04 - DAC0 Configuration Register 0"] - pub dac0cfg0: DAC0CFG0, + #[inline(always)] + pub const fn dac0cfg0(&self) -> &DAC0CFG0 { + &self.dac0cfg0 + } #[doc = "0x08 - DAC0 Configuration Register 1"] - pub dac0cfg1: DAC0CFG1, + #[inline(always)] + pub const fn dac0cfg1(&self) -> &DAC0CFG1 { + &self.dac0cfg1 + } #[doc = "0x0c - DAC1 Configuration Register 0"] - pub dac1cfg0: DAC1CFG0, + #[inline(always)] + pub const fn dac1cfg0(&self) -> &DAC1CFG0 { + &self.dac1cfg0 + } #[doc = "0x10 - DAC1 Configuration Register 1"] - pub dac1cfg1: DAC1CFG1, + #[inline(always)] + pub const fn dac1cfg1(&self) -> &DAC1CFG1 { + &self.dac1cfg1 + } #[doc = "0x14 - DAC0 Data Register"] - pub dac0data: DAC0DATA, + #[inline(always)] + pub const fn dac0data(&self) -> &DAC0DATA { + &self.dac0data + } #[doc = "0x18 - DAC1 Data Register"] - pub dac1data: DAC1DATA, + #[inline(always)] + pub const fn dac1data(&self) -> &DAC1DATA { + &self.dac1data + } #[doc = "0x1c - DAC01 Data Register"] - pub dac01data: DAC01DATA, + #[inline(always)] + pub const fn dac01data(&self) -> &DAC01DATA { + &self.dac01data + } #[doc = "0x20 - DAC0 Lower Pattern Register"] - pub dac0patl: DAC0PATL, + #[inline(always)] + pub const fn dac0patl(&self) -> &DAC0PATL { + &self.dac0patl + } #[doc = "0x24 - DAC0 Higher Pattern Register"] - pub dac0path: DAC0PATH, + #[inline(always)] + pub const fn dac0path(&self) -> &DAC0PATH { + &self.dac0path + } #[doc = "0x28 - DAC1 Lower Pattern Register"] - pub dac1patl: DAC1PATL, + #[inline(always)] + pub const fn dac1patl(&self) -> &DAC1PATL { + &self.dac1patl + } #[doc = "0x2c - DAC1 Higher Pattern Register"] - pub dac1path: DAC1PATH, + #[inline(always)] + pub const fn dac1path(&self) -> &DAC1PATH { + &self.dac1path + } } -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "DAC0CFG0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC0CFG0 (rw) register accessor: DAC0 Configuration Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0cfg0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0cfg0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac0cfg0`] +module"] pub type DAC0CFG0 = crate::Reg; #[doc = "DAC0 Configuration Register 0"] pub mod dac0cfg0; -#[doc = "DAC0CFG1 (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC0CFG1 (rw) register accessor: DAC0 Configuration Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0cfg1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0cfg1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac0cfg1`] +module"] pub type DAC0CFG1 = crate::Reg; #[doc = "DAC0 Configuration Register 1"] pub mod dac0cfg1; -#[doc = "DAC1CFG0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC1CFG0 (rw) register accessor: DAC1 Configuration Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1cfg0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1cfg0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac1cfg0`] +module"] pub type DAC1CFG0 = crate::Reg; #[doc = "DAC1 Configuration Register 0"] pub mod dac1cfg0; -#[doc = "DAC1CFG1 (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC1CFG1 (rw) register accessor: DAC1 Configuration Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1cfg1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1cfg1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac1cfg1`] +module"] pub type DAC1CFG1 = crate::Reg; #[doc = "DAC1 Configuration Register 1"] pub mod dac1cfg1; -#[doc = "DAC0DATA (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC0DATA (rw) register accessor: DAC0 Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0data::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0data::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac0data`] +module"] pub type DAC0DATA = crate::Reg; #[doc = "DAC0 Data Register"] pub mod dac0data; -#[doc = "DAC1DATA (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC1DATA (rw) register accessor: DAC1 Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1data::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1data::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac1data`] +module"] pub type DAC1DATA = crate::Reg; #[doc = "DAC1 Data Register"] pub mod dac1data; -#[doc = "DAC01DATA (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC01DATA (rw) register accessor: DAC01 Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac01data::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac01data::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac01data`] +module"] pub type DAC01DATA = crate::Reg; #[doc = "DAC01 Data Register"] pub mod dac01data; -#[doc = "DAC0PATL (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC0PATL (rw) register accessor: DAC0 Lower Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0patl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0patl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac0patl`] +module"] pub type DAC0PATL = crate::Reg; #[doc = "DAC0 Lower Pattern Register"] pub mod dac0patl; -#[doc = "DAC0PATH (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC0PATH (rw) register accessor: DAC0 Higher Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0path::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0path::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac0path`] +module"] pub type DAC0PATH = crate::Reg; #[doc = "DAC0 Higher Pattern Register"] pub mod dac0path; -#[doc = "DAC1PATL (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC1PATL (rw) register accessor: DAC1 Lower Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1patl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1patl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac1patl`] +module"] pub type DAC1PATL = crate::Reg; #[doc = "DAC1 Lower Pattern Register"] pub mod dac1patl; -#[doc = "DAC1PATH (rw) register accessor: an alias for `Reg`"] +#[doc = "DAC1PATH (rw) register accessor: DAC1 Higher Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1path::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1path::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dac1path`] +module"] 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 015c027f..f865f2d7 100644 --- a/src/dac/dac01data.rs +++ b/src/dac/dac01data.rs @@ -1,47 +1,15 @@ #[doc = "Register `DAC01DATA` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DATA0` reader - DAC0 Data Bits"] -pub type DATA0_R = crate::FieldReader; +pub type DATA0_R = crate::FieldReader; #[doc = "Field `DATA0` writer - DAC0 Data Bits"] -pub type DATA0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC01DATA_SPEC, u16, u16, 12, O>; +pub type DATA0_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; #[doc = "Field `DATA1` reader - DAC1 Data Bits"] -pub type DATA1_R = crate::FieldReader; +pub type DATA1_R = crate::FieldReader; #[doc = "Field `DATA1` writer - DAC1 Data Bits"] -pub type DATA1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC01DATA_SPEC, u16, u16, 12, O>; +pub type DATA1_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:11 - DAC0 Data Bits"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:11 - DAC0 Data Bits"] #[inline(always)] #[must_use] - pub fn data0(&mut self) -> DATA0_W<0> { - DATA0_W::new(self) + pub fn data0(&mut self) -> DATA0_W { + DATA0_W::new(self, 0) } #[doc = "Bits 16:27 - DAC1 Data Bits"] #[inline(always)] #[must_use] - pub fn data1(&mut self) -> DATA1_W<16> { - DATA1_W::new(self) + pub fn data1(&mut self) -> DATA1_W { + DATA1_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC01 Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac01data::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac01data::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac01data::R`](R) reader structure"] +impl crate::Readable for DAC01DATA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac01data::W`](W) writer structure"] impl crate::Writable for DAC01DATA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac0cfg0.rs b/src/dac/dac0cfg0.rs index d1878380..c5dcabb8 100644 --- a/src/dac/dac0cfg0.rs +++ b/src/dac/dac0cfg0.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `FREQ` reader - Integer Frequency Divider Value"] -pub type FREQ_R = crate::FieldReader; +pub type FREQ_R = crate::FieldReader; #[doc = "Field `FREQ` writer - Integer Frequency Divider Value"] -pub type FREQ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0CFG0_SPEC, u32, u32, 20, O>; +pub type FREQ_W<'a, REG> = crate::FieldWriter<'a, REG, 20, u32>; #[doc = "Field `MODE` reader - Enables and Sets the Mode for DAC0"] -pub type MODE_R = crate::FieldReader; +pub type MODE_R = crate::FieldReader; #[doc = "Enables and Sets the Mode for DAC0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -67,10 +35,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MODE_A { + type Ux = u8; +} impl MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MODE_A { + pub const fn variant(&self) -> MODE_A { match self.bits { 0 => MODE_A::VALUE1, 1 => MODE_A::VALUE2, @@ -83,88 +54,92 @@ impl MODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "disable/switch-off DAC"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Single Value Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data Mode"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Patgen Mode"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MODE_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Noise Mode"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == MODE_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Ramp Mode"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == MODE_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "na"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == MODE_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "na"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == MODE_A::VALUE8 } } #[doc = "Field `MODE` writer - Enables and Sets the Mode for DAC0"] -pub type MODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DAC0CFG0_SPEC, u8, MODE_A, 3, O>; -impl<'a, const O: u8> MODE_W<'a, O> { +pub type MODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, MODE_A>; +impl<'a, REG> MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "disable/switch-off DAC"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE1) } #[doc = "Single Value Mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE2) } #[doc = "Data Mode"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE3) } #[doc = "Patgen Mode"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE4) } #[doc = "Noise Mode"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE5) } #[doc = "Ramp Mode"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE6) } #[doc = "na"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE7) } #[doc = "na"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE8) } } @@ -187,39 +162,42 @@ impl From for bool { impl SIGN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SIGN_A { + pub const fn variant(&self) -> SIGN_A { match self.bits { false => SIGN_A::VALUE1, true => SIGN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC expects unsigned input data"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SIGN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC expects signed input data"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SIGN_A::VALUE2 } } #[doc = "Field `SIGN` writer - Selects Between Signed and Unsigned DAC0 Mode"] -pub type SIGN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC0CFG0_SPEC, SIGN_A, O>; -impl<'a, const O: u8> SIGN_W<'a, O> { +pub type SIGN_W<'a, REG> = crate::BitWriter<'a, REG, SIGN_A>; +impl<'a, REG> SIGN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DAC expects unsigned input data"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIGN_A::VALUE1) } #[doc = "DAC expects signed input data"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIGN_A::VALUE2) } } #[doc = "Field `FIFOIND` reader - Current write position inside the data FIFO"] -pub type FIFOIND_R = crate::FieldReader; +pub type FIFOIND_R = crate::FieldReader; #[doc = "Field `FIFOEMP` reader - Indicate if the FIFO is empty"] pub type FIFOEMP_R = crate::BitReader; #[doc = "Indicate if the FIFO is empty\n\nValue on reset: 0"] @@ -239,18 +217,18 @@ impl From for bool { impl FIFOEMP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FIFOEMP_A { + pub const fn variant(&self) -> FIFOEMP_A { match self.bits { false => FIFOEMP_A::VALUE1, true => FIFOEMP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "FIFO not empty"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FIFOEMP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "FIFO empty"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FIFOEMP_A::VALUE2 @@ -275,18 +253,18 @@ impl From for bool { impl FIFOFUL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FIFOFUL_A { + pub const fn variant(&self) -> FIFOFUL_A { match self.bits { false => FIFOFUL_A::VALUE1, true => FIFOFUL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "FIFO not full"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FIFOFUL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "FIFO full"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FIFOFUL_A::VALUE2 @@ -311,34 +289,37 @@ impl From for bool { impl NEGATE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NEGATE_A { + pub const fn variant(&self) -> NEGATE_A { match self.bits { false => NEGATE_A::VALUE1, true => NEGATE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC output not negated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NEGATE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC output negated"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NEGATE_A::VALUE2 } } #[doc = "Field `NEGATE` writer - Negates the DAC0 output"] -pub type NEGATE_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC0CFG0_SPEC, NEGATE_A, O>; -impl<'a, const O: u8> NEGATE_W<'a, O> { +pub type NEGATE_W<'a, REG> = crate::BitWriter<'a, REG, NEGATE_A>; +impl<'a, REG> NEGATE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DAC output not negated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NEGATE_A::VALUE1) } #[doc = "DAC output negated"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NEGATE_A::VALUE2) } } @@ -361,34 +342,37 @@ impl From for bool { impl SIGNEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SIGNEN_A { + pub const fn variant(&self) -> SIGNEN_A { match self.bits { false => SIGNEN_A::VALUE1, true => SIGNEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SIGNEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SIGNEN_A::VALUE2 } } #[doc = "Field `SIGNEN` writer - Enable Sign Output of DAC0 Pattern Generator"] -pub type SIGNEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC0CFG0_SPEC, SIGNEN_A, O>; -impl<'a, const O: u8> SIGNEN_W<'a, O> { +pub type SIGNEN_W<'a, REG> = crate::BitWriter<'a, REG, SIGNEN_A>; +impl<'a, REG> SIGNEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIGNEN_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIGNEN_A::VALUE2) } } @@ -411,34 +395,37 @@ impl From for bool { impl SREN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SREN_A { + pub const fn variant(&self) -> SREN_A { match self.bits { false => SREN_A::VALUE1, true => SREN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SREN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SREN_A::VALUE2 } } #[doc = "Field `SREN` writer - Enable DAC0 service request interrupt generation"] -pub type SREN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC0CFG0_SPEC, SREN_A, O>; -impl<'a, const O: u8> SREN_W<'a, O> { +pub type SREN_W<'a, REG> = crate::BitWriter<'a, REG, SREN_A>; +impl<'a, REG> SREN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SREN_A::VALUE1) } #[doc = "enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SREN_A::VALUE2) } } @@ -461,18 +448,18 @@ impl From for bool { impl RUN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RUN_A { + pub const fn variant(&self) -> RUN_A { match self.bits { false => RUN_A::VALUE1, true => RUN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC0 channel disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RUN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC0 channel in operation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RUN_A::VALUE2 @@ -534,58 +521,59 @@ impl W { #[doc = "Bits 0:19 - Integer Frequency Divider Value"] #[inline(always)] #[must_use] - pub fn freq(&mut self) -> FREQ_W<0> { - FREQ_W::new(self) + pub fn freq(&mut self) -> FREQ_W { + FREQ_W::new(self, 0) } #[doc = "Bits 20:22 - Enables and Sets the Mode for DAC0"] #[inline(always)] #[must_use] - pub fn mode(&mut self) -> MODE_W<20> { - MODE_W::new(self) + pub fn mode(&mut self) -> MODE_W { + MODE_W::new(self, 20) } #[doc = "Bit 23 - Selects Between Signed and Unsigned DAC0 Mode"] #[inline(always)] #[must_use] - pub fn sign(&mut self) -> SIGN_W<23> { - SIGN_W::new(self) + pub fn sign(&mut self) -> SIGN_W { + SIGN_W::new(self, 23) } #[doc = "Bit 28 - Negates the DAC0 output"] #[inline(always)] #[must_use] - pub fn negate(&mut self) -> NEGATE_W<28> { - NEGATE_W::new(self) + pub fn negate(&mut self) -> NEGATE_W { + NEGATE_W::new(self, 28) } #[doc = "Bit 29 - Enable Sign Output of DAC0 Pattern Generator"] #[inline(always)] #[must_use] - pub fn signen(&mut self) -> SIGNEN_W<29> { - SIGNEN_W::new(self) + pub fn signen(&mut self) -> SIGNEN_W { + SIGNEN_W::new(self, 29) } #[doc = "Bit 30 - Enable DAC0 service request interrupt generation"] #[inline(always)] #[must_use] - pub fn sren(&mut self) -> SREN_W<30> { - SREN_W::new(self) + pub fn sren(&mut self) -> SREN_W { + SREN_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC0 Configuration Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0cfg0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0cfg0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac0cfg0::R`](R) reader structure"] +impl crate::Readable for DAC0CFG0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac0cfg0::W`](W) writer structure"] impl crate::Writable for DAC0CFG0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac0cfg1.rs b/src/dac/dac0cfg1.rs index 344352b8..0a810b7c 100644 --- a/src/dac/dac0cfg1.rs +++ b/src/dac/dac0cfg1.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[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 type SCALE_R = crate::FieldReader; +pub type SCALE_R = crate::FieldReader; #[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"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SCALE_A { + type Ux = u8; +} impl SCALE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCALE_A { + pub const fn variant(&self) -> SCALE_A { match self.bits { 0 => SCALE_A::VALUE1, 1 => SCALE_A::VALUE2, @@ -79,88 +50,92 @@ impl SCALE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no shift = multiplication/division by 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCALE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "shift by 1 = multiplication/division by 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCALE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "shift by 2 = multiplication/division by 4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SCALE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "shift left by 3 = multiplication/division by 8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SCALE_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "shift left by 4 = multiplication/division by 16"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == SCALE_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "shift left by 5 = multiplication/division by 32"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == SCALE_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "shift left by 6 = multiplication/division by 64"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == SCALE_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "shift left by 7 = multiplication/division by 128"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == SCALE_A::VALUE8 } } #[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 type SCALE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DAC0CFG1_SPEC, u8, SCALE_A, 3, O>; -impl<'a, const O: u8> SCALE_W<'a, O> { +pub type SCALE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, SCALE_A>; +impl<'a, REG> SCALE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "no shift = multiplication/division by 1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE1) } #[doc = "shift by 1 = multiplication/division by 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE2) } #[doc = "shift by 2 = multiplication/division by 4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE3) } #[doc = "shift left by 3 = multiplication/division by 8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE4) } #[doc = "shift left by 4 = multiplication/division by 16"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE5) } #[doc = "shift left by 5 = multiplication/division by 32"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE6) } #[doc = "shift left by 6 = multiplication/division by 64"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE7) } #[doc = "shift left by 7 = multiplication/division by 128"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE8) } } @@ -183,45 +158,48 @@ impl From for bool { impl MULDIV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MULDIV_A { + pub const fn variant(&self) -> MULDIV_A { match self.bits { false => MULDIV_A::VALUE1, true => MULDIV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "downscale = division (shift SCALE positions to the right)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MULDIV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "upscale = multiplication (shift SCALE positions to the left)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MULDIV_A::VALUE2 } } #[doc = "Field `MULDIV` writer - Switch between up- and downscale of the DAC0 input data values"] -pub type MULDIV_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC0CFG1_SPEC, MULDIV_A, O>; -impl<'a, const O: u8> MULDIV_W<'a, O> { +pub type MULDIV_W<'a, REG> = crate::BitWriter<'a, REG, MULDIV_A>; +impl<'a, REG> MULDIV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "downscale = division (shift SCALE positions to the right)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MULDIV_A::VALUE1) } #[doc = "upscale = multiplication (shift SCALE positions to the left)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MULDIV_A::VALUE2) } } #[doc = "Field `OFFS` reader - 8-bit offset value addition"] -pub type OFFS_R = crate::FieldReader; +pub type OFFS_R = crate::FieldReader; #[doc = "Field `OFFS` writer - 8-bit offset value addition"] -pub type OFFS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0CFG1_SPEC, u8, u8, 8, O>; +pub type OFFS_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `TRIGSEL` reader - Selects one of the eight external trigger sources for DAC0"] -pub type TRIGSEL_R = crate::FieldReader; +pub type TRIGSEL_R = crate::FieldReader; #[doc = "Field `TRIGSEL` writer - Selects one of the eight external trigger sources for DAC0"] -pub type TRIGSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0CFG1_SPEC, u8, u8, 3, O>; +pub type TRIGSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `DATMOD` reader - Switch between independent or simultaneous DAC mode and select the input data register for DAC0 and DAC1"] pub type DATMOD_R = crate::BitReader; #[doc = "Switch between independent or simultaneous DAC mode and select the input data register for DAC0 and DAC1\n\nValue on reset: 0"] @@ -241,43 +219,46 @@ impl From for bool { impl DATMOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DATMOD_A { + pub const fn variant(&self) -> DATMOD_A { match self.bits { false => DATMOD_A::VALUE1, true => DATMOD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == DATMOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "simultaneous data handling - process data from DAC01 register to both DACs (bits 11:0 to DAC0 and bits 23:12 to DAC1)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DATMOD_A::VALUE2 } } #[doc = "Field `DATMOD` writer - Switch between independent or simultaneous DAC mode and select the input data register for DAC0 and DAC1"] -pub type DATMOD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC0CFG1_SPEC, DATMOD_A, O>; -impl<'a, const O: u8> DATMOD_W<'a, O> { +pub type DATMOD_W<'a, REG> = crate::BitWriter<'a, REG, DATMOD_A>; +impl<'a, REG> DATMOD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DATMOD_A::VALUE1) } #[doc = "simultaneous data handling - process data from DAC01 register to both DACs (bits 11:0 to DAC0 and bits 23:12 to DAC1)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DATMOD_A::VALUE2) } } #[doc = "Field `SWTRIG` reader - Software Trigger"] -pub type SWTRIG_R = crate::BitReader; +pub type SWTRIG_R = crate::BitReader; #[doc = "Field `SWTRIG` writer - Software Trigger"] -pub type SWTRIG_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC0CFG1_SPEC, bool, O>; +pub type SWTRIG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TRIGMOD` reader - Select the trigger source for channel 0"] -pub type TRIGMOD_R = crate::FieldReader; +pub type TRIGMOD_R = crate::FieldReader; #[doc = "Select the trigger source for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -295,10 +276,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TRIGMOD_A { + type Ux = u8; +} impl TRIGMOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TRIGMOD_A::VALUE1), 1 => Some(TRIGMOD_A::VALUE2), @@ -306,45 +290,49 @@ impl TRIGMOD_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "internal Trigger (integer divided clock - see FREQ parameter)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRIGMOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "external Trigger (preselected trigger by TRIGSEL parameter)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRIGMOD_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "software Trigger (see SWTRIG parameter)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TRIGMOD_A::VALUE3 } } #[doc = "Field `TRIGMOD` writer - Select the trigger source for channel 0"] -pub type TRIGMOD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0CFG1_SPEC, u8, TRIGMOD_A, 2, O>; -impl<'a, const O: u8> TRIGMOD_W<'a, O> { +pub type TRIGMOD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, TRIGMOD_A>; +impl<'a, REG> TRIGMOD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "internal Trigger (integer divided clock - see FREQ parameter)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRIGMOD_A::VALUE1) } #[doc = "external Trigger (preselected trigger by TRIGSEL parameter)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRIGMOD_A::VALUE2) } #[doc = "software Trigger (see SWTRIG parameter)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TRIGMOD_A::VALUE3) } } #[doc = "Field `ANACFG` reader - DAC0 analog configuration/calibration parameters"] -pub type ANACFG_R = crate::FieldReader; +pub type ANACFG_R = crate::FieldReader; #[doc = "Field `ANACFG` writer - DAC0 analog configuration/calibration parameters"] -pub type ANACFG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0CFG1_SPEC, u8, u8, 5, O>; +pub type ANACFG_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `ANAEN` reader - Enable analog DAC for channel 0"] pub type ANAEN_R = crate::BitReader; #[doc = "Enable analog DAC for channel 0\n\nValue on reset: 0"] @@ -364,41 +352,44 @@ impl From for bool { impl ANAEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ANAEN_A { + pub const fn variant(&self) -> ANAEN_A { match self.bits { false => ANAEN_A::VALUE1, true => ANAEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC0 is set to standby (analog output only)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ANAEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "enable DAC0 (analog output only)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ANAEN_A::VALUE2 } } #[doc = "Field `ANAEN` writer - Enable analog DAC for channel 0"] -pub type ANAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC0CFG1_SPEC, ANAEN_A, O>; -impl<'a, const O: u8> ANAEN_W<'a, O> { +pub type ANAEN_W<'a, REG> = crate::BitWriter<'a, REG, ANAEN_A>; +impl<'a, REG> ANAEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DAC0 is set to standby (analog output only)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ANAEN_A::VALUE1) } #[doc = "enable DAC0 (analog output only)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ANAEN_A::VALUE2) } } #[doc = "Field `REFCFGL` reader - Lower 4 band-gap configuration/calibration parameters"] -pub type REFCFGL_R = crate::FieldReader; +pub type REFCFGL_R = crate::FieldReader; #[doc = "Field `REFCFGL` writer - Lower 4 band-gap configuration/calibration parameters"] -pub type REFCFGL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0CFG1_SPEC, u8, u8, 4, O>; +pub type REFCFGL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:2 - Scale value for up- or downscale of the DAC0 input data in steps by the power of 2 (=shift operation)"] #[inline(always)] @@ -455,82 +446,83 @@ impl W { #[doc = "Bits 0:2 - Scale value for up- or downscale of the DAC0 input data in steps by the power of 2 (=shift operation)"] #[inline(always)] #[must_use] - pub fn scale(&mut self) -> SCALE_W<0> { - SCALE_W::new(self) + pub fn scale(&mut self) -> SCALE_W { + SCALE_W::new(self, 0) } #[doc = "Bit 3 - Switch between up- and downscale of the DAC0 input data values"] #[inline(always)] #[must_use] - pub fn muldiv(&mut self) -> MULDIV_W<3> { - MULDIV_W::new(self) + pub fn muldiv(&mut self) -> MULDIV_W { + MULDIV_W::new(self, 3) } #[doc = "Bits 4:11 - 8-bit offset value addition"] #[inline(always)] #[must_use] - pub fn offs(&mut self) -> OFFS_W<4> { - OFFS_W::new(self) + pub fn offs(&mut self) -> OFFS_W { + OFFS_W::new(self, 4) } #[doc = "Bits 12:14 - Selects one of the eight external trigger sources for DAC0"] #[inline(always)] #[must_use] - pub fn trigsel(&mut self) -> TRIGSEL_W<12> { - TRIGSEL_W::new(self) + pub fn trigsel(&mut self) -> TRIGSEL_W { + TRIGSEL_W::new(self, 12) } #[doc = "Bit 15 - Switch between independent or simultaneous DAC mode and select the input data register for DAC0 and DAC1"] #[inline(always)] #[must_use] - pub fn datmod(&mut self) -> DATMOD_W<15> { - DATMOD_W::new(self) + pub fn datmod(&mut self) -> DATMOD_W { + DATMOD_W::new(self, 15) } #[doc = "Bit 16 - Software Trigger"] #[inline(always)] #[must_use] - pub fn swtrig(&mut self) -> SWTRIG_W<16> { - SWTRIG_W::new(self) + pub fn swtrig(&mut self) -> SWTRIG_W { + SWTRIG_W::new(self, 16) } #[doc = "Bits 17:18 - Select the trigger source for channel 0"] #[inline(always)] #[must_use] - pub fn trigmod(&mut self) -> TRIGMOD_W<17> { - TRIGMOD_W::new(self) + pub fn trigmod(&mut self) -> TRIGMOD_W { + TRIGMOD_W::new(self, 17) } #[doc = "Bits 19:23 - DAC0 analog configuration/calibration parameters"] #[inline(always)] #[must_use] - pub fn anacfg(&mut self) -> ANACFG_W<19> { - ANACFG_W::new(self) + pub fn anacfg(&mut self) -> ANACFG_W { + ANACFG_W::new(self, 19) } #[doc = "Bit 24 - Enable analog DAC for channel 0"] #[inline(always)] #[must_use] - pub fn anaen(&mut self) -> ANAEN_W<24> { - ANAEN_W::new(self) + pub fn anaen(&mut self) -> ANAEN_W { + ANAEN_W::new(self, 24) } #[doc = "Bits 28:31 - Lower 4 band-gap configuration/calibration parameters"] #[inline(always)] #[must_use] - pub fn refcfgl(&mut self) -> REFCFGL_W<28> { - REFCFGL_W::new(self) + pub fn refcfgl(&mut self) -> REFCFGL_W { + REFCFGL_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC0 Configuration Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0cfg1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0cfg1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac0cfg1::R`](R) reader structure"] +impl crate::Readable for DAC0CFG1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac0cfg1::W`](W) writer structure"] impl crate::Writable for DAC0CFG1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac0data.rs b/src/dac/dac0data.rs index 79e8b25e..2eeb5e3d 100644 --- a/src/dac/dac0data.rs +++ b/src/dac/dac0data.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DATA0` reader - DAC0 Data Bits"] -pub type DATA0_R = crate::FieldReader; +pub type DATA0_R = crate::FieldReader; #[doc = "Field `DATA0` writer - DAC0 Data Bits"] -pub type DATA0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0DATA_SPEC, u16, u16, 12, O>; +pub type DATA0_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:11 - DAC0 Data Bits"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:11 - DAC0 Data Bits"] #[inline(always)] #[must_use] - pub fn data0(&mut self) -> DATA0_W<0> { - DATA0_W::new(self) + pub fn data0(&mut self) -> DATA0_W { + DATA0_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC0 Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0data::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0data::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac0data::R`](R) reader structure"] +impl crate::Readable for DAC0DATA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac0data::W`](W) writer structure"] impl crate::Writable for DAC0DATA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac0path.rs b/src/dac/dac0path.rs index b269cd4f..3f7bbbf2 100644 --- a/src/dac/dac0path.rs +++ b/src/dac/dac0path.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PAT6` reader - Pattern Number 6 for PATGEN of DAC0"] -pub type PAT6_R = crate::FieldReader; +pub type PAT6_R = crate::FieldReader; #[doc = "Field `PAT6` writer - Pattern Number 6 for PATGEN of DAC0"] -pub type PAT6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATH_SPEC, u8, u8, 5, O>; +pub type PAT6_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT7` reader - Pattern Number 7 for PATGEN of DAC0"] -pub type PAT7_R = crate::FieldReader; +pub type PAT7_R = crate::FieldReader; #[doc = "Field `PAT7` writer - Pattern Number 7 for PATGEN of DAC0"] -pub type PAT7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATH_SPEC, u8, u8, 5, O>; +pub type PAT7_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT8` reader - Pattern Number 8 for PATGEN of DAC0"] -pub type PAT8_R = crate::FieldReader; +pub type PAT8_R = crate::FieldReader; #[doc = "Field `PAT8` writer - Pattern Number 8 for PATGEN of DAC0"] -pub type PAT8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATH_SPEC, u8, u8, 5, O>; +pub type PAT8_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; impl R { #[doc = "Bits 0:4 - Pattern Number 6 for PATGEN of DAC0"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bits 0:4 - Pattern Number 6 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat6(&mut self) -> PAT6_W<0> { - PAT6_W::new(self) + pub fn pat6(&mut self) -> PAT6_W { + PAT6_W::new(self, 0) } #[doc = "Bits 5:9 - Pattern Number 7 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat7(&mut self) -> PAT7_W<5> { - PAT7_W::new(self) + pub fn pat7(&mut self) -> PAT7_W { + PAT7_W::new(self, 5) } #[doc = "Bits 10:14 - Pattern Number 8 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat8(&mut self) -> PAT8_W<10> { - PAT8_W::new(self) + pub fn pat8(&mut self) -> PAT8_W { + PAT8_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC0 Higher Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0path::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0path::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac0path::R`](R) reader structure"] +impl crate::Readable for DAC0PATH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac0path::W`](W) writer structure"] impl crate::Writable for DAC0PATH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac0patl.rs b/src/dac/dac0patl.rs index 659be5ee..32feefe0 100644 --- a/src/dac/dac0patl.rs +++ b/src/dac/dac0patl.rs @@ -1,63 +1,31 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PAT0` reader - Pattern Number 0 for PATGEN of DAC0"] -pub type PAT0_R = crate::FieldReader; +pub type PAT0_R = crate::FieldReader; #[doc = "Field `PAT0` writer - Pattern Number 0 for PATGEN of DAC0"] -pub type PAT0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATL_SPEC, u8, u8, 5, O>; +pub type PAT0_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT1` reader - Pattern Number 1 for PATGEN of DAC0"] -pub type PAT1_R = crate::FieldReader; +pub type PAT1_R = crate::FieldReader; #[doc = "Field `PAT1` writer - Pattern Number 1 for PATGEN of DAC0"] -pub type PAT1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATL_SPEC, u8, u8, 5, O>; +pub type PAT1_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT2` reader - Pattern Number 2 for PATGEN of DAC0"] -pub type PAT2_R = crate::FieldReader; +pub type PAT2_R = crate::FieldReader; #[doc = "Field `PAT2` writer - Pattern Number 2 for PATGEN of DAC0"] -pub type PAT2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATL_SPEC, u8, u8, 5, O>; +pub type PAT2_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT3` reader - Pattern Number 3 for PATGEN of DAC0"] -pub type PAT3_R = crate::FieldReader; +pub type PAT3_R = crate::FieldReader; #[doc = "Field `PAT3` writer - Pattern Number 3 for PATGEN of DAC0"] -pub type PAT3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATL_SPEC, u8, u8, 5, O>; +pub type PAT3_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT4` reader - Pattern Number 4 for PATGEN of DAC0"] -pub type PAT4_R = crate::FieldReader; +pub type PAT4_R = crate::FieldReader; #[doc = "Field `PAT4` writer - Pattern Number 4 for PATGEN of DAC0"] -pub type PAT4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATL_SPEC, u8, u8, 5, O>; +pub type PAT4_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT5` reader - Pattern Number 5 for PATGEN of DAC0"] -pub type PAT5_R = crate::FieldReader; +pub type PAT5_R = crate::FieldReader; #[doc = "Field `PAT5` writer - Pattern Number 5 for PATGEN of DAC0"] -pub type PAT5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC0PATL_SPEC, u8, u8, 5, O>; +pub type PAT5_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; impl R { #[doc = "Bits 0:4 - Pattern Number 0 for PATGEN of DAC0"] #[inline(always)] @@ -94,58 +62,59 @@ impl W { #[doc = "Bits 0:4 - Pattern Number 0 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat0(&mut self) -> PAT0_W<0> { - PAT0_W::new(self) + pub fn pat0(&mut self) -> PAT0_W { + PAT0_W::new(self, 0) } #[doc = "Bits 5:9 - Pattern Number 1 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat1(&mut self) -> PAT1_W<5> { - PAT1_W::new(self) + pub fn pat1(&mut self) -> PAT1_W { + PAT1_W::new(self, 5) } #[doc = "Bits 10:14 - Pattern Number 2 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat2(&mut self) -> PAT2_W<10> { - PAT2_W::new(self) + pub fn pat2(&mut self) -> PAT2_W { + PAT2_W::new(self, 10) } #[doc = "Bits 15:19 - Pattern Number 3 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat3(&mut self) -> PAT3_W<15> { - PAT3_W::new(self) + pub fn pat3(&mut self) -> PAT3_W { + PAT3_W::new(self, 15) } #[doc = "Bits 20:24 - Pattern Number 4 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat4(&mut self) -> PAT4_W<20> { - PAT4_W::new(self) + pub fn pat4(&mut self) -> PAT4_W { + PAT4_W::new(self, 20) } #[doc = "Bits 25:29 - Pattern Number 5 for PATGEN of DAC0"] #[inline(always)] #[must_use] - pub fn pat5(&mut self) -> PAT5_W<25> { - PAT5_W::new(self) + pub fn pat5(&mut self) -> PAT5_W { + PAT5_W::new(self, 25) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC0 Lower Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac0patl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac0patl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac0patl::R`](R) reader structure"] +impl crate::Readable for DAC0PATL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac0patl::W`](W) writer structure"] impl crate::Writable for DAC0PATL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac1cfg0.rs b/src/dac/dac1cfg0.rs index 9a51514a..a338977b 100644 --- a/src/dac/dac1cfg0.rs +++ b/src/dac/dac1cfg0.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `FREQ` reader - Integer Frequency Divider Value"] -pub type FREQ_R = crate::FieldReader; +pub type FREQ_R = crate::FieldReader; #[doc = "Field `FREQ` writer - Integer Frequency Divider Value"] -pub type FREQ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1CFG0_SPEC, u32, u32, 20, O>; +pub type FREQ_W<'a, REG> = crate::FieldWriter<'a, REG, 20, u32>; #[doc = "Field `MODE` reader - Enables and sets the Mode for DAC1"] -pub type MODE_R = crate::FieldReader; +pub type MODE_R = crate::FieldReader; #[doc = "Enables and sets the Mode for DAC1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -67,10 +35,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MODE_A { + type Ux = u8; +} impl MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MODE_A { + pub const fn variant(&self) -> MODE_A { match self.bits { 0 => MODE_A::VALUE1, 1 => MODE_A::VALUE2, @@ -83,88 +54,92 @@ impl MODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "disable/switch-off DAC"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Single Value Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data Mode"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Patgen Mode"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MODE_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Noise Mode"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == MODE_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Ramp Mode"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == MODE_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "na"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == MODE_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "na"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == MODE_A::VALUE8 } } #[doc = "Field `MODE` writer - Enables and sets the Mode for DAC1"] -pub type MODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DAC1CFG0_SPEC, u8, MODE_A, 3, O>; -impl<'a, const O: u8> MODE_W<'a, O> { +pub type MODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, MODE_A>; +impl<'a, REG> MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "disable/switch-off DAC"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE1) } #[doc = "Single Value Mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE2) } #[doc = "Data Mode"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE3) } #[doc = "Patgen Mode"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE4) } #[doc = "Noise Mode"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE5) } #[doc = "Ramp Mode"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE6) } #[doc = "na"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE7) } #[doc = "na"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE8) } } @@ -187,39 +162,42 @@ impl From for bool { impl SIGN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SIGN_A { + pub const fn variant(&self) -> SIGN_A { match self.bits { false => SIGN_A::VALUE1, true => SIGN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC expects unsigned input data"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SIGN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC expects signed input data"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SIGN_A::VALUE2 } } #[doc = "Field `SIGN` writer - Selects between signed and unsigned DAC1 mode"] -pub type SIGN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC1CFG0_SPEC, SIGN_A, O>; -impl<'a, const O: u8> SIGN_W<'a, O> { +pub type SIGN_W<'a, REG> = crate::BitWriter<'a, REG, SIGN_A>; +impl<'a, REG> SIGN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DAC expects unsigned input data"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIGN_A::VALUE1) } #[doc = "DAC expects signed input data"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIGN_A::VALUE2) } } #[doc = "Field `FIFOIND` reader - Current write position inside the data FIFO"] -pub type FIFOIND_R = crate::FieldReader; +pub type FIFOIND_R = crate::FieldReader; #[doc = "Field `FIFOEMP` reader - Indicate if the FIFO is empty"] pub type FIFOEMP_R = crate::BitReader; #[doc = "Indicate if the FIFO is empty\n\nValue on reset: 0"] @@ -239,18 +217,18 @@ impl From for bool { impl FIFOEMP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FIFOEMP_A { + pub const fn variant(&self) -> FIFOEMP_A { match self.bits { false => FIFOEMP_A::VALUE1, true => FIFOEMP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "FIFO not empty"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FIFOEMP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "FIFO empty"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FIFOEMP_A::VALUE2 @@ -275,18 +253,18 @@ impl From for bool { impl FIFOFUL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FIFOFUL_A { + pub const fn variant(&self) -> FIFOFUL_A { match self.bits { false => FIFOFUL_A::VALUE1, true => FIFOFUL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "FIFO not full"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FIFOFUL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "FIFO full"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FIFOFUL_A::VALUE2 @@ -311,34 +289,37 @@ impl From for bool { impl NEGATE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NEGATE_A { + pub const fn variant(&self) -> NEGATE_A { match self.bits { false => NEGATE_A::VALUE1, true => NEGATE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC output not negated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NEGATE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC output negated"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NEGATE_A::VALUE2 } } #[doc = "Field `NEGATE` writer - Negates the DAC1 output"] -pub type NEGATE_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC1CFG0_SPEC, NEGATE_A, O>; -impl<'a, const O: u8> NEGATE_W<'a, O> { +pub type NEGATE_W<'a, REG> = crate::BitWriter<'a, REG, NEGATE_A>; +impl<'a, REG> NEGATE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DAC output not negated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NEGATE_A::VALUE1) } #[doc = "DAC output negated"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NEGATE_A::VALUE2) } } @@ -361,34 +342,37 @@ impl From for bool { impl SIGNEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SIGNEN_A { + pub const fn variant(&self) -> SIGNEN_A { match self.bits { false => SIGNEN_A::VALUE1, true => SIGNEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SIGNEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SIGNEN_A::VALUE2 } } #[doc = "Field `SIGNEN` writer - Enable sign output of DAC1 pattern generator"] -pub type SIGNEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC1CFG0_SPEC, SIGNEN_A, O>; -impl<'a, const O: u8> SIGNEN_W<'a, O> { +pub type SIGNEN_W<'a, REG> = crate::BitWriter<'a, REG, SIGNEN_A>; +impl<'a, REG> SIGNEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIGNEN_A::VALUE1) } #[doc = "enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIGNEN_A::VALUE2) } } @@ -411,34 +395,37 @@ impl From for bool { impl SREN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SREN_A { + pub const fn variant(&self) -> SREN_A { match self.bits { false => SREN_A::VALUE1, true => SREN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SREN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SREN_A::VALUE2 } } #[doc = "Field `SREN` writer - Enable DAC1 service request interrupt generation"] -pub type SREN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC1CFG0_SPEC, SREN_A, O>; -impl<'a, const O: u8> SREN_W<'a, O> { +pub type SREN_W<'a, REG> = crate::BitWriter<'a, REG, SREN_A>; +impl<'a, REG> SREN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SREN_A::VALUE1) } #[doc = "enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SREN_A::VALUE2) } } @@ -461,18 +448,18 @@ impl From for bool { impl RUN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RUN_A { + pub const fn variant(&self) -> RUN_A { match self.bits { false => RUN_A::VALUE1, true => RUN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC1 channel disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RUN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC1 channel in operation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RUN_A::VALUE2 @@ -534,58 +521,59 @@ impl W { #[doc = "Bits 0:19 - Integer Frequency Divider Value"] #[inline(always)] #[must_use] - pub fn freq(&mut self) -> FREQ_W<0> { - FREQ_W::new(self) + pub fn freq(&mut self) -> FREQ_W { + FREQ_W::new(self, 0) } #[doc = "Bits 20:22 - Enables and sets the Mode for DAC1"] #[inline(always)] #[must_use] - pub fn mode(&mut self) -> MODE_W<20> { - MODE_W::new(self) + pub fn mode(&mut self) -> MODE_W { + MODE_W::new(self, 20) } #[doc = "Bit 23 - Selects between signed and unsigned DAC1 mode"] #[inline(always)] #[must_use] - pub fn sign(&mut self) -> SIGN_W<23> { - SIGN_W::new(self) + pub fn sign(&mut self) -> SIGN_W { + SIGN_W::new(self, 23) } #[doc = "Bit 28 - Negates the DAC1 output"] #[inline(always)] #[must_use] - pub fn negate(&mut self) -> NEGATE_W<28> { - NEGATE_W::new(self) + pub fn negate(&mut self) -> NEGATE_W { + NEGATE_W::new(self, 28) } #[doc = "Bit 29 - Enable sign output of DAC1 pattern generator"] #[inline(always)] #[must_use] - pub fn signen(&mut self) -> SIGNEN_W<29> { - SIGNEN_W::new(self) + pub fn signen(&mut self) -> SIGNEN_W { + SIGNEN_W::new(self, 29) } #[doc = "Bit 30 - Enable DAC1 service request interrupt generation"] #[inline(always)] #[must_use] - pub fn sren(&mut self) -> SREN_W<30> { - SREN_W::new(self) + pub fn sren(&mut self) -> SREN_W { + SREN_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC1 Configuration Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1cfg0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1cfg0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac1cfg0::R`](R) reader structure"] +impl crate::Readable for DAC1CFG0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac1cfg0::W`](W) writer structure"] impl crate::Writable for DAC1CFG0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac1cfg1.rs b/src/dac/dac1cfg1.rs index 4af3bb1a..97dcde72 100644 --- a/src/dac/dac1cfg1.rs +++ b/src/dac/dac1cfg1.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[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 type SCALE_R = crate::FieldReader; +pub type SCALE_R = crate::FieldReader; #[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"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SCALE_A { + type Ux = u8; +} impl SCALE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCALE_A { + pub const fn variant(&self) -> SCALE_A { match self.bits { 0 => SCALE_A::VALUE1, 1 => SCALE_A::VALUE2, @@ -79,88 +50,92 @@ impl SCALE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no shift = multiplication/division by 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCALE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "shift by 1 = multiplication/division by 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCALE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "shift by 2 = multiplication/division by 4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SCALE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "shift left by 3 = multiplication/division by 8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SCALE_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "shift left by 4 = multiplication/division by 16"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == SCALE_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "shift left by 5 = multiplication/division by 32"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == SCALE_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "shift left by 6 = multiplication/division by 64"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == SCALE_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "shift left by 7 = multiplication/division by 128"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == SCALE_A::VALUE8 } } #[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 type SCALE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DAC1CFG1_SPEC, u8, SCALE_A, 3, O>; -impl<'a, const O: u8> SCALE_W<'a, O> { +pub type SCALE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, SCALE_A>; +impl<'a, REG> SCALE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "no shift = multiplication/division by 1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE1) } #[doc = "shift by 1 = multiplication/division by 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE2) } #[doc = "shift by 2 = multiplication/division by 4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE3) } #[doc = "shift left by 3 = multiplication/division by 8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE4) } #[doc = "shift left by 4 = multiplication/division by 16"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE5) } #[doc = "shift left by 5 = multiplication/division by 32"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE6) } #[doc = "shift left by 6 = multiplication/division by 64"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE7) } #[doc = "shift left by 7 = multiplication/division by 128"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(SCALE_A::VALUE8) } } @@ -183,51 +158,54 @@ impl From for bool { impl MULDIV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MULDIV_A { + pub const fn variant(&self) -> MULDIV_A { match self.bits { false => MULDIV_A::VALUE1, true => MULDIV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "downscale = division (shift SCALE positions to the right)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MULDIV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "upscale = multiplication (shift SCALE positions to the left)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MULDIV_A::VALUE2 } } #[doc = "Field `MULDIV` writer - Switch between up- and downscale of the DAC1 input data values"] -pub type MULDIV_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC1CFG1_SPEC, MULDIV_A, O>; -impl<'a, const O: u8> MULDIV_W<'a, O> { +pub type MULDIV_W<'a, REG> = crate::BitWriter<'a, REG, MULDIV_A>; +impl<'a, REG> MULDIV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "downscale = division (shift SCALE positions to the right)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MULDIV_A::VALUE1) } #[doc = "upscale = multiplication (shift SCALE positions to the left)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MULDIV_A::VALUE2) } } #[doc = "Field `OFFS` reader - 8-bit offset value addition"] -pub type OFFS_R = crate::FieldReader; +pub type OFFS_R = crate::FieldReader; #[doc = "Field `OFFS` writer - 8-bit offset value addition"] -pub type OFFS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1CFG1_SPEC, u8, u8, 8, O>; +pub type OFFS_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `TRIGSEL` reader - Selects one of the eight external trigger sources for DAC1"] -pub type TRIGSEL_R = crate::FieldReader; +pub type TRIGSEL_R = crate::FieldReader; #[doc = "Field `TRIGSEL` writer - Selects one of the eight external trigger sources for DAC1"] -pub type TRIGSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1CFG1_SPEC, u8, u8, 3, O>; +pub type TRIGSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `SWTRIG` reader - Software Trigger"] -pub type SWTRIG_R = crate::BitReader; +pub type SWTRIG_R = crate::BitReader; #[doc = "Field `SWTRIG` writer - Software Trigger"] -pub type SWTRIG_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC1CFG1_SPEC, bool, O>; +pub type SWTRIG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TRIGMOD` reader - Select the trigger source for channel 1"] -pub type TRIGMOD_R = crate::FieldReader; +pub type TRIGMOD_R = crate::FieldReader; #[doc = "Select the trigger source for channel 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -245,10 +223,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TRIGMOD_A { + type Ux = u8; +} impl TRIGMOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TRIGMOD_A::VALUE1), 1 => Some(TRIGMOD_A::VALUE2), @@ -256,45 +237,49 @@ impl TRIGMOD_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "internal Trigger (integer divided clock - see FREQ parameter)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRIGMOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "external Trigger (preselected trigger by TRIGSEL parameter)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRIGMOD_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "software Trigger (see SWTRIG parameter)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TRIGMOD_A::VALUE3 } } #[doc = "Field `TRIGMOD` writer - Select the trigger source for channel 1"] -pub type TRIGMOD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1CFG1_SPEC, u8, TRIGMOD_A, 2, O>; -impl<'a, const O: u8> TRIGMOD_W<'a, O> { +pub type TRIGMOD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, TRIGMOD_A>; +impl<'a, REG> TRIGMOD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "internal Trigger (integer divided clock - see FREQ parameter)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRIGMOD_A::VALUE1) } #[doc = "external Trigger (preselected trigger by TRIGSEL parameter)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRIGMOD_A::VALUE2) } #[doc = "software Trigger (see SWTRIG parameter)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TRIGMOD_A::VALUE3) } } #[doc = "Field `ANACFG` reader - DAC1 analog configuration/calibration parameters"] -pub type ANACFG_R = crate::FieldReader; +pub type ANACFG_R = crate::FieldReader; #[doc = "Field `ANACFG` writer - DAC1 analog configuration/calibration parameters"] -pub type ANACFG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1CFG1_SPEC, u8, u8, 5, O>; +pub type ANACFG_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `ANAEN` reader - Enable analog DAC for channel 1"] pub type ANAEN_R = crate::BitReader; #[doc = "Enable analog DAC for channel 1\n\nValue on reset: 0"] @@ -314,41 +299,44 @@ impl From for bool { impl ANAEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ANAEN_A { + pub const fn variant(&self) -> ANAEN_A { match self.bits { false => ANAEN_A::VALUE1, true => ANAEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC1 is set to standby (analog output only)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ANAEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "enable DAC1 (analog output only)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ANAEN_A::VALUE2 } } #[doc = "Field `ANAEN` writer - Enable analog DAC for channel 1"] -pub type ANAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DAC1CFG1_SPEC, ANAEN_A, O>; -impl<'a, const O: u8> ANAEN_W<'a, O> { +pub type ANAEN_W<'a, REG> = crate::BitWriter<'a, REG, ANAEN_A>; +impl<'a, REG> ANAEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DAC1 is set to standby (analog output only)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ANAEN_A::VALUE1) } #[doc = "enable DAC1 (analog output only)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ANAEN_A::VALUE2) } } #[doc = "Field `REFCFGH` reader - Higher 4 band-gap configuration/calibration parameters"] -pub type REFCFGH_R = crate::FieldReader; +pub type REFCFGH_R = crate::FieldReader; #[doc = "Field `REFCFGH` writer - Higher 4 band-gap configuration/calibration parameters"] -pub type REFCFGH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1CFG1_SPEC, u8, u8, 4, O>; +pub type REFCFGH_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:2 - Scale value for up- or downscale of the DAC1 input data in steps by the power of 2 (=shift operation)"] #[inline(always)] @@ -400,76 +388,77 @@ impl W { #[doc = "Bits 0:2 - Scale value for up- or downscale of the DAC1 input data in steps by the power of 2 (=shift operation)"] #[inline(always)] #[must_use] - pub fn scale(&mut self) -> SCALE_W<0> { - SCALE_W::new(self) + pub fn scale(&mut self) -> SCALE_W { + SCALE_W::new(self, 0) } #[doc = "Bit 3 - Switch between up- and downscale of the DAC1 input data values"] #[inline(always)] #[must_use] - pub fn muldiv(&mut self) -> MULDIV_W<3> { - MULDIV_W::new(self) + pub fn muldiv(&mut self) -> MULDIV_W { + MULDIV_W::new(self, 3) } #[doc = "Bits 4:11 - 8-bit offset value addition"] #[inline(always)] #[must_use] - pub fn offs(&mut self) -> OFFS_W<4> { - OFFS_W::new(self) + pub fn offs(&mut self) -> OFFS_W { + OFFS_W::new(self, 4) } #[doc = "Bits 12:14 - Selects one of the eight external trigger sources for DAC1"] #[inline(always)] #[must_use] - pub fn trigsel(&mut self) -> TRIGSEL_W<12> { - TRIGSEL_W::new(self) + pub fn trigsel(&mut self) -> TRIGSEL_W { + TRIGSEL_W::new(self, 12) } #[doc = "Bit 16 - Software Trigger"] #[inline(always)] #[must_use] - pub fn swtrig(&mut self) -> SWTRIG_W<16> { - SWTRIG_W::new(self) + pub fn swtrig(&mut self) -> SWTRIG_W { + SWTRIG_W::new(self, 16) } #[doc = "Bits 17:18 - Select the trigger source for channel 1"] #[inline(always)] #[must_use] - pub fn trigmod(&mut self) -> TRIGMOD_W<17> { - TRIGMOD_W::new(self) + pub fn trigmod(&mut self) -> TRIGMOD_W { + TRIGMOD_W::new(self, 17) } #[doc = "Bits 19:23 - DAC1 analog configuration/calibration parameters"] #[inline(always)] #[must_use] - pub fn anacfg(&mut self) -> ANACFG_W<19> { - ANACFG_W::new(self) + pub fn anacfg(&mut self) -> ANACFG_W { + ANACFG_W::new(self, 19) } #[doc = "Bit 24 - Enable analog DAC for channel 1"] #[inline(always)] #[must_use] - pub fn anaen(&mut self) -> ANAEN_W<24> { - ANAEN_W::new(self) + pub fn anaen(&mut self) -> ANAEN_W { + ANAEN_W::new(self, 24) } #[doc = "Bits 28:31 - Higher 4 band-gap configuration/calibration parameters"] #[inline(always)] #[must_use] - pub fn refcfgh(&mut self) -> REFCFGH_W<28> { - REFCFGH_W::new(self) + pub fn refcfgh(&mut self) -> REFCFGH_W { + REFCFGH_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC1 Configuration Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1cfg1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1cfg1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac1cfg1::R`](R) reader structure"] +impl crate::Readable for DAC1CFG1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac1cfg1::W`](W) writer structure"] impl crate::Writable for DAC1CFG1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac1data.rs b/src/dac/dac1data.rs index d504c2c7..fef303da 100644 --- a/src/dac/dac1data.rs +++ b/src/dac/dac1data.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DATA1` reader - DAC1 Data Bits"] -pub type DATA1_R = crate::FieldReader; +pub type DATA1_R = crate::FieldReader; #[doc = "Field `DATA1` writer - DAC1 Data Bits"] -pub type DATA1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1DATA_SPEC, u16, u16, 12, O>; +pub type DATA1_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:11 - DAC1 Data Bits"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:11 - DAC1 Data Bits"] #[inline(always)] #[must_use] - pub fn data1(&mut self) -> DATA1_W<0> { - DATA1_W::new(self) + pub fn data1(&mut self) -> DATA1_W { + DATA1_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC1 Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1data::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1data::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac1data::R`](R) reader structure"] +impl crate::Readable for DAC1DATA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac1data::W`](W) writer structure"] impl crate::Writable for DAC1DATA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac1path.rs b/src/dac/dac1path.rs index 2102eaa3..0a80e8c4 100644 --- a/src/dac/dac1path.rs +++ b/src/dac/dac1path.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PAT6` reader - Pattern Number 6 for PATGEN of DAC1"] -pub type PAT6_R = crate::FieldReader; +pub type PAT6_R = crate::FieldReader; #[doc = "Field `PAT6` writer - Pattern Number 6 for PATGEN of DAC1"] -pub type PAT6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATH_SPEC, u8, u8, 5, O>; +pub type PAT6_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT7` reader - Pattern Number 7 for PATGEN of DAC1"] -pub type PAT7_R = crate::FieldReader; +pub type PAT7_R = crate::FieldReader; #[doc = "Field `PAT7` writer - Pattern Number 7 for PATGEN of DAC1"] -pub type PAT7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATH_SPEC, u8, u8, 5, O>; +pub type PAT7_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT8` reader - Pattern Number 8 for PATGEN of DAC1"] -pub type PAT8_R = crate::FieldReader; +pub type PAT8_R = crate::FieldReader; #[doc = "Field `PAT8` writer - Pattern Number 8 for PATGEN of DAC1"] -pub type PAT8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATH_SPEC, u8, u8, 5, O>; +pub type PAT8_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; impl R { #[doc = "Bits 0:4 - Pattern Number 6 for PATGEN of DAC1"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bits 0:4 - Pattern Number 6 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat6(&mut self) -> PAT6_W<0> { - PAT6_W::new(self) + pub fn pat6(&mut self) -> PAT6_W { + PAT6_W::new(self, 0) } #[doc = "Bits 5:9 - Pattern Number 7 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat7(&mut self) -> PAT7_W<5> { - PAT7_W::new(self) + pub fn pat7(&mut self) -> PAT7_W { + PAT7_W::new(self, 5) } #[doc = "Bits 10:14 - Pattern Number 8 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat8(&mut self) -> PAT8_W<10> { - PAT8_W::new(self) + pub fn pat8(&mut self) -> PAT8_W { + PAT8_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC1 Higher Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1path::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1path::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac1path::R`](R) reader structure"] +impl crate::Readable for DAC1PATH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac1path::W`](W) writer structure"] impl crate::Writable for DAC1PATH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/dac1patl.rs b/src/dac/dac1patl.rs index bc60c7ce..e049f28b 100644 --- a/src/dac/dac1patl.rs +++ b/src/dac/dac1patl.rs @@ -1,63 +1,31 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PAT0` reader - Pattern Number 0 for PATGEN of DAC1"] -pub type PAT0_R = crate::FieldReader; +pub type PAT0_R = crate::FieldReader; #[doc = "Field `PAT0` writer - Pattern Number 0 for PATGEN of DAC1"] -pub type PAT0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATL_SPEC, u8, u8, 5, O>; +pub type PAT0_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT1` reader - Pattern Number 1 for PATGEN of DAC1"] -pub type PAT1_R = crate::FieldReader; +pub type PAT1_R = crate::FieldReader; #[doc = "Field `PAT1` writer - Pattern Number 1 for PATGEN of DAC1"] -pub type PAT1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATL_SPEC, u8, u8, 5, O>; +pub type PAT1_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT2` reader - Pattern Number 2 for PATGEN of DAC1"] -pub type PAT2_R = crate::FieldReader; +pub type PAT2_R = crate::FieldReader; #[doc = "Field `PAT2` writer - Pattern Number 2 for PATGEN of DAC1"] -pub type PAT2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATL_SPEC, u8, u8, 5, O>; +pub type PAT2_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT3` reader - Pattern Number 3 for PATGEN of DAC1"] -pub type PAT3_R = crate::FieldReader; +pub type PAT3_R = crate::FieldReader; #[doc = "Field `PAT3` writer - Pattern Number 3 for PATGEN of DAC1"] -pub type PAT3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATL_SPEC, u8, u8, 5, O>; +pub type PAT3_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT4` reader - Pattern Number 4 for PATGEN of DAC1"] -pub type PAT4_R = crate::FieldReader; +pub type PAT4_R = crate::FieldReader; #[doc = "Field `PAT4` writer - Pattern Number 4 for PATGEN of DAC1"] -pub type PAT4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATL_SPEC, u8, u8, 5, O>; +pub type PAT4_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PAT5` reader - Pattern Number 5 for PATGEN of DAC1"] -pub type PAT5_R = crate::FieldReader; +pub type PAT5_R = crate::FieldReader; #[doc = "Field `PAT5` writer - Pattern Number 5 for PATGEN of DAC1"] -pub type PAT5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAC1PATL_SPEC, u8, u8, 5, O>; +pub type PAT5_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; impl R { #[doc = "Bits 0:4 - Pattern Number 0 for PATGEN of DAC1"] #[inline(always)] @@ -94,58 +62,59 @@ impl W { #[doc = "Bits 0:4 - Pattern Number 0 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat0(&mut self) -> PAT0_W<0> { - PAT0_W::new(self) + pub fn pat0(&mut self) -> PAT0_W { + PAT0_W::new(self, 0) } #[doc = "Bits 5:9 - Pattern Number 1 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat1(&mut self) -> PAT1_W<5> { - PAT1_W::new(self) + pub fn pat1(&mut self) -> PAT1_W { + PAT1_W::new(self, 5) } #[doc = "Bits 10:14 - Pattern Number 2 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat2(&mut self) -> PAT2_W<10> { - PAT2_W::new(self) + pub fn pat2(&mut self) -> PAT2_W { + PAT2_W::new(self, 10) } #[doc = "Bits 15:19 - Pattern Number 3 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat3(&mut self) -> PAT3_W<15> { - PAT3_W::new(self) + pub fn pat3(&mut self) -> PAT3_W { + PAT3_W::new(self, 15) } #[doc = "Bits 20:24 - Pattern Number 4 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat4(&mut self) -> PAT4_W<20> { - PAT4_W::new(self) + pub fn pat4(&mut self) -> PAT4_W { + PAT4_W::new(self, 20) } #[doc = "Bits 25:29 - Pattern Number 5 for PATGEN of DAC1"] #[inline(always)] #[must_use] - pub fn pat5(&mut self) -> PAT5_W<25> { - PAT5_W::new(self) + pub fn pat5(&mut self) -> PAT5_W { + PAT5_W::new(self, 25) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC1 Lower Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dac1patl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dac1patl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dac1patl::R`](R) reader structure"] +impl crate::Readable for DAC1PATL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dac1patl::W`](W) writer structure"] impl crate::Writable for DAC1PATL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dac/id.rs b/src/dac/id.rs index 0cb33e99..67d3f7ff 100644 --- a/src/dac/id.rs +++ b/src/dac/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MODR` reader - Module Revision"] -pub type MODR_R = crate::FieldReader; +pub type MODR_R = crate::FieldReader; #[doc = "Field `MODT` reader - Module Type"] -pub type MODT_R = crate::FieldReader; +pub type MODT_R = crate::FieldReader; #[doc = "Field `MODN` reader - Module Number"] -pub type MODN_R = crate::FieldReader; +pub type MODN_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00a5_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00a5_c000; diff --git a/src/dlr.rs b/src/dlr.rs index d6dd72ee..3ce7fb6a 100644 --- a/src/dlr.rs +++ b/src/dlr.rs @@ -1,29 +1,51 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + ovrstat: OVRSTAT, + ovrclr: OVRCLR, + srsel0: SRSEL0, + _reserved3: [u8; 0x04], + lnen: LNEN, +} +impl RegisterBlock { #[doc = "0x00 - Overrun Status"] - pub ovrstat: OVRSTAT, + #[inline(always)] + pub const fn ovrstat(&self) -> &OVRSTAT { + &self.ovrstat + } #[doc = "0x04 - Overrun Clear"] - pub ovrclr: OVRCLR, + #[inline(always)] + pub const fn ovrclr(&self) -> &OVRCLR { + &self.ovrclr + } #[doc = "0x08 - Service Request Selection 0"] - pub srsel0: SRSEL0, - _reserved3: [u8; 0x04], + #[inline(always)] + pub const fn srsel0(&self) -> &SRSEL0 { + &self.srsel0 + } #[doc = "0x10 - Line Enable"] - pub lnen: LNEN, + #[inline(always)] + pub const fn lnen(&self) -> &LNEN { + &self.lnen + } } -#[doc = "OVRSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "OVRSTAT (r) register accessor: Overrun Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ovrstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ovrstat`] +module"] pub type OVRSTAT = crate::Reg; #[doc = "Overrun Status"] pub mod ovrstat; -#[doc = "OVRCLR (w) register accessor: an alias for `Reg`"] +#[doc = "OVRCLR (w) register accessor: Overrun Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ovrclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ovrclr`] +module"] pub type OVRCLR = crate::Reg; #[doc = "Overrun Clear"] pub mod ovrclr; -#[doc = "SRSEL0 (rw) register accessor: an alias for `Reg`"] +#[doc = "SRSEL0 (rw) register accessor: Service Request Selection 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srsel0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srsel0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srsel0`] +module"] pub type SRSEL0 = crate::Reg; #[doc = "Service Request Selection 0"] pub mod srsel0; -#[doc = "LNEN (rw) register accessor: an alias for `Reg`"] +#[doc = "LNEN (rw) register accessor: Line Enable\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lnen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lnen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lnen`] +module"] pub type LNEN = crate::Reg; #[doc = "Line Enable"] pub mod lnen; diff --git a/src/dlr/lnen.rs b/src/dlr/lnen.rs index 96259685..116c3c4d 100644 --- a/src/dlr/lnen.rs +++ b/src/dlr/lnen.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `LN0` reader - Line 0 Enable"] pub type LN0_R = crate::BitReader; #[doc = "Line 0 Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl LN0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LN0_A { + pub const fn variant(&self) -> LN0_A { match self.bits { false => LN0_A::VALUE1, true => LN0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables the line"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LN0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables the line and resets a pending request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LN0_A::VALUE2 } } #[doc = "Field `LN0` writer - Line 0 Enable"] -pub type LN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, LNEN_SPEC, LN0_A, O>; -impl<'a, const O: u8> LN0_W<'a, O> { +pub type LN0_W<'a, REG> = crate::BitWriter<'a, REG, LN0_A>; +impl<'a, REG> LN0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables the line"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LN0_A::VALUE1) } #[doc = "Enables the line and resets a pending request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LN0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl LN1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LN1_A { + pub const fn variant(&self) -> LN1_A { match self.bits { false => LN1_A::VALUE1, true => LN1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables the line"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LN1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables the line and resets a pending request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LN1_A::VALUE2 } } #[doc = "Field `LN1` writer - Line 1 Enable"] -pub type LN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, LNEN_SPEC, LN1_A, O>; -impl<'a, const O: u8> LN1_W<'a, O> { +pub type LN1_W<'a, REG> = crate::BitWriter<'a, REG, LN1_A>; +impl<'a, REG> LN1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables the line"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LN1_A::VALUE1) } #[doc = "Enables the line and resets a pending request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LN1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl LN2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LN2_A { + pub const fn variant(&self) -> LN2_A { match self.bits { false => LN2_A::VALUE1, true => LN2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables the line"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LN2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables the line and resets a pending request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LN2_A::VALUE2 } } #[doc = "Field `LN2` writer - Line 2 Enable"] -pub type LN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, LNEN_SPEC, LN2_A, O>; -impl<'a, const O: u8> LN2_W<'a, O> { +pub type LN2_W<'a, REG> = crate::BitWriter<'a, REG, LN2_A>; +impl<'a, REG> LN2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables the line"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LN2_A::VALUE1) } #[doc = "Enables the line and resets a pending request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LN2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl LN3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LN3_A { + pub const fn variant(&self) -> LN3_A { match self.bits { false => LN3_A::VALUE1, true => LN3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables the line"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LN3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables the line and resets a pending request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LN3_A::VALUE2 } } #[doc = "Field `LN3` writer - Line 3 Enable"] -pub type LN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, LNEN_SPEC, LN3_A, O>; -impl<'a, const O: u8> LN3_W<'a, O> { +pub type LN3_W<'a, REG> = crate::BitWriter<'a, REG, LN3_A>; +impl<'a, REG> LN3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables the line"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LN3_A::VALUE1) } #[doc = "Enables the line and resets a pending request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LN3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl LN4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LN4_A { + pub const fn variant(&self) -> LN4_A { match self.bits { false => LN4_A::VALUE1, true => LN4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables the line"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LN4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables the line and resets a pending request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LN4_A::VALUE2 } } #[doc = "Field `LN4` writer - Line 4 Enable"] -pub type LN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, LNEN_SPEC, LN4_A, O>; -impl<'a, const O: u8> LN4_W<'a, O> { +pub type LN4_W<'a, REG> = crate::BitWriter<'a, REG, LN4_A>; +impl<'a, REG> LN4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables the line"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LN4_A::VALUE1) } #[doc = "Enables the line and resets a pending request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LN4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl LN5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LN5_A { + pub const fn variant(&self) -> LN5_A { match self.bits { false => LN5_A::VALUE1, true => LN5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables the line"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LN5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables the line and resets a pending request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LN5_A::VALUE2 } } #[doc = "Field `LN5` writer - Line 5 Enable"] -pub type LN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, LNEN_SPEC, LN5_A, O>; -impl<'a, const O: u8> LN5_W<'a, O> { +pub type LN5_W<'a, REG> = crate::BitWriter<'a, REG, LN5_A>; +impl<'a, REG> LN5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables the line"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LN5_A::VALUE1) } #[doc = "Enables the line and resets a pending request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LN5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl LN6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LN6_A { + pub const fn variant(&self) -> LN6_A { match self.bits { false => LN6_A::VALUE1, true => LN6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables the line"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LN6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables the line and resets a pending request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LN6_A::VALUE2 } } #[doc = "Field `LN6` writer - Line 6 Enable"] -pub type LN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, LNEN_SPEC, LN6_A, O>; -impl<'a, const O: u8> LN6_W<'a, O> { +pub type LN6_W<'a, REG> = crate::BitWriter<'a, REG, LN6_A>; +impl<'a, REG> LN6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables the line"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LN6_A::VALUE1) } #[doc = "Enables the line and resets a pending request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LN6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl LN7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LN7_A { + pub const fn variant(&self) -> LN7_A { match self.bits { false => LN7_A::VALUE1, true => LN7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables the line"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LN7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables the line and resets a pending request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LN7_A::VALUE2 } } #[doc = "Field `LN7` writer - Line 7 Enable"] -pub type LN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, LNEN_SPEC, LN7_A, O>; -impl<'a, const O: u8> LN7_W<'a, O> { +pub type LN7_W<'a, REG> = crate::BitWriter<'a, REG, LN7_A>; +impl<'a, REG> LN7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables the line"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LN7_A::VALUE1) } #[doc = "Enables the line and resets a pending request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LN7_A::VALUE2) } } @@ -480,70 +472,71 @@ impl W { #[doc = "Bit 0 - Line 0 Enable"] #[inline(always)] #[must_use] - pub fn ln0(&mut self) -> LN0_W<0> { - LN0_W::new(self) + pub fn ln0(&mut self) -> LN0_W { + LN0_W::new(self, 0) } #[doc = "Bit 1 - Line 1 Enable"] #[inline(always)] #[must_use] - pub fn ln1(&mut self) -> LN1_W<1> { - LN1_W::new(self) + pub fn ln1(&mut self) -> LN1_W { + LN1_W::new(self, 1) } #[doc = "Bit 2 - Line 2 Enable"] #[inline(always)] #[must_use] - pub fn ln2(&mut self) -> LN2_W<2> { - LN2_W::new(self) + pub fn ln2(&mut self) -> LN2_W { + LN2_W::new(self, 2) } #[doc = "Bit 3 - Line 3 Enable"] #[inline(always)] #[must_use] - pub fn ln3(&mut self) -> LN3_W<3> { - LN3_W::new(self) + pub fn ln3(&mut self) -> LN3_W { + LN3_W::new(self, 3) } #[doc = "Bit 4 - Line 4 Enable"] #[inline(always)] #[must_use] - pub fn ln4(&mut self) -> LN4_W<4> { - LN4_W::new(self) + pub fn ln4(&mut self) -> LN4_W { + LN4_W::new(self, 4) } #[doc = "Bit 5 - Line 5 Enable"] #[inline(always)] #[must_use] - pub fn ln5(&mut self) -> LN5_W<5> { - LN5_W::new(self) + pub fn ln5(&mut self) -> LN5_W { + LN5_W::new(self, 5) } #[doc = "Bit 6 - Line 6 Enable"] #[inline(always)] #[must_use] - pub fn ln6(&mut self) -> LN6_W<6> { - LN6_W::new(self) + pub fn ln6(&mut self) -> LN6_W { + LN6_W::new(self, 6) } #[doc = "Bit 7 - Line 7 Enable"] #[inline(always)] #[must_use] - pub fn ln7(&mut self) -> LN7_W<7> { - LN7_W::new(self) + pub fn ln7(&mut self) -> LN7_W { + LN7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Line Enable\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lnen::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lnen::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`lnen::R`](R) reader structure"] +impl crate::Readable for LNEN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`lnen::W`](W) writer structure"] impl crate::Writable for LNEN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dlr/ovrclr.rs b/src/dlr/ovrclr.rs index 113a037b..1a52d84c 100644 --- a/src/dlr/ovrclr.rs +++ b/src/dlr/ovrclr.rs @@ -1,104 +1,88 @@ #[doc = "Register `OVRCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `LN0` writer - Line 0 Overrun Status Clear"] -pub type LN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OVRCLR_SPEC, bool, O>; +pub type LN0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LN1` writer - Line 1 Overrun Status Clear"] -pub type LN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OVRCLR_SPEC, bool, O>; +pub type LN1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LN2` writer - Line 2 Overrun Status Clear"] -pub type LN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OVRCLR_SPEC, bool, O>; +pub type LN2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LN3` writer - Line 3 Overrun Status Clear"] -pub type LN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OVRCLR_SPEC, bool, O>; +pub type LN3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LN4` writer - Line 4 Overrun Status Clear"] -pub type LN4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OVRCLR_SPEC, bool, O>; +pub type LN4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LN5` writer - Line 5 Overrun Status Clear"] -pub type LN5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OVRCLR_SPEC, bool, O>; +pub type LN5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LN6` writer - Line 6 Overrun Status Clear"] -pub type LN6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OVRCLR_SPEC, bool, O>; +pub type LN6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LN7` writer - Line 7 Overrun Status Clear"] -pub type LN7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OVRCLR_SPEC, bool, O>; +pub type LN7_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Line 0 Overrun Status Clear"] #[inline(always)] #[must_use] - pub fn ln0(&mut self) -> LN0_W<0> { - LN0_W::new(self) + pub fn ln0(&mut self) -> LN0_W { + LN0_W::new(self, 0) } #[doc = "Bit 1 - Line 1 Overrun Status Clear"] #[inline(always)] #[must_use] - pub fn ln1(&mut self) -> LN1_W<1> { - LN1_W::new(self) + pub fn ln1(&mut self) -> LN1_W { + LN1_W::new(self, 1) } #[doc = "Bit 2 - Line 2 Overrun Status Clear"] #[inline(always)] #[must_use] - pub fn ln2(&mut self) -> LN2_W<2> { - LN2_W::new(self) + pub fn ln2(&mut self) -> LN2_W { + LN2_W::new(self, 2) } #[doc = "Bit 3 - Line 3 Overrun Status Clear"] #[inline(always)] #[must_use] - pub fn ln3(&mut self) -> LN3_W<3> { - LN3_W::new(self) + pub fn ln3(&mut self) -> LN3_W { + LN3_W::new(self, 3) } #[doc = "Bit 4 - Line 4 Overrun Status Clear"] #[inline(always)] #[must_use] - pub fn ln4(&mut self) -> LN4_W<4> { - LN4_W::new(self) + pub fn ln4(&mut self) -> LN4_W { + LN4_W::new(self, 4) } #[doc = "Bit 5 - Line 5 Overrun Status Clear"] #[inline(always)] #[must_use] - pub fn ln5(&mut self) -> LN5_W<5> { - LN5_W::new(self) + pub fn ln5(&mut self) -> LN5_W { + LN5_W::new(self, 5) } #[doc = "Bit 6 - Line 6 Overrun Status Clear"] #[inline(always)] #[must_use] - pub fn ln6(&mut self) -> LN6_W<6> { - LN6_W::new(self) + pub fn ln6(&mut self) -> LN6_W { + LN6_W::new(self, 6) } #[doc = "Bit 7 - Line 7 Overrun Status Clear"] #[inline(always)] #[must_use] - pub fn ln7(&mut self) -> LN7_W<7> { - LN7_W::new(self) + pub fn ln7(&mut self) -> LN7_W { + LN7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Overrun Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ovrclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OVRCLR_SPEC; impl crate::RegisterSpec for OVRCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [ovrclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`ovrclr::W`](W) writer structure"] impl crate::Writable for OVRCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dlr/ovrstat.rs b/src/dlr/ovrstat.rs index edbea8b6..13ec0ada 100644 --- a/src/dlr/ovrstat.rs +++ b/src/dlr/ovrstat.rs @@ -1,34 +1,21 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `LN0` reader - Line 0 Overrun Status"] -pub type LN0_R = crate::BitReader; +pub type LN0_R = crate::BitReader; #[doc = "Field `LN1` reader - Line 1 Overrun Status"] -pub type LN1_R = crate::BitReader; +pub type LN1_R = crate::BitReader; #[doc = "Field `LN2` reader - Line 2 Overrun Status"] -pub type LN2_R = crate::BitReader; +pub type LN2_R = crate::BitReader; #[doc = "Field `LN3` reader - Line 3 Overrun Status"] -pub type LN3_R = crate::BitReader; +pub type LN3_R = crate::BitReader; #[doc = "Field `LN4` reader - Line 4 Overrun Status"] -pub type LN4_R = crate::BitReader; +pub type LN4_R = crate::BitReader; #[doc = "Field `LN5` reader - Line 5 Overrun Status"] -pub type LN5_R = crate::BitReader; +pub type LN5_R = crate::BitReader; #[doc = "Field `LN6` reader - Line 6 Overrun Status"] -pub type LN6_R = crate::BitReader; +pub type LN6_R = crate::BitReader; #[doc = "Field `LN7` reader - Line 7 Overrun Status"] -pub type LN7_R = crate::BitReader; +pub type LN7_R = crate::BitReader; impl R { #[doc = "Bit 0 - Line 0 Overrun Status"] #[inline(always)] @@ -71,15 +58,13 @@ impl R { LN7_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "Overrun Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ovrstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`ovrstat::R`](R) reader structure"] +impl crate::Readable for OVRSTAT_SPEC {} #[doc = "`reset()` method sets OVRSTAT to value 0"] impl crate::Resettable for OVRSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/dlr/srsel0.rs b/src/dlr/srsel0.rs index a9726902..ab02ce1a 100644 --- a/src/dlr/srsel0.rs +++ b/src/dlr/srsel0.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RS0` reader - Request Source for Line 0"] -pub type RS0_R = crate::FieldReader; +pub type RS0_R = crate::FieldReader; #[doc = "Field `RS0` writer - Request Source for Line 0"] -pub type RS0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRSEL0_SPEC, u8, u8, 4, O>; +pub type RS0_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `RS1` reader - Request Source for Line 1"] -pub type RS1_R = crate::FieldReader; +pub type RS1_R = crate::FieldReader; #[doc = "Field `RS1` writer - Request Source for Line 1"] -pub type RS1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRSEL0_SPEC, u8, u8, 4, O>; +pub type RS1_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `RS2` reader - Request Source for Line 2"] -pub type RS2_R = crate::FieldReader; +pub type RS2_R = crate::FieldReader; #[doc = "Field `RS2` writer - Request Source for Line 2"] -pub type RS2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRSEL0_SPEC, u8, u8, 4, O>; +pub type RS2_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `RS3` reader - Request Source for Line 3"] -pub type RS3_R = crate::FieldReader; +pub type RS3_R = crate::FieldReader; #[doc = "Field `RS3` writer - Request Source for Line 3"] -pub type RS3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRSEL0_SPEC, u8, u8, 4, O>; +pub type RS3_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `RS4` reader - Request Source for Line 4"] -pub type RS4_R = crate::FieldReader; +pub type RS4_R = crate::FieldReader; #[doc = "Field `RS4` writer - Request Source for Line 4"] -pub type RS4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRSEL0_SPEC, u8, u8, 4, O>; +pub type RS4_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `RS5` reader - Request Source for Line 5"] -pub type RS5_R = crate::FieldReader; +pub type RS5_R = crate::FieldReader; #[doc = "Field `RS5` writer - Request Source for Line 5"] -pub type RS5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRSEL0_SPEC, u8, u8, 4, O>; +pub type RS5_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `RS6` reader - Request Source for Line 6"] -pub type RS6_R = crate::FieldReader; +pub type RS6_R = crate::FieldReader; #[doc = "Field `RS6` writer - Request Source for Line 6"] -pub type RS6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRSEL0_SPEC, u8, u8, 4, O>; +pub type RS6_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `RS7` reader - Request Source for Line 7"] -pub type RS7_R = crate::FieldReader; +pub type RS7_R = crate::FieldReader; #[doc = "Field `RS7` writer - Request Source for Line 7"] -pub type RS7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRSEL0_SPEC, u8, u8, 4, O>; +pub type RS7_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Request Source for Line 0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:3 - Request Source for Line 0"] #[inline(always)] #[must_use] - pub fn rs0(&mut self) -> RS0_W<0> { - RS0_W::new(self) + pub fn rs0(&mut self) -> RS0_W { + RS0_W::new(self, 0) } #[doc = "Bits 4:7 - Request Source for Line 1"] #[inline(always)] #[must_use] - pub fn rs1(&mut self) -> RS1_W<4> { - RS1_W::new(self) + pub fn rs1(&mut self) -> RS1_W { + RS1_W::new(self, 4) } #[doc = "Bits 8:11 - Request Source for Line 2"] #[inline(always)] #[must_use] - pub fn rs2(&mut self) -> RS2_W<8> { - RS2_W::new(self) + pub fn rs2(&mut self) -> RS2_W { + RS2_W::new(self, 8) } #[doc = "Bits 12:15 - Request Source for Line 3"] #[inline(always)] #[must_use] - pub fn rs3(&mut self) -> RS3_W<12> { - RS3_W::new(self) + pub fn rs3(&mut self) -> RS3_W { + RS3_W::new(self, 12) } #[doc = "Bits 16:19 - Request Source for Line 4"] #[inline(always)] #[must_use] - pub fn rs4(&mut self) -> RS4_W<16> { - RS4_W::new(self) + pub fn rs4(&mut self) -> RS4_W { + RS4_W::new(self, 16) } #[doc = "Bits 20:23 - Request Source for Line 5"] #[inline(always)] #[must_use] - pub fn rs5(&mut self) -> RS5_W<20> { - RS5_W::new(self) + pub fn rs5(&mut self) -> RS5_W { + RS5_W::new(self, 20) } #[doc = "Bits 24:27 - Request Source for Line 6"] #[inline(always)] #[must_use] - pub fn rs6(&mut self) -> RS6_W<24> { - RS6_W::new(self) + pub fn rs6(&mut self) -> RS6_W { + RS6_W::new(self, 24) } #[doc = "Bits 28:31 - Request Source for Line 7"] #[inline(always)] #[must_use] - pub fn rs7(&mut self) -> RS7_W<28> { - RS7_W::new(self) + pub fn rs7(&mut self) -> RS7_W { + RS7_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Selection 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srsel0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srsel0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`srsel0::R`](R) reader structure"] +impl crate::Readable for SRSEL0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`srsel0::W`](W) writer structure"] impl crate::Writable for SRSEL0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd.rs b/src/dsd.rs index d115b8d0..b3fff3bc 100644 --- a/src/dsd.rs +++ b/src/dsd.rs @@ -1,58 +1,100 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Clock Control Register"] - pub clc: CLC, + clc: CLC, _reserved1: [u8; 0x04], - #[doc = "0x08 - Module Identification Register"] - pub id: ID, + id: ID, _reserved2: [u8; 0x1c], - #[doc = "0x28 - OCDS Control and Status Register"] - pub ocs: OCS, + ocs: OCS, _reserved3: [u8; 0x54], - #[doc = "0x80 - Global Configuration Register"] - pub globcfg: GLOBCFG, + globcfg: GLOBCFG, _reserved4: [u8; 0x04], - #[doc = "0x88 - Global Run Control Register"] - pub globrc: GLOBRC, + globrc: GLOBRC, _reserved5: [u8; 0x14], - #[doc = "0xa0 - Carrier Generator Configuration Register"] - pub cgcfg: CGCFG, + cgcfg: CGCFG, _reserved6: [u8; 0x3c], + evflag: EVFLAG, + evflagclr: EVFLAGCLR, +} +impl RegisterBlock { + #[doc = "0x00 - Clock Control Register"] + #[inline(always)] + pub const fn clc(&self) -> &CLC { + &self.clc + } + #[doc = "0x08 - Module Identification Register"] + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } + #[doc = "0x28 - OCDS Control and Status Register"] + #[inline(always)] + pub const fn ocs(&self) -> &OCS { + &self.ocs + } + #[doc = "0x80 - Global Configuration Register"] + #[inline(always)] + pub const fn globcfg(&self) -> &GLOBCFG { + &self.globcfg + } + #[doc = "0x88 - Global Run Control Register"] + #[inline(always)] + pub const fn globrc(&self) -> &GLOBRC { + &self.globrc + } + #[doc = "0xa0 - Carrier Generator Configuration Register"] + #[inline(always)] + pub const fn cgcfg(&self) -> &CGCFG { + &self.cgcfg + } #[doc = "0xe0 - Event Flag Register"] - pub evflag: EVFLAG, + #[inline(always)] + pub const fn evflag(&self) -> &EVFLAG { + &self.evflag + } #[doc = "0xe4 - Event Flag Clear Register"] - pub evflagclr: EVFLAGCLR, + #[inline(always)] + pub const fn evflagclr(&self) -> &EVFLAGCLR { + &self.evflagclr + } } -#[doc = "CLC (rw) register accessor: an alias for `Reg`"] +#[doc = "CLC (rw) register accessor: Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clc`] +module"] pub type CLC = crate::Reg; #[doc = "Clock Control Register"] pub mod clc; -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "OCS (rw) register accessor: an alias for `Reg`"] +#[doc = "OCS (rw) register accessor: OCDS Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ocs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ocs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ocs`] +module"] pub type OCS = crate::Reg; #[doc = "OCDS Control and Status Register"] pub mod ocs; -#[doc = "GLOBCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBCFG (rw) register accessor: Global Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globcfg`] +module"] pub type GLOBCFG = crate::Reg; #[doc = "Global Configuration Register"] pub mod globcfg; -#[doc = "GLOBRC (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBRC (rw) register accessor: Global Run Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globrc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globrc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globrc`] +module"] pub type GLOBRC = crate::Reg; #[doc = "Global Run Control Register"] pub mod globrc; -#[doc = "CGCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "CGCFG (rw) register accessor: Carrier Generator Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgcfg`] +module"] pub type CGCFG = crate::Reg; #[doc = "Carrier Generator Configuration Register"] pub mod cgcfg; -#[doc = "EVFLAG (rw) register accessor: an alias for `Reg`"] +#[doc = "EVFLAG (rw) register accessor: Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`evflag::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`evflag::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@evflag`] +module"] pub type EVFLAG = crate::Reg; #[doc = "Event Flag Register"] pub mod evflag; -#[doc = "EVFLAGCLR (w) register accessor: an alias for `Reg`"] +#[doc = "EVFLAGCLR (w) register accessor: Event Flag Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`evflagclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@evflagclr`] +module"] pub type EVFLAGCLR = crate::Reg; #[doc = "Event Flag Clear Register"] pub mod evflagclr; diff --git a/src/dsd/cgcfg.rs b/src/dsd/cgcfg.rs index dc03b8bf..bf96e86c 100644 --- a/src/dsd/cgcfg.rs +++ b/src/dsd/cgcfg.rs @@ -1,41 +1,9 @@ #[doc = "Register `CGCFG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `CGCFG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CGMOD` reader - Carrier Generator Operating Mode"] -pub type CGMOD_R = crate::FieldReader; +pub type CGMOD_R = crate::FieldReader; #[doc = "Carrier Generator Operating Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CGMOD_A { + type Ux = u8; +} impl CGMOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CGMOD_A { + pub const fn variant(&self) -> CGMOD_A { match self.bits { 0 => CGMOD_A::VALUE1, 1 => CGMOD_A::VALUE2, @@ -67,48 +38,52 @@ impl CGMOD_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Stopped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CGMOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Square wave"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CGMOD_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Triangle"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CGMOD_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Sine wave"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CGMOD_A::VALUE4 } } #[doc = "Field `CGMOD` writer - Carrier Generator Operating Mode"] -pub type CGMOD_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CGCFG_SPEC, u8, CGMOD_A, 2, O>; -impl<'a, const O: u8> CGMOD_W<'a, O> { +pub type CGMOD_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CGMOD_A>; +impl<'a, REG> CGMOD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Stopped"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CGMOD_A::VALUE1) } #[doc = "Square wave"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CGMOD_A::VALUE2) } #[doc = "Triangle"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CGMOD_A::VALUE3) } #[doc = "Sine wave"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CGMOD_A::VALUE4) } } @@ -131,34 +106,37 @@ impl From for bool { impl BREV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BREV_A { + pub const fn variant(&self) -> BREV_A { match self.bits { false => BREV_A::VALUE1, true => BREV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BREV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bit-reverse mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BREV_A::VALUE2 } } #[doc = "Field `BREV` writer - Bit-Reverse PWM Generation"] -pub type BREV_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGCFG_SPEC, BREV_A, O>; -impl<'a, const O: u8> BREV_W<'a, O> { +pub type BREV_W<'a, REG> = crate::BitWriter<'a, REG, BREV_A>; +impl<'a, REG> BREV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BREV_A::VALUE1) } #[doc = "Bit-reverse mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BREV_A::VALUE2) } } @@ -181,39 +159,42 @@ impl From for bool { impl SIGPOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SIGPOL_A { + pub const fn variant(&self) -> SIGPOL_A { match self.bits { false => SIGPOL_A::VALUE1, true => SIGPOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal: carrier signal begins with +1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SIGPOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Inverted: carrier signal begins with -1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SIGPOL_A::VALUE2 } } #[doc = "Field `SIGPOL` writer - Signal Polarity"] -pub type SIGPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGCFG_SPEC, SIGPOL_A, O>; -impl<'a, const O: u8> SIGPOL_W<'a, O> { +pub type SIGPOL_W<'a, REG> = crate::BitWriter<'a, REG, SIGPOL_A>; +impl<'a, REG> SIGPOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal: carrier signal begins with +1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIGPOL_A::VALUE1) } #[doc = "Inverted: carrier signal begins with -1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIGPOL_A::VALUE2) } } #[doc = "Field `DIVCG` reader - Divider Factor for the PWM Pattern Signal Generator"] -pub type DIVCG_R = crate::FieldReader; +pub type DIVCG_R = crate::FieldReader; #[doc = "Divider Factor for the PWM Pattern Signal Generator\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -233,10 +214,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DIVCG_A { + type Ux = u8; +} impl DIVCG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DIVCG_A::VALUE1), 1 => Some(DIVCG_A::VALUE2), @@ -245,48 +229,52 @@ impl DIVCG_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fCG = fCLK / 2"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIVCG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fCG = fCLK / 4"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIVCG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fCG = fCLK / 6"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DIVCG_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "fCG = fCLK / 32"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DIVCG_A::VALUE4 } } #[doc = "Field `DIVCG` writer - Divider Factor for the PWM Pattern Signal Generator"] -pub type DIVCG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CGCFG_SPEC, u8, DIVCG_A, 4, O>; -impl<'a, const O: u8> DIVCG_W<'a, O> { +pub type DIVCG_W<'a, REG> = crate::FieldWriter<'a, REG, 4, DIVCG_A>; +impl<'a, REG> DIVCG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fCG = fCLK / 2"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIVCG_A::VALUE1) } #[doc = "fCG = fCLK / 4"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIVCG_A::VALUE2) } #[doc = "fCG = fCLK / 6"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DIVCG_A::VALUE3) } #[doc = "fCG = fCLK / 32"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DIVCG_A::VALUE4) } } @@ -309,27 +297,27 @@ impl From for bool { impl RUN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RUN_A { + pub const fn variant(&self) -> RUN_A { match self.bits { false => RUN_A::VALUE1, true => RUN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Stopped (cleared at the end of a period)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RUN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RUN_A::VALUE2 } } #[doc = "Field `BITCOUNT` reader - Bit Counter"] -pub type BITCOUNT_R = crate::FieldReader; +pub type BITCOUNT_R = crate::FieldReader; #[doc = "Field `STEPCOUNT` reader - Step Counter"] -pub type STEPCOUNT_R = crate::FieldReader; +pub type STEPCOUNT_R = crate::FieldReader; #[doc = "Field `STEPS` reader - Step Counter Sign"] pub type STEPS_R = crate::BitReader; #[doc = "Step Counter Sign\n\nValue on reset: 0"] @@ -349,18 +337,18 @@ impl From for bool { impl STEPS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STEPS_A { + pub const fn variant(&self) -> STEPS_A { match self.bits { false => STEPS_A::VALUE1, true => STEPS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Step counter value is positive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STEPS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Step counter value is negative"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STEPS_A::VALUE2 @@ -385,18 +373,18 @@ impl From for bool { impl STEPD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STEPD_A { + pub const fn variant(&self) -> STEPD_A { match self.bits { false => STEPD_A::VALUE1, true => STEPD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Step counter is counting up"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STEPD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Step counter is counting down"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STEPD_A::VALUE2 @@ -421,18 +409,18 @@ impl From for bool { impl SGNCG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SGNCG_A { + pub const fn variant(&self) -> SGNCG_A { match self.bits { false => SGNCG_A::VALUE1, true => SGNCG_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Positive values"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SGNCG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Negative values"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SGNCG_A::VALUE2 @@ -494,46 +482,47 @@ impl W { #[doc = "Bits 0:1 - Carrier Generator Operating Mode"] #[inline(always)] #[must_use] - pub fn cgmod(&mut self) -> CGMOD_W<0> { - CGMOD_W::new(self) + pub fn cgmod(&mut self) -> CGMOD_W { + CGMOD_W::new(self, 0) } #[doc = "Bit 2 - Bit-Reverse PWM Generation"] #[inline(always)] #[must_use] - pub fn brev(&mut self) -> BREV_W<2> { - BREV_W::new(self) + pub fn brev(&mut self) -> BREV_W { + BREV_W::new(self, 2) } #[doc = "Bit 3 - Signal Polarity"] #[inline(always)] #[must_use] - pub fn sigpol(&mut self) -> SIGPOL_W<3> { - SIGPOL_W::new(self) + pub fn sigpol(&mut self) -> SIGPOL_W { + SIGPOL_W::new(self, 3) } #[doc = "Bits 4:7 - Divider Factor for the PWM Pattern Signal Generator"] #[inline(always)] #[must_use] - pub fn divcg(&mut self) -> DIVCG_W<4> { - DIVCG_W::new(self) + pub fn divcg(&mut self) -> DIVCG_W { + DIVCG_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Carrier Generator 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 [cgcfg](index.html) module"] +#[doc = "Carrier Generator Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CGCFG_SPEC; impl crate::RegisterSpec for CGCFG_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [cgcfg::R](R) reader structure"] -impl crate::Readable for CGCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [cgcfg::W](W) writer structure"] +#[doc = "`read()` method returns [`cgcfg::R`](R) reader structure"] +impl crate::Readable for CGCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cgcfg::W`](W) writer structure"] impl crate::Writable for CGCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd/clc.rs b/src/dsd/clc.rs index 7bbd3188..7a7c39c0 100644 --- a/src/dsd/clc.rs +++ b/src/dsd/clc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DISR` reader - Module Disable Request Bit"] pub type DISR_R = crate::BitReader; #[doc = "Module Disable Request Bit\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl DISR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DISR_A { + pub const fn variant(&self) -> DISR_A { match self.bits { false => DISR_A::VALUE1, true => DISR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "On request: enable the module clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DISR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Off request: stop the module clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DISR_A::VALUE2 } } #[doc = "Field `DISR` writer - Module Disable Request Bit"] -pub type DISR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLC_SPEC, DISR_A, O>; -impl<'a, const O: u8> DISR_W<'a, O> { +pub type DISR_W<'a, REG> = crate::BitWriter<'a, REG, DISR_A>; +impl<'a, REG> DISR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "On request: enable the module clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DISR_A::VALUE1) } #[doc = "Off request: stop the module clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DISR_A::VALUE2) } } @@ -103,18 +74,18 @@ impl From for bool { impl DISS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DISS_A { + pub const fn variant(&self) -> DISS_A { match self.bits { false => DISS_A::VALUE1, true => DISS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Module clock is enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DISS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Off: module is not clocked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DISS_A::VALUE2 @@ -139,34 +110,37 @@ impl From for bool { impl EDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EDIS_A { + pub const fn variant(&self) -> EDIS_A { match self.bits { false => EDIS_A::VALUE1, true => EDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Sleep mode request is enabled and functional"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Module disregards the sleep mode control signal"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EDIS_A::VALUE2 } } #[doc = "Field `EDIS` writer - Sleep Mode Enable Control"] -pub type EDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLC_SPEC, EDIS_A, O>; -impl<'a, const O: u8> EDIS_W<'a, O> { +pub type EDIS_W<'a, REG> = crate::BitWriter<'a, REG, EDIS_A>; +impl<'a, REG> EDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Sleep mode request is enabled and functional"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EDIS_A::VALUE1) } #[doc = "Module disregards the sleep mode control signal"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EDIS_A::VALUE2) } } @@ -191,34 +165,35 @@ impl W { #[doc = "Bit 0 - Module Disable Request Bit"] #[inline(always)] #[must_use] - pub fn disr(&mut self) -> DISR_W<0> { - DISR_W::new(self) + pub fn disr(&mut self) -> DISR_W { + DISR_W::new(self, 0) } #[doc = "Bit 3 - Sleep Mode Enable Control"] #[inline(always)] #[must_use] - pub fn edis(&mut self) -> EDIS_W<3> { - EDIS_W::new(self) + pub fn edis(&mut self) -> EDIS_W { + EDIS_W::new(self, 3) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`clc::R`](R) reader structure"] +impl crate::Readable for CLC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`clc::W`](W) writer structure"] impl crate::Writable for CLC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd/evflag.rs b/src/dsd/evflag.rs index 65a0ffa2..70f73cc7 100644 --- a/src/dsd/evflag.rs +++ b/src/dsd/evflag.rs @@ -1,39 +1,7 @@ #[doc = "Register `EVFLAG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `EVFLAG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RESEV0` reader - Result Event"] pub type RESEV0_R = crate::BitReader; #[doc = "Result Event\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl RESEV0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RESEV0_A { + pub const fn variant(&self) -> RESEV0_A { match self.bits { false => RESEV0_A::VALUE1, true => RESEV0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RESEV0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new result has been stored in register RESMx"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RESEV0_A::VALUE2 } } #[doc = "Field `RESEV0` writer - Result Event"] -pub type RESEV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, RESEV0_A, O>; -impl<'a, const O: u8> RESEV0_W<'a, O> { +pub type RESEV0_W<'a, REG> = crate::BitWriter<'a, REG, RESEV0_A>; +impl<'a, REG> RESEV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESEV0_A::VALUE1) } #[doc = "A new result has been stored in register RESMx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESEV0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl RESEV1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RESEV1_A { + pub const fn variant(&self) -> RESEV1_A { match self.bits { false => RESEV1_A::VALUE1, true => RESEV1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RESEV1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new result has been stored in register RESMx"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RESEV1_A::VALUE2 } } #[doc = "Field `RESEV1` writer - Result Event"] -pub type RESEV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, RESEV1_A, O>; -impl<'a, const O: u8> RESEV1_W<'a, O> { +pub type RESEV1_W<'a, REG> = crate::BitWriter<'a, REG, RESEV1_A>; +impl<'a, REG> RESEV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESEV1_A::VALUE1) } #[doc = "A new result has been stored in register RESMx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESEV1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl RESEV2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RESEV2_A { + pub const fn variant(&self) -> RESEV2_A { match self.bits { false => RESEV2_A::VALUE1, true => RESEV2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RESEV2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new result has been stored in register RESMx"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RESEV2_A::VALUE2 } } #[doc = "Field `RESEV2` writer - Result Event"] -pub type RESEV2_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, RESEV2_A, O>; -impl<'a, const O: u8> RESEV2_W<'a, O> { +pub type RESEV2_W<'a, REG> = crate::BitWriter<'a, REG, RESEV2_A>; +impl<'a, REG> RESEV2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESEV2_A::VALUE1) } #[doc = "A new result has been stored in register RESMx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESEV2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl RESEV3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RESEV3_A { + pub const fn variant(&self) -> RESEV3_A { match self.bits { false => RESEV3_A::VALUE1, true => RESEV3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RESEV3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A new result has been stored in register RESMx"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RESEV3_A::VALUE2 } } #[doc = "Field `RESEV3` writer - Result Event"] -pub type RESEV3_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, RESEV3_A, O>; -impl<'a, const O: u8> RESEV3_W<'a, O> { +pub type RESEV3_W<'a, REG> = crate::BitWriter<'a, REG, RESEV3_A>; +impl<'a, REG> RESEV3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESEV3_A::VALUE1) } #[doc = "A new result has been stored in register RESMx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESEV3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl ALEV0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV0_A { + pub const fn variant(&self) -> ALEV0_A { match self.bits { false => ALEV0_A::VALUE1, true => ALEV0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV0_A::VALUE2 } } #[doc = "Field `ALEV0` writer - Alarm Event"] -pub type ALEV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV0_A, O>; -impl<'a, const O: u8> ALEV0_W<'a, O> { +pub type ALEV0_W<'a, REG> = crate::BitWriter<'a, REG, ALEV0_A>; +impl<'a, REG> ALEV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV0_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV0_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl ALEV1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV1_A { + pub const fn variant(&self) -> ALEV1_A { match self.bits { false => ALEV1_A::VALUE1, true => ALEV1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV1_A::VALUE2 } } #[doc = "Field `ALEV1` writer - Alarm Event"] -pub type ALEV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV1_A, O>; -impl<'a, const O: u8> ALEV1_W<'a, O> { +pub type ALEV1_W<'a, REG> = crate::BitWriter<'a, REG, ALEV1_A>; +impl<'a, REG> ALEV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV1_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV1_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl ALEV2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV2_A { + pub const fn variant(&self) -> ALEV2_A { match self.bits { false => ALEV2_A::VALUE1, true => ALEV2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV2_A::VALUE2 } } #[doc = "Field `ALEV2` writer - Alarm Event"] -pub type ALEV2_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV2_A, O>; -impl<'a, const O: u8> ALEV2_W<'a, O> { +pub type ALEV2_W<'a, REG> = crate::BitWriter<'a, REG, ALEV2_A>; +impl<'a, REG> ALEV2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV2_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV2_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl ALEV3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV3_A { + pub const fn variant(&self) -> ALEV3_A { match self.bits { false => ALEV3_A::VALUE1, true => ALEV3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV3_A::VALUE2 } } #[doc = "Field `ALEV3` writer - Alarm Event"] -pub type ALEV3_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV3_A, O>; -impl<'a, const O: u8> ALEV3_W<'a, O> { +pub type ALEV3_W<'a, REG> = crate::BitWriter<'a, REG, ALEV3_A>; +impl<'a, REG> ALEV3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV3_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV3_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl ALEV4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV4_A { + pub const fn variant(&self) -> ALEV4_A { match self.bits { false => ALEV4_A::VALUE1, true => ALEV4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV4_A::VALUE2 } } #[doc = "Field `ALEV4` writer - Alarm Event"] -pub type ALEV4_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV4_A, O>; -impl<'a, const O: u8> ALEV4_W<'a, O> { +pub type ALEV4_W<'a, REG> = crate::BitWriter<'a, REG, ALEV4_A>; +impl<'a, REG> ALEV4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV4_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV4_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl ALEV5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV5_A { + pub const fn variant(&self) -> ALEV5_A { match self.bits { false => ALEV5_A::VALUE1, true => ALEV5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV5_A::VALUE2 } } #[doc = "Field `ALEV5` writer - Alarm Event"] -pub type ALEV5_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV5_A, O>; -impl<'a, const O: u8> ALEV5_W<'a, O> { +pub type ALEV5_W<'a, REG> = crate::BitWriter<'a, REG, ALEV5_A>; +impl<'a, REG> ALEV5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV5_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV5_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl ALEV6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV6_A { + pub const fn variant(&self) -> ALEV6_A { match self.bits { false => ALEV6_A::VALUE1, true => ALEV6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV6_A::VALUE2 } } #[doc = "Field `ALEV6` writer - Alarm Event"] -pub type ALEV6_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV6_A, O>; -impl<'a, const O: u8> ALEV6_W<'a, O> { +pub type ALEV6_W<'a, REG> = crate::BitWriter<'a, REG, ALEV6_A>; +impl<'a, REG> ALEV6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV6_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV6_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl ALEV7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV7_A { + pub const fn variant(&self) -> ALEV7_A { match self.bits { false => ALEV7_A::VALUE1, true => ALEV7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV7_A::VALUE2 } } #[doc = "Field `ALEV7` writer - Alarm Event"] -pub type ALEV7_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV7_A, O>; -impl<'a, const O: u8> ALEV7_W<'a, O> { +pub type ALEV7_W<'a, REG> = crate::BitWriter<'a, REG, ALEV7_A>; +impl<'a, REG> ALEV7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV7_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV7_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl ALEV8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV8_A { + pub const fn variant(&self) -> ALEV8_A { match self.bits { false => ALEV8_A::VALUE1, true => ALEV8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV8_A::VALUE2 } } #[doc = "Field `ALEV8` writer - Alarm Event"] -pub type ALEV8_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV8_A, O>; -impl<'a, const O: u8> ALEV8_W<'a, O> { +pub type ALEV8_W<'a, REG> = crate::BitWriter<'a, REG, ALEV8_A>; +impl<'a, REG> ALEV8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV8_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV8_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl ALEV9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALEV9_A { + pub const fn variant(&self) -> ALEV9_A { match self.bits { false => ALEV9_A::VALUE1, true => ALEV9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No alarm event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALEV9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alarm event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALEV9_A::VALUE2 } } #[doc = "Field `ALEV9` writer - Alarm Event"] -pub type ALEV9_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAG_SPEC, ALEV9_A, O>; -impl<'a, const O: u8> ALEV9_W<'a, O> { +pub type ALEV9_W<'a, REG> = crate::BitWriter<'a, REG, ALEV9_A>; +impl<'a, REG> ALEV9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No alarm event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEV9_A::VALUE1) } #[doc = "An alarm event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEV9_A::VALUE2) } } @@ -810,106 +820,107 @@ impl W { #[doc = "Bit 0 - Result Event"] #[inline(always)] #[must_use] - pub fn resev0(&mut self) -> RESEV0_W<0> { - RESEV0_W::new(self) + pub fn resev0(&mut self) -> RESEV0_W { + RESEV0_W::new(self, 0) } #[doc = "Bit 1 - Result Event"] #[inline(always)] #[must_use] - pub fn resev1(&mut self) -> RESEV1_W<1> { - RESEV1_W::new(self) + pub fn resev1(&mut self) -> RESEV1_W { + RESEV1_W::new(self, 1) } #[doc = "Bit 2 - Result Event"] #[inline(always)] #[must_use] - pub fn resev2(&mut self) -> RESEV2_W<2> { - RESEV2_W::new(self) + pub fn resev2(&mut self) -> RESEV2_W { + RESEV2_W::new(self, 2) } #[doc = "Bit 3 - Result Event"] #[inline(always)] #[must_use] - pub fn resev3(&mut self) -> RESEV3_W<3> { - RESEV3_W::new(self) + pub fn resev3(&mut self) -> RESEV3_W { + RESEV3_W::new(self, 3) } #[doc = "Bit 16 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev0(&mut self) -> ALEV0_W<16> { - ALEV0_W::new(self) + pub fn alev0(&mut self) -> ALEV0_W { + ALEV0_W::new(self, 16) } #[doc = "Bit 17 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev1(&mut self) -> ALEV1_W<17> { - ALEV1_W::new(self) + pub fn alev1(&mut self) -> ALEV1_W { + ALEV1_W::new(self, 17) } #[doc = "Bit 18 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev2(&mut self) -> ALEV2_W<18> { - ALEV2_W::new(self) + pub fn alev2(&mut self) -> ALEV2_W { + ALEV2_W::new(self, 18) } #[doc = "Bit 19 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev3(&mut self) -> ALEV3_W<19> { - ALEV3_W::new(self) + pub fn alev3(&mut self) -> ALEV3_W { + ALEV3_W::new(self, 19) } #[doc = "Bit 20 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev4(&mut self) -> ALEV4_W<20> { - ALEV4_W::new(self) + pub fn alev4(&mut self) -> ALEV4_W { + ALEV4_W::new(self, 20) } #[doc = "Bit 21 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev5(&mut self) -> ALEV5_W<21> { - ALEV5_W::new(self) + pub fn alev5(&mut self) -> ALEV5_W { + ALEV5_W::new(self, 21) } #[doc = "Bit 22 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev6(&mut self) -> ALEV6_W<22> { - ALEV6_W::new(self) + pub fn alev6(&mut self) -> ALEV6_W { + ALEV6_W::new(self, 22) } #[doc = "Bit 23 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev7(&mut self) -> ALEV7_W<23> { - ALEV7_W::new(self) + pub fn alev7(&mut self) -> ALEV7_W { + ALEV7_W::new(self, 23) } #[doc = "Bit 24 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev8(&mut self) -> ALEV8_W<24> { - ALEV8_W::new(self) + pub fn alev8(&mut self) -> ALEV8_W { + ALEV8_W::new(self, 24) } #[doc = "Bit 25 - Alarm Event"] #[inline(always)] #[must_use] - pub fn alev9(&mut self) -> ALEV9_W<25> { - ALEV9_W::new(self) + pub fn alev9(&mut self) -> ALEV9_W { + ALEV9_W::new(self, 25) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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 [evflag](index.html) module"] +#[doc = "Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`evflag::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`evflag::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct EVFLAG_SPEC; impl crate::RegisterSpec for EVFLAG_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [evflag::R](R) reader structure"] -impl crate::Readable for EVFLAG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [evflag::W](W) writer structure"] +#[doc = "`read()` method returns [`evflag::R`](R) reader structure"] +impl crate::Readable for EVFLAG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`evflag::W`](W) writer structure"] impl crate::Writable for EVFLAG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd/evflagclr.rs b/src/dsd/evflagclr.rs index 1aff6cbd..098b497e 100644 --- a/src/dsd/evflagclr.rs +++ b/src/dsd/evflagclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `EVFLAGCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Result Event Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum RESEC0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `RESEC0` writer - Result Event Clear"] -pub type RESEC0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAGCLR_SPEC, RESEC0_AW, O>; -impl<'a, const O: u8> RESEC0_W<'a, O> { +pub type RESEC0_W<'a, REG> = crate::BitWriter<'a, REG, RESEC0_AW>; +impl<'a, REG> RESEC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESEC0_AW::VALUE1) } #[doc = "Clear bit RESEVx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESEC0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `RESEC1` writer - Result Event Clear"] -pub type RESEC1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAGCLR_SPEC, RESEC1_AW, O>; -impl<'a, const O: u8> RESEC1_W<'a, O> { +pub type RESEC1_W<'a, REG> = crate::BitWriter<'a, REG, RESEC1_AW>; +impl<'a, REG> RESEC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESEC1_AW::VALUE1) } #[doc = "Clear bit RESEVx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESEC1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `RESEC2` writer - Result Event Clear"] -pub type RESEC2_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAGCLR_SPEC, RESEC2_AW, O>; -impl<'a, const O: u8> RESEC2_W<'a, O> { +pub type RESEC2_W<'a, REG> = crate::BitWriter<'a, REG, RESEC2_AW>; +impl<'a, REG> RESEC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESEC2_AW::VALUE1) } #[doc = "Clear bit RESEVx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESEC2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `RESEC3` writer - Result Event Clear"] -pub type RESEC3_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAGCLR_SPEC, RESEC3_AW, O>; -impl<'a, const O: u8> RESEC3_W<'a, O> { +pub type RESEC3_W<'a, REG> = crate::BitWriter<'a, REG, RESEC3_AW>; +impl<'a, REG> RESEC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESEC3_AW::VALUE1) } #[doc = "Clear bit RESEVx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESEC3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `ALEC0` writer - Alarm Event Clear"] -pub type ALEC0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAGCLR_SPEC, ALEC0_AW, O>; -impl<'a, const O: u8> ALEC0_W<'a, O> { +pub type ALEC0_W<'a, REG> = crate::BitWriter<'a, REG, ALEC0_AW>; +impl<'a, REG> ALEC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEC0_AW::VALUE1) } #[doc = "Clear bit ALEVx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEC0_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `ALEC1` writer - Alarm Event Clear"] -pub type ALEC1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAGCLR_SPEC, ALEC1_AW, O>; -impl<'a, const O: u8> ALEC1_W<'a, O> { +pub type ALEC1_W<'a, REG> = crate::BitWriter<'a, REG, ALEC1_AW>; +impl<'a, REG> ALEC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEC1_AW::VALUE1) } #[doc = "Clear bit ALEVx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEC1_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `ALEC2` writer - Alarm Event Clear"] -pub type ALEC2_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAGCLR_SPEC, ALEC2_AW, O>; -impl<'a, const O: u8> ALEC2_W<'a, O> { +pub type ALEC2_W<'a, REG> = crate::BitWriter<'a, REG, ALEC2_AW>; +impl<'a, REG> ALEC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEC2_AW::VALUE1) } #[doc = "Clear bit ALEVx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEC2_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `ALEC3` writer - Alarm Event Clear"] -pub type ALEC3_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFLAGCLR_SPEC, ALEC3_AW, O>; -impl<'a, const O: u8> ALEC3_W<'a, O> { +pub type ALEC3_W<'a, REG> = crate::BitWriter<'a, REG, ALEC3_AW>; +impl<'a, REG> ALEC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALEC3_AW::VALUE1) } #[doc = "Clear bit ALEVx"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALEC3_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Result Event Clear"] #[inline(always)] #[must_use] - pub fn resec0(&mut self) -> RESEC0_W<0> { - RESEC0_W::new(self) + pub fn resec0(&mut self) -> RESEC0_W { + RESEC0_W::new(self, 0) } #[doc = "Bit 1 - Result Event Clear"] #[inline(always)] #[must_use] - pub fn resec1(&mut self) -> RESEC1_W<1> { - RESEC1_W::new(self) + pub fn resec1(&mut self) -> RESEC1_W { + RESEC1_W::new(self, 1) } #[doc = "Bit 2 - Result Event Clear"] #[inline(always)] #[must_use] - pub fn resec2(&mut self) -> RESEC2_W<2> { - RESEC2_W::new(self) + pub fn resec2(&mut self) -> RESEC2_W { + RESEC2_W::new(self, 2) } #[doc = "Bit 3 - Result Event Clear"] #[inline(always)] #[must_use] - pub fn resec3(&mut self) -> RESEC3_W<3> { - RESEC3_W::new(self) + pub fn resec3(&mut self) -> RESEC3_W { + RESEC3_W::new(self, 3) } #[doc = "Bit 16 - Alarm Event Clear"] #[inline(always)] #[must_use] - pub fn alec0(&mut self) -> ALEC0_W<16> { - ALEC0_W::new(self) + pub fn alec0(&mut self) -> ALEC0_W { + ALEC0_W::new(self, 16) } #[doc = "Bit 17 - Alarm Event Clear"] #[inline(always)] #[must_use] - pub fn alec1(&mut self) -> ALEC1_W<17> { - ALEC1_W::new(self) + pub fn alec1(&mut self) -> ALEC1_W { + ALEC1_W::new(self, 17) } #[doc = "Bit 18 - Alarm Event Clear"] #[inline(always)] #[must_use] - pub fn alec2(&mut self) -> ALEC2_W<18> { - ALEC2_W::new(self) + pub fn alec2(&mut self) -> ALEC2_W { + ALEC2_W::new(self, 18) } #[doc = "Bit 19 - Alarm Event Clear"] #[inline(always)] #[must_use] - pub fn alec3(&mut self) -> ALEC3_W<19> { - ALEC3_W::new(self) + pub fn alec3(&mut self) -> ALEC3_W { + ALEC3_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "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 [evflagclr](index.html) module"] +#[doc = "Event Flag Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`evflagclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct EVFLAGCLR_SPEC; impl crate::RegisterSpec for EVFLAGCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [evflagclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`evflagclr::W`](W) writer structure"] impl crate::Writable for EVFLAGCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd/globcfg.rs b/src/dsd/globcfg.rs index d96982da..fdf7b42b 100644 --- a/src/dsd/globcfg.rs +++ b/src/dsd/globcfg.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MCSEL` reader - Modulator Clock Select"] -pub type MCSEL_R = crate::FieldReader; +pub type MCSEL_R = crate::FieldReader; #[doc = "Modulator Clock Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -51,38 +19,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MCSEL_A { + type Ux = u8; +} impl MCSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(MCSEL_A::VALUE1), 1 => Some(MCSEL_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Internal clock off, no source selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fDSD"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCSEL_A::VALUE2 } } #[doc = "Field `MCSEL` writer - Modulator Clock Select"] -pub type MCSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBCFG_SPEC, u8, MCSEL_A, 3, O>; -impl<'a, const O: u8> MCSEL_W<'a, O> { +pub type MCSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, MCSEL_A>; +impl<'a, REG> MCSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Internal clock off, no source selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCSEL_A::VALUE1) } #[doc = "fDSD"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCSEL_A::VALUE2) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:2 - Modulator Clock Select"] #[inline(always)] #[must_use] - pub fn mcsel(&mut self) -> MCSEL_W<0> { - MCSEL_W::new(self) + pub fn mcsel(&mut self) -> MCSEL_W { + MCSEL_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globcfg::R`](R) reader structure"] +impl crate::Readable for GLOBCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globcfg::W`](W) writer structure"] impl crate::Writable for GLOBCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd/globrc.rs b/src/dsd/globrc.rs index 7cbfa79a..eaa5a566 100644 --- a/src/dsd/globrc.rs +++ b/src/dsd/globrc.rs @@ -1,39 +1,7 @@ #[doc = "Register `GLOBRC` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GLOBRC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CH0RUN` reader - Channel 0 Run Control"] pub type CH0RUN_R = crate::BitReader; #[doc = "Channel 0 Run Control\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CH0RUN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH0RUN_A { + pub const fn variant(&self) -> CH0RUN_A { match self.bits { false => CH0RUN_A::VALUE1, true => CH0RUN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Stop channel x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH0RUN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Demodulator channel x is enabled and runs"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH0RUN_A::VALUE2 } } #[doc = "Field `CH0RUN` writer - Channel 0 Run Control"] -pub type CH0RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBRC_SPEC, CH0RUN_A, O>; -impl<'a, const O: u8> CH0RUN_W<'a, O> { +pub type CH0RUN_W<'a, REG> = crate::BitWriter<'a, REG, CH0RUN_A>; +impl<'a, REG> CH0RUN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Stop channel x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0RUN_A::VALUE1) } #[doc = "Demodulator channel x is enabled and runs"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0RUN_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CH1RUN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH1RUN_A { + pub const fn variant(&self) -> CH1RUN_A { match self.bits { false => CH1RUN_A::VALUE1, true => CH1RUN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Stop channel x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH1RUN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Demodulator channel x is enabled and runs"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH1RUN_A::VALUE2 } } #[doc = "Field `CH1RUN` writer - Channel 1 Run Control"] -pub type CH1RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBRC_SPEC, CH1RUN_A, O>; -impl<'a, const O: u8> CH1RUN_W<'a, O> { +pub type CH1RUN_W<'a, REG> = crate::BitWriter<'a, REG, CH1RUN_A>; +impl<'a, REG> CH1RUN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Stop channel x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1RUN_A::VALUE1) } #[doc = "Demodulator channel x is enabled and runs"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1RUN_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CH2RUN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH2RUN_A { + pub const fn variant(&self) -> CH2RUN_A { match self.bits { false => CH2RUN_A::VALUE1, true => CH2RUN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Stop channel x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH2RUN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Demodulator channel x is enabled and runs"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH2RUN_A::VALUE2 } } #[doc = "Field `CH2RUN` writer - Channel 2 Run Control"] -pub type CH2RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBRC_SPEC, CH2RUN_A, O>; -impl<'a, const O: u8> CH2RUN_W<'a, O> { +pub type CH2RUN_W<'a, REG> = crate::BitWriter<'a, REG, CH2RUN_A>; +impl<'a, REG> CH2RUN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Stop channel x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2RUN_A::VALUE1) } #[doc = "Demodulator channel x is enabled and runs"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2RUN_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CH3RUN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH3RUN_A { + pub const fn variant(&self) -> CH3RUN_A { match self.bits { false => CH3RUN_A::VALUE1, true => CH3RUN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Stop channel x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH3RUN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Demodulator channel x is enabled and runs"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH3RUN_A::VALUE2 } } #[doc = "Field `CH3RUN` writer - Channel 3 Run Control"] -pub type CH3RUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBRC_SPEC, CH3RUN_A, O>; -impl<'a, const O: u8> CH3RUN_W<'a, O> { +pub type CH3RUN_W<'a, REG> = crate::BitWriter<'a, REG, CH3RUN_A>; +impl<'a, REG> CH3RUN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Stop channel x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3RUN_A::VALUE1) } #[doc = "Demodulator channel x is enabled and runs"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3RUN_A::VALUE2) } } @@ -260,46 +240,47 @@ impl W { #[doc = "Bit 0 - Channel 0 Run Control"] #[inline(always)] #[must_use] - pub fn ch0run(&mut self) -> CH0RUN_W<0> { - CH0RUN_W::new(self) + pub fn ch0run(&mut self) -> CH0RUN_W { + CH0RUN_W::new(self, 0) } #[doc = "Bit 1 - Channel 1 Run Control"] #[inline(always)] #[must_use] - pub fn ch1run(&mut self) -> CH1RUN_W<1> { - CH1RUN_W::new(self) + pub fn ch1run(&mut self) -> CH1RUN_W { + CH1RUN_W::new(self, 1) } #[doc = "Bit 2 - Channel 2 Run Control"] #[inline(always)] #[must_use] - pub fn ch2run(&mut self) -> CH2RUN_W<2> { - CH2RUN_W::new(self) + pub fn ch2run(&mut self) -> CH2RUN_W { + CH2RUN_W::new(self, 2) } #[doc = "Bit 3 - Channel 3 Run Control"] #[inline(always)] #[must_use] - pub fn ch3run(&mut self) -> CH3RUN_W<3> { - CH3RUN_W::new(self) + pub fn ch3run(&mut self) -> CH3RUN_W { + CH3RUN_W::new(self, 3) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Global Run 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 [globrc](index.html) module"] +#[doc = "Global Run Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globrc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globrc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GLOBRC_SPEC; impl crate::RegisterSpec for GLOBRC_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [globrc::R](R) reader structure"] -impl crate::Readable for GLOBRC_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [globrc::W](W) writer structure"] +#[doc = "`read()` method returns [`globrc::R`](R) reader structure"] +impl crate::Readable for GLOBRC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globrc::W`](W) writer structure"] impl crate::Writable for GLOBRC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd/id.rs b/src/dsd/id.rs index fd0330a3..1abcb9bc 100644 --- a/src/dsd/id.rs +++ b/src/dsd/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00a4_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00a4_c000; diff --git a/src/dsd/ocs.rs b/src/dsd/ocs.rs index f76f72b0..76e30cca 100644 --- a/src/dsd/ocs.rs +++ b/src/dsd/ocs.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SUS` reader - OCDS Suspend Control"] -pub type SUS_R = crate::FieldReader; +pub type SUS_R = crate::FieldReader; #[doc = "OCDS Suspend Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SUS_A { + type Ux = u8; +} impl SUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SUS_A::VALUE1), 1 => Some(SUS_A::VALUE2), @@ -70,63 +41,67 @@ impl SUS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Will not suspend"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Hard suspend: Clock is switched off immediately."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Soft suspend channel 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SUS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Soft suspend channel 1"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SUS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Soft suspend channel 3"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == SUS_A::VALUE5 } } #[doc = "Field `SUS` writer - OCDS Suspend Control"] -pub type SUS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OCS_SPEC, u8, SUS_A, 4, O>; -impl<'a, const O: u8> SUS_W<'a, O> { +pub type SUS_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SUS_A>; +impl<'a, REG> SUS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Will not suspend"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE1) } #[doc = "Hard suspend: Clock is switched off immediately."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE2) } #[doc = "Soft suspend channel 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE3) } #[doc = "Soft suspend channel 1"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE4) } #[doc = "Soft suspend channel 3"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE5) } } #[doc = "Field `SUS_P` writer - SUS Write Protection"] -pub type SUS_P_W<'a, const O: u8> = crate::BitWriter<'a, u32, OCS_SPEC, bool, O>; +pub type SUS_P_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SUSSTA` reader - Suspend State"] pub type SUSSTA_R = crate::BitReader; #[doc = "Suspend State\n\nValue on reset: 0"] @@ -146,18 +121,18 @@ impl From for bool { impl SUSSTA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SUSSTA_A { + pub const fn variant(&self) -> SUSSTA_A { match self.bits { false => SUSSTA_A::VALUE1, true => SUSSTA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Module is not (yet) suspended"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUSSTA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Module is suspended"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUSSTA_A::VALUE2 @@ -179,34 +154,35 @@ impl W { #[doc = "Bits 24:27 - OCDS Suspend Control"] #[inline(always)] #[must_use] - pub fn sus(&mut self) -> SUS_W<24> { - SUS_W::new(self) + pub fn sus(&mut self) -> SUS_W { + SUS_W::new(self, 24) } #[doc = "Bit 28 - SUS Write Protection"] #[inline(always)] #[must_use] - pub fn sus_p(&mut self) -> SUS_P_W<28> { - SUS_P_W::new(self) + pub fn sus_p(&mut self) -> SUS_P_W { + SUS_P_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "OCDS Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ocs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ocs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ocs::R`](R) reader structure"] +impl crate::Readable for OCS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ocs::W`](W) writer structure"] impl crate::Writable for OCS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0.rs b/src/dsd_ch0.rs index 1b8d2750..3fedc17c 100644 --- a/src/dsd_ch0.rs +++ b/src/dsd_ch0.rs @@ -1,86 +1,148 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Modulator Configuration Register"] - pub modcfg: MODCFG, + modcfg: MODCFG, _reserved1: [u8; 0x04], - #[doc = "0x08 - Demodulator Input Configuration Register"] - pub dicfg: DICFG, + dicfg: DICFG, _reserved2: [u8; 0x08], + fcfgc: FCFGC, + fcfga: FCFGA, + _reserved4: [u8; 0x04], + iwctr: IWCTR, + _reserved5: [u8; 0x04], + boundsel: BOUNDSEL, + _reserved6: [u8; 0x04], + resm: RESM, + _reserved7: [u8; 0x04], + offm: OFFM, + _reserved8: [u8; 0x04], + resa: RESA, + _reserved9: [u8; 0x0c], + tstmp: TSTMP, + _reserved10: [u8; 0x4c], + cgsync: CGSYNC, + _reserved11: [u8; 0x04], + rectcfg: RECTCFG, +} +impl RegisterBlock { + #[doc = "0x00 - Modulator Configuration Register"] + #[inline(always)] + pub const fn modcfg(&self) -> &MODCFG { + &self.modcfg + } + #[doc = "0x08 - Demodulator Input Configuration Register"] + #[inline(always)] + pub const fn dicfg(&self) -> &DICFG { + &self.dicfg + } #[doc = "0x14 - Filter Configuration Register, Main CIC Filter"] - pub fcfgc: FCFGC, + #[inline(always)] + pub const fn fcfgc(&self) -> &FCFGC { + &self.fcfgc + } #[doc = "0x18 - Filter Configuration Register, Auxiliary Filter"] - pub fcfga: FCFGA, - _reserved4: [u8; 0x04], + #[inline(always)] + pub const fn fcfga(&self) -> &FCFGA { + &self.fcfga + } #[doc = "0x20 - Integration Window Control Register"] - pub iwctr: IWCTR, - _reserved5: [u8; 0x04], + #[inline(always)] + pub const fn iwctr(&self) -> &IWCTR { + &self.iwctr + } #[doc = "0x28 - Boundary Select Register"] - pub boundsel: BOUNDSEL, - _reserved6: [u8; 0x04], + #[inline(always)] + pub const fn boundsel(&self) -> &BOUNDSEL { + &self.boundsel + } #[doc = "0x30 - Result Register, Main Filter"] - pub resm: RESM, - _reserved7: [u8; 0x04], + #[inline(always)] + pub const fn resm(&self) -> &RESM { + &self.resm + } #[doc = "0x38 - Offset Register, Main Filter"] - pub offm: OFFM, - _reserved8: [u8; 0x04], + #[inline(always)] + pub const fn offm(&self) -> &OFFM { + &self.offm + } #[doc = "0x40 - Result Register, Auxiliary Filter"] - pub resa: RESA, - _reserved9: [u8; 0x0c], + #[inline(always)] + pub const fn resa(&self) -> &RESA { + &self.resa + } #[doc = "0x50 - Time-Stamp Register"] - pub tstmp: TSTMP, - _reserved10: [u8; 0x4c], + #[inline(always)] + pub const fn tstmp(&self) -> &TSTMP { + &self.tstmp + } #[doc = "0xa0 - Carrier Generator Synchronization Register"] - pub cgsync: CGSYNC, - _reserved11: [u8; 0x04], + #[inline(always)] + pub const fn cgsync(&self) -> &CGSYNC { + &self.cgsync + } #[doc = "0xa8 - Rectification Configuration Register"] - pub rectcfg: RECTCFG, + #[inline(always)] + pub const fn rectcfg(&self) -> &RECTCFG { + &self.rectcfg + } } -#[doc = "MODCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "MODCFG (rw) register accessor: Modulator Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`modcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`modcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@modcfg`] +module"] pub type MODCFG = crate::Reg; #[doc = "Modulator Configuration Register"] pub mod modcfg; -#[doc = "DICFG (rw) register accessor: an alias for `Reg`"] +#[doc = "DICFG (rw) register accessor: Demodulator Input Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dicfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dicfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dicfg`] +module"] pub type DICFG = crate::Reg; #[doc = "Demodulator Input Configuration Register"] pub mod dicfg; -#[doc = "FCFGC (rw) register accessor: an alias for `Reg`"] +#[doc = "FCFGC (rw) register accessor: Filter Configuration Register, Main CIC Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fcfgc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fcfgc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fcfgc`] +module"] pub type FCFGC = crate::Reg; #[doc = "Filter Configuration Register, Main CIC Filter"] pub mod fcfgc; -#[doc = "FCFGA (rw) register accessor: an alias for `Reg`"] +#[doc = "FCFGA (rw) register accessor: Filter Configuration Register, Auxiliary Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fcfga::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fcfga::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fcfga`] +module"] pub type FCFGA = crate::Reg; #[doc = "Filter Configuration Register, Auxiliary Filter"] pub mod fcfga; -#[doc = "IWCTR (rw) register accessor: an alias for `Reg`"] +#[doc = "IWCTR (rw) register accessor: Integration Window Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iwctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iwctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iwctr`] +module"] pub type IWCTR = crate::Reg; #[doc = "Integration Window Control Register"] pub mod iwctr; -#[doc = "BOUNDSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "BOUNDSEL (rw) register accessor: Boundary Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`boundsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`boundsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@boundsel`] +module"] pub type BOUNDSEL = crate::Reg; #[doc = "Boundary Select Register"] pub mod boundsel; -#[doc = "RESM (r) register accessor: an alias for `Reg`"] +#[doc = "RESM (r) register accessor: Result Register, Main Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`resm::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@resm`] +module"] pub type RESM = crate::Reg; #[doc = "Result Register, Main Filter"] pub mod resm; -#[doc = "OFFM (rw) register accessor: an alias for `Reg`"] +#[doc = "OFFM (rw) register accessor: Offset Register, Main Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`offm::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`offm::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@offm`] +module"] pub type OFFM = crate::Reg; #[doc = "Offset Register, Main Filter"] pub mod offm; -#[doc = "RESA (r) register accessor: an alias for `Reg`"] +#[doc = "RESA (r) register accessor: Result Register, Auxiliary Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`resa::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@resa`] +module"] pub type RESA = crate::Reg; #[doc = "Result Register, Auxiliary Filter"] pub mod resa; -#[doc = "TSTMP (r) register accessor: an alias for `Reg`"] +#[doc = "TSTMP (r) register accessor: Time-Stamp Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tstmp::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tstmp`] +module"] pub type TSTMP = crate::Reg; #[doc = "Time-Stamp Register"] pub mod tstmp; -#[doc = "CGSYNC (rw) register accessor: an alias for `Reg`"] +#[doc = "CGSYNC (rw) register accessor: Carrier Generator Synchronization Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgsync::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgsync::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgsync`] +module"] pub type CGSYNC = crate::Reg; #[doc = "Carrier Generator Synchronization Register"] pub mod cgsync; -#[doc = "RECTCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "RECTCFG (rw) register accessor: Rectification Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rectcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rectcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rectcfg`] +module"] pub type RECTCFG = crate::Reg; #[doc = "Rectification Configuration Register"] pub mod rectcfg; diff --git a/src/dsd_ch0/boundsel.rs b/src/dsd_ch0/boundsel.rs index 6b6a1fd8..d92d4171 100644 --- a/src/dsd_ch0/boundsel.rs +++ b/src/dsd_ch0/boundsel.rs @@ -1,47 +1,15 @@ #[doc = "Register `BOUNDSEL` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `BOUNDSEL` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `BOUNDARYL` reader - Lower Boundary Value for Limit Checking"] -pub type BOUNDARYL_R = crate::FieldReader; +pub type BOUNDARYL_R = crate::FieldReader; #[doc = "Field `BOUNDARYL` writer - Lower Boundary Value for Limit Checking"] -pub type BOUNDARYL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BOUNDSEL_SPEC, u16, u16, 16, O>; +pub type BOUNDARYL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `BOUNDARYU` reader - Upper Boundary Value for Limit Checking"] -pub type BOUNDARYU_R = crate::FieldReader; +pub type BOUNDARYU_R = crate::FieldReader; #[doc = "Field `BOUNDARYU` writer - Upper Boundary Value for Limit Checking"] -pub type BOUNDARYU_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BOUNDSEL_SPEC, u16, u16, 16, O>; +pub type BOUNDARYU_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Lower Boundary Value for Limit Checking"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - Lower Boundary Value for Limit Checking"] #[inline(always)] #[must_use] - pub fn boundaryl(&mut self) -> BOUNDARYL_W<0> { - BOUNDARYL_W::new(self) + pub fn boundaryl(&mut self) -> BOUNDARYL_W { + BOUNDARYL_W::new(self, 0) } #[doc = "Bits 16:31 - Upper Boundary Value for Limit Checking"] #[inline(always)] #[must_use] - pub fn boundaryu(&mut self) -> BOUNDARYU_W<16> { - BOUNDARYU_W::new(self) + pub fn boundaryu(&mut self) -> BOUNDARYU_W { + BOUNDARYU_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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 [boundsel](index.html) module"] +#[doc = "Boundary Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`boundsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`boundsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct BOUNDSEL_SPEC; impl crate::RegisterSpec for BOUNDSEL_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [boundsel::R](R) reader structure"] -impl crate::Readable for BOUNDSEL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [boundsel::W](W) writer structure"] +#[doc = "`read()` method returns [`boundsel::R`](R) reader structure"] +impl crate::Readable for BOUNDSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`boundsel::W`](W) writer structure"] impl crate::Writable for BOUNDSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/cgsync.rs b/src/dsd_ch0/cgsync.rs index ba76e255..6171fcad 100644 --- a/src/dsd_ch0/cgsync.rs +++ b/src/dsd_ch0/cgsync.rs @@ -1,51 +1,19 @@ #[doc = "Register `CGSYNC` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `CGSYNC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SDCOUNT` reader - Sign Delay Counter"] -pub type SDCOUNT_R = crate::FieldReader; +pub type SDCOUNT_R = crate::FieldReader; #[doc = "Field `SDCAP` reader - Sign Delay Capture Value"] -pub type SDCAP_R = crate::FieldReader; +pub type SDCAP_R = crate::FieldReader; #[doc = "Field `SDPOS` reader - Sign Delay Value for Positive Halfwave"] -pub type SDPOS_R = crate::FieldReader; +pub type SDPOS_R = crate::FieldReader; #[doc = "Field `SDPOS` writer - Sign Delay Value for Positive Halfwave"] -pub type SDPOS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CGSYNC_SPEC, u8, u8, 8, O>; +pub type SDPOS_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `SDNEG` reader - Sign Delay Value for Negative Halfwave"] -pub type SDNEG_R = crate::FieldReader; +pub type SDNEG_R = crate::FieldReader; #[doc = "Field `SDNEG` writer - Sign Delay Value for Negative Halfwave"] -pub type SDNEG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CGSYNC_SPEC, u8, u8, 8, O>; +pub type SDNEG_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Sign Delay Counter"] #[inline(always)] @@ -72,34 +40,35 @@ impl W { #[doc = "Bits 16:23 - Sign Delay Value for Positive Halfwave"] #[inline(always)] #[must_use] - pub fn sdpos(&mut self) -> SDPOS_W<16> { - SDPOS_W::new(self) + pub fn sdpos(&mut self) -> SDPOS_W { + SDPOS_W::new(self, 16) } #[doc = "Bits 24:31 - Sign Delay Value for Negative Halfwave"] #[inline(always)] #[must_use] - pub fn sdneg(&mut self) -> SDNEG_W<24> { - SDNEG_W::new(self) + pub fn sdneg(&mut self) -> SDNEG_W { + SDNEG_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Carrier Generator Synchronization 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 [cgsync](index.html) module"] +#[doc = "Carrier Generator Synchronization Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgsync::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgsync::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CGSYNC_SPEC; impl crate::RegisterSpec for CGSYNC_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [cgsync::R](R) reader structure"] -impl crate::Readable for CGSYNC_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [cgsync::W](W) writer structure"] +#[doc = "`read()` method returns [`cgsync::R`](R) reader structure"] +impl crate::Readable for CGSYNC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cgsync::W`](W) writer structure"] impl crate::Writable for CGSYNC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/dicfg.rs b/src/dsd_ch0/dicfg.rs index acd4e60e..141469b0 100644 --- a/src/dsd_ch0/dicfg.rs +++ b/src/dsd_ch0/dicfg.rs @@ -1,41 +1,9 @@ #[doc = "Register `DICFG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `DICFG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `DSRC` reader - Input Data Source Select"] -pub type DSRC_R = crate::FieldReader; +pub type DSRC_R = crate::FieldReader; #[doc = "Input Data Source Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DSRC_A { + type Ux = u8; +} impl DSRC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DSRC_A::VALUE1), 2 => Some(DSRC_A::VALUE2), @@ -70,58 +41,62 @@ impl DSRC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disconnected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSRC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External, from input A, direct"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSRC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External, from input A, inverted"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DSRC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External, from input B, direct"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DSRC_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "External, from input B, inverted"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == DSRC_A::VALUE5 } } #[doc = "Field `DSRC` writer - Input Data Source Select"] -pub type DSRC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DICFG_SPEC, u8, DSRC_A, 4, O>; -impl<'a, const O: u8> DSRC_W<'a, O> { +pub type DSRC_W<'a, REG> = crate::FieldWriter<'a, REG, 4, DSRC_A>; +impl<'a, REG> DSRC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Disconnected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSRC_A::VALUE1) } #[doc = "External, from input A, direct"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSRC_A::VALUE2) } #[doc = "External, from input A, inverted"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DSRC_A::VALUE3) } #[doc = "External, from input B, direct"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DSRC_A::VALUE4) } #[doc = "External, from input B, inverted"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(DSRC_A::VALUE5) } } @@ -140,21 +115,24 @@ impl From for bool { } } #[doc = "Field `DSWC` writer - Write Control for Data Selection"] -pub type DSWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, DICFG_SPEC, DSWC_AW, O>; -impl<'a, const O: u8> DSWC_W<'a, O> { +pub type DSWC_W<'a, REG> = crate::BitWriter<'a, REG, DSWC_AW>; +impl<'a, REG> DSWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to data parameters"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSWC_AW::VALUE1) } #[doc = "Bitfield DSRC can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSWC_AW::VALUE2) } } #[doc = "Field `ITRMODE` reader - Integrator Trigger Mode"] -pub type ITRMODE_R = crate::FieldReader; +pub type ITRMODE_R = crate::FieldReader; #[doc = "Integrator Trigger Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -174,10 +152,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ITRMODE_A { + type Ux = u8; +} impl ITRMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ITRMODE_A { + pub const fn variant(&self) -> ITRMODE_A { match self.bits { 0 => ITRMODE_A::VALUE1, 1 => ITRMODE_A::VALUE2, @@ -186,53 +167,57 @@ impl ITRMODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No integration trigger, integrator bypassed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ITRMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger event upon a falling edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ITRMODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Trigger event upon a rising edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ITRMODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "No trigger, integrator active all the time"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ITRMODE_A::VALUE4 } } #[doc = "Field `ITRMODE` writer - Integrator Trigger Mode"] -pub type ITRMODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DICFG_SPEC, u8, ITRMODE_A, 2, O>; -impl<'a, const O: u8> ITRMODE_W<'a, O> { +pub type ITRMODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ITRMODE_A>; +impl<'a, REG> ITRMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No integration trigger, integrator bypassed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ITRMODE_A::VALUE1) } #[doc = "Trigger event upon a falling edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ITRMODE_A::VALUE2) } #[doc = "Trigger event upon a rising edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ITRMODE_A::VALUE3) } #[doc = "No trigger, integrator active all the time"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ITRMODE_A::VALUE4) } } #[doc = "Field `TSTRMODE` reader - Timestamp Trigger Mode"] -pub type TSTRMODE_R = crate::FieldReader; +pub type TSTRMODE_R = crate::FieldReader; #[doc = "Timestamp Trigger Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -252,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TSTRMODE_A { + type Ux = u8; +} impl TSTRMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSTRMODE_A { + pub const fn variant(&self) -> TSTRMODE_A { match self.bits { 0 => TSTRMODE_A::VALUE1, 1 => TSTRMODE_A::VALUE2, @@ -264,55 +252,59 @@ impl TSTRMODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No timestamp trigger"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSTRMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger event upon a falling edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSTRMODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Trigger event upon a rising edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TSTRMODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Trigger event upon each edge"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TSTRMODE_A::VALUE4 } } #[doc = "Field `TSTRMODE` writer - Timestamp Trigger Mode"] -pub type TSTRMODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DICFG_SPEC, u8, TSTRMODE_A, 2, O>; -impl<'a, const O: u8> TSTRMODE_W<'a, O> { +pub type TSTRMODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, TSTRMODE_A>; +impl<'a, REG> TSTRMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No timestamp trigger"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSTRMODE_A::VALUE1) } #[doc = "Trigger event upon a falling edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSTRMODE_A::VALUE2) } #[doc = "Trigger event upon a rising edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TSTRMODE_A::VALUE3) } #[doc = "Trigger event upon each edge"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TSTRMODE_A::VALUE4) } } #[doc = "Field `TRSEL` reader - Trigger Select"] -pub type TRSEL_R = crate::FieldReader; +pub type TRSEL_R = crate::FieldReader; #[doc = "Field `TRSEL` writer - Trigger Select"] -pub type TRSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DICFG_SPEC, u8, u8, 3, O>; +pub type TRSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Write Control for Trigger Parameters\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum TRWC_AW { @@ -328,21 +320,24 @@ impl From for bool { } } #[doc = "Field `TRWC` writer - Write Control for Trigger Parameters"] -pub type TRWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, DICFG_SPEC, TRWC_AW, O>; -impl<'a, const O: u8> TRWC_W<'a, O> { +pub type TRWC_W<'a, REG> = crate::BitWriter<'a, REG, TRWC_AW>; +impl<'a, REG> TRWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to trigger parameters"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRWC_AW::VALUE1) } #[doc = "Bitfields TRSEL, TSTRMODE, ITRMODE can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRWC_AW::VALUE2) } } #[doc = "Field `CSRC` reader - Sample Clock Source Select"] -pub type CSRC_R = crate::FieldReader; +pub type CSRC_R = crate::FieldReader; #[doc = "Sample Clock Source Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -364,10 +359,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CSRC_A { + type Ux = u8; +} impl CSRC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(CSRC_A::VALUE2), 2 => Some(CSRC_A::VALUE3), @@ -377,63 +375,67 @@ impl CSRC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External, from input A"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CSRC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External, from input B"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CSRC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External, from input C"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CSRC_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "External, from input D"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == CSRC_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Internal clock"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == CSRC_A::VALUE6 } } #[doc = "Field `CSRC` writer - Sample Clock Source Select"] -pub type CSRC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DICFG_SPEC, u8, CSRC_A, 4, O>; -impl<'a, const O: u8> CSRC_W<'a, O> { +pub type CSRC_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CSRC_A>; +impl<'a, REG> CSRC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External, from input A"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CSRC_A::VALUE2) } #[doc = "External, from input B"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CSRC_A::VALUE3) } #[doc = "External, from input C"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CSRC_A::VALUE4) } #[doc = "External, from input D"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(CSRC_A::VALUE5) } #[doc = "Internal clock"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(CSRC_A::VALUE6) } } #[doc = "Field `STROBE` reader - Data Strobe Generatoion Mode"] -pub type STROBE_R = crate::FieldReader; +pub type STROBE_R = crate::FieldReader; #[doc = "Data Strobe Generatoion Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -457,10 +459,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STROBE_A { + type Ux = u8; +} impl STROBE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(STROBE_A::VALUE1), 1 => Some(STROBE_A::VALUE2), @@ -471,68 +476,72 @@ impl STROBE_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No data strobe"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STROBE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Direct clock, a sample trigger is generated at each rising clock edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STROBE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Direct clock, a sample trigger is generated at each falling clock edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STROBE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Double data, a sample trigger is generated at each rising and falling clock edge"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STROBE_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Double clock, a sample trigger is generated at every 2nd rising clock edge"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == STROBE_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Double clock, a sample trigger is generated at every 2nd falling clock edge"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == STROBE_A::VALUE7 } } #[doc = "Field `STROBE` writer - Data Strobe Generatoion Mode"] -pub type STROBE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DICFG_SPEC, u8, STROBE_A, 4, O>; -impl<'a, const O: u8> STROBE_W<'a, O> { +pub type STROBE_W<'a, REG> = crate::FieldWriter<'a, REG, 4, STROBE_A>; +impl<'a, REG> STROBE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No data strobe"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STROBE_A::VALUE1) } #[doc = "Direct clock, a sample trigger is generated at each rising clock edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STROBE_A::VALUE2) } #[doc = "Direct clock, a sample trigger is generated at each falling clock edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STROBE_A::VALUE3) } #[doc = "Double data, a sample trigger is generated at each rising and falling clock edge"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STROBE_A::VALUE4) } #[doc = "Double clock, a sample trigger is generated at every 2nd rising clock edge"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(STROBE_A::VALUE6) } #[doc = "Double clock, a sample trigger is generated at every 2nd falling clock edge"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(STROBE_A::VALUE7) } } @@ -551,16 +560,19 @@ impl From for bool { } } #[doc = "Field `SCWC` writer - Write Control for Strobe/Clock Selection"] -pub type SCWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, DICFG_SPEC, SCWC_AW, O>; -impl<'a, const O: u8> SCWC_W<'a, O> { +pub type SCWC_W<'a, REG> = crate::BitWriter<'a, REG, SCWC_AW>; +impl<'a, REG> SCWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to strobe/clock parameters"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCWC_AW::VALUE1) } #[doc = "Bitfields STROBE, CSRC can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCWC_AW::VALUE2) } } @@ -600,76 +612,77 @@ impl W { #[doc = "Bits 0:3 - Input Data Source Select"] #[inline(always)] #[must_use] - pub fn dsrc(&mut self) -> DSRC_W<0> { - DSRC_W::new(self) + pub fn dsrc(&mut self) -> DSRC_W { + DSRC_W::new(self, 0) } #[doc = "Bit 7 - Write Control for Data Selection"] #[inline(always)] #[must_use] - pub fn dswc(&mut self) -> DSWC_W<7> { - DSWC_W::new(self) + pub fn dswc(&mut self) -> DSWC_W { + DSWC_W::new(self, 7) } #[doc = "Bits 8:9 - Integrator Trigger Mode"] #[inline(always)] #[must_use] - pub fn itrmode(&mut self) -> ITRMODE_W<8> { - ITRMODE_W::new(self) + pub fn itrmode(&mut self) -> ITRMODE_W { + ITRMODE_W::new(self, 8) } #[doc = "Bits 10:11 - Timestamp Trigger Mode"] #[inline(always)] #[must_use] - pub fn tstrmode(&mut self) -> TSTRMODE_W<10> { - TSTRMODE_W::new(self) + pub fn tstrmode(&mut self) -> TSTRMODE_W { + TSTRMODE_W::new(self, 10) } #[doc = "Bits 12:14 - Trigger Select"] #[inline(always)] #[must_use] - pub fn trsel(&mut self) -> TRSEL_W<12> { - TRSEL_W::new(self) + pub fn trsel(&mut self) -> TRSEL_W { + TRSEL_W::new(self, 12) } #[doc = "Bit 15 - Write Control for Trigger Parameters"] #[inline(always)] #[must_use] - pub fn trwc(&mut self) -> TRWC_W<15> { - TRWC_W::new(self) + pub fn trwc(&mut self) -> TRWC_W { + TRWC_W::new(self, 15) } #[doc = "Bits 16:19 - Sample Clock Source Select"] #[inline(always)] #[must_use] - pub fn csrc(&mut self) -> CSRC_W<16> { - CSRC_W::new(self) + pub fn csrc(&mut self) -> CSRC_W { + CSRC_W::new(self, 16) } #[doc = "Bits 20:23 - Data Strobe Generatoion Mode"] #[inline(always)] #[must_use] - pub fn strobe(&mut self) -> STROBE_W<20> { - STROBE_W::new(self) + pub fn strobe(&mut self) -> STROBE_W { + STROBE_W::new(self, 20) } #[doc = "Bit 31 - Write Control for Strobe/Clock Selection"] #[inline(always)] #[must_use] - pub fn scwc(&mut self) -> SCWC_W<31> { - SCWC_W::new(self) + pub fn scwc(&mut self) -> SCWC_W { + SCWC_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Demodulator Input 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 [dicfg](index.html) module"] +#[doc = "Demodulator Input Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dicfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dicfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct DICFG_SPEC; impl crate::RegisterSpec for DICFG_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [dicfg::R](R) reader structure"] -impl crate::Readable for DICFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [dicfg::W](W) writer structure"] +#[doc = "`read()` method returns [`dicfg::R`](R) reader structure"] +impl crate::Readable for DICFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dicfg::W`](W) writer structure"] impl crate::Writable for DICFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/fcfga.rs b/src/dsd_ch0/fcfga.rs index 776c28ac..98af5186 100644 --- a/src/dsd_ch0/fcfga.rs +++ b/src/dsd_ch0/fcfga.rs @@ -1,45 +1,13 @@ #[doc = "Register `FCFGA` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `FCFGA` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CFADF` reader - CIC Filter (Auxiliary) Decimation Factor"] -pub type CFADF_R = crate::FieldReader; +pub type CFADF_R = crate::FieldReader; #[doc = "Field `CFADF` writer - CIC Filter (Auxiliary) Decimation Factor"] -pub type CFADF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCFGA_SPEC, u8, u8, 8, O>; +pub type CFADF_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CFAC` reader - CIC Filter (Auxiliary) Configuration"] -pub type CFAC_R = crate::FieldReader; +pub type CFAC_R = crate::FieldReader; #[doc = "CIC Filter (Auxiliary) Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CFAC_A { + type Ux = u8; +} impl CFAC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CFAC_A { + pub const fn variant(&self) -> CFAC_A { match self.bits { 0 => CFAC_A::VALUE1, 1 => CFAC_A::VALUE2, @@ -71,53 +42,57 @@ impl CFAC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CIC1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFAC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CIC2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CFAC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CIC3"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CFAC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CICF"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CFAC_A::VALUE4 } } #[doc = "Field `CFAC` writer - CIC Filter (Auxiliary) Configuration"] -pub type CFAC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, FCFGA_SPEC, u8, CFAC_A, 2, O>; -impl<'a, const O: u8> CFAC_W<'a, O> { +pub type CFAC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CFAC_A>; +impl<'a, REG> CFAC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CIC1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CFAC_A::VALUE1) } #[doc = "CIC2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CFAC_A::VALUE2) } #[doc = "CIC3"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CFAC_A::VALUE3) } #[doc = "CICF"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CFAC_A::VALUE4) } } #[doc = "Field `SRGA` reader - Service Request Generation Auxiliary Filter"] -pub type SRGA_R = crate::FieldReader; +pub type SRGA_R = crate::FieldReader; #[doc = "Service Request Generation Auxiliary Filter\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -135,10 +110,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRGA_A { + type Ux = u8; +} impl SRGA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRGA_A::VALUE1), 1 => Some(SRGA_A::VALUE2), @@ -146,43 +124,47 @@ impl SRGA_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Never, service requests disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRGA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Auxiliary filter: As selected by bitfield ESEL"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRGA_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Alternate source: Capturing of a sign delay value to register CGSYNCx (x = 0 - 3)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SRGA_A::VALUE3 } } #[doc = "Field `SRGA` writer - Service Request Generation Auxiliary Filter"] -pub type SRGA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCFGA_SPEC, u8, SRGA_A, 2, O>; -impl<'a, const O: u8> SRGA_W<'a, O> { +pub type SRGA_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SRGA_A>; +impl<'a, REG> SRGA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Never, service requests disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRGA_A::VALUE1) } #[doc = "Auxiliary filter: As selected by bitfield ESEL"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRGA_A::VALUE2) } #[doc = "Alternate source: Capturing of a sign delay value to register CGSYNCx (x = 0 - 3)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SRGA_A::VALUE3) } } #[doc = "Field `ESEL` reader - Event Select"] -pub type ESEL_R = crate::FieldReader; +pub type ESEL_R = crate::FieldReader; #[doc = "Event Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -200,10 +182,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ESEL_A { + type Ux = u8; +} impl ESEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ESEL_A::VALUE1), 1 => Some(ESEL_A::VALUE2), @@ -211,38 +196,42 @@ impl ESEL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Always, for each new result value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ESEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "If result is inside the boundary band"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ESEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "If result is outside the boundary band"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ESEL_A::VALUE3 } } #[doc = "Field `ESEL` writer - Event Select"] -pub type ESEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCFGA_SPEC, u8, ESEL_A, 2, O>; -impl<'a, const O: u8> ESEL_W<'a, O> { +pub type ESEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ESEL_A>; +impl<'a, REG> ESEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Always, for each new result value"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ESEL_A::VALUE1) } #[doc = "If result is inside the boundary band"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ESEL_A::VALUE2) } #[doc = "If result is outside the boundary band"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ESEL_A::VALUE3) } } @@ -265,39 +254,42 @@ impl From for bool { impl EGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EGT_A { + pub const fn variant(&self) -> EGT_A { match self.bits { false => EGT_A::VALUE1, true => EGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Separate: generate events according to ESEL"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Coupled: generate events only when the integrator is enabled and after the discard phase defined by bitfield NVALDIS"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EGT_A::VALUE2 } } #[doc = "Field `EGT` writer - Event Gating"] -pub type EGT_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCFGA_SPEC, EGT_A, O>; -impl<'a, const O: u8> EGT_W<'a, O> { +pub type EGT_W<'a, REG> = crate::BitWriter<'a, REG, EGT_A>; +impl<'a, REG> EGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Separate: generate events according to ESEL"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EGT_A::VALUE1) } #[doc = "Coupled: generate events only when the integrator is enabled and after the discard phase defined by bitfield NVALDIS"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EGT_A::VALUE2) } } #[doc = "Field `CFADCNT` reader - CIC Filter (Auxiliary) Decimation Counter"] -pub type CFADCNT_R = crate::FieldReader; +pub type CFADCNT_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - CIC Filter (Auxiliary) Decimation Factor"] #[inline(always)] @@ -334,52 +326,53 @@ impl W { #[doc = "Bits 0:7 - CIC Filter (Auxiliary) Decimation Factor"] #[inline(always)] #[must_use] - pub fn cfadf(&mut self) -> CFADF_W<0> { - CFADF_W::new(self) + pub fn cfadf(&mut self) -> CFADF_W { + CFADF_W::new(self, 0) } #[doc = "Bits 8:9 - CIC Filter (Auxiliary) Configuration"] #[inline(always)] #[must_use] - pub fn cfac(&mut self) -> CFAC_W<8> { - CFAC_W::new(self) + pub fn cfac(&mut self) -> CFAC_W { + CFAC_W::new(self, 8) } #[doc = "Bits 10:11 - Service Request Generation Auxiliary Filter"] #[inline(always)] #[must_use] - pub fn srga(&mut self) -> SRGA_W<10> { - SRGA_W::new(self) + pub fn srga(&mut self) -> SRGA_W { + SRGA_W::new(self, 10) } #[doc = "Bits 12:13 - Event Select"] #[inline(always)] #[must_use] - pub fn esel(&mut self) -> ESEL_W<12> { - ESEL_W::new(self) + pub fn esel(&mut self) -> ESEL_W { + ESEL_W::new(self, 12) } #[doc = "Bit 14 - Event Gating"] #[inline(always)] #[must_use] - pub fn egt(&mut self) -> EGT_W<14> { - EGT_W::new(self) + pub fn egt(&mut self) -> EGT_W { + EGT_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Filter Configuration Register, Auxiliary Filter\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fcfga](index.html) module"] +#[doc = "Filter Configuration Register, Auxiliary Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fcfga::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fcfga::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct FCFGA_SPEC; impl crate::RegisterSpec for FCFGA_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [fcfga::R](R) reader structure"] -impl crate::Readable for FCFGA_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [fcfga::W](W) writer structure"] +#[doc = "`read()` method returns [`fcfga::R`](R) reader structure"] +impl crate::Readable for FCFGA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fcfga::W`](W) writer structure"] impl crate::Writable for FCFGA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/fcfgc.rs b/src/dsd_ch0/fcfgc.rs index 218896cc..053980c3 100644 --- a/src/dsd_ch0/fcfgc.rs +++ b/src/dsd_ch0/fcfgc.rs @@ -1,45 +1,13 @@ #[doc = "Register `FCFGC` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `FCFGC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CFMDF` reader - CIC Filter (Main Chain) Decimation Factor"] -pub type CFMDF_R = crate::FieldReader; +pub type CFMDF_R = crate::FieldReader; #[doc = "Field `CFMDF` writer - CIC Filter (Main Chain) Decimation Factor"] -pub type CFMDF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCFGC_SPEC, u8, u8, 8, O>; +pub type CFMDF_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CFMC` reader - CIC Filter (Main Chain) Configuration"] -pub type CFMC_R = crate::FieldReader; +pub type CFMC_R = crate::FieldReader; #[doc = "CIC Filter (Main Chain) Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CFMC_A { + type Ux = u8; +} impl CFMC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CFMC_A { + pub const fn variant(&self) -> CFMC_A { match self.bits { 0 => CFMC_A::VALUE1, 1 => CFMC_A::VALUE2, @@ -71,48 +42,52 @@ impl CFMC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CIC1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFMC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CIC2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CFMC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CIC3"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CFMC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CICF"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CFMC_A::VALUE4 } } #[doc = "Field `CFMC` writer - CIC Filter (Main Chain) Configuration"] -pub type CFMC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, FCFGC_SPEC, u8, CFMC_A, 2, O>; -impl<'a, const O: u8> CFMC_W<'a, O> { +pub type CFMC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CFMC_A>; +impl<'a, REG> CFMC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CIC1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CFMC_A::VALUE1) } #[doc = "CIC2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CFMC_A::VALUE2) } #[doc = "CIC3"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CFMC_A::VALUE3) } #[doc = "CICF"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CFMC_A::VALUE4) } } @@ -135,39 +110,42 @@ impl From for bool { impl CFEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CFEN_A { + pub const fn variant(&self) -> CFEN_A { match self.bits { false => CFEN_A::VALUE1, true => CFEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CIC filter disabled and bypassed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable CIC filter"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CFEN_A::VALUE2 } } #[doc = "Field `CFEN` writer - CIC Filter Enable"] -pub type CFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCFGC_SPEC, CFEN_A, O>; -impl<'a, const O: u8> CFEN_W<'a, O> { +pub type CFEN_W<'a, REG> = crate::BitWriter<'a, REG, CFEN_A>; +impl<'a, REG> CFEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "CIC filter disabled and bypassed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CFEN_A::VALUE1) } #[doc = "Enable CIC filter"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CFEN_A::VALUE2) } } #[doc = "Field `SRGM` reader - Service Request Generation Main Chain"] -pub type SRGM_R = crate::FieldReader; +pub type SRGM_R = crate::FieldReader; #[doc = "Service Request Generation Main Chain\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,47 +161,54 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRGM_A { + type Ux = u8; +} impl SRGM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRGM_A::VALUE1), 3 => Some(SRGM_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Never, service requests disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRGM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Always, for each new result value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SRGM_A::VALUE4 } } #[doc = "Field `SRGM` writer - Service Request Generation Main Chain"] -pub type SRGM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCFGC_SPEC, u8, SRGM_A, 2, O>; -impl<'a, const O: u8> SRGM_W<'a, O> { +pub type SRGM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SRGM_A>; +impl<'a, REG> SRGM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Never, service requests disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRGM_A::VALUE1) } #[doc = "Always, for each new result value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SRGM_A::VALUE4) } } #[doc = "Field `CFMSV` reader - CIC Filter (Main Chain) Start Value"] -pub type CFMSV_R = crate::FieldReader; +pub type CFMSV_R = crate::FieldReader; #[doc = "Field `CFMSV` writer - CIC Filter (Main Chain) Start Value"] -pub type CFMSV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCFGC_SPEC, u8, u8, 8, O>; +pub type CFMSV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CFMDCNT` reader - CIC Filter (Main Chain) Decimation Counter"] -pub type CFMDCNT_R = crate::FieldReader; +pub type CFMDCNT_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - CIC Filter (Main Chain) Decimation Factor"] #[inline(always)] @@ -260,52 +245,53 @@ impl W { #[doc = "Bits 0:7 - CIC Filter (Main Chain) Decimation Factor"] #[inline(always)] #[must_use] - pub fn cfmdf(&mut self) -> CFMDF_W<0> { - CFMDF_W::new(self) + pub fn cfmdf(&mut self) -> CFMDF_W { + CFMDF_W::new(self, 0) } #[doc = "Bits 8:9 - CIC Filter (Main Chain) Configuration"] #[inline(always)] #[must_use] - pub fn cfmc(&mut self) -> CFMC_W<8> { - CFMC_W::new(self) + pub fn cfmc(&mut self) -> CFMC_W { + CFMC_W::new(self, 8) } #[doc = "Bit 10 - CIC Filter Enable"] #[inline(always)] #[must_use] - pub fn cfen(&mut self) -> CFEN_W<10> { - CFEN_W::new(self) + pub fn cfen(&mut self) -> CFEN_W { + CFEN_W::new(self, 10) } #[doc = "Bits 14:15 - Service Request Generation Main Chain"] #[inline(always)] #[must_use] - pub fn srgm(&mut self) -> SRGM_W<14> { - SRGM_W::new(self) + pub fn srgm(&mut self) -> SRGM_W { + SRGM_W::new(self, 14) } #[doc = "Bits 16:23 - CIC Filter (Main Chain) Start Value"] #[inline(always)] #[must_use] - pub fn cfmsv(&mut self) -> CFMSV_W<16> { - CFMSV_W::new(self) + pub fn cfmsv(&mut self) -> CFMSV_W { + CFMSV_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Filter Configuration Register, Main CIC Filter\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fcfgc](index.html) module"] +#[doc = "Filter Configuration Register, Main CIC Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fcfgc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fcfgc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct FCFGC_SPEC; impl crate::RegisterSpec for FCFGC_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [fcfgc::R](R) reader structure"] -impl crate::Readable for FCFGC_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [fcfgc::W](W) writer structure"] +#[doc = "`read()` method returns [`fcfgc::R`](R) reader structure"] +impl crate::Readable for FCFGC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fcfgc::W`](W) writer structure"] impl crate::Writable for FCFGC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/iwctr.rs b/src/dsd_ch0/iwctr.rs index 4315879e..0398ee55 100644 --- a/src/dsd_ch0/iwctr.rs +++ b/src/dsd_ch0/iwctr.rs @@ -1,41 +1,9 @@ #[doc = "Register `IWCTR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `IWCTR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `NVALCNT` reader - Number of Values Counted"] -pub type NVALCNT_R = crate::FieldReader; +pub type NVALCNT_R = crate::FieldReader; #[doc = "Field `INTEN` reader - Integration Enable"] pub type INTEN_R = crate::BitReader; #[doc = "Integration Enable\n\nValue on reset: 0"] @@ -55,33 +23,33 @@ impl From for bool { impl INTEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INTEN_A { + pub const fn variant(&self) -> INTEN_A { match self.bits { false => INTEN_A::VALUE1, true => INTEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Integration stopped. INTEN is cleared at the end of the integration window, i.e. upon the inverse trigger event transition of the external trigger signal."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INTEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Integration enabled. INTEN is set upon the defined trigger event."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INTEN_A::VALUE2 } } #[doc = "Field `REPCNT` reader - Integration Cycle Counter"] -pub type REPCNT_R = crate::FieldReader; +pub type REPCNT_R = crate::FieldReader; #[doc = "Field `REPVAL` reader - Number of Integration Cycles"] -pub type REPVAL_R = crate::FieldReader; +pub type REPVAL_R = crate::FieldReader; #[doc = "Field `REPVAL` writer - Number of Integration Cycles"] -pub type REPVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IWCTR_SPEC, u8, u8, 4, O>; +pub type REPVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `NVALDIS` reader - Number of Values Discarded"] -pub type NVALDIS_R = crate::FieldReader; +pub type NVALDIS_R = crate::FieldReader; #[doc = "Field `NVALDIS` writer - Number of Values Discarded"] -pub type NVALDIS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IWCTR_SPEC, u8, u8, 6, O>; +pub type NVALDIS_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `IWS` reader - Integration Window SIze"] pub type IWS_R = crate::BitReader; #[doc = "Integration Window SIze\n\nValue on reset: 0"] @@ -101,41 +69,44 @@ impl From for bool { impl IWS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IWS_A { + pub const fn variant(&self) -> IWS_A { match self.bits { false => IWS_A::VALUE1, true => IWS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Internal control: stop integrator after REPVAL+1 integration cycles"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IWS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External control: stop integrator when bit INTEN becomes 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IWS_A::VALUE2 } } #[doc = "Field `IWS` writer - Integration Window SIze"] -pub type IWS_W<'a, const O: u8> = crate::BitWriter<'a, u32, IWCTR_SPEC, IWS_A, O>; -impl<'a, const O: u8> IWS_W<'a, O> { +pub type IWS_W<'a, REG> = crate::BitWriter<'a, REG, IWS_A>; +impl<'a, REG> IWS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Internal control: stop integrator after REPVAL+1 integration cycles"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IWS_A::VALUE1) } #[doc = "External control: stop integrator when bit INTEN becomes 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IWS_A::VALUE2) } } #[doc = "Field `NVALINT` reader - Number of Values Integrated"] -pub type NVALINT_R = crate::FieldReader; +pub type NVALINT_R = crate::FieldReader; #[doc = "Field `NVALINT` writer - Number of Values Integrated"] -pub type NVALINT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IWCTR_SPEC, u8, u8, 6, O>; +pub type NVALINT_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; impl R { #[doc = "Bits 0:5 - Number of Values Counted"] #[inline(always)] @@ -177,46 +148,47 @@ impl W { #[doc = "Bits 12:15 - Number of Integration Cycles"] #[inline(always)] #[must_use] - pub fn repval(&mut self) -> REPVAL_W<12> { - REPVAL_W::new(self) + pub fn repval(&mut self) -> REPVAL_W { + REPVAL_W::new(self, 12) } #[doc = "Bits 16:21 - Number of Values Discarded"] #[inline(always)] #[must_use] - pub fn nvaldis(&mut self) -> NVALDIS_W<16> { - NVALDIS_W::new(self) + pub fn nvaldis(&mut self) -> NVALDIS_W { + NVALDIS_W::new(self, 16) } #[doc = "Bit 23 - Integration Window SIze"] #[inline(always)] #[must_use] - pub fn iws(&mut self) -> IWS_W<23> { - IWS_W::new(self) + pub fn iws(&mut self) -> IWS_W { + IWS_W::new(self, 23) } #[doc = "Bits 24:29 - Number of Values Integrated"] #[inline(always)] #[must_use] - pub fn nvalint(&mut self) -> NVALINT_W<24> { - NVALINT_W::new(self) + pub fn nvalint(&mut self) -> NVALINT_W { + NVALINT_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Integration Window 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 [iwctr](index.html) module"] +#[doc = "Integration Window Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iwctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iwctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct IWCTR_SPEC; impl crate::RegisterSpec for IWCTR_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [iwctr::R](R) reader structure"] -impl crate::Readable for IWCTR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [iwctr::W](W) writer structure"] +#[doc = "`read()` method returns [`iwctr::R`](R) reader structure"] +impl crate::Readable for IWCTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iwctr::W`](W) writer structure"] impl crate::Writable for IWCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/modcfg.rs b/src/dsd_ch0/modcfg.rs index 9dc2bf9b..f446fd6f 100644 --- a/src/dsd_ch0/modcfg.rs +++ b/src/dsd_ch0/modcfg.rs @@ -1,41 +1,9 @@ #[doc = "Register `MODCFG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MODCFG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `DIVM` reader - Divider Factor for Modulator Clock"] -pub type DIVM_R = crate::FieldReader; +pub type DIVM_R = crate::FieldReader; #[doc = "Divider Factor for Modulator Clock\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DIVM_A { + type Ux = u8; +} impl DIVM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DIVM_A::VALUE1), 1 => Some(DIVM_A::VALUE2), @@ -67,48 +38,52 @@ impl DIVM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fMOD = fCLK / 2"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIVM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fMOD = fCLK / 4"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIVM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fMOD = fCLK / 6"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DIVM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "fMOD = fCLK / 32"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DIVM_A::VALUE4 } } #[doc = "Field `DIVM` writer - Divider Factor for Modulator Clock"] -pub type DIVM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODCFG_SPEC, u8, DIVM_A, 4, O>; -impl<'a, const O: u8> DIVM_W<'a, O> { +pub type DIVM_W<'a, REG> = crate::FieldWriter<'a, REG, 4, DIVM_A>; +impl<'a, REG> DIVM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fMOD = fCLK / 2"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIVM_A::VALUE1) } #[doc = "fMOD = fCLK / 4"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIVM_A::VALUE2) } #[doc = "fMOD = fCLK / 6"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DIVM_A::VALUE3) } #[doc = "fMOD = fCLK / 32"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DIVM_A::VALUE4) } } @@ -127,16 +102,19 @@ impl From for bool { } } #[doc = "Field `DWC` writer - Write Control for Divider Factor"] -pub type DWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MODCFG_SPEC, DWC_AW, O>; -impl<'a, const O: u8> DWC_W<'a, O> { +pub type DWC_W<'a, REG> = crate::BitWriter<'a, REG, DWC_AW>; +impl<'a, REG> DWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to divider factor"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DWC_AW::VALUE1) } #[doc = "Bitfield DIVM can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DWC_AW::VALUE2) } } @@ -151,34 +129,35 @@ impl W { #[doc = "Bits 16:19 - Divider Factor for Modulator Clock"] #[inline(always)] #[must_use] - pub fn divm(&mut self) -> DIVM_W<16> { - DIVM_W::new(self) + pub fn divm(&mut self) -> DIVM_W { + DIVM_W::new(self, 16) } #[doc = "Bit 23 - Write Control for Divider Factor"] #[inline(always)] #[must_use] - pub fn dwc(&mut self) -> DWC_W<23> { - DWC_W::new(self) + pub fn dwc(&mut self) -> DWC_W { + DWC_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Modulator 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 [modcfg](index.html) module"] +#[doc = "Modulator Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`modcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`modcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MODCFG_SPEC; impl crate::RegisterSpec for MODCFG_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [modcfg::R](R) reader structure"] -impl crate::Readable for MODCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [modcfg::W](W) writer structure"] +#[doc = "`read()` method returns [`modcfg::R`](R) reader structure"] +impl crate::Readable for MODCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`modcfg::W`](W) writer structure"] impl crate::Writable for MODCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/offm.rs b/src/dsd_ch0/offm.rs index 37e4211b..4e869fe1 100644 --- a/src/dsd_ch0/offm.rs +++ b/src/dsd_ch0/offm.rs @@ -1,43 +1,11 @@ #[doc = "Register `OFFM` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `OFFM` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `OFFSET` reader - Offset Value"] -pub type OFFSET_R = crate::FieldReader; +pub type OFFSET_R = crate::FieldReader; #[doc = "Field `OFFSET` writer - Offset Value"] -pub type OFFSET_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OFFM_SPEC, u16, u16, 16, O>; +pub type OFFSET_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Offset Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Offset Value"] #[inline(always)] #[must_use] - pub fn offset(&mut self) -> OFFSET_W<0> { - OFFSET_W::new(self) + pub fn offset(&mut self) -> OFFSET_W { + OFFSET_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Offset Register, Main Filter\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [offm](index.html) module"] +#[doc = "Offset Register, Main Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`offm::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`offm::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OFFM_SPEC; impl crate::RegisterSpec for OFFM_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [offm::R](R) reader structure"] -impl crate::Readable for OFFM_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [offm::W](W) writer structure"] +#[doc = "`read()` method returns [`offm::R`](R) reader structure"] +impl crate::Readable for OFFM_SPEC {} +#[doc = "`write(|w| ..)` method takes [`offm::W`](W) writer structure"] impl crate::Writable for OFFM_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/rectcfg.rs b/src/dsd_ch0/rectcfg.rs index 58fe41e3..c3eab7de 100644 --- a/src/dsd_ch0/rectcfg.rs +++ b/src/dsd_ch0/rectcfg.rs @@ -1,39 +1,7 @@ #[doc = "Register `RECTCFG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `RECTCFG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RFEN` reader - Rectification Enable"] pub type RFEN_R = crate::BitReader; #[doc = "Rectification Enable\n\nValue on reset: 0"] @@ -53,39 +21,42 @@ impl From for bool { impl RFEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RFEN_A { + pub const fn variant(&self) -> RFEN_A { match self.bits { false => RFEN_A::VALUE1, true => RFEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No rectification, data not altered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RFEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data are rectified according to SGND"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RFEN_A::VALUE2 } } #[doc = "Field `RFEN` writer - Rectification Enable"] -pub type RFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RECTCFG_SPEC, RFEN_A, O>; -impl<'a, const O: u8> RFEN_W<'a, O> { +pub type RFEN_W<'a, REG> = crate::BitWriter<'a, REG, RFEN_A>; +impl<'a, REG> RFEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No rectification, data not altered"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RFEN_A::VALUE1) } #[doc = "Data are rectified according to SGND"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RFEN_A::VALUE2) } } #[doc = "Field `SSRC` reader - Sign Source"] -pub type SSRC_R = crate::FieldReader; +pub type SSRC_R = crate::FieldReader; #[doc = "Sign Source\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -105,10 +76,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SSRC_A { + type Ux = u8; +} impl SSRC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SSRC_A { + pub const fn variant(&self) -> SSRC_A { match self.bits { 0 => SSRC_A::VALUE1, 1 => SSRC_A::VALUE2, @@ -117,48 +91,52 @@ impl SSRC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "On-chip carrier generator"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SSRC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Sign of result of next channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SSRC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External sign signal A"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SSRC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "External sign signal B"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SSRC_A::VALUE4 } } #[doc = "Field `SSRC` writer - Sign Source"] -pub type SSRC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, RECTCFG_SPEC, u8, SSRC_A, 2, O>; -impl<'a, const O: u8> SSRC_W<'a, O> { +pub type SSRC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SSRC_A>; +impl<'a, REG> SSRC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "On-chip carrier generator"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SSRC_A::VALUE1) } #[doc = "Sign of result of next channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SSRC_A::VALUE2) } #[doc = "External sign signal A"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SSRC_A::VALUE3) } #[doc = "External sign signal B"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SSRC_A::VALUE4) } } @@ -181,18 +159,18 @@ impl From for bool { impl SDVAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SDVAL_A { + pub const fn variant(&self) -> SDVAL_A { match self.bits { false => SDVAL_A::VALUE1, true => SDVAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new result available"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SDVAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bitfield SDCAP has been updated with a new captured value and has not yet been read"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SDVAL_A::VALUE2 @@ -217,18 +195,18 @@ impl From for bool { impl SGNCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SGNCS_A { + pub const fn variant(&self) -> SGNCS_A { match self.bits { false => SGNCS_A::VALUE1, true => SGNCS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Positive values"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SGNCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Negative values"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SGNCS_A::VALUE2 @@ -253,18 +231,18 @@ impl From for bool { impl SGND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SGND_A { + pub const fn variant(&self) -> SGND_A { match self.bits { false => SGND_A::VALUE1, true => SGND_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Positive values"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SGND_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Negative values"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SGND_A::VALUE2 @@ -301,34 +279,35 @@ impl W { #[doc = "Bit 0 - Rectification Enable"] #[inline(always)] #[must_use] - pub fn rfen(&mut self) -> RFEN_W<0> { - RFEN_W::new(self) + pub fn rfen(&mut self) -> RFEN_W { + RFEN_W::new(self, 0) } #[doc = "Bits 4:5 - Sign Source"] #[inline(always)] #[must_use] - pub fn ssrc(&mut self) -> SSRC_W<4> { - SSRC_W::new(self) + pub fn ssrc(&mut self) -> SSRC_W { + SSRC_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Rectification 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 [rectcfg](index.html) module"] +#[doc = "Rectification Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rectcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rectcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RECTCFG_SPEC; impl crate::RegisterSpec for RECTCFG_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rectcfg::R](R) reader structure"] -impl crate::Readable for RECTCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [rectcfg::W](W) writer structure"] +#[doc = "`read()` method returns [`rectcfg::R`](R) reader structure"] +impl crate::Readable for RECTCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rectcfg::W`](W) writer structure"] impl crate::Writable for RECTCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/dsd_ch0/resa.rs b/src/dsd_ch0/resa.rs index 8f194dd9..6fa8be5c 100644 --- a/src/dsd_ch0/resa.rs +++ b/src/dsd_ch0/resa.rs @@ -1,20 +1,7 @@ #[doc = "Register `RESA` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RESULT` reader - Result of most recent conversion"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Result of most recent conversion"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RESULT_R::new((self.bits & 0xffff) as u16) } } -#[doc = "Result Register, Auxiliary Filter\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [resa](index.html) module"] +#[doc = "Result Register, Auxiliary Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`resa::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RESA_SPEC; impl crate::RegisterSpec for RESA_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [resa::R](R) reader structure"] -impl crate::Readable for RESA_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`resa::R`](R) reader structure"] +impl crate::Readable for RESA_SPEC {} #[doc = "`reset()` method sets RESA to value 0"] impl crate::Resettable for RESA_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/dsd_ch0/resm.rs b/src/dsd_ch0/resm.rs index a9dba3b8..49759fbd 100644 --- a/src/dsd_ch0/resm.rs +++ b/src/dsd_ch0/resm.rs @@ -1,20 +1,7 @@ #[doc = "Register `RESM` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RESULT` reader - Result of most recent conversion"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Result of most recent conversion"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RESULT_R::new((self.bits & 0xffff) as u16) } } -#[doc = "Result Register, Main Filter\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [resm](index.html) module"] +#[doc = "Result Register, Main Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`resm::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RESM_SPEC; impl crate::RegisterSpec for RESM_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [resm::R](R) reader structure"] -impl crate::Readable for RESM_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`resm::R`](R) reader structure"] +impl crate::Readable for RESM_SPEC {} #[doc = "`reset()` method sets RESM to value 0"] impl crate::Resettable for RESM_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/dsd_ch0/tstmp.rs b/src/dsd_ch0/tstmp.rs index 01b9b7f4..377cd8f9 100644 --- a/src/dsd_ch0/tstmp.rs +++ b/src/dsd_ch0/tstmp.rs @@ -1,24 +1,11 @@ #[doc = "Register `TSTMP` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RESULT` reader - Result of most recent conversion"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; #[doc = "Field `CFMDCNT` reader - CIC Filter (Main Chain) Decimation Counter"] -pub type CFMDCNT_R = crate::FieldReader; +pub type CFMDCNT_R = crate::FieldReader; #[doc = "Field `NVALCNT` reader - Number of Values Counted"] -pub type NVALCNT_R = crate::FieldReader; +pub type NVALCNT_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Result of most recent conversion"] #[inline(always)] @@ -36,15 +23,13 @@ impl R { NVALCNT_R::new(((self.bits >> 24) & 0x3f) as u8) } } -#[doc = "Time-Stamp 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 [tstmp](index.html) module"] +#[doc = "Time-Stamp Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tstmp::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TSTMP_SPEC; impl crate::RegisterSpec for TSTMP_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tstmp::R](R) reader structure"] -impl crate::Readable for TSTMP_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tstmp::R`](R) reader structure"] +impl crate::Readable for TSTMP_SPEC {} #[doc = "`reset()` method sets TSTMP to value 0"] impl crate::Resettable for TSTMP_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eru0.rs b/src/eru0.rs index 09b40361..073db4dd 100644 --- a/src/eru0.rs +++ b/src/eru0.rs @@ -1,23 +1,40 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Event Input Select"] - pub exisel: EXISEL, + exisel: EXISEL, _reserved1: [u8; 0x0c], + exicon: [EXICON; 4], + exocon: [EXOCON; 4], +} +impl RegisterBlock { + #[doc = "0x00 - Event Input Select"] + #[inline(always)] + pub const fn exisel(&self) -> &EXISEL { + &self.exisel + } #[doc = "0x10..0x20 - Event Input Control"] - pub exicon: [EXICON; 4], + #[inline(always)] + pub const fn exicon(&self, n: usize) -> &EXICON { + &self.exicon[n] + } #[doc = "0x20..0x30 - Event Output Trigger Control"] - pub exocon: [EXOCON; 4], + #[inline(always)] + pub const fn exocon(&self, n: usize) -> &EXOCON { + &self.exocon[n] + } } -#[doc = "EXISEL (rw) register accessor: an alias for `Reg`"] +#[doc = "EXISEL (rw) register accessor: Event Input Select\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exisel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`exisel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@exisel`] +module"] pub type EXISEL = crate::Reg; #[doc = "Event Input Select"] pub mod exisel; -#[doc = "EXICON (rw) register accessor: an alias for `Reg`"] +#[doc = "EXICON (rw) register accessor: Event Input Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exicon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`exicon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@exicon`] +module"] pub type EXICON = crate::Reg; #[doc = "Event Input Control"] pub mod exicon; -#[doc = "EXOCON (rw) register accessor: an alias for `Reg`"] +#[doc = "EXOCON (rw) register accessor: Event Output Trigger Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exocon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`exocon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@exocon`] +module"] 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 2d619742..cc60aff7 100644 --- a/src/eru0/exicon.rs +++ b/src/eru0/exicon.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PE` reader - Output Trigger Pulse Enable for ETLx"] pub type PE_R = crate::BitReader; #[doc = "Output Trigger Pulse Enable for ETLx\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PE_A { + pub const fn variant(&self) -> PE_A { match self.bits { false => PE_A::VALUE1, true => PE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The trigger pulse generation is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The trigger pulse generation is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PE_A::VALUE2 } } #[doc = "Field `PE` writer - Output Trigger Pulse Enable for ETLx"] -pub type PE_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXICON_SPEC, PE_A, O>; -impl<'a, const O: u8> PE_W<'a, O> { +pub type PE_W<'a, REG> = crate::BitWriter<'a, REG, PE_A>; +impl<'a, REG> PE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The trigger pulse generation is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PE_A::VALUE1) } #[doc = "The trigger pulse generation is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PE_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl LD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LD_A { + pub const fn variant(&self) -> LD_A { match self.bits { false => LD_A::VALUE1, true => LD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == LD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The status flag FL rebuilds a level detection of the desired event. It becomes automatically set with a rising edge if RE = 1 or with a falling edge if FE = 1. It becomes automatically cleared with a rising edge if RE = 0 or with a falling edge if FE = 0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LD_A::VALUE2 } } #[doc = "Field `LD` writer - Rebuild Level Detection for Status Flag for ETLx"] -pub type LD_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXICON_SPEC, LD_A, O>; -impl<'a, const O: u8> LD_W<'a, O> { +pub type LD_W<'a, REG> = crate::BitWriter<'a, REG, LD_A>; +impl<'a, REG> LD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LD_A::VALUE1) } #[doc = "The status flag FL rebuilds a level detection of the desired event. It becomes automatically set with a rising edge if RE = 1 or with a falling edge if FE = 1. It becomes automatically cleared with a rising edge if RE = 0 or with a falling edge if FE = 0."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LD_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl RE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RE_A { + pub const fn variant(&self) -> RE_A { match self.bits { false => RE_A::VALUE1, true => RE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A rising edge is not considered as edge event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A rising edge is considered as edge event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RE_A::VALUE2 } } #[doc = "Field `RE` writer - Rising Edge Detection Enable ETLx"] -pub type RE_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXICON_SPEC, RE_A, O>; -impl<'a, const O: u8> RE_W<'a, O> { +pub type RE_W<'a, REG> = crate::BitWriter<'a, REG, RE_A>; +impl<'a, REG> RE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A rising edge is not considered as edge event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RE_A::VALUE1) } #[doc = "A rising edge is considered as edge event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RE_A::VALUE2) } } @@ -203,39 +180,42 @@ impl From for bool { impl FE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FE_A { + pub const fn variant(&self) -> FE_A { match self.bits { false => FE_A::VALUE1, true => FE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A falling edge is not considered as edge event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A falling edge is considered as edge event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FE_A::VALUE2 } } #[doc = "Field `FE` writer - Falling Edge Detection Enable ETLx"] -pub type FE_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXICON_SPEC, FE_A, O>; -impl<'a, const O: u8> FE_W<'a, O> { +pub type FE_W<'a, REG> = crate::BitWriter<'a, REG, FE_A>; +impl<'a, REG> FE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A falling edge is not considered as edge event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FE_A::VALUE1) } #[doc = "A falling edge is considered as edge event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FE_A::VALUE2) } } #[doc = "Field `OCS` reader - Output Channel Select for ETLx Output Trigger Pulse"] -pub type OCS_R = crate::FieldReader; +pub type OCS_R = crate::FieldReader; #[doc = "Output Channel Select for ETLx Output Trigger Pulse\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -255,10 +235,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for OCS_A { + type Ux = u8; +} impl OCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(OCS_A::VALUE1), 1 => Some(OCS_A::VALUE2), @@ -267,48 +250,52 @@ impl OCS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trigger pulses are sent to OGU0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger pulses are sent to OGU1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OCS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Trigger pulses are sent to OGU2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == OCS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Trigger pulses are sent to OGU3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == OCS_A::VALUE4 } } #[doc = "Field `OCS` writer - Output Channel Select for ETLx Output Trigger Pulse"] -pub type OCS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, EXICON_SPEC, u8, OCS_A, 3, O>; -impl<'a, const O: u8> OCS_W<'a, O> { +pub type OCS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, OCS_A>; +impl<'a, REG> OCS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Trigger pulses are sent to OGU0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OCS_A::VALUE1) } #[doc = "Trigger pulses are sent to OGU1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OCS_A::VALUE2) } #[doc = "Trigger pulses are sent to OGU2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(OCS_A::VALUE3) } #[doc = "Trigger pulses are sent to OGU3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(OCS_A::VALUE4) } } @@ -331,39 +318,42 @@ impl From for bool { impl FL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FL_A { + pub const fn variant(&self) -> FL_A { match self.bits { false => FL_A::VALUE1, true => FL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The enabled edge event has not been detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The enabled edge event has been detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FL_A::VALUE2 } } #[doc = "Field `FL` writer - Status Flag for ETLx"] -pub type FL_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXICON_SPEC, FL_A, O>; -impl<'a, const O: u8> FL_W<'a, O> { +pub type FL_W<'a, REG> = crate::BitWriter<'a, REG, FL_A>; +impl<'a, REG> FL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The enabled edge event has not been detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FL_A::VALUE1) } #[doc = "The enabled edge event has been detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FL_A::VALUE2) } } #[doc = "Field `SS` reader - Input Source Select for ERSx"] -pub type SS_R = crate::FieldReader; +pub type SS_R = crate::FieldReader; #[doc = "Input Source Select for ERSx\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -383,10 +373,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SS_A { + type Ux = u8; +} impl SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SS_A { + pub const fn variant(&self) -> SS_A { match self.bits { 0 => SS_A::VALUE1, 1 => SS_A::VALUE2, @@ -395,48 +388,52 @@ impl SS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input A without additional combination"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input B without additional combination"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input A OR input B"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input A AND input B"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SS_A::VALUE4 } } #[doc = "Field `SS` writer - Input Source Select for ERSx"] -pub type SS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXICON_SPEC, u8, SS_A, 2, O>; -impl<'a, const O: u8> SS_W<'a, O> { +pub type SS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SS_A>; +impl<'a, REG> SS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input A without additional combination"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SS_A::VALUE1) } #[doc = "Input B without additional combination"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SS_A::VALUE2) } #[doc = "Input A OR input B"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SS_A::VALUE3) } #[doc = "Input A AND input B"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SS_A::VALUE4) } } @@ -459,34 +456,37 @@ impl From for bool { impl NA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NA_A { + pub const fn variant(&self) -> NA_A { match self.bits { false => NA_A::VALUE1, true => NA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input A is used directly"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input A is inverted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NA_A::VALUE2 } } #[doc = "Field `NA` writer - Input A Negation Select for ERSx"] -pub type NA_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXICON_SPEC, NA_A, O>; -impl<'a, const O: u8> NA_W<'a, O> { +pub type NA_W<'a, REG> = crate::BitWriter<'a, REG, NA_A>; +impl<'a, REG> NA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Input A is used directly"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NA_A::VALUE1) } #[doc = "Input A is inverted"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NA_A::VALUE2) } } @@ -509,34 +509,37 @@ impl From for bool { impl NB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NB_A { + pub const fn variant(&self) -> NB_A { match self.bits { false => NB_A::VALUE1, true => NB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input B is used directly"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input B is inverted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NB_A::VALUE2 } } #[doc = "Field `NB` writer - Input B Negation Select for ERSx"] -pub type NB_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXICON_SPEC, NB_A, O>; -impl<'a, const O: u8> NB_W<'a, O> { +pub type NB_W<'a, REG> = crate::BitWriter<'a, REG, NB_A>; +impl<'a, REG> NB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Input B is used directly"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NB_A::VALUE1) } #[doc = "Input B is inverted"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NB_A::VALUE2) } } @@ -591,76 +594,77 @@ impl W { #[doc = "Bit 0 - Output Trigger Pulse Enable for ETLx"] #[inline(always)] #[must_use] - pub fn pe(&mut self) -> PE_W<0> { - PE_W::new(self) + pub fn pe(&mut self) -> PE_W { + PE_W::new(self, 0) } #[doc = "Bit 1 - Rebuild Level Detection for Status Flag for ETLx"] #[inline(always)] #[must_use] - pub fn ld(&mut self) -> LD_W<1> { - LD_W::new(self) + pub fn ld(&mut self) -> LD_W { + LD_W::new(self, 1) } #[doc = "Bit 2 - Rising Edge Detection Enable ETLx"] #[inline(always)] #[must_use] - pub fn re(&mut self) -> RE_W<2> { - RE_W::new(self) + pub fn re(&mut self) -> RE_W { + RE_W::new(self, 2) } #[doc = "Bit 3 - Falling Edge Detection Enable ETLx"] #[inline(always)] #[must_use] - pub fn fe(&mut self) -> FE_W<3> { - FE_W::new(self) + pub fn fe(&mut self) -> FE_W { + FE_W::new(self, 3) } #[doc = "Bits 4:6 - Output Channel Select for ETLx Output Trigger Pulse"] #[inline(always)] #[must_use] - pub fn ocs(&mut self) -> OCS_W<4> { - OCS_W::new(self) + pub fn ocs(&mut self) -> OCS_W { + OCS_W::new(self, 4) } #[doc = "Bit 7 - Status Flag for ETLx"] #[inline(always)] #[must_use] - pub fn fl(&mut self) -> FL_W<7> { - FL_W::new(self) + pub fn fl(&mut self) -> FL_W { + FL_W::new(self, 7) } #[doc = "Bits 8:9 - Input Source Select for ERSx"] #[inline(always)] #[must_use] - pub fn ss(&mut self) -> SS_W<8> { - SS_W::new(self) + pub fn ss(&mut self) -> SS_W { + SS_W::new(self, 8) } #[doc = "Bit 10 - Input A Negation Select for ERSx"] #[inline(always)] #[must_use] - pub fn na(&mut self) -> NA_W<10> { - NA_W::new(self) + pub fn na(&mut self) -> NA_W { + NA_W::new(self, 10) } #[doc = "Bit 11 - Input B Negation Select for ERSx"] #[inline(always)] #[must_use] - pub fn nb(&mut self) -> NB_W<11> { - NB_W::new(self) + pub fn nb(&mut self) -> NB_W { + NB_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Event Input Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exicon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`exicon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`exicon::R`](R) reader structure"] +impl crate::Readable for EXICON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`exicon::W`](W) writer structure"] impl crate::Writable for EXICON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eru0/exisel.rs b/src/eru0/exisel.rs index 9417b2ac..1eb8ceb5 100644 --- a/src/eru0/exisel.rs +++ b/src/eru0/exisel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `EXS0A` reader - Event Source Select for A0 (ERS0)"] -pub type EXS0A_R = crate::FieldReader; +pub type EXS0A_R = crate::FieldReader; #[doc = "Event Source Select for A0 (ERS0)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EXS0A_A { + type Ux = u8; +} impl EXS0A_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXS0A_A { + pub const fn variant(&self) -> EXS0A_A { match self.bits { 0 => EXS0A_A::VALUE1, 1 => EXS0A_A::VALUE2, @@ -67,53 +38,57 @@ impl EXS0A_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input ERU_0A0 is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXS0A_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_0A1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXS0A_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_0A2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EXS0A_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_0A3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EXS0A_A::VALUE4 } } #[doc = "Field `EXS0A` writer - Event Source Select for A0 (ERS0)"] -pub type EXS0A_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXISEL_SPEC, u8, EXS0A_A, 2, O>; -impl<'a, const O: u8> EXS0A_W<'a, O> { +pub type EXS0A_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EXS0A_A>; +impl<'a, REG> EXS0A_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input ERU_0A0 is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXS0A_A::VALUE1) } #[doc = "Input ERU_0A1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXS0A_A::VALUE2) } #[doc = "Input ERU_0A2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EXS0A_A::VALUE3) } #[doc = "Input ERU_0A3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EXS0A_A::VALUE4) } } #[doc = "Field `EXS0B` reader - Event Source Select for B0 (ERS0)"] -pub type EXS0B_R = crate::FieldReader; +pub type EXS0B_R = crate::FieldReader; #[doc = "Event Source Select for B0 (ERS0)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EXS0B_A { + type Ux = u8; +} impl EXS0B_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXS0B_A { + pub const fn variant(&self) -> EXS0B_A { match self.bits { 0 => EXS0B_A::VALUE1, 1 => EXS0B_A::VALUE2, @@ -145,53 +123,57 @@ impl EXS0B_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input ERU_0B0 is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXS0B_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_0B1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXS0B_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_0B2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EXS0B_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_0B3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EXS0B_A::VALUE4 } } #[doc = "Field `EXS0B` writer - Event Source Select for B0 (ERS0)"] -pub type EXS0B_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXISEL_SPEC, u8, EXS0B_A, 2, O>; -impl<'a, const O: u8> EXS0B_W<'a, O> { +pub type EXS0B_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EXS0B_A>; +impl<'a, REG> EXS0B_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input ERU_0B0 is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXS0B_A::VALUE1) } #[doc = "Input ERU_0B1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXS0B_A::VALUE2) } #[doc = "Input ERU_0B2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EXS0B_A::VALUE3) } #[doc = "Input ERU_0B3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EXS0B_A::VALUE4) } } #[doc = "Field `EXS1A` reader - Event Source Select for A1 (ERS1)"] -pub type EXS1A_R = crate::FieldReader; +pub type EXS1A_R = crate::FieldReader; #[doc = "Event Source Select for A1 (ERS1)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EXS1A_A { + type Ux = u8; +} impl EXS1A_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXS1A_A { + pub const fn variant(&self) -> EXS1A_A { match self.bits { 0 => EXS1A_A::VALUE1, 1 => EXS1A_A::VALUE2, @@ -223,53 +208,57 @@ impl EXS1A_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input ERU_1A0 is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXS1A_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_1A1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXS1A_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_1A2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EXS1A_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_1A3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EXS1A_A::VALUE4 } } #[doc = "Field `EXS1A` writer - Event Source Select for A1 (ERS1)"] -pub type EXS1A_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXISEL_SPEC, u8, EXS1A_A, 2, O>; -impl<'a, const O: u8> EXS1A_W<'a, O> { +pub type EXS1A_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EXS1A_A>; +impl<'a, REG> EXS1A_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input ERU_1A0 is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXS1A_A::VALUE1) } #[doc = "Input ERU_1A1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXS1A_A::VALUE2) } #[doc = "Input ERU_1A2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EXS1A_A::VALUE3) } #[doc = "Input ERU_1A3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EXS1A_A::VALUE4) } } #[doc = "Field `EXS1B` reader - Event Source Select for B1 (ERS1)"] -pub type EXS1B_R = crate::FieldReader; +pub type EXS1B_R = crate::FieldReader; #[doc = "Event Source Select for B1 (ERS1)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EXS1B_A { + type Ux = u8; +} impl EXS1B_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXS1B_A { + pub const fn variant(&self) -> EXS1B_A { match self.bits { 0 => EXS1B_A::VALUE1, 1 => EXS1B_A::VALUE2, @@ -301,53 +293,57 @@ impl EXS1B_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input ERU_1B0 is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXS1B_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_1B1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXS1B_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_1B2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EXS1B_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_1B3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EXS1B_A::VALUE4 } } #[doc = "Field `EXS1B` writer - Event Source Select for B1 (ERS1)"] -pub type EXS1B_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXISEL_SPEC, u8, EXS1B_A, 2, O>; -impl<'a, const O: u8> EXS1B_W<'a, O> { +pub type EXS1B_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EXS1B_A>; +impl<'a, REG> EXS1B_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input ERU_1B0 is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXS1B_A::VALUE1) } #[doc = "Input ERU_1B1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXS1B_A::VALUE2) } #[doc = "Input ERU_1B2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EXS1B_A::VALUE3) } #[doc = "Input ERU_1B3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EXS1B_A::VALUE4) } } #[doc = "Field `EXS2A` reader - Event Source Select for A2 (ERS2)"] -pub type EXS2A_R = crate::FieldReader; +pub type EXS2A_R = crate::FieldReader; #[doc = "Event Source Select for A2 (ERS2)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EXS2A_A { + type Ux = u8; +} impl EXS2A_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXS2A_A { + pub const fn variant(&self) -> EXS2A_A { match self.bits { 0 => EXS2A_A::VALUE1, 1 => EXS2A_A::VALUE2, @@ -379,53 +378,57 @@ impl EXS2A_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input ERU_2A0 is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXS2A_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_2A1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXS2A_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_2A2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EXS2A_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_2A3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EXS2A_A::VALUE4 } } #[doc = "Field `EXS2A` writer - Event Source Select for A2 (ERS2)"] -pub type EXS2A_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXISEL_SPEC, u8, EXS2A_A, 2, O>; -impl<'a, const O: u8> EXS2A_W<'a, O> { +pub type EXS2A_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EXS2A_A>; +impl<'a, REG> EXS2A_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input ERU_2A0 is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXS2A_A::VALUE1) } #[doc = "Input ERU_2A1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXS2A_A::VALUE2) } #[doc = "Input ERU_2A2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EXS2A_A::VALUE3) } #[doc = "Input ERU_2A3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EXS2A_A::VALUE4) } } #[doc = "Field `EXS2B` reader - Event Source Select for B2 (ERS2)"] -pub type EXS2B_R = crate::FieldReader; +pub type EXS2B_R = crate::FieldReader; #[doc = "Event Source Select for B2 (ERS2)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EXS2B_A { + type Ux = u8; +} impl EXS2B_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXS2B_A { + pub const fn variant(&self) -> EXS2B_A { match self.bits { 0 => EXS2B_A::VALUE1, 1 => EXS2B_A::VALUE2, @@ -457,53 +463,57 @@ impl EXS2B_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input ERU_2B0 is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXS2B_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_2B1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXS2B_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_2B2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EXS2B_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_2B3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EXS2B_A::VALUE4 } } #[doc = "Field `EXS2B` writer - Event Source Select for B2 (ERS2)"] -pub type EXS2B_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXISEL_SPEC, u8, EXS2B_A, 2, O>; -impl<'a, const O: u8> EXS2B_W<'a, O> { +pub type EXS2B_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EXS2B_A>; +impl<'a, REG> EXS2B_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input ERU_2B0 is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXS2B_A::VALUE1) } #[doc = "Input ERU_2B1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXS2B_A::VALUE2) } #[doc = "Input ERU_2B2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EXS2B_A::VALUE3) } #[doc = "Input ERU_2B3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EXS2B_A::VALUE4) } } #[doc = "Field `EXS3A` reader - Event Source Select for A3 (ERS3)"] -pub type EXS3A_R = crate::FieldReader; +pub type EXS3A_R = crate::FieldReader; #[doc = "Event Source Select for A3 (ERS3)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -523,10 +533,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EXS3A_A { + type Ux = u8; +} impl EXS3A_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXS3A_A { + pub const fn variant(&self) -> EXS3A_A { match self.bits { 0 => EXS3A_A::VALUE1, 1 => EXS3A_A::VALUE2, @@ -535,53 +548,57 @@ impl EXS3A_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input ERU_3A0 is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXS3A_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_3A1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXS3A_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_3A2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EXS3A_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_3A3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EXS3A_A::VALUE4 } } #[doc = "Field `EXS3A` writer - Event Source Select for A3 (ERS3)"] -pub type EXS3A_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXISEL_SPEC, u8, EXS3A_A, 2, O>; -impl<'a, const O: u8> EXS3A_W<'a, O> { +pub type EXS3A_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EXS3A_A>; +impl<'a, REG> EXS3A_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input ERU_3A0 is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXS3A_A::VALUE1) } #[doc = "Input ERU_3A1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXS3A_A::VALUE2) } #[doc = "Input ERU_3A2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EXS3A_A::VALUE3) } #[doc = "Input ERU_3A3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EXS3A_A::VALUE4) } } #[doc = "Field `EXS3B` reader - Event Source Select for B3 (ERS3)"] -pub type EXS3B_R = crate::FieldReader; +pub type EXS3B_R = crate::FieldReader; #[doc = "Event Source Select for B3 (ERS3)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -601,10 +618,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EXS3B_A { + type Ux = u8; +} impl EXS3B_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXS3B_A { + pub const fn variant(&self) -> EXS3B_A { match self.bits { 0 => EXS3B_A::VALUE1, 1 => EXS3B_A::VALUE2, @@ -613,48 +633,52 @@ impl EXS3B_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input ERU_3B0 is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXS3B_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_3B1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXS3B_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_3B2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EXS3B_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_3B3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EXS3B_A::VALUE4 } } #[doc = "Field `EXS3B` writer - Event Source Select for B3 (ERS3)"] -pub type EXS3B_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXISEL_SPEC, u8, EXS3B_A, 2, O>; -impl<'a, const O: u8> EXS3B_W<'a, O> { +pub type EXS3B_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EXS3B_A>; +impl<'a, REG> EXS3B_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input ERU_3B0 is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXS3B_A::VALUE1) } #[doc = "Input ERU_3B1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXS3B_A::VALUE2) } #[doc = "Input ERU_3B2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EXS3B_A::VALUE3) } #[doc = "Input ERU_3B3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EXS3B_A::VALUE4) } } @@ -704,70 +728,71 @@ impl W { #[doc = "Bits 0:1 - Event Source Select for A0 (ERS0)"] #[inline(always)] #[must_use] - pub fn exs0a(&mut self) -> EXS0A_W<0> { - EXS0A_W::new(self) + pub fn exs0a(&mut self) -> EXS0A_W { + EXS0A_W::new(self, 0) } #[doc = "Bits 2:3 - Event Source Select for B0 (ERS0)"] #[inline(always)] #[must_use] - pub fn exs0b(&mut self) -> EXS0B_W<2> { - EXS0B_W::new(self) + pub fn exs0b(&mut self) -> EXS0B_W { + EXS0B_W::new(self, 2) } #[doc = "Bits 4:5 - Event Source Select for A1 (ERS1)"] #[inline(always)] #[must_use] - pub fn exs1a(&mut self) -> EXS1A_W<4> { - EXS1A_W::new(self) + pub fn exs1a(&mut self) -> EXS1A_W { + EXS1A_W::new(self, 4) } #[doc = "Bits 6:7 - Event Source Select for B1 (ERS1)"] #[inline(always)] #[must_use] - pub fn exs1b(&mut self) -> EXS1B_W<6> { - EXS1B_W::new(self) + pub fn exs1b(&mut self) -> EXS1B_W { + EXS1B_W::new(self, 6) } #[doc = "Bits 8:9 - Event Source Select for A2 (ERS2)"] #[inline(always)] #[must_use] - pub fn exs2a(&mut self) -> EXS2A_W<8> { - EXS2A_W::new(self) + pub fn exs2a(&mut self) -> EXS2A_W { + EXS2A_W::new(self, 8) } #[doc = "Bits 10:11 - Event Source Select for B2 (ERS2)"] #[inline(always)] #[must_use] - pub fn exs2b(&mut self) -> EXS2B_W<10> { - EXS2B_W::new(self) + pub fn exs2b(&mut self) -> EXS2B_W { + EXS2B_W::new(self, 10) } #[doc = "Bits 12:13 - Event Source Select for A3 (ERS3)"] #[inline(always)] #[must_use] - pub fn exs3a(&mut self) -> EXS3A_W<12> { - EXS3A_W::new(self) + pub fn exs3a(&mut self) -> EXS3A_W { + EXS3A_W::new(self, 12) } #[doc = "Bits 14:15 - Event Source Select for B3 (ERS3)"] #[inline(always)] #[must_use] - pub fn exs3b(&mut self) -> EXS3B_W<14> { - EXS3B_W::new(self) + pub fn exs3b(&mut self) -> EXS3B_W { + EXS3B_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Event Input Select\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exisel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`exisel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`exisel::R`](R) reader structure"] +impl crate::Readable for EXISEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`exisel::W`](W) writer structure"] impl crate::Writable for EXISEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eru0/exocon.rs b/src/eru0/exocon.rs index e4acc424..922ae74e 100644 --- a/src/eru0/exocon.rs +++ b/src/eru0/exocon.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ISS` reader - Internal Trigger Source Selection"] -pub type ISS_R = crate::FieldReader; +pub type ISS_R = crate::FieldReader; #[doc = "Internal Trigger Source Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ISS_A { + type Ux = u8; +} impl ISS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ISS_A { + pub const fn variant(&self) -> ISS_A { match self.bits { 0 => ISS_A::VALUE1, 1 => ISS_A::VALUE2, @@ -67,48 +38,52 @@ impl ISS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The peripheral trigger function is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ISS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input ERU_OGUy1 is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ISS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input ERU_OGUy2 is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ISS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input ERU_OGUy3 is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ISS_A::VALUE4 } } #[doc = "Field `ISS` writer - Internal Trigger Source Selection"] -pub type ISS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXOCON_SPEC, u8, ISS_A, 2, O>; -impl<'a, const O: u8> ISS_W<'a, O> { +pub type ISS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ISS_A>; +impl<'a, REG> ISS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The peripheral trigger function is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ISS_A::VALUE1) } #[doc = "Input ERU_OGUy1 is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ISS_A::VALUE2) } #[doc = "Input ERU_OGUy2 is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ISS_A::VALUE3) } #[doc = "Input ERU_OGUy3 is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ISS_A::VALUE4) } } @@ -131,34 +106,37 @@ impl From for bool { impl GEEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GEEN_A { + pub const fn variant(&self) -> GEEN_A { match self.bits { false => GEEN_A::VALUE1, true => GEEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The event detection is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GEEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The event detection is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GEEN_A::VALUE2 } } #[doc = "Field `GEEN` writer - Gating Event Enable"] -pub type GEEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXOCON_SPEC, GEEN_A, O>; -impl<'a, const O: u8> GEEN_W<'a, O> { +pub type GEEN_W<'a, REG> = crate::BitWriter<'a, REG, GEEN_A>; +impl<'a, REG> GEEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The event detection is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GEEN_A::VALUE1) } #[doc = "The event detection is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GEEN_A::VALUE2) } } @@ -181,25 +159,25 @@ impl From for bool { impl PDR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDR_A { + pub const fn variant(&self) -> PDR_A { match self.bits { false => PDR_A::VALUE1, true => PDR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A pattern miss is detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A pattern match is detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDR_A::VALUE2 } } #[doc = "Field `GP` reader - Gating Selection for Pattern Detection Result"] -pub type GP_R = crate::FieldReader; +pub type GP_R = crate::FieldReader; #[doc = "Gating Selection for Pattern Detection Result\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -219,10 +197,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for GP_A { + type Ux = u8; +} impl GP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GP_A { + pub const fn variant(&self) -> GP_A { match self.bits { 0 => GP_A::VALUE1, 1 => GP_A::VALUE2, @@ -231,48 +212,52 @@ impl GP_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "ERU_GOUTy is always disabled and ERU_IOUTy can not be activated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ERU_GOUTy is always enabled and ERU_IOUTy becomes activated with each activation of ERU_TOUTy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "ERU_GOUTy is equal to ERU_PDOUTy and ERU_IOUTy becomes activated with an activation of ERU_TOUTy while the desired pattern is detected (pattern match PDR = 1)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == GP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "ERU_GOUTy is inverted to ERU_PDOUTy and ERU_IOUTy becomes activated with an activation of ERU_TOUTy while the desired pattern is not detected (pattern miss PDR = 0)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == GP_A::VALUE4 } } #[doc = "Field `GP` writer - Gating Selection for Pattern Detection Result"] -pub type GP_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EXOCON_SPEC, u8, GP_A, 2, O>; -impl<'a, const O: u8> GP_W<'a, O> { +pub type GP_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, GP_A>; +impl<'a, REG> GP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "ERU_GOUTy is always disabled and ERU_IOUTy can not be activated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GP_A::VALUE1) } #[doc = "ERU_GOUTy is always enabled and ERU_IOUTy becomes activated with each activation of ERU_TOUTy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GP_A::VALUE2) } #[doc = "ERU_GOUTy is equal to ERU_PDOUTy and ERU_IOUTy becomes activated with an activation of ERU_TOUTy while the desired pattern is detected (pattern match PDR = 1)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(GP_A::VALUE3) } #[doc = "ERU_GOUTy is inverted to ERU_PDOUTy and ERU_IOUTy becomes activated with an activation of ERU_TOUTy while the desired pattern is not detected (pattern miss PDR = 0)"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(GP_A::VALUE4) } } @@ -295,34 +280,37 @@ impl From for bool { impl IPEN0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IPEN0_A { + pub const fn variant(&self) -> IPEN0_A { match self.bits { false => IPEN0_A::VALUE1, true => IPEN0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IPEN0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flag EXICONx.FL is included in the pattern detection"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IPEN0_A::VALUE2 } } #[doc = "Field `IPEN0` writer - Pattern Detection Enable for ETL0"] -pub type IPEN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXOCON_SPEC, IPEN0_A, O>; -impl<'a, const O: u8> IPEN0_W<'a, O> { +pub type IPEN0_W<'a, REG> = crate::BitWriter<'a, REG, IPEN0_A>; +impl<'a, REG> IPEN0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IPEN0_A::VALUE1) } #[doc = "Flag EXICONx.FL is included in the pattern detection"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IPEN0_A::VALUE2) } } @@ -345,34 +333,37 @@ impl From for bool { impl IPEN1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IPEN1_A { + pub const fn variant(&self) -> IPEN1_A { match self.bits { false => IPEN1_A::VALUE1, true => IPEN1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IPEN1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flag EXICONx.FL is included in the pattern detection"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IPEN1_A::VALUE2 } } #[doc = "Field `IPEN1` writer - Pattern Detection Enable for ETL1"] -pub type IPEN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXOCON_SPEC, IPEN1_A, O>; -impl<'a, const O: u8> IPEN1_W<'a, O> { +pub type IPEN1_W<'a, REG> = crate::BitWriter<'a, REG, IPEN1_A>; +impl<'a, REG> IPEN1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IPEN1_A::VALUE1) } #[doc = "Flag EXICONx.FL is included in the pattern detection"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IPEN1_A::VALUE2) } } @@ -395,34 +386,37 @@ impl From for bool { impl IPEN2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IPEN2_A { + pub const fn variant(&self) -> IPEN2_A { match self.bits { false => IPEN2_A::VALUE1, true => IPEN2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IPEN2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flag EXICONx.FL is included in the pattern detection"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IPEN2_A::VALUE2 } } #[doc = "Field `IPEN2` writer - Pattern Detection Enable for ETL2"] -pub type IPEN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXOCON_SPEC, IPEN2_A, O>; -impl<'a, const O: u8> IPEN2_W<'a, O> { +pub type IPEN2_W<'a, REG> = crate::BitWriter<'a, REG, IPEN2_A>; +impl<'a, REG> IPEN2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IPEN2_A::VALUE1) } #[doc = "Flag EXICONx.FL is included in the pattern detection"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IPEN2_A::VALUE2) } } @@ -445,34 +439,37 @@ impl From for bool { impl IPEN3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IPEN3_A { + pub const fn variant(&self) -> IPEN3_A { match self.bits { false => IPEN3_A::VALUE1, true => IPEN3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IPEN3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flag EXICONx.FL is included in the pattern detection"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IPEN3_A::VALUE2 } } #[doc = "Field `IPEN3` writer - Pattern Detection Enable for ETL3"] -pub type IPEN3_W<'a, const O: u8> = crate::BitWriter<'a, u32, EXOCON_SPEC, IPEN3_A, O>; -impl<'a, const O: u8> IPEN3_W<'a, O> { +pub type IPEN3_W<'a, REG> = crate::BitWriter<'a, REG, IPEN3_A>; +impl<'a, REG> IPEN3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Flag EXICONx.FL is excluded from the pattern detection"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IPEN3_A::VALUE1) } #[doc = "Flag EXICONx.FL is included in the pattern detection"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IPEN3_A::VALUE2) } } @@ -522,64 +519,65 @@ impl W { #[doc = "Bits 0:1 - Internal Trigger Source Selection"] #[inline(always)] #[must_use] - pub fn iss(&mut self) -> ISS_W<0> { - ISS_W::new(self) + pub fn iss(&mut self) -> ISS_W { + ISS_W::new(self, 0) } #[doc = "Bit 2 - Gating Event Enable"] #[inline(always)] #[must_use] - pub fn geen(&mut self) -> GEEN_W<2> { - GEEN_W::new(self) + pub fn geen(&mut self) -> GEEN_W { + GEEN_W::new(self, 2) } #[doc = "Bits 4:5 - Gating Selection for Pattern Detection Result"] #[inline(always)] #[must_use] - pub fn gp(&mut self) -> GP_W<4> { - GP_W::new(self) + pub fn gp(&mut self) -> GP_W { + GP_W::new(self, 4) } #[doc = "Bit 12 - Pattern Detection Enable for ETL0"] #[inline(always)] #[must_use] - pub fn ipen0(&mut self) -> IPEN0_W<12> { - IPEN0_W::new(self) + pub fn ipen0(&mut self) -> IPEN0_W { + IPEN0_W::new(self, 12) } #[doc = "Bit 13 - Pattern Detection Enable for ETL1"] #[inline(always)] #[must_use] - pub fn ipen1(&mut self) -> IPEN1_W<13> { - IPEN1_W::new(self) + pub fn ipen1(&mut self) -> IPEN1_W { + IPEN1_W::new(self, 13) } #[doc = "Bit 14 - Pattern Detection Enable for ETL2"] #[inline(always)] #[must_use] - pub fn ipen2(&mut self) -> IPEN2_W<14> { - IPEN2_W::new(self) + pub fn ipen2(&mut self) -> IPEN2_W { + IPEN2_W::new(self, 14) } #[doc = "Bit 15 - Pattern Detection Enable for ETL3"] #[inline(always)] #[must_use] - pub fn ipen3(&mut self) -> IPEN3_W<15> { - IPEN3_W::new(self) + pub fn ipen3(&mut self) -> IPEN3_W { + IPEN3_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Event Output Trigger Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`exocon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`exocon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`exocon::R`](R) reader structure"] +impl crate::Readable for EXOCON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`exocon::W`](W) writer structure"] impl crate::Writable for EXOCON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0.rs b/src/eth0.rs index da0ff91e..f27f9f67 100644 --- a/src/eth0.rs +++ b/src/eth0.rs @@ -1,837 +1,1524 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + mac_configuration: MAC_CONFIGURATION, + mac_frame_filter: MAC_FRAME_FILTER, + hash_table_high: HASH_TABLE_HIGH, + hash_table_low: HASH_TABLE_LOW, + gmii_address: GMII_ADDRESS, + gmii_data: GMII_DATA, + flow_control: FLOW_CONTROL, + vlan_tag: VLAN_TAG, + version: VERSION, + debug: DEBUG, + remote_wake_up_frame_filter: REMOTE_WAKE_UP_FRAME_FILTER, + pmt_control_status: PMT_CONTROL_STATUS, + _reserved12: [u8; 0x08], + interrupt_status: INTERRUPT_STATUS, + interrupt_mask: INTERRUPT_MASK, + mac_address0_high: MAC_ADDRESS0_HIGH, + mac_address0_low: MAC_ADDRESS0_LOW, + mac_address1_high: MAC_ADDRESS1_HIGH, + mac_address1_low: MAC_ADDRESS1_LOW, + mac_address2_high: MAC_ADDRESS2_HIGH, + mac_address2_low: MAC_ADDRESS2_LOW, + mac_address3_high: MAC_ADDRESS3_HIGH, + mac_address3_low: MAC_ADDRESS3_LOW, + _reserved22: [u8; 0xa0], + mmc_control: MMC_CONTROL, + mmc_receive_interrupt: MMC_RECEIVE_INTERRUPT, + mmc_transmit_interrupt: MMC_TRANSMIT_INTERRUPT, + mmc_receive_interrupt_mask: MMC_RECEIVE_INTERRUPT_MASK, + mmc_transmit_interrupt_mask: MMC_TRANSMIT_INTERRUPT_MASK, + tx_octet_count_good_bad: TX_OCTET_COUNT_GOOD_BAD, + tx_frame_count_good_bad: TX_FRAME_COUNT_GOOD_BAD, + tx_broadcast_frames_good: TX_BROADCAST_FRAMES_GOOD, + tx_multicast_frames_good: TX_MULTICAST_FRAMES_GOOD, + tx_64octets_frames_good_bad: TX_64OCTETS_FRAMES_GOOD_BAD, + tx_65to127octets_frames_good_bad: TX_65TO127OCTETS_FRAMES_GOOD_BAD, + tx_128to255octets_frames_good_bad: TX_128TO255OCTETS_FRAMES_GOOD_BAD, + tx_256to511octets_frames_good_bad: TX_256TO511OCTETS_FRAMES_GOOD_BAD, + tx_512to1023octets_frames_good_bad: TX_512TO1023OCTETS_FRAMES_GOOD_BAD, + tx_1024tomaxoctets_frames_good_bad: TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD, + tx_unicast_frames_good_bad: TX_UNICAST_FRAMES_GOOD_BAD, + tx_multicast_frames_good_bad: TX_MULTICAST_FRAMES_GOOD_BAD, + tx_broadcast_frames_good_bad: TX_BROADCAST_FRAMES_GOOD_BAD, + tx_underflow_error_frames: TX_UNDERFLOW_ERROR_FRAMES, + tx_single_collision_good_frames: TX_SINGLE_COLLISION_GOOD_FRAMES, + tx_multiple_collision_good_frames: TX_MULTIPLE_COLLISION_GOOD_FRAMES, + tx_deferred_frames: TX_DEFERRED_FRAMES, + tx_late_collision_frames: TX_LATE_COLLISION_FRAMES, + tx_excessive_collision_frames: TX_EXCESSIVE_COLLISION_FRAMES, + tx_carrier_error_frames: TX_CARRIER_ERROR_FRAMES, + tx_octet_count_good: TX_OCTET_COUNT_GOOD, + tx_frame_count_good: TX_FRAME_COUNT_GOOD, + tx_excessive_deferral_error: TX_EXCESSIVE_DEFERRAL_ERROR, + tx_pause_frames: TX_PAUSE_FRAMES, + tx_vlan_frames_good: TX_VLAN_FRAMES_GOOD, + tx_osize_frames_good: TX_OSIZE_FRAMES_GOOD, + _reserved53: [u8; 0x04], + rx_frames_count_good_bad: RX_FRAMES_COUNT_GOOD_BAD, + rx_octet_count_good_bad: RX_OCTET_COUNT_GOOD_BAD, + rx_octet_count_good: RX_OCTET_COUNT_GOOD, + rx_broadcast_frames_good: RX_BROADCAST_FRAMES_GOOD, + rx_multicast_frames_good: RX_MULTICAST_FRAMES_GOOD, + rx_crc_error_frames: RX_CRC_ERROR_FRAMES, + rx_alignment_error_frames: RX_ALIGNMENT_ERROR_FRAMES, + rx_runt_error_frames: RX_RUNT_ERROR_FRAMES, + rx_jabber_error_frames: RX_JABBER_ERROR_FRAMES, + rx_undersize_frames_good: RX_UNDERSIZE_FRAMES_GOOD, + rx_oversize_frames_good: RX_OVERSIZE_FRAMES_GOOD, + rx_64octets_frames_good_bad: RX_64OCTETS_FRAMES_GOOD_BAD, + rx_65to127octets_frames_good_bad: RX_65TO127OCTETS_FRAMES_GOOD_BAD, + rx_128to255octets_frames_good_bad: RX_128TO255OCTETS_FRAMES_GOOD_BAD, + rx_256to511octets_frames_good_bad: RX_256TO511OCTETS_FRAMES_GOOD_BAD, + rx_512to1023octets_frames_good_bad: RX_512TO1023OCTETS_FRAMES_GOOD_BAD, + rx_1024tomaxoctets_frames_good_bad: RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD, + rx_unicast_frames_good: RX_UNICAST_FRAMES_GOOD, + rx_length_error_frames: RX_LENGTH_ERROR_FRAMES, + rx_out_of_range_type_frames: RX_OUT_OF_RANGE_TYPE_FRAMES, + rx_pause_frames: RX_PAUSE_FRAMES, + rx_fifo_overflow_frames: RX_FIFO_OVERFLOW_FRAMES, + rx_vlan_frames_good_bad: RX_VLAN_FRAMES_GOOD_BAD, + rx_watchdog_error_frames: RX_WATCHDOG_ERROR_FRAMES, + rx_receive_error_frames: RX_RECEIVE_ERROR_FRAMES, + rx_control_frames_good: RX_CONTROL_FRAMES_GOOD, + _reserved79: [u8; 0x18], + mmc_ipc_receive_interrupt_mask: MMC_IPC_RECEIVE_INTERRUPT_MASK, + _reserved80: [u8; 0x04], + mmc_ipc_receive_interrupt: MMC_IPC_RECEIVE_INTERRUPT, + _reserved81: [u8; 0x04], + rxipv4_good_frames: RXIPV4_GOOD_FRAMES, + rxipv4_header_error_frames: RXIPV4_HEADER_ERROR_FRAMES, + rxipv4_no_payload_frames: RXIPV4_NO_PAYLOAD_FRAMES, + rxipv4_fragmented_frames: RXIPV4_FRAGMENTED_FRAMES, + rxipv4_udp_checksum_disabled_frames: RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES, + rxipv6_good_frames: RXIPV6_GOOD_FRAMES, + rxipv6_header_error_frames: RXIPV6_HEADER_ERROR_FRAMES, + rxipv6_no_payload_frames: RXIPV6_NO_PAYLOAD_FRAMES, + rxudp_good_frames: RXUDP_GOOD_FRAMES, + rxudp_error_frames: RXUDP_ERROR_FRAMES, + rxtcp_good_frames: RXTCP_GOOD_FRAMES, + rxtcp_error_frames: RXTCP_ERROR_FRAMES, + rxicmp_good_frames: RXICMP_GOOD_FRAMES, + rxicmp_error_frames: RXICMP_ERROR_FRAMES, + _reserved95: [u8; 0x08], + rxipv4_good_octets: RXIPV4_GOOD_OCTETS, + rxipv4_header_error_octets: RXIPV4_HEADER_ERROR_OCTETS, + rxipv4_no_payload_octets: RXIPV4_NO_PAYLOAD_OCTETS, + rxipv4_fragmented_octets: RXIPV4_FRAGMENTED_OCTETS, + rxipv4_udp_checksum_disable_octets: RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS, + rxipv6_good_octets: RXIPV6_GOOD_OCTETS, + rxipv6_header_error_octets: RXIPV6_HEADER_ERROR_OCTETS, + rxipv6_no_payload_octets: RXIPV6_NO_PAYLOAD_OCTETS, + rxudp_good_octets: RXUDP_GOOD_OCTETS, + rxudp_error_octets: RXUDP_ERROR_OCTETS, + rxtcp_good_octets: RXTCP_GOOD_OCTETS, + rxtcp_error_octets: RXTCP_ERROR_OCTETS, + rxicmp_good_octets: RXICMP_GOOD_OCTETS, + rxicmp_error_octets: RXICMP_ERROR_OCTETS, + _reserved109: [u8; 0x0478], + timestamp_control: TIMESTAMP_CONTROL, + sub_second_increment: SUB_SECOND_INCREMENT, + system_time_seconds: SYSTEM_TIME_SECONDS, + system_time_nanoseconds: SYSTEM_TIME_NANOSECONDS, + system_time_seconds_update: SYSTEM_TIME_SECONDS_UPDATE, + system_time_nanoseconds_update: SYSTEM_TIME_NANOSECONDS_UPDATE, + timestamp_addend: TIMESTAMP_ADDEND, + target_time_seconds: TARGET_TIME_SECONDS, + target_time_nanoseconds: TARGET_TIME_NANOSECONDS, + system_time_higher_word_seconds: SYSTEM_TIME_HIGHER_WORD_SECONDS, + timestamp_status: TIMESTAMP_STATUS, + pps_control: PPS_CONTROL, + _reserved121: [u8; 0x08d0], + bus_mode: BUS_MODE, + transmit_poll_demand: TRANSMIT_POLL_DEMAND, + receive_poll_demand: RECEIVE_POLL_DEMAND, + receive_descriptor_list_address: RECEIVE_DESCRIPTOR_LIST_ADDRESS, + transmit_descriptor_list_address: TRANSMIT_DESCRIPTOR_LIST_ADDRESS, + status: STATUS, + operation_mode: OPERATION_MODE, + interrupt_enable: INTERRUPT_ENABLE, + missed_frame_and_buffer_overflow_counter: MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER, + receive_interrupt_watchdog_timer: RECEIVE_INTERRUPT_WATCHDOG_TIMER, + _reserved131: [u8; 0x04], + ahb_status: AHB_STATUS, + _reserved132: [u8; 0x18], + current_host_transmit_descriptor: CURRENT_HOST_TRANSMIT_DESCRIPTOR, + current_host_receive_descriptor: CURRENT_HOST_RECEIVE_DESCRIPTOR, + current_host_transmit_buffer_address: CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS, + current_host_receive_buffer_address: CURRENT_HOST_RECEIVE_BUFFER_ADDRESS, + hw_feature: HW_FEATURE, +} +impl RegisterBlock { #[doc = "0x00 - MAC Configuration Register"] - pub mac_configuration: MAC_CONFIGURATION, + #[inline(always)] + pub const fn mac_configuration(&self) -> &MAC_CONFIGURATION { + &self.mac_configuration + } #[doc = "0x04 - MAC Frame Filter"] - pub mac_frame_filter: MAC_FRAME_FILTER, + #[inline(always)] + pub const fn mac_frame_filter(&self) -> &MAC_FRAME_FILTER { + &self.mac_frame_filter + } #[doc = "0x08 - Hash Table High Register"] - pub hash_table_high: HASH_TABLE_HIGH, + #[inline(always)] + pub const fn hash_table_high(&self) -> &HASH_TABLE_HIGH { + &self.hash_table_high + } #[doc = "0x0c - Hash Table Low Register"] - pub hash_table_low: HASH_TABLE_LOW, + #[inline(always)] + pub const fn hash_table_low(&self) -> &HASH_TABLE_LOW { + &self.hash_table_low + } #[doc = "0x10 - MII Address Register"] - pub gmii_address: GMII_ADDRESS, + #[inline(always)] + pub const fn gmii_address(&self) -> &GMII_ADDRESS { + &self.gmii_address + } #[doc = "0x14 - MII Data Register"] - pub gmii_data: GMII_DATA, + #[inline(always)] + pub const fn gmii_data(&self) -> &GMII_DATA { + &self.gmii_data + } #[doc = "0x18 - Flow Control Register"] - pub flow_control: FLOW_CONTROL, + #[inline(always)] + pub const fn flow_control(&self) -> &FLOW_CONTROL { + &self.flow_control + } #[doc = "0x1c - VLAN Tag Register"] - pub vlan_tag: VLAN_TAG, + #[inline(always)] + pub const fn vlan_tag(&self) -> &VLAN_TAG { + &self.vlan_tag + } #[doc = "0x20 - Version Register"] - pub version: VERSION, + #[inline(always)] + pub const fn version(&self) -> &VERSION { + &self.version + } #[doc = "0x24 - Debug Register"] - pub debug: DEBUG, + #[inline(always)] + pub const fn debug(&self) -> &DEBUG { + &self.debug + } #[doc = "0x28 - Remote Wake Up Frame Filter Register"] - pub remote_wake_up_frame_filter: REMOTE_WAKE_UP_FRAME_FILTER, + #[inline(always)] + pub const fn remote_wake_up_frame_filter(&self) -> &REMOTE_WAKE_UP_FRAME_FILTER { + &self.remote_wake_up_frame_filter + } #[doc = "0x2c - PMT Control and Status Register"] - pub pmt_control_status: PMT_CONTROL_STATUS, - _reserved12: [u8; 0x08], + #[inline(always)] + pub const fn pmt_control_status(&self) -> &PMT_CONTROL_STATUS { + &self.pmt_control_status + } #[doc = "0x38 - Interrupt Register"] - pub interrupt_status: INTERRUPT_STATUS, + #[inline(always)] + pub const fn interrupt_status(&self) -> &INTERRUPT_STATUS { + &self.interrupt_status + } #[doc = "0x3c - Interrupt Mask Register"] - pub interrupt_mask: INTERRUPT_MASK, + #[inline(always)] + pub const fn interrupt_mask(&self) -> &INTERRUPT_MASK { + &self.interrupt_mask + } #[doc = "0x40 - MAC Address0 High Register"] - pub mac_address0_high: MAC_ADDRESS0_HIGH, + #[inline(always)] + pub const fn mac_address0_high(&self) -> &MAC_ADDRESS0_HIGH { + &self.mac_address0_high + } #[doc = "0x44 - MAC Address0 Low Register"] - pub mac_address0_low: MAC_ADDRESS0_LOW, + #[inline(always)] + pub const fn mac_address0_low(&self) -> &MAC_ADDRESS0_LOW { + &self.mac_address0_low + } #[doc = "0x48 - MAC Address1 High Register"] - pub mac_address1_high: MAC_ADDRESS1_HIGH, + #[inline(always)] + pub const fn mac_address1_high(&self) -> &MAC_ADDRESS1_HIGH { + &self.mac_address1_high + } #[doc = "0x4c - MAC Address1 Low Register"] - pub mac_address1_low: MAC_ADDRESS1_LOW, + #[inline(always)] + pub const fn mac_address1_low(&self) -> &MAC_ADDRESS1_LOW { + &self.mac_address1_low + } #[doc = "0x50 - MAC Address2 High Register"] - pub mac_address2_high: MAC_ADDRESS2_HIGH, + #[inline(always)] + pub const fn mac_address2_high(&self) -> &MAC_ADDRESS2_HIGH { + &self.mac_address2_high + } #[doc = "0x54 - MAC Address2 Low Register"] - pub mac_address2_low: MAC_ADDRESS2_LOW, + #[inline(always)] + pub const fn mac_address2_low(&self) -> &MAC_ADDRESS2_LOW { + &self.mac_address2_low + } #[doc = "0x58 - MAC Address3 High Register"] - pub mac_address3_high: MAC_ADDRESS3_HIGH, + #[inline(always)] + pub const fn mac_address3_high(&self) -> &MAC_ADDRESS3_HIGH { + &self.mac_address3_high + } #[doc = "0x5c - MAC Address3 Low Register"] - pub mac_address3_low: MAC_ADDRESS3_LOW, - _reserved22: [u8; 0xa0], + #[inline(always)] + pub const fn mac_address3_low(&self) -> &MAC_ADDRESS3_LOW { + &self.mac_address3_low + } #[doc = "0x100 - MMC Control Register"] - pub mmc_control: MMC_CONTROL, + #[inline(always)] + pub const fn mmc_control(&self) -> &MMC_CONTROL { + &self.mmc_control + } #[doc = "0x104 - MMC Receive Interrupt Register"] - pub mmc_receive_interrupt: MMC_RECEIVE_INTERRUPT, + #[inline(always)] + pub const fn mmc_receive_interrupt(&self) -> &MMC_RECEIVE_INTERRUPT { + &self.mmc_receive_interrupt + } #[doc = "0x108 - MMC Transmit Interrupt Register"] - pub mmc_transmit_interrupt: MMC_TRANSMIT_INTERRUPT, + #[inline(always)] + pub const fn mmc_transmit_interrupt(&self) -> &MMC_TRANSMIT_INTERRUPT { + &self.mmc_transmit_interrupt + } #[doc = "0x10c - MMC Reveive Interrupt Mask Register"] - pub mmc_receive_interrupt_mask: MMC_RECEIVE_INTERRUPT_MASK, + #[inline(always)] + pub const fn mmc_receive_interrupt_mask(&self) -> &MMC_RECEIVE_INTERRUPT_MASK { + &self.mmc_receive_interrupt_mask + } #[doc = "0x110 - MMC Transmit Interrupt Mask Register"] - pub mmc_transmit_interrupt_mask: MMC_TRANSMIT_INTERRUPT_MASK, + #[inline(always)] + pub const fn mmc_transmit_interrupt_mask(&self) -> &MMC_TRANSMIT_INTERRUPT_MASK { + &self.mmc_transmit_interrupt_mask + } #[doc = "0x114 - Transmit Octet Count for Good and Bad Frames Register"] - pub tx_octet_count_good_bad: TX_OCTET_COUNT_GOOD_BAD, + #[inline(always)] + pub const fn tx_octet_count_good_bad(&self) -> &TX_OCTET_COUNT_GOOD_BAD { + &self.tx_octet_count_good_bad + } #[doc = "0x118 - Transmit Frame Count for Goodand Bad Frames Register"] - pub tx_frame_count_good_bad: TX_FRAME_COUNT_GOOD_BAD, + #[inline(always)] + pub const fn tx_frame_count_good_bad(&self) -> &TX_FRAME_COUNT_GOOD_BAD { + &self.tx_frame_count_good_bad + } #[doc = "0x11c - Transmit Frame Count for Good Broadcast Frames"] - pub tx_broadcast_frames_good: TX_BROADCAST_FRAMES_GOOD, + #[inline(always)] + pub const fn tx_broadcast_frames_good(&self) -> &TX_BROADCAST_FRAMES_GOOD { + &self.tx_broadcast_frames_good + } #[doc = "0x120 - Transmit Frame Count for Good Multicast Frames"] - pub tx_multicast_frames_good: TX_MULTICAST_FRAMES_GOOD, + #[inline(always)] + pub const fn tx_multicast_frames_good(&self) -> &TX_MULTICAST_FRAMES_GOOD { + &self.tx_multicast_frames_good + } #[doc = "0x124 - Transmit Octet Count for Good and Bad 64 Byte Frames"] - pub tx_64octets_frames_good_bad: TX_64OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_64octets_frames_good_bad(&self) -> &TX_64OCTETS_FRAMES_GOOD_BAD { + &self.tx_64octets_frames_good_bad + } #[doc = "0x128 - Transmit Octet Count for Good and Bad 65 to 127 Bytes Frames"] - pub tx_65to127octets_frames_good_bad: TX_65TO127OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_65to127octets_frames_good_bad(&self) -> &TX_65TO127OCTETS_FRAMES_GOOD_BAD { + &self.tx_65to127octets_frames_good_bad + } #[doc = "0x12c - Transmit Octet Count for Good and Bad 128 to 255 Bytes Frames"] - pub tx_128to255octets_frames_good_bad: TX_128TO255OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_128to255octets_frames_good_bad(&self) -> &TX_128TO255OCTETS_FRAMES_GOOD_BAD { + &self.tx_128to255octets_frames_good_bad + } #[doc = "0x130 - Transmit Octet Count for Good and Bad 256 to 511 Bytes Frames"] - pub tx_256to511octets_frames_good_bad: TX_256TO511OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_256to511octets_frames_good_bad(&self) -> &TX_256TO511OCTETS_FRAMES_GOOD_BAD { + &self.tx_256to511octets_frames_good_bad + } #[doc = "0x134 - Transmit Octet Count for Good and Bad 512 to 1023 Bytes Frames"] - pub tx_512to1023octets_frames_good_bad: TX_512TO1023OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_512to1023octets_frames_good_bad(&self) -> &TX_512TO1023OCTETS_FRAMES_GOOD_BAD { + &self.tx_512to1023octets_frames_good_bad + } #[doc = "0x138 - Transmit Octet Count for Good and Bad 1024 to Maxsize Bytes Frames"] - pub tx_1024tomaxoctets_frames_good_bad: TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_1024tomaxoctets_frames_good_bad(&self) -> &TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD { + &self.tx_1024tomaxoctets_frames_good_bad + } #[doc = "0x13c - Transmit Frame Count for Good and Bad Unicast Frames"] - pub tx_unicast_frames_good_bad: TX_UNICAST_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_unicast_frames_good_bad(&self) -> &TX_UNICAST_FRAMES_GOOD_BAD { + &self.tx_unicast_frames_good_bad + } #[doc = "0x140 - Transmit Frame Count for Good and Bad Multicast Frames"] - pub tx_multicast_frames_good_bad: TX_MULTICAST_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_multicast_frames_good_bad(&self) -> &TX_MULTICAST_FRAMES_GOOD_BAD { + &self.tx_multicast_frames_good_bad + } #[doc = "0x144 - Transmit Frame Count for Good and Bad Broadcast Frames"] - pub tx_broadcast_frames_good_bad: TX_BROADCAST_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn tx_broadcast_frames_good_bad(&self) -> &TX_BROADCAST_FRAMES_GOOD_BAD { + &self.tx_broadcast_frames_good_bad + } #[doc = "0x148 - Transmit Frame Count for Underflow Error Frames"] - pub tx_underflow_error_frames: TX_UNDERFLOW_ERROR_FRAMES, + #[inline(always)] + pub const fn tx_underflow_error_frames(&self) -> &TX_UNDERFLOW_ERROR_FRAMES { + &self.tx_underflow_error_frames + } #[doc = "0x14c - Transmit Frame Count for Frames Transmitted after Single Collision"] - pub tx_single_collision_good_frames: TX_SINGLE_COLLISION_GOOD_FRAMES, + #[inline(always)] + pub const fn tx_single_collision_good_frames(&self) -> &TX_SINGLE_COLLISION_GOOD_FRAMES { + &self.tx_single_collision_good_frames + } #[doc = "0x150 - Transmit Frame Count for Frames Transmitted after Multiple Collision"] - pub tx_multiple_collision_good_frames: TX_MULTIPLE_COLLISION_GOOD_FRAMES, + #[inline(always)] + pub const fn tx_multiple_collision_good_frames(&self) -> &TX_MULTIPLE_COLLISION_GOOD_FRAMES { + &self.tx_multiple_collision_good_frames + } #[doc = "0x154 - Tx Deferred Frames Register"] - pub tx_deferred_frames: TX_DEFERRED_FRAMES, + #[inline(always)] + pub const fn tx_deferred_frames(&self) -> &TX_DEFERRED_FRAMES { + &self.tx_deferred_frames + } #[doc = "0x158 - Transmit Frame Count for Late Collision Error Frames"] - pub tx_late_collision_frames: TX_LATE_COLLISION_FRAMES, + #[inline(always)] + pub const fn tx_late_collision_frames(&self) -> &TX_LATE_COLLISION_FRAMES { + &self.tx_late_collision_frames + } #[doc = "0x15c - Transmit Frame Count for Excessive Collision Error Frames"] - pub tx_excessive_collision_frames: TX_EXCESSIVE_COLLISION_FRAMES, + #[inline(always)] + pub const fn tx_excessive_collision_frames(&self) -> &TX_EXCESSIVE_COLLISION_FRAMES { + &self.tx_excessive_collision_frames + } #[doc = "0x160 - Transmit Frame Count for Carrier Sense Error Frames"] - pub tx_carrier_error_frames: TX_CARRIER_ERROR_FRAMES, + #[inline(always)] + pub const fn tx_carrier_error_frames(&self) -> &TX_CARRIER_ERROR_FRAMES { + &self.tx_carrier_error_frames + } #[doc = "0x164 - Tx Octet Count Good Register"] - pub tx_octet_count_good: TX_OCTET_COUNT_GOOD, + #[inline(always)] + pub const fn tx_octet_count_good(&self) -> &TX_OCTET_COUNT_GOOD { + &self.tx_octet_count_good + } #[doc = "0x168 - Tx Frame Count Good Register"] - pub tx_frame_count_good: TX_FRAME_COUNT_GOOD, + #[inline(always)] + pub const fn tx_frame_count_good(&self) -> &TX_FRAME_COUNT_GOOD { + &self.tx_frame_count_good + } #[doc = "0x16c - Transmit Frame Count for Excessive Deferral Error Frames"] - pub tx_excessive_deferral_error: TX_EXCESSIVE_DEFERRAL_ERROR, + #[inline(always)] + pub const fn tx_excessive_deferral_error(&self) -> &TX_EXCESSIVE_DEFERRAL_ERROR { + &self.tx_excessive_deferral_error + } #[doc = "0x170 - Transmit Frame Count for Good PAUSE Frames"] - pub tx_pause_frames: TX_PAUSE_FRAMES, + #[inline(always)] + pub const fn tx_pause_frames(&self) -> &TX_PAUSE_FRAMES { + &self.tx_pause_frames + } #[doc = "0x174 - Transmit Frame Count for Good VLAN Frames"] - pub tx_vlan_frames_good: TX_VLAN_FRAMES_GOOD, + #[inline(always)] + pub const fn tx_vlan_frames_good(&self) -> &TX_VLAN_FRAMES_GOOD { + &self.tx_vlan_frames_good + } #[doc = "0x178 - Transmit Frame Count for Good Oversize Frames"] - pub tx_osize_frames_good: TX_OSIZE_FRAMES_GOOD, - _reserved53: [u8; 0x04], + #[inline(always)] + pub const fn tx_osize_frames_good(&self) -> &TX_OSIZE_FRAMES_GOOD { + &self.tx_osize_frames_good + } #[doc = "0x180 - Receive Frame Count for Good and Bad Frames"] - pub rx_frames_count_good_bad: RX_FRAMES_COUNT_GOOD_BAD, + #[inline(always)] + pub const fn rx_frames_count_good_bad(&self) -> &RX_FRAMES_COUNT_GOOD_BAD { + &self.rx_frames_count_good_bad + } #[doc = "0x184 - Receive Octet Count for Good and Bad Frames"] - pub rx_octet_count_good_bad: RX_OCTET_COUNT_GOOD_BAD, + #[inline(always)] + pub const fn rx_octet_count_good_bad(&self) -> &RX_OCTET_COUNT_GOOD_BAD { + &self.rx_octet_count_good_bad + } #[doc = "0x188 - Rx Octet Count Good Register"] - pub rx_octet_count_good: RX_OCTET_COUNT_GOOD, + #[inline(always)] + pub const fn rx_octet_count_good(&self) -> &RX_OCTET_COUNT_GOOD { + &self.rx_octet_count_good + } #[doc = "0x18c - Receive Frame Count for Good Broadcast Frames"] - pub rx_broadcast_frames_good: RX_BROADCAST_FRAMES_GOOD, + #[inline(always)] + pub const fn rx_broadcast_frames_good(&self) -> &RX_BROADCAST_FRAMES_GOOD { + &self.rx_broadcast_frames_good + } #[doc = "0x190 - Receive Frame Count for Good Multicast Frames"] - pub rx_multicast_frames_good: RX_MULTICAST_FRAMES_GOOD, + #[inline(always)] + pub const fn rx_multicast_frames_good(&self) -> &RX_MULTICAST_FRAMES_GOOD { + &self.rx_multicast_frames_good + } #[doc = "0x194 - Receive Frame Count for CRC Error Frames"] - pub rx_crc_error_frames: RX_CRC_ERROR_FRAMES, + #[inline(always)] + pub const fn rx_crc_error_frames(&self) -> &RX_CRC_ERROR_FRAMES { + &self.rx_crc_error_frames + } #[doc = "0x198 - Receive Frame Count for Alignment Error Frames"] - pub rx_alignment_error_frames: RX_ALIGNMENT_ERROR_FRAMES, + #[inline(always)] + pub const fn rx_alignment_error_frames(&self) -> &RX_ALIGNMENT_ERROR_FRAMES { + &self.rx_alignment_error_frames + } #[doc = "0x19c - Receive Frame Count for Runt Error Frames"] - pub rx_runt_error_frames: RX_RUNT_ERROR_FRAMES, + #[inline(always)] + pub const fn rx_runt_error_frames(&self) -> &RX_RUNT_ERROR_FRAMES { + &self.rx_runt_error_frames + } #[doc = "0x1a0 - Receive Frame Count for Jabber Error Frames"] - pub rx_jabber_error_frames: RX_JABBER_ERROR_FRAMES, + #[inline(always)] + pub const fn rx_jabber_error_frames(&self) -> &RX_JABBER_ERROR_FRAMES { + &self.rx_jabber_error_frames + } #[doc = "0x1a4 - Receive Frame Count for Undersize Frames"] - pub rx_undersize_frames_good: RX_UNDERSIZE_FRAMES_GOOD, + #[inline(always)] + pub const fn rx_undersize_frames_good(&self) -> &RX_UNDERSIZE_FRAMES_GOOD { + &self.rx_undersize_frames_good + } #[doc = "0x1a8 - Rx Oversize Frames Good Register"] - pub rx_oversize_frames_good: RX_OVERSIZE_FRAMES_GOOD, + #[inline(always)] + pub const fn rx_oversize_frames_good(&self) -> &RX_OVERSIZE_FRAMES_GOOD { + &self.rx_oversize_frames_good + } #[doc = "0x1ac - Receive Frame Count for Good and Bad 64 Byte Frames"] - pub rx_64octets_frames_good_bad: RX_64OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn rx_64octets_frames_good_bad(&self) -> &RX_64OCTETS_FRAMES_GOOD_BAD { + &self.rx_64octets_frames_good_bad + } #[doc = "0x1b0 - Receive Frame Count for Good and Bad 65 to 127 Bytes Frames"] - pub rx_65to127octets_frames_good_bad: RX_65TO127OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn rx_65to127octets_frames_good_bad(&self) -> &RX_65TO127OCTETS_FRAMES_GOOD_BAD { + &self.rx_65to127octets_frames_good_bad + } #[doc = "0x1b4 - Receive Frame Count for Good and Bad 128 to 255 Bytes Frames"] - pub rx_128to255octets_frames_good_bad: RX_128TO255OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn rx_128to255octets_frames_good_bad(&self) -> &RX_128TO255OCTETS_FRAMES_GOOD_BAD { + &self.rx_128to255octets_frames_good_bad + } #[doc = "0x1b8 - Receive Frame Count for Good and Bad 256 to 511 Bytes Frames"] - pub rx_256to511octets_frames_good_bad: RX_256TO511OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn rx_256to511octets_frames_good_bad(&self) -> &RX_256TO511OCTETS_FRAMES_GOOD_BAD { + &self.rx_256to511octets_frames_good_bad + } #[doc = "0x1bc - Receive Frame Count for Good and Bad 512 to 1,023 Bytes Frames"] - pub rx_512to1023octets_frames_good_bad: RX_512TO1023OCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn rx_512to1023octets_frames_good_bad(&self) -> &RX_512TO1023OCTETS_FRAMES_GOOD_BAD { + &self.rx_512to1023octets_frames_good_bad + } #[doc = "0x1c0 - Receive Frame Count for Good and Bad 1,024 to Maxsize Bytes Frames"] - pub rx_1024tomaxoctets_frames_good_bad: RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn rx_1024tomaxoctets_frames_good_bad(&self) -> &RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD { + &self.rx_1024tomaxoctets_frames_good_bad + } #[doc = "0x1c4 - Receive Frame Count for Good Unicast Frames"] - pub rx_unicast_frames_good: RX_UNICAST_FRAMES_GOOD, + #[inline(always)] + pub const fn rx_unicast_frames_good(&self) -> &RX_UNICAST_FRAMES_GOOD { + &self.rx_unicast_frames_good + } #[doc = "0x1c8 - Receive Frame Count for Length Error Frames"] - pub rx_length_error_frames: RX_LENGTH_ERROR_FRAMES, + #[inline(always)] + pub const fn rx_length_error_frames(&self) -> &RX_LENGTH_ERROR_FRAMES { + &self.rx_length_error_frames + } #[doc = "0x1cc - Receive Frame Count for Out of Range Frames"] - pub rx_out_of_range_type_frames: RX_OUT_OF_RANGE_TYPE_FRAMES, + #[inline(always)] + pub const fn rx_out_of_range_type_frames(&self) -> &RX_OUT_OF_RANGE_TYPE_FRAMES { + &self.rx_out_of_range_type_frames + } #[doc = "0x1d0 - Receive Frame Count for PAUSE Frames"] - pub rx_pause_frames: RX_PAUSE_FRAMES, + #[inline(always)] + pub const fn rx_pause_frames(&self) -> &RX_PAUSE_FRAMES { + &self.rx_pause_frames + } #[doc = "0x1d4 - Receive Frame Count for FIFO Overflow Frames"] - pub rx_fifo_overflow_frames: RX_FIFO_OVERFLOW_FRAMES, + #[inline(always)] + pub const fn rx_fifo_overflow_frames(&self) -> &RX_FIFO_OVERFLOW_FRAMES { + &self.rx_fifo_overflow_frames + } #[doc = "0x1d8 - Receive Frame Count for Good and Bad VLAN Frames"] - pub rx_vlan_frames_good_bad: RX_VLAN_FRAMES_GOOD_BAD, + #[inline(always)] + pub const fn rx_vlan_frames_good_bad(&self) -> &RX_VLAN_FRAMES_GOOD_BAD { + &self.rx_vlan_frames_good_bad + } #[doc = "0x1dc - Receive Frame Count for Watchdog Error Frames"] - pub rx_watchdog_error_frames: RX_WATCHDOG_ERROR_FRAMES, + #[inline(always)] + pub const fn rx_watchdog_error_frames(&self) -> &RX_WATCHDOG_ERROR_FRAMES { + &self.rx_watchdog_error_frames + } #[doc = "0x1e0 - Receive Frame Count for Receive Error Frames"] - pub rx_receive_error_frames: RX_RECEIVE_ERROR_FRAMES, + #[inline(always)] + pub const fn rx_receive_error_frames(&self) -> &RX_RECEIVE_ERROR_FRAMES { + &self.rx_receive_error_frames + } #[doc = "0x1e4 - Receive Frame Count for Good Control Frames Frames"] - pub rx_control_frames_good: RX_CONTROL_FRAMES_GOOD, - _reserved79: [u8; 0x18], + #[inline(always)] + pub const fn rx_control_frames_good(&self) -> &RX_CONTROL_FRAMES_GOOD { + &self.rx_control_frames_good + } #[doc = "0x200 - MMC Receive Checksum Offload Interrupt Mask Register"] - pub mmc_ipc_receive_interrupt_mask: MMC_IPC_RECEIVE_INTERRUPT_MASK, - _reserved80: [u8; 0x04], + #[inline(always)] + pub const fn mmc_ipc_receive_interrupt_mask(&self) -> &MMC_IPC_RECEIVE_INTERRUPT_MASK { + &self.mmc_ipc_receive_interrupt_mask + } #[doc = "0x208 - MMC Receive Checksum Offload Interrupt Register"] - pub mmc_ipc_receive_interrupt: MMC_IPC_RECEIVE_INTERRUPT, - _reserved81: [u8; 0x04], + #[inline(always)] + pub const fn mmc_ipc_receive_interrupt(&self) -> &MMC_IPC_RECEIVE_INTERRUPT { + &self.mmc_ipc_receive_interrupt + } #[doc = "0x210 - RxIPv4 Good Frames Register"] - pub rxipv4_good_frames: RXIPV4_GOOD_FRAMES, + #[inline(always)] + pub const fn rxipv4_good_frames(&self) -> &RXIPV4_GOOD_FRAMES { + &self.rxipv4_good_frames + } #[doc = "0x214 - Receive IPV4 Header Error Frame Counter Register"] - pub rxipv4_header_error_frames: RXIPV4_HEADER_ERROR_FRAMES, + #[inline(always)] + pub const fn rxipv4_header_error_frames(&self) -> &RXIPV4_HEADER_ERROR_FRAMES { + &self.rxipv4_header_error_frames + } #[doc = "0x218 - Receive IPV4 No Payload Frame Counter Register"] - pub rxipv4_no_payload_frames: RXIPV4_NO_PAYLOAD_FRAMES, + #[inline(always)] + pub const fn rxipv4_no_payload_frames(&self) -> &RXIPV4_NO_PAYLOAD_FRAMES { + &self.rxipv4_no_payload_frames + } #[doc = "0x21c - Receive IPV4 Fragmented Frame Counter Register"] - pub rxipv4_fragmented_frames: RXIPV4_FRAGMENTED_FRAMES, + #[inline(always)] + pub const fn rxipv4_fragmented_frames(&self) -> &RXIPV4_FRAGMENTED_FRAMES { + &self.rxipv4_fragmented_frames + } #[doc = "0x220 - Receive IPV4 UDP Checksum Disabled Frame Counter Register"] - pub rxipv4_udp_checksum_disabled_frames: RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES, + #[inline(always)] + pub const fn rxipv4_udp_checksum_disabled_frames(&self) -> &RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES { + &self.rxipv4_udp_checksum_disabled_frames + } #[doc = "0x224 - RxIPv6 Good Frames Register"] - pub rxipv6_good_frames: RXIPV6_GOOD_FRAMES, + #[inline(always)] + pub const fn rxipv6_good_frames(&self) -> &RXIPV6_GOOD_FRAMES { + &self.rxipv6_good_frames + } #[doc = "0x228 - Receive IPV6 Header Error Frame Counter Register"] - pub rxipv6_header_error_frames: RXIPV6_HEADER_ERROR_FRAMES, + #[inline(always)] + pub const fn rxipv6_header_error_frames(&self) -> &RXIPV6_HEADER_ERROR_FRAMES { + &self.rxipv6_header_error_frames + } #[doc = "0x22c - Receive IPV6 No Payload Frame Counter Register"] - pub rxipv6_no_payload_frames: RXIPV6_NO_PAYLOAD_FRAMES, + #[inline(always)] + pub const fn rxipv6_no_payload_frames(&self) -> &RXIPV6_NO_PAYLOAD_FRAMES { + &self.rxipv6_no_payload_frames + } #[doc = "0x230 - RxUDP Good Frames Register"] - pub rxudp_good_frames: RXUDP_GOOD_FRAMES, + #[inline(always)] + pub const fn rxudp_good_frames(&self) -> &RXUDP_GOOD_FRAMES { + &self.rxudp_good_frames + } #[doc = "0x234 - RxUDP Error Frames Register"] - pub rxudp_error_frames: RXUDP_ERROR_FRAMES, + #[inline(always)] + pub const fn rxudp_error_frames(&self) -> &RXUDP_ERROR_FRAMES { + &self.rxudp_error_frames + } #[doc = "0x238 - RxTCP Good Frames Register"] - pub rxtcp_good_frames: RXTCP_GOOD_FRAMES, + #[inline(always)] + pub const fn rxtcp_good_frames(&self) -> &RXTCP_GOOD_FRAMES { + &self.rxtcp_good_frames + } #[doc = "0x23c - RxTCP Error Frames Register"] - pub rxtcp_error_frames: RXTCP_ERROR_FRAMES, + #[inline(always)] + pub const fn rxtcp_error_frames(&self) -> &RXTCP_ERROR_FRAMES { + &self.rxtcp_error_frames + } #[doc = "0x240 - RxICMP Good Frames Register"] - pub rxicmp_good_frames: RXICMP_GOOD_FRAMES, + #[inline(always)] + pub const fn rxicmp_good_frames(&self) -> &RXICMP_GOOD_FRAMES { + &self.rxicmp_good_frames + } #[doc = "0x244 - RxICMP Error Frames Register"] - pub rxicmp_error_frames: RXICMP_ERROR_FRAMES, - _reserved95: [u8; 0x08], + #[inline(always)] + pub const fn rxicmp_error_frames(&self) -> &RXICMP_ERROR_FRAMES { + &self.rxicmp_error_frames + } #[doc = "0x250 - RxIPv4 Good Octets Register"] - pub rxipv4_good_octets: RXIPV4_GOOD_OCTETS, + #[inline(always)] + pub const fn rxipv4_good_octets(&self) -> &RXIPV4_GOOD_OCTETS { + &self.rxipv4_good_octets + } #[doc = "0x254 - Receive IPV4 Header Error Octet Counter Register"] - pub rxipv4_header_error_octets: RXIPV4_HEADER_ERROR_OCTETS, + #[inline(always)] + pub const fn rxipv4_header_error_octets(&self) -> &RXIPV4_HEADER_ERROR_OCTETS { + &self.rxipv4_header_error_octets + } #[doc = "0x258 - Receive IPV4 No Payload Octet Counter Register"] - pub rxipv4_no_payload_octets: RXIPV4_NO_PAYLOAD_OCTETS, + #[inline(always)] + pub const fn rxipv4_no_payload_octets(&self) -> &RXIPV4_NO_PAYLOAD_OCTETS { + &self.rxipv4_no_payload_octets + } #[doc = "0x25c - Receive IPV4 Fragmented Octet Counter Register"] - pub rxipv4_fragmented_octets: RXIPV4_FRAGMENTED_OCTETS, + #[inline(always)] + pub const fn rxipv4_fragmented_octets(&self) -> &RXIPV4_FRAGMENTED_OCTETS { + &self.rxipv4_fragmented_octets + } #[doc = "0x260 - Receive IPV4 Fragmented Octet Counter Register"] - pub rxipv4_udp_checksum_disable_octets: RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS, + #[inline(always)] + pub const fn rxipv4_udp_checksum_disable_octets(&self) -> &RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS { + &self.rxipv4_udp_checksum_disable_octets + } #[doc = "0x264 - RxIPv6 Good Octets Register"] - pub rxipv6_good_octets: RXIPV6_GOOD_OCTETS, + #[inline(always)] + pub const fn rxipv6_good_octets(&self) -> &RXIPV6_GOOD_OCTETS { + &self.rxipv6_good_octets + } #[doc = "0x268 - Receive IPV6 Header Error Octet Counter Register"] - pub rxipv6_header_error_octets: RXIPV6_HEADER_ERROR_OCTETS, + #[inline(always)] + pub const fn rxipv6_header_error_octets(&self) -> &RXIPV6_HEADER_ERROR_OCTETS { + &self.rxipv6_header_error_octets + } #[doc = "0x26c - Receive IPV6 No Payload Octet Counter Register"] - pub rxipv6_no_payload_octets: RXIPV6_NO_PAYLOAD_OCTETS, + #[inline(always)] + pub const fn rxipv6_no_payload_octets(&self) -> &RXIPV6_NO_PAYLOAD_OCTETS { + &self.rxipv6_no_payload_octets + } #[doc = "0x270 - Receive UDP Good Octets Register"] - pub rxudp_good_octets: RXUDP_GOOD_OCTETS, + #[inline(always)] + pub const fn rxudp_good_octets(&self) -> &RXUDP_GOOD_OCTETS { + &self.rxudp_good_octets + } #[doc = "0x274 - Receive UDP Error Octets Register"] - pub rxudp_error_octets: RXUDP_ERROR_OCTETS, + #[inline(always)] + pub const fn rxudp_error_octets(&self) -> &RXUDP_ERROR_OCTETS { + &self.rxudp_error_octets + } #[doc = "0x278 - Receive TCP Good Octets Register"] - pub rxtcp_good_octets: RXTCP_GOOD_OCTETS, + #[inline(always)] + pub const fn rxtcp_good_octets(&self) -> &RXTCP_GOOD_OCTETS { + &self.rxtcp_good_octets + } #[doc = "0x27c - Receive TCP Error Octets Register"] - pub rxtcp_error_octets: RXTCP_ERROR_OCTETS, + #[inline(always)] + pub const fn rxtcp_error_octets(&self) -> &RXTCP_ERROR_OCTETS { + &self.rxtcp_error_octets + } #[doc = "0x280 - Receive ICMP Good Octets Register"] - pub rxicmp_good_octets: RXICMP_GOOD_OCTETS, + #[inline(always)] + pub const fn rxicmp_good_octets(&self) -> &RXICMP_GOOD_OCTETS { + &self.rxicmp_good_octets + } #[doc = "0x284 - Receive ICMP Error Octets Register"] - pub rxicmp_error_octets: RXICMP_ERROR_OCTETS, - _reserved109: [u8; 0x0478], + #[inline(always)] + pub const fn rxicmp_error_octets(&self) -> &RXICMP_ERROR_OCTETS { + &self.rxicmp_error_octets + } #[doc = "0x700 - Timestamp Control Register"] - pub timestamp_control: TIMESTAMP_CONTROL, + #[inline(always)] + pub const fn timestamp_control(&self) -> &TIMESTAMP_CONTROL { + &self.timestamp_control + } #[doc = "0x704 - Sub-Second Increment Register"] - pub sub_second_increment: SUB_SECOND_INCREMENT, + #[inline(always)] + pub const fn sub_second_increment(&self) -> &SUB_SECOND_INCREMENT { + &self.sub_second_increment + } #[doc = "0x708 - System Time - Seconds Register"] - pub system_time_seconds: SYSTEM_TIME_SECONDS, + #[inline(always)] + pub const fn system_time_seconds(&self) -> &SYSTEM_TIME_SECONDS { + &self.system_time_seconds + } #[doc = "0x70c - System Time Nanoseconds Register"] - pub system_time_nanoseconds: SYSTEM_TIME_NANOSECONDS, + #[inline(always)] + pub const fn system_time_nanoseconds(&self) -> &SYSTEM_TIME_NANOSECONDS { + &self.system_time_nanoseconds + } #[doc = "0x710 - System Time - Seconds Update Register"] - pub system_time_seconds_update: SYSTEM_TIME_SECONDS_UPDATE, + #[inline(always)] + pub const fn system_time_seconds_update(&self) -> &SYSTEM_TIME_SECONDS_UPDATE { + &self.system_time_seconds_update + } #[doc = "0x714 - System Time Nanoseconds Update Register"] - pub system_time_nanoseconds_update: SYSTEM_TIME_NANOSECONDS_UPDATE, + #[inline(always)] + pub const fn system_time_nanoseconds_update(&self) -> &SYSTEM_TIME_NANOSECONDS_UPDATE { + &self.system_time_nanoseconds_update + } #[doc = "0x718 - Timestamp Addend Register"] - pub timestamp_addend: TIMESTAMP_ADDEND, + #[inline(always)] + pub const fn timestamp_addend(&self) -> &TIMESTAMP_ADDEND { + &self.timestamp_addend + } #[doc = "0x71c - Target Time Seconds Register"] - pub target_time_seconds: TARGET_TIME_SECONDS, + #[inline(always)] + pub const fn target_time_seconds(&self) -> &TARGET_TIME_SECONDS { + &self.target_time_seconds + } #[doc = "0x720 - Target Time Nanoseconds Register"] - pub target_time_nanoseconds: TARGET_TIME_NANOSECONDS, + #[inline(always)] + pub const fn target_time_nanoseconds(&self) -> &TARGET_TIME_NANOSECONDS { + &self.target_time_nanoseconds + } #[doc = "0x724 - System Time - Higher Word Seconds Register"] - pub system_time_higher_word_seconds: SYSTEM_TIME_HIGHER_WORD_SECONDS, + #[inline(always)] + pub const fn system_time_higher_word_seconds(&self) -> &SYSTEM_TIME_HIGHER_WORD_SECONDS { + &self.system_time_higher_word_seconds + } #[doc = "0x728 - Timestamp Status Register"] - pub timestamp_status: TIMESTAMP_STATUS, + #[inline(always)] + pub const fn timestamp_status(&self) -> &TIMESTAMP_STATUS { + &self.timestamp_status + } #[doc = "0x72c - PPS Control Register"] - pub pps_control: PPS_CONTROL, - _reserved121: [u8; 0x08d0], + #[inline(always)] + pub const fn pps_control(&self) -> &PPS_CONTROL { + &self.pps_control + } #[doc = "0x1000 - Bus Mode Register"] - pub bus_mode: BUS_MODE, + #[inline(always)] + pub const fn bus_mode(&self) -> &BUS_MODE { + &self.bus_mode + } #[doc = "0x1004 - Transmit Poll Demand Register"] - pub transmit_poll_demand: TRANSMIT_POLL_DEMAND, + #[inline(always)] + pub const fn transmit_poll_demand(&self) -> &TRANSMIT_POLL_DEMAND { + &self.transmit_poll_demand + } #[doc = "0x1008 - Receive Poll Demand Register"] - pub receive_poll_demand: RECEIVE_POLL_DEMAND, + #[inline(always)] + pub const fn receive_poll_demand(&self) -> &RECEIVE_POLL_DEMAND { + &self.receive_poll_demand + } #[doc = "0x100c - Receive Descriptor Address Register"] - pub receive_descriptor_list_address: RECEIVE_DESCRIPTOR_LIST_ADDRESS, + #[inline(always)] + pub const fn receive_descriptor_list_address(&self) -> &RECEIVE_DESCRIPTOR_LIST_ADDRESS { + &self.receive_descriptor_list_address + } #[doc = "0x1010 - Transmit descripter Address Register"] - pub transmit_descriptor_list_address: TRANSMIT_DESCRIPTOR_LIST_ADDRESS, + #[inline(always)] + pub const fn transmit_descriptor_list_address(&self) -> &TRANSMIT_DESCRIPTOR_LIST_ADDRESS { + &self.transmit_descriptor_list_address + } #[doc = "0x1014 - Status Register"] - pub status: STATUS, + #[inline(always)] + pub const fn status(&self) -> &STATUS { + &self.status + } #[doc = "0x1018 - Operation Mode Register"] - pub operation_mode: OPERATION_MODE, + #[inline(always)] + pub const fn operation_mode(&self) -> &OPERATION_MODE { + &self.operation_mode + } #[doc = "0x101c - Interrupt Enable Register"] - pub interrupt_enable: INTERRUPT_ENABLE, + #[inline(always)] + pub const fn interrupt_enable(&self) -> &INTERRUPT_ENABLE { + &self.interrupt_enable + } #[doc = "0x1020 - Missed Frame and Buffer Overflow Counter Register"] - pub missed_frame_and_buffer_overflow_counter: MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER, + #[inline(always)] + pub const fn missed_frame_and_buffer_overflow_counter(&self) -> &MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER { + &self.missed_frame_and_buffer_overflow_counter + } #[doc = "0x1024 - Receive Interrupt Watchdog Timer Register"] - pub receive_interrupt_watchdog_timer: RECEIVE_INTERRUPT_WATCHDOG_TIMER, - _reserved131: [u8; 0x04], + #[inline(always)] + pub const fn receive_interrupt_watchdog_timer(&self) -> &RECEIVE_INTERRUPT_WATCHDOG_TIMER { + &self.receive_interrupt_watchdog_timer + } #[doc = "0x102c - AHB Status Register"] - pub ahb_status: AHB_STATUS, - _reserved132: [u8; 0x18], + #[inline(always)] + pub const fn ahb_status(&self) -> &AHB_STATUS { + &self.ahb_status + } #[doc = "0x1048 - Current Host Transmit Descriptor Register"] - pub current_host_transmit_descriptor: CURRENT_HOST_TRANSMIT_DESCRIPTOR, + #[inline(always)] + pub const fn current_host_transmit_descriptor(&self) -> &CURRENT_HOST_TRANSMIT_DESCRIPTOR { + &self.current_host_transmit_descriptor + } #[doc = "0x104c - Current Host Receive Descriptor Register"] - pub current_host_receive_descriptor: CURRENT_HOST_RECEIVE_DESCRIPTOR, + #[inline(always)] + pub const fn current_host_receive_descriptor(&self) -> &CURRENT_HOST_RECEIVE_DESCRIPTOR { + &self.current_host_receive_descriptor + } #[doc = "0x1050 - Current Host Transmit Buffer Address Register"] - pub current_host_transmit_buffer_address: CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS, + #[inline(always)] + pub const fn current_host_transmit_buffer_address(&self) -> &CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS { + &self.current_host_transmit_buffer_address + } #[doc = "0x1054 - Current Host Receive Buffer Address Register"] - pub current_host_receive_buffer_address: CURRENT_HOST_RECEIVE_BUFFER_ADDRESS, + #[inline(always)] + pub const fn current_host_receive_buffer_address(&self) -> &CURRENT_HOST_RECEIVE_BUFFER_ADDRESS { + &self.current_host_receive_buffer_address + } #[doc = "0x1058 - HW Feature Register"] - pub hw_feature: HW_FEATURE, + #[inline(always)] + pub const fn hw_feature(&self) -> &HW_FEATURE { + &self.hw_feature + } } -#[doc = "MAC_CONFIGURATION (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_CONFIGURATION (rw) register accessor: MAC Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_configuration::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_configuration::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_configuration`] +module"] pub type MAC_CONFIGURATION = crate::Reg; #[doc = "MAC Configuration Register"] pub mod mac_configuration; -#[doc = "MAC_FRAME_FILTER (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_FRAME_FILTER (rw) register accessor: MAC Frame Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_frame_filter::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_frame_filter::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_frame_filter`] +module"] pub type MAC_FRAME_FILTER = crate::Reg; #[doc = "MAC Frame Filter"] pub mod mac_frame_filter; -#[doc = "HASH_TABLE_HIGH (rw) register accessor: an alias for `Reg`"] +#[doc = "HASH_TABLE_HIGH (rw) register accessor: Hash Table High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hash_table_high::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hash_table_high::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hash_table_high`] +module"] pub type HASH_TABLE_HIGH = crate::Reg; #[doc = "Hash Table High Register"] pub mod hash_table_high; -#[doc = "HASH_TABLE_LOW (rw) register accessor: an alias for `Reg`"] +#[doc = "HASH_TABLE_LOW (rw) register accessor: Hash Table Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hash_table_low::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hash_table_low::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hash_table_low`] +module"] pub type HASH_TABLE_LOW = crate::Reg; #[doc = "Hash Table Low Register"] pub mod hash_table_low; -#[doc = "GMII_ADDRESS (rw) register accessor: an alias for `Reg`"] +#[doc = "GMII_ADDRESS (rw) register accessor: MII Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gmii_address::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gmii_address::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gmii_address`] +module"] pub type GMII_ADDRESS = crate::Reg; #[doc = "MII Address Register"] pub mod gmii_address; -#[doc = "GMII_DATA (rw) register accessor: an alias for `Reg`"] +#[doc = "GMII_DATA (rw) register accessor: MII Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gmii_data::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gmii_data::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gmii_data`] +module"] pub type GMII_DATA = crate::Reg; #[doc = "MII Data Register"] pub mod gmii_data; -#[doc = "FLOW_CONTROL (rw) register accessor: an alias for `Reg`"] +#[doc = "FLOW_CONTROL (rw) register accessor: Flow Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`flow_control::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`flow_control::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@flow_control`] +module"] pub type FLOW_CONTROL = crate::Reg; #[doc = "Flow Control Register"] pub mod flow_control; -#[doc = "VLAN_TAG (rw) register accessor: an alias for `Reg`"] +#[doc = "VLAN_TAG (rw) register accessor: VLAN Tag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`vlan_tag::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`vlan_tag::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@vlan_tag`] +module"] pub type VLAN_TAG = crate::Reg; #[doc = "VLAN Tag Register"] pub mod vlan_tag; -#[doc = "VERSION (r) register accessor: an alias for `Reg`"] +#[doc = "VERSION (r) register accessor: Version Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`version::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@version`] +module"] pub type VERSION = crate::Reg; #[doc = "Version Register"] pub mod version; -#[doc = "DEBUG (r) register accessor: an alias for `Reg`"] +#[doc = "DEBUG (r) register accessor: Debug Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`debug::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@debug`] +module"] pub type DEBUG = crate::Reg; #[doc = "Debug Register"] pub mod debug; -#[doc = "REMOTE_WAKE_UP_FRAME_FILTER (rw) register accessor: an alias for `Reg`"] +#[doc = "REMOTE_WAKE_UP_FRAME_FILTER (rw) register accessor: Remote Wake Up Frame Filter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`remote_wake_up_frame_filter::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`remote_wake_up_frame_filter::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@remote_wake_up_frame_filter`] +module"] pub type REMOTE_WAKE_UP_FRAME_FILTER = crate::Reg; #[doc = "Remote Wake Up Frame Filter Register"] pub mod remote_wake_up_frame_filter; -#[doc = "PMT_CONTROL_STATUS (rw) register accessor: an alias for `Reg`"] +#[doc = "PMT_CONTROL_STATUS (rw) register accessor: PMT Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pmt_control_status::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pmt_control_status::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmt_control_status`] +module"] pub type PMT_CONTROL_STATUS = crate::Reg; #[doc = "PMT Control and Status Register"] pub mod pmt_control_status; -#[doc = "INTERRUPT_STATUS (r) register accessor: an alias for `Reg`"] +#[doc = "INTERRUPT_STATUS (r) register accessor: Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`interrupt_status::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@interrupt_status`] +module"] pub type INTERRUPT_STATUS = crate::Reg; #[doc = "Interrupt Register"] pub mod interrupt_status; -#[doc = "INTERRUPT_MASK (rw) register accessor: an alias for `Reg`"] +#[doc = "INTERRUPT_MASK (rw) register accessor: Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`interrupt_mask::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`interrupt_mask::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@interrupt_mask`] +module"] pub type INTERRUPT_MASK = crate::Reg; #[doc = "Interrupt Mask Register"] pub mod interrupt_mask; -#[doc = "MAC_ADDRESS0_HIGH (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_ADDRESS0_HIGH (rw) register accessor: MAC Address0 High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address0_high::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address0_high::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_address0_high`] +module"] pub type MAC_ADDRESS0_HIGH = crate::Reg; #[doc = "MAC Address0 High Register"] pub mod mac_address0_high; -#[doc = "MAC_ADDRESS0_LOW (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_ADDRESS0_LOW (rw) register accessor: MAC Address0 Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address0_low::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address0_low::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_address0_low`] +module"] pub type MAC_ADDRESS0_LOW = crate::Reg; #[doc = "MAC Address0 Low Register"] pub mod mac_address0_low; -#[doc = "MAC_ADDRESS1_HIGH (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_ADDRESS1_HIGH (rw) register accessor: MAC Address1 High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address1_high::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address1_high::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_address1_high`] +module"] pub type MAC_ADDRESS1_HIGH = crate::Reg; #[doc = "MAC Address1 High Register"] pub mod mac_address1_high; -#[doc = "MAC_ADDRESS1_LOW (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_ADDRESS1_LOW (rw) register accessor: MAC Address1 Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address1_low::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address1_low::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_address1_low`] +module"] pub type MAC_ADDRESS1_LOW = crate::Reg; #[doc = "MAC Address1 Low Register"] pub mod mac_address1_low; -#[doc = "MAC_ADDRESS2_HIGH (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_ADDRESS2_HIGH (rw) register accessor: MAC Address2 High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address2_high::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address2_high::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_address2_high`] +module"] pub type MAC_ADDRESS2_HIGH = crate::Reg; #[doc = "MAC Address2 High Register"] pub mod mac_address2_high; -#[doc = "MAC_ADDRESS2_LOW (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_ADDRESS2_LOW (rw) register accessor: MAC Address2 Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address2_low::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address2_low::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_address2_low`] +module"] pub type MAC_ADDRESS2_LOW = crate::Reg; #[doc = "MAC Address2 Low Register"] pub mod mac_address2_low; -#[doc = "MAC_ADDRESS3_HIGH (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_ADDRESS3_HIGH (rw) register accessor: MAC Address3 High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address3_high::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address3_high::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_address3_high`] +module"] pub type MAC_ADDRESS3_HIGH = crate::Reg; #[doc = "MAC Address3 High Register"] pub mod mac_address3_high; -#[doc = "MAC_ADDRESS3_LOW (rw) register accessor: an alias for `Reg`"] +#[doc = "MAC_ADDRESS3_LOW (rw) register accessor: MAC Address3 Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address3_low::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address3_low::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mac_address3_low`] +module"] pub type MAC_ADDRESS3_LOW = crate::Reg; #[doc = "MAC Address3 Low Register"] pub mod mac_address3_low; -#[doc = "MMC_CONTROL (rw) register accessor: an alias for `Reg`"] +#[doc = "MMC_CONTROL (rw) register accessor: MMC Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_control::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmc_control::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mmc_control`] +module"] pub type MMC_CONTROL = crate::Reg; #[doc = "MMC Control Register"] pub mod mmc_control; -#[doc = "MMC_RECEIVE_INTERRUPT (r) register accessor: an alias for `Reg`"] +#[doc = "MMC_RECEIVE_INTERRUPT (r) register accessor: MMC Receive Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_receive_interrupt::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mmc_receive_interrupt`] +module"] pub type MMC_RECEIVE_INTERRUPT = crate::Reg; #[doc = "MMC Receive Interrupt Register"] pub mod mmc_receive_interrupt; -#[doc = "MMC_TRANSMIT_INTERRUPT (r) register accessor: an alias for `Reg`"] +#[doc = "MMC_TRANSMIT_INTERRUPT (r) register accessor: MMC Transmit Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_transmit_interrupt::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mmc_transmit_interrupt`] +module"] pub type MMC_TRANSMIT_INTERRUPT = crate::Reg; #[doc = "MMC Transmit Interrupt Register"] pub mod mmc_transmit_interrupt; -#[doc = "MMC_RECEIVE_INTERRUPT_MASK (rw) register accessor: an alias for `Reg`"] +#[doc = "MMC_RECEIVE_INTERRUPT_MASK (rw) register accessor: MMC Reveive Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_receive_interrupt_mask::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmc_receive_interrupt_mask::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mmc_receive_interrupt_mask`] +module"] pub type MMC_RECEIVE_INTERRUPT_MASK = crate::Reg; #[doc = "MMC Reveive Interrupt Mask Register"] pub mod mmc_receive_interrupt_mask; -#[doc = "MMC_TRANSMIT_INTERRUPT_MASK (rw) register accessor: an alias for `Reg`"] +#[doc = "MMC_TRANSMIT_INTERRUPT_MASK (rw) register accessor: MMC Transmit Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_transmit_interrupt_mask::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmc_transmit_interrupt_mask::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mmc_transmit_interrupt_mask`] +module"] pub type MMC_TRANSMIT_INTERRUPT_MASK = crate::Reg; #[doc = "MMC Transmit Interrupt Mask Register"] pub mod mmc_transmit_interrupt_mask; -#[doc = "TX_OCTET_COUNT_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_OCTET_COUNT_GOOD_BAD (r) register accessor: Transmit Octet Count for Good and Bad Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_octet_count_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_octet_count_good_bad`] +module"] pub type TX_OCTET_COUNT_GOOD_BAD = crate::Reg; #[doc = "Transmit Octet Count for Good and Bad Frames Register"] pub mod tx_octet_count_good_bad; -#[doc = "TX_FRAME_COUNT_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_FRAME_COUNT_GOOD_BAD (r) register accessor: Transmit Frame Count for Goodand Bad Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_frame_count_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_frame_count_good_bad`] +module"] pub type TX_FRAME_COUNT_GOOD_BAD = crate::Reg; #[doc = "Transmit Frame Count for Goodand Bad Frames Register"] pub mod tx_frame_count_good_bad; -#[doc = "TX_BROADCAST_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_BROADCAST_FRAMES_GOOD (r) register accessor: Transmit Frame Count for Good Broadcast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_broadcast_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_broadcast_frames_good`] +module"] pub type TX_BROADCAST_FRAMES_GOOD = crate::Reg; #[doc = "Transmit Frame Count for Good Broadcast Frames"] pub mod tx_broadcast_frames_good; -#[doc = "TX_MULTICAST_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_MULTICAST_FRAMES_GOOD (r) register accessor: Transmit Frame Count for Good Multicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_multicast_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_multicast_frames_good`] +module"] pub type TX_MULTICAST_FRAMES_GOOD = crate::Reg; #[doc = "Transmit Frame Count for Good Multicast Frames"] pub mod tx_multicast_frames_good; -#[doc = "TX_64OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_64OCTETS_FRAMES_GOOD_BAD (r) register accessor: Transmit Octet Count for Good and Bad 64 Byte Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_64octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_64octets_frames_good_bad`] +module"] pub type TX_64OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Octet Count for Good and Bad 64 Byte Frames"] pub mod tx_64octets_frames_good_bad; -#[doc = "TX_65TO127OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_65TO127OCTETS_FRAMES_GOOD_BAD (r) register accessor: Transmit Octet Count for Good and Bad 65 to 127 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_65to127octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_65to127octets_frames_good_bad`] +module"] pub type TX_65TO127OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Octet Count for Good and Bad 65 to 127 Bytes Frames"] pub mod tx_65to127octets_frames_good_bad; -#[doc = "TX_128TO255OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_128TO255OCTETS_FRAMES_GOOD_BAD (r) register accessor: Transmit Octet Count for Good and Bad 128 to 255 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_128to255octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_128to255octets_frames_good_bad`] +module"] pub type TX_128TO255OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Octet Count for Good and Bad 128 to 255 Bytes Frames"] pub mod tx_128to255octets_frames_good_bad; -#[doc = "TX_256TO511OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_256TO511OCTETS_FRAMES_GOOD_BAD (r) register accessor: Transmit Octet Count for Good and Bad 256 to 511 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_256to511octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_256to511octets_frames_good_bad`] +module"] pub type TX_256TO511OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Octet Count for Good and Bad 256 to 511 Bytes Frames"] pub mod tx_256to511octets_frames_good_bad; -#[doc = "TX_512TO1023OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_512TO1023OCTETS_FRAMES_GOOD_BAD (r) register accessor: Transmit Octet Count for Good and Bad 512 to 1023 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_512to1023octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_512to1023octets_frames_good_bad`] +module"] pub type TX_512TO1023OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Octet Count for Good and Bad 512 to 1023 Bytes Frames"] pub mod tx_512to1023octets_frames_good_bad; -#[doc = "TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD (r) register accessor: Transmit Octet Count for Good and Bad 1024 to Maxsize Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_1024tomaxoctets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_1024tomaxoctets_frames_good_bad`] +module"] pub type TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Octet Count for Good and Bad 1024 to Maxsize Bytes Frames"] pub mod tx_1024tomaxoctets_frames_good_bad; -#[doc = "TX_UNICAST_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_UNICAST_FRAMES_GOOD_BAD (r) register accessor: Transmit Frame Count for Good and Bad Unicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_unicast_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_unicast_frames_good_bad`] +module"] pub type TX_UNICAST_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Frame Count for Good and Bad Unicast Frames"] pub mod tx_unicast_frames_good_bad; -#[doc = "TX_MULTICAST_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_MULTICAST_FRAMES_GOOD_BAD (r) register accessor: Transmit Frame Count for Good and Bad Multicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_multicast_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_multicast_frames_good_bad`] +module"] pub type TX_MULTICAST_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Frame Count for Good and Bad Multicast Frames"] pub mod tx_multicast_frames_good_bad; -#[doc = "TX_BROADCAST_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_BROADCAST_FRAMES_GOOD_BAD (r) register accessor: Transmit Frame Count for Good and Bad Broadcast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_broadcast_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_broadcast_frames_good_bad`] +module"] pub type TX_BROADCAST_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Transmit Frame Count for Good and Bad Broadcast Frames"] pub mod tx_broadcast_frames_good_bad; -#[doc = "TX_UNDERFLOW_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "TX_UNDERFLOW_ERROR_FRAMES (r) register accessor: Transmit Frame Count for Underflow Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_underflow_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_underflow_error_frames`] +module"] pub type TX_UNDERFLOW_ERROR_FRAMES = crate::Reg; #[doc = "Transmit Frame Count for Underflow Error Frames"] pub mod tx_underflow_error_frames; -#[doc = "TX_SINGLE_COLLISION_GOOD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "TX_SINGLE_COLLISION_GOOD_FRAMES (r) register accessor: Transmit Frame Count for Frames Transmitted after Single Collision\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_single_collision_good_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_single_collision_good_frames`] +module"] pub type TX_SINGLE_COLLISION_GOOD_FRAMES = crate::Reg; #[doc = "Transmit Frame Count for Frames Transmitted after Single Collision"] pub mod tx_single_collision_good_frames; -#[doc = "TX_MULTIPLE_COLLISION_GOOD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "TX_MULTIPLE_COLLISION_GOOD_FRAMES (r) register accessor: Transmit Frame Count for Frames Transmitted after Multiple Collision\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_multiple_collision_good_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_multiple_collision_good_frames`] +module"] pub type TX_MULTIPLE_COLLISION_GOOD_FRAMES = crate::Reg; #[doc = "Transmit Frame Count for Frames Transmitted after Multiple Collision"] pub mod tx_multiple_collision_good_frames; -#[doc = "TX_DEFERRED_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "TX_DEFERRED_FRAMES (r) register accessor: Tx Deferred Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_deferred_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_deferred_frames`] +module"] pub type TX_DEFERRED_FRAMES = crate::Reg; #[doc = "Tx Deferred Frames Register"] pub mod tx_deferred_frames; -#[doc = "TX_LATE_COLLISION_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "TX_LATE_COLLISION_FRAMES (r) register accessor: Transmit Frame Count for Late Collision Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_late_collision_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_late_collision_frames`] +module"] pub type TX_LATE_COLLISION_FRAMES = crate::Reg; #[doc = "Transmit Frame Count for Late Collision Error Frames"] pub mod tx_late_collision_frames; -#[doc = "TX_EXCESSIVE_COLLISION_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "TX_EXCESSIVE_COLLISION_FRAMES (r) register accessor: Transmit Frame Count for Excessive Collision Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_excessive_collision_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_excessive_collision_frames`] +module"] pub type TX_EXCESSIVE_COLLISION_FRAMES = crate::Reg; #[doc = "Transmit Frame Count for Excessive Collision Error Frames"] pub mod tx_excessive_collision_frames; -#[doc = "TX_CARRIER_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "TX_CARRIER_ERROR_FRAMES (r) register accessor: Transmit Frame Count for Carrier Sense Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_carrier_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_carrier_error_frames`] +module"] pub type TX_CARRIER_ERROR_FRAMES = crate::Reg; #[doc = "Transmit Frame Count for Carrier Sense Error Frames"] pub mod tx_carrier_error_frames; -#[doc = "TX_OCTET_COUNT_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_OCTET_COUNT_GOOD (r) register accessor: Tx Octet Count Good Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_octet_count_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_octet_count_good`] +module"] pub type TX_OCTET_COUNT_GOOD = crate::Reg; #[doc = "Tx Octet Count Good Register"] pub mod tx_octet_count_good; -#[doc = "TX_FRAME_COUNT_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_FRAME_COUNT_GOOD (r) register accessor: Tx Frame Count Good Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_frame_count_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_frame_count_good`] +module"] pub type TX_FRAME_COUNT_GOOD = crate::Reg; #[doc = "Tx Frame Count Good Register"] pub mod tx_frame_count_good; -#[doc = "TX_EXCESSIVE_DEFERRAL_ERROR (r) register accessor: an alias for `Reg`"] +#[doc = "TX_EXCESSIVE_DEFERRAL_ERROR (r) register accessor: Transmit Frame Count for Excessive Deferral Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_excessive_deferral_error::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_excessive_deferral_error`] +module"] pub type TX_EXCESSIVE_DEFERRAL_ERROR = crate::Reg; #[doc = "Transmit Frame Count for Excessive Deferral Error Frames"] pub mod tx_excessive_deferral_error; -#[doc = "TX_PAUSE_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "TX_PAUSE_FRAMES (r) register accessor: Transmit Frame Count for Good PAUSE Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_pause_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_pause_frames`] +module"] pub type TX_PAUSE_FRAMES = crate::Reg; #[doc = "Transmit Frame Count for Good PAUSE Frames"] pub mod tx_pause_frames; -#[doc = "TX_VLAN_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_VLAN_FRAMES_GOOD (r) register accessor: Transmit Frame Count for Good VLAN Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_vlan_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_vlan_frames_good`] +module"] pub type TX_VLAN_FRAMES_GOOD = crate::Reg; #[doc = "Transmit Frame Count for Good VLAN Frames"] pub mod tx_vlan_frames_good; -#[doc = "TX_OSIZE_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "TX_OSIZE_FRAMES_GOOD (r) register accessor: Transmit Frame Count for Good Oversize Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_osize_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tx_osize_frames_good`] +module"] pub type TX_OSIZE_FRAMES_GOOD = crate::Reg; #[doc = "Transmit Frame Count for Good Oversize Frames"] pub mod tx_osize_frames_good; -#[doc = "RX_FRAMES_COUNT_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_FRAMES_COUNT_GOOD_BAD (r) register accessor: Receive Frame Count for Good and Bad Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_frames_count_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_frames_count_good_bad`] +module"] pub type RX_FRAMES_COUNT_GOOD_BAD = crate::Reg; #[doc = "Receive Frame Count for Good and Bad Frames"] pub mod rx_frames_count_good_bad; -#[doc = "RX_OCTET_COUNT_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_OCTET_COUNT_GOOD_BAD (r) register accessor: Receive Octet Count for Good and Bad Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_octet_count_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_octet_count_good_bad`] +module"] pub type RX_OCTET_COUNT_GOOD_BAD = crate::Reg; #[doc = "Receive Octet Count for Good and Bad Frames"] pub mod rx_octet_count_good_bad; -#[doc = "RX_OCTET_COUNT_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_OCTET_COUNT_GOOD (r) register accessor: Rx Octet Count Good Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_octet_count_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_octet_count_good`] +module"] pub type RX_OCTET_COUNT_GOOD = crate::Reg; #[doc = "Rx Octet Count Good Register"] pub mod rx_octet_count_good; -#[doc = "RX_BROADCAST_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_BROADCAST_FRAMES_GOOD (r) register accessor: Receive Frame Count for Good Broadcast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_broadcast_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_broadcast_frames_good`] +module"] pub type RX_BROADCAST_FRAMES_GOOD = crate::Reg; #[doc = "Receive Frame Count for Good Broadcast Frames"] pub mod rx_broadcast_frames_good; -#[doc = "RX_MULTICAST_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_MULTICAST_FRAMES_GOOD (r) register accessor: Receive Frame Count for Good Multicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_multicast_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_multicast_frames_good`] +module"] pub type RX_MULTICAST_FRAMES_GOOD = crate::Reg; #[doc = "Receive Frame Count for Good Multicast Frames"] pub mod rx_multicast_frames_good; -#[doc = "RX_CRC_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_CRC_ERROR_FRAMES (r) register accessor: Receive Frame Count for CRC Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_crc_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_crc_error_frames`] +module"] pub type RX_CRC_ERROR_FRAMES = crate::Reg; #[doc = "Receive Frame Count for CRC Error Frames"] pub mod rx_crc_error_frames; -#[doc = "RX_ALIGNMENT_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_ALIGNMENT_ERROR_FRAMES (r) register accessor: Receive Frame Count for Alignment Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_alignment_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_alignment_error_frames`] +module"] pub type RX_ALIGNMENT_ERROR_FRAMES = crate::Reg; #[doc = "Receive Frame Count for Alignment Error Frames"] pub mod rx_alignment_error_frames; -#[doc = "RX_RUNT_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_RUNT_ERROR_FRAMES (r) register accessor: Receive Frame Count for Runt Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_runt_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_runt_error_frames`] +module"] pub type RX_RUNT_ERROR_FRAMES = crate::Reg; #[doc = "Receive Frame Count for Runt Error Frames"] pub mod rx_runt_error_frames; -#[doc = "RX_JABBER_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_JABBER_ERROR_FRAMES (r) register accessor: Receive Frame Count for Jabber Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_jabber_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_jabber_error_frames`] +module"] pub type RX_JABBER_ERROR_FRAMES = crate::Reg; #[doc = "Receive Frame Count for Jabber Error Frames"] pub mod rx_jabber_error_frames; -#[doc = "RX_UNDERSIZE_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_UNDERSIZE_FRAMES_GOOD (r) register accessor: Receive Frame Count for Undersize Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_undersize_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_undersize_frames_good`] +module"] pub type RX_UNDERSIZE_FRAMES_GOOD = crate::Reg; #[doc = "Receive Frame Count for Undersize Frames"] pub mod rx_undersize_frames_good; -#[doc = "RX_OVERSIZE_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_OVERSIZE_FRAMES_GOOD (r) register accessor: Rx Oversize Frames Good Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_oversize_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_oversize_frames_good`] +module"] pub type RX_OVERSIZE_FRAMES_GOOD = crate::Reg; #[doc = "Rx Oversize Frames Good Register"] pub mod rx_oversize_frames_good; -#[doc = "RX_64OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_64OCTETS_FRAMES_GOOD_BAD (r) register accessor: Receive Frame Count for Good and Bad 64 Byte Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_64octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_64octets_frames_good_bad`] +module"] pub type RX_64OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Receive Frame Count for Good and Bad 64 Byte Frames"] pub mod rx_64octets_frames_good_bad; -#[doc = "RX_65TO127OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_65TO127OCTETS_FRAMES_GOOD_BAD (r) register accessor: Receive Frame Count for Good and Bad 65 to 127 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_65to127octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_65to127octets_frames_good_bad`] +module"] pub type RX_65TO127OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Receive Frame Count for Good and Bad 65 to 127 Bytes Frames"] pub mod rx_65to127octets_frames_good_bad; -#[doc = "RX_128TO255OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_128TO255OCTETS_FRAMES_GOOD_BAD (r) register accessor: Receive Frame Count for Good and Bad 128 to 255 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_128to255octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_128to255octets_frames_good_bad`] +module"] pub type RX_128TO255OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Receive Frame Count for Good and Bad 128 to 255 Bytes Frames"] pub mod rx_128to255octets_frames_good_bad; -#[doc = "RX_256TO511OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_256TO511OCTETS_FRAMES_GOOD_BAD (r) register accessor: Receive Frame Count for Good and Bad 256 to 511 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_256to511octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_256to511octets_frames_good_bad`] +module"] pub type RX_256TO511OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Receive Frame Count for Good and Bad 256 to 511 Bytes Frames"] pub mod rx_256to511octets_frames_good_bad; -#[doc = "RX_512TO1023OCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_512TO1023OCTETS_FRAMES_GOOD_BAD (r) register accessor: Receive Frame Count for Good and Bad 512 to 1,023 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_512to1023octets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_512to1023octets_frames_good_bad`] +module"] pub type RX_512TO1023OCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Receive Frame Count for Good and Bad 512 to 1,023 Bytes Frames"] pub mod rx_512to1023octets_frames_good_bad; -#[doc = "RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD (r) register accessor: Receive Frame Count for Good and Bad 1,024 to Maxsize Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_1024tomaxoctets_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_1024tomaxoctets_frames_good_bad`] +module"] pub type RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Receive Frame Count for Good and Bad 1,024 to Maxsize Bytes Frames"] pub mod rx_1024tomaxoctets_frames_good_bad; -#[doc = "RX_UNICAST_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_UNICAST_FRAMES_GOOD (r) register accessor: Receive Frame Count for Good Unicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_unicast_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_unicast_frames_good`] +module"] pub type RX_UNICAST_FRAMES_GOOD = crate::Reg; #[doc = "Receive Frame Count for Good Unicast Frames"] pub mod rx_unicast_frames_good; -#[doc = "RX_LENGTH_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_LENGTH_ERROR_FRAMES (r) register accessor: Receive Frame Count for Length Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_length_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_length_error_frames`] +module"] pub type RX_LENGTH_ERROR_FRAMES = crate::Reg; #[doc = "Receive Frame Count for Length Error Frames"] pub mod rx_length_error_frames; -#[doc = "RX_OUT_OF_RANGE_TYPE_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_OUT_OF_RANGE_TYPE_FRAMES (r) register accessor: Receive Frame Count for Out of Range Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_out_of_range_type_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_out_of_range_type_frames`] +module"] pub type RX_OUT_OF_RANGE_TYPE_FRAMES = crate::Reg; #[doc = "Receive Frame Count for Out of Range Frames"] pub mod rx_out_of_range_type_frames; -#[doc = "RX_PAUSE_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_PAUSE_FRAMES (r) register accessor: Receive Frame Count for PAUSE Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_pause_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_pause_frames`] +module"] pub type RX_PAUSE_FRAMES = crate::Reg; #[doc = "Receive Frame Count for PAUSE Frames"] pub mod rx_pause_frames; -#[doc = "RX_FIFO_OVERFLOW_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_FIFO_OVERFLOW_FRAMES (r) register accessor: Receive Frame Count for FIFO Overflow Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_fifo_overflow_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_fifo_overflow_frames`] +module"] pub type RX_FIFO_OVERFLOW_FRAMES = crate::Reg; #[doc = "Receive Frame Count for FIFO Overflow Frames"] pub mod rx_fifo_overflow_frames; -#[doc = "RX_VLAN_FRAMES_GOOD_BAD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_VLAN_FRAMES_GOOD_BAD (r) register accessor: Receive Frame Count for Good and Bad VLAN Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_vlan_frames_good_bad::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_vlan_frames_good_bad`] +module"] pub type RX_VLAN_FRAMES_GOOD_BAD = crate::Reg; #[doc = "Receive Frame Count for Good and Bad VLAN Frames"] pub mod rx_vlan_frames_good_bad; -#[doc = "RX_WATCHDOG_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_WATCHDOG_ERROR_FRAMES (r) register accessor: Receive Frame Count for Watchdog Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_watchdog_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_watchdog_error_frames`] +module"] pub type RX_WATCHDOG_ERROR_FRAMES = crate::Reg; #[doc = "Receive Frame Count for Watchdog Error Frames"] pub mod rx_watchdog_error_frames; -#[doc = "RX_RECEIVE_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RX_RECEIVE_ERROR_FRAMES (r) register accessor: Receive Frame Count for Receive Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_receive_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_receive_error_frames`] +module"] pub type RX_RECEIVE_ERROR_FRAMES = crate::Reg; #[doc = "Receive Frame Count for Receive Error Frames"] pub mod rx_receive_error_frames; -#[doc = "RX_CONTROL_FRAMES_GOOD (r) register accessor: an alias for `Reg`"] +#[doc = "RX_CONTROL_FRAMES_GOOD (r) register accessor: Receive Frame Count for Good Control Frames Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_control_frames_good::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rx_control_frames_good`] +module"] pub type RX_CONTROL_FRAMES_GOOD = crate::Reg; #[doc = "Receive Frame Count for Good Control Frames Frames"] pub mod rx_control_frames_good; -#[doc = "MMC_IPC_RECEIVE_INTERRUPT_MASK (rw) register accessor: an alias for `Reg`"] +#[doc = "MMC_IPC_RECEIVE_INTERRUPT_MASK (rw) register accessor: MMC Receive Checksum Offload Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_ipc_receive_interrupt_mask::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmc_ipc_receive_interrupt_mask::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mmc_ipc_receive_interrupt_mask`] +module"] pub type MMC_IPC_RECEIVE_INTERRUPT_MASK = crate::Reg; #[doc = "MMC Receive Checksum Offload Interrupt Mask Register"] pub mod mmc_ipc_receive_interrupt_mask; -#[doc = "MMC_IPC_RECEIVE_INTERRUPT (r) register accessor: an alias for `Reg`"] +#[doc = "MMC_IPC_RECEIVE_INTERRUPT (r) register accessor: MMC Receive Checksum Offload Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_ipc_receive_interrupt::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mmc_ipc_receive_interrupt`] +module"] pub type MMC_IPC_RECEIVE_INTERRUPT = crate::Reg; #[doc = "MMC Receive Checksum Offload Interrupt Register"] pub mod mmc_ipc_receive_interrupt; -#[doc = "RXIPV4_GOOD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_GOOD_FRAMES (r) register accessor: RxIPv4 Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_good_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_good_frames`] +module"] pub type RXIPV4_GOOD_FRAMES = crate::Reg; #[doc = "RxIPv4 Good Frames Register"] pub mod rxipv4_good_frames; -#[doc = "RXIPV4_HEADER_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_HEADER_ERROR_FRAMES (r) register accessor: Receive IPV4 Header Error Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_header_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_header_error_frames`] +module"] pub type RXIPV4_HEADER_ERROR_FRAMES = crate::Reg; #[doc = "Receive IPV4 Header Error Frame Counter Register"] pub mod rxipv4_header_error_frames; -#[doc = "RXIPV4_NO_PAYLOAD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_NO_PAYLOAD_FRAMES (r) register accessor: Receive IPV4 No Payload Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_no_payload_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_no_payload_frames`] +module"] pub type RXIPV4_NO_PAYLOAD_FRAMES = crate::Reg; #[doc = "Receive IPV4 No Payload Frame Counter Register"] pub mod rxipv4_no_payload_frames; -#[doc = "RXIPV4_FRAGMENTED_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_FRAGMENTED_FRAMES (r) register accessor: Receive IPV4 Fragmented Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_fragmented_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_fragmented_frames`] +module"] pub type RXIPV4_FRAGMENTED_FRAMES = crate::Reg; #[doc = "Receive IPV4 Fragmented Frame Counter Register"] pub mod rxipv4_fragmented_frames; -#[doc = "RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES (r) register accessor: Receive IPV4 UDP Checksum Disabled Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_udp_checksum_disabled_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_udp_checksum_disabled_frames`] +module"] pub type RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES = crate::Reg; #[doc = "Receive IPV4 UDP Checksum Disabled Frame Counter Register"] pub mod rxipv4_udp_checksum_disabled_frames; -#[doc = "RXIPV6_GOOD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV6_GOOD_FRAMES (r) register accessor: RxIPv6 Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_good_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv6_good_frames`] +module"] pub type RXIPV6_GOOD_FRAMES = crate::Reg; #[doc = "RxIPv6 Good Frames Register"] pub mod rxipv6_good_frames; -#[doc = "RXIPV6_HEADER_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV6_HEADER_ERROR_FRAMES (r) register accessor: Receive IPV6 Header Error Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_header_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv6_header_error_frames`] +module"] pub type RXIPV6_HEADER_ERROR_FRAMES = crate::Reg; #[doc = "Receive IPV6 Header Error Frame Counter Register"] pub mod rxipv6_header_error_frames; -#[doc = "RXIPV6_NO_PAYLOAD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV6_NO_PAYLOAD_FRAMES (r) register accessor: Receive IPV6 No Payload Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_no_payload_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv6_no_payload_frames`] +module"] pub type RXIPV6_NO_PAYLOAD_FRAMES = crate::Reg; #[doc = "Receive IPV6 No Payload Frame Counter Register"] pub mod rxipv6_no_payload_frames; -#[doc = "RXUDP_GOOD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXUDP_GOOD_FRAMES (r) register accessor: RxUDP Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxudp_good_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxudp_good_frames`] +module"] pub type RXUDP_GOOD_FRAMES = crate::Reg; #[doc = "RxUDP Good Frames Register"] pub mod rxudp_good_frames; -#[doc = "RXUDP_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXUDP_ERROR_FRAMES (r) register accessor: RxUDP Error Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxudp_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxudp_error_frames`] +module"] pub type RXUDP_ERROR_FRAMES = crate::Reg; #[doc = "RxUDP Error Frames Register"] pub mod rxudp_error_frames; -#[doc = "RXTCP_GOOD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXTCP_GOOD_FRAMES (r) register accessor: RxTCP Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxtcp_good_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxtcp_good_frames`] +module"] pub type RXTCP_GOOD_FRAMES = crate::Reg; #[doc = "RxTCP Good Frames Register"] pub mod rxtcp_good_frames; -#[doc = "RXTCP_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXTCP_ERROR_FRAMES (r) register accessor: RxTCP Error Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxtcp_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxtcp_error_frames`] +module"] pub type RXTCP_ERROR_FRAMES = crate::Reg; #[doc = "RxTCP Error Frames Register"] pub mod rxtcp_error_frames; -#[doc = "RXICMP_GOOD_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXICMP_GOOD_FRAMES (r) register accessor: RxICMP Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxicmp_good_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxicmp_good_frames`] +module"] pub type RXICMP_GOOD_FRAMES = crate::Reg; #[doc = "RxICMP Good Frames Register"] pub mod rxicmp_good_frames; -#[doc = "RXICMP_ERROR_FRAMES (r) register accessor: an alias for `Reg`"] +#[doc = "RXICMP_ERROR_FRAMES (r) register accessor: RxICMP Error Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxicmp_error_frames::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxicmp_error_frames`] +module"] pub type RXICMP_ERROR_FRAMES = crate::Reg; #[doc = "RxICMP Error Frames Register"] pub mod rxicmp_error_frames; -#[doc = "RXIPV4_GOOD_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_GOOD_OCTETS (r) register accessor: RxIPv4 Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_good_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_good_octets`] +module"] pub type RXIPV4_GOOD_OCTETS = crate::Reg; #[doc = "RxIPv4 Good Octets Register"] pub mod rxipv4_good_octets; -#[doc = "RXIPV4_HEADER_ERROR_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_HEADER_ERROR_OCTETS (r) register accessor: Receive IPV4 Header Error Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_header_error_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_header_error_octets`] +module"] pub type RXIPV4_HEADER_ERROR_OCTETS = crate::Reg; #[doc = "Receive IPV4 Header Error Octet Counter Register"] pub mod rxipv4_header_error_octets; -#[doc = "RXIPV4_NO_PAYLOAD_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_NO_PAYLOAD_OCTETS (r) register accessor: Receive IPV4 No Payload Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_no_payload_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_no_payload_octets`] +module"] pub type RXIPV4_NO_PAYLOAD_OCTETS = crate::Reg; #[doc = "Receive IPV4 No Payload Octet Counter Register"] pub mod rxipv4_no_payload_octets; -#[doc = "RXIPV4_FRAGMENTED_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_FRAGMENTED_OCTETS (r) register accessor: Receive IPV4 Fragmented Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_fragmented_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_fragmented_octets`] +module"] pub type RXIPV4_FRAGMENTED_OCTETS = crate::Reg; #[doc = "Receive IPV4 Fragmented Octet Counter Register"] pub mod rxipv4_fragmented_octets; -#[doc = "RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS (r) register accessor: Receive IPV4 Fragmented Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_udp_checksum_disable_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv4_udp_checksum_disable_octets`] +module"] pub type RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS = crate::Reg; #[doc = "Receive IPV4 Fragmented Octet Counter Register"] pub mod rxipv4_udp_checksum_disable_octets; -#[doc = "RXIPV6_GOOD_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV6_GOOD_OCTETS (r) register accessor: RxIPv6 Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_good_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv6_good_octets`] +module"] pub type RXIPV6_GOOD_OCTETS = crate::Reg; #[doc = "RxIPv6 Good Octets Register"] pub mod rxipv6_good_octets; -#[doc = "RXIPV6_HEADER_ERROR_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV6_HEADER_ERROR_OCTETS (r) register accessor: Receive IPV6 Header Error Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_header_error_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv6_header_error_octets`] +module"] pub type RXIPV6_HEADER_ERROR_OCTETS = crate::Reg; #[doc = "Receive IPV6 Header Error Octet Counter Register"] pub mod rxipv6_header_error_octets; -#[doc = "RXIPV6_NO_PAYLOAD_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXIPV6_NO_PAYLOAD_OCTETS (r) register accessor: Receive IPV6 No Payload Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_no_payload_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxipv6_no_payload_octets`] +module"] pub type RXIPV6_NO_PAYLOAD_OCTETS = crate::Reg; #[doc = "Receive IPV6 No Payload Octet Counter Register"] pub mod rxipv6_no_payload_octets; -#[doc = "RXUDP_GOOD_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXUDP_GOOD_OCTETS (r) register accessor: Receive UDP Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxudp_good_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxudp_good_octets`] +module"] pub type RXUDP_GOOD_OCTETS = crate::Reg; #[doc = "Receive UDP Good Octets Register"] pub mod rxudp_good_octets; -#[doc = "RXUDP_ERROR_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXUDP_ERROR_OCTETS (r) register accessor: Receive UDP Error Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxudp_error_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxudp_error_octets`] +module"] pub type RXUDP_ERROR_OCTETS = crate::Reg; #[doc = "Receive UDP Error Octets Register"] pub mod rxudp_error_octets; -#[doc = "RXTCP_GOOD_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXTCP_GOOD_OCTETS (r) register accessor: Receive TCP Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxtcp_good_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxtcp_good_octets`] +module"] pub type RXTCP_GOOD_OCTETS = crate::Reg; #[doc = "Receive TCP Good Octets Register"] pub mod rxtcp_good_octets; -#[doc = "RXTCP_ERROR_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXTCP_ERROR_OCTETS (r) register accessor: Receive TCP Error Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxtcp_error_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxtcp_error_octets`] +module"] pub type RXTCP_ERROR_OCTETS = crate::Reg; #[doc = "Receive TCP Error Octets Register"] pub mod rxtcp_error_octets; -#[doc = "RXICMP_GOOD_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXICMP_GOOD_OCTETS (r) register accessor: Receive ICMP Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxicmp_good_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxicmp_good_octets`] +module"] pub type RXICMP_GOOD_OCTETS = crate::Reg; #[doc = "Receive ICMP Good Octets Register"] pub mod rxicmp_good_octets; -#[doc = "RXICMP_ERROR_OCTETS (r) register accessor: an alias for `Reg`"] +#[doc = "RXICMP_ERROR_OCTETS (r) register accessor: Receive ICMP Error Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxicmp_error_octets::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rxicmp_error_octets`] +module"] pub type RXICMP_ERROR_OCTETS = crate::Reg; #[doc = "Receive ICMP Error Octets Register"] pub mod rxicmp_error_octets; -#[doc = "TIMESTAMP_CONTROL (rw) register accessor: an alias for `Reg`"] +#[doc = "TIMESTAMP_CONTROL (rw) register accessor: Timestamp Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timestamp_control::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`timestamp_control::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@timestamp_control`] +module"] pub type TIMESTAMP_CONTROL = crate::Reg; #[doc = "Timestamp Control Register"] pub mod timestamp_control; -#[doc = "SUB_SECOND_INCREMENT (rw) register accessor: an alias for `Reg`"] +#[doc = "SUB_SECOND_INCREMENT (rw) register accessor: Sub-Second Increment Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sub_second_increment::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sub_second_increment::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sub_second_increment`] +module"] pub type SUB_SECOND_INCREMENT = crate::Reg; #[doc = "Sub-Second Increment Register"] pub mod sub_second_increment; -#[doc = "SYSTEM_TIME_SECONDS (r) register accessor: an alias for `Reg`"] +#[doc = "SYSTEM_TIME_SECONDS (r) register accessor: System Time - Seconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_seconds::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@system_time_seconds`] +module"] pub type SYSTEM_TIME_SECONDS = crate::Reg; #[doc = "System Time - Seconds Register"] pub mod system_time_seconds; -#[doc = "SYSTEM_TIME_NANOSECONDS (r) register accessor: an alias for `Reg`"] +#[doc = "SYSTEM_TIME_NANOSECONDS (r) register accessor: System Time Nanoseconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_nanoseconds::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@system_time_nanoseconds`] +module"] pub type SYSTEM_TIME_NANOSECONDS = crate::Reg; #[doc = "System Time Nanoseconds Register"] pub mod system_time_nanoseconds; -#[doc = "SYSTEM_TIME_SECONDS_UPDATE (rw) register accessor: an alias for `Reg`"] +#[doc = "SYSTEM_TIME_SECONDS_UPDATE (rw) register accessor: System Time - Seconds Update Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_seconds_update::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`system_time_seconds_update::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@system_time_seconds_update`] +module"] pub type SYSTEM_TIME_SECONDS_UPDATE = crate::Reg; #[doc = "System Time - Seconds Update Register"] pub mod system_time_seconds_update; -#[doc = "SYSTEM_TIME_NANOSECONDS_UPDATE (rw) register accessor: an alias for `Reg`"] +#[doc = "SYSTEM_TIME_NANOSECONDS_UPDATE (rw) register accessor: System Time Nanoseconds Update Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_nanoseconds_update::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`system_time_nanoseconds_update::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@system_time_nanoseconds_update`] +module"] pub type SYSTEM_TIME_NANOSECONDS_UPDATE = crate::Reg; #[doc = "System Time Nanoseconds Update Register"] pub mod system_time_nanoseconds_update; -#[doc = "TIMESTAMP_ADDEND (rw) register accessor: an alias for `Reg`"] +#[doc = "TIMESTAMP_ADDEND (rw) register accessor: Timestamp Addend Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timestamp_addend::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`timestamp_addend::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@timestamp_addend`] +module"] pub type TIMESTAMP_ADDEND = crate::Reg; #[doc = "Timestamp Addend Register"] pub mod timestamp_addend; -#[doc = "TARGET_TIME_SECONDS (rw) register accessor: an alias for `Reg`"] +#[doc = "TARGET_TIME_SECONDS (rw) register accessor: Target Time Seconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`target_time_seconds::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`target_time_seconds::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@target_time_seconds`] +module"] pub type TARGET_TIME_SECONDS = crate::Reg; #[doc = "Target Time Seconds Register"] pub mod target_time_seconds; -#[doc = "TARGET_TIME_NANOSECONDS (rw) register accessor: an alias for `Reg`"] +#[doc = "TARGET_TIME_NANOSECONDS (rw) register accessor: Target Time Nanoseconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`target_time_nanoseconds::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`target_time_nanoseconds::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@target_time_nanoseconds`] +module"] pub type TARGET_TIME_NANOSECONDS = crate::Reg; #[doc = "Target Time Nanoseconds Register"] pub mod target_time_nanoseconds; -#[doc = "SYSTEM_TIME_HIGHER_WORD_SECONDS (rw) register accessor: an alias for `Reg`"] +#[doc = "SYSTEM_TIME_HIGHER_WORD_SECONDS (rw) register accessor: System Time - Higher Word Seconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_higher_word_seconds::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`system_time_higher_word_seconds::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@system_time_higher_word_seconds`] +module"] pub type SYSTEM_TIME_HIGHER_WORD_SECONDS = crate::Reg; #[doc = "System Time - Higher Word Seconds Register"] pub mod system_time_higher_word_seconds; -#[doc = "TIMESTAMP_STATUS (r) register accessor: an alias for `Reg`"] +#[doc = "TIMESTAMP_STATUS (r) register accessor: Timestamp Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timestamp_status::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@timestamp_status`] +module"] pub type TIMESTAMP_STATUS = crate::Reg; #[doc = "Timestamp Status Register"] pub mod timestamp_status; -#[doc = "PPS_CONTROL (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS_CONTROL (rw) register accessor: PPS Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps_control::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps_control::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps_control`] +module"] pub type PPS_CONTROL = crate::Reg; #[doc = "PPS Control Register"] pub mod pps_control; -#[doc = "BUS_MODE (rw) register accessor: an alias for `Reg`"] +#[doc = "BUS_MODE (rw) register accessor: Bus Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bus_mode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bus_mode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bus_mode`] +module"] pub type BUS_MODE = crate::Reg; #[doc = "Bus Mode Register"] pub mod bus_mode; -#[doc = "TRANSMIT_POLL_DEMAND (rw) register accessor: an alias for `Reg`"] +#[doc = "TRANSMIT_POLL_DEMAND (rw) register accessor: Transmit Poll Demand Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`transmit_poll_demand::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`transmit_poll_demand::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@transmit_poll_demand`] +module"] pub type TRANSMIT_POLL_DEMAND = crate::Reg; #[doc = "Transmit Poll Demand Register"] pub mod transmit_poll_demand; -#[doc = "RECEIVE_POLL_DEMAND (rw) register accessor: an alias for `Reg`"] +#[doc = "RECEIVE_POLL_DEMAND (rw) register accessor: Receive Poll Demand Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`receive_poll_demand::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`receive_poll_demand::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@receive_poll_demand`] +module"] pub type RECEIVE_POLL_DEMAND = crate::Reg; #[doc = "Receive Poll Demand Register"] pub mod receive_poll_demand; -#[doc = "RECEIVE_DESCRIPTOR_LIST_ADDRESS (rw) register accessor: an alias for `Reg`"] +#[doc = "RECEIVE_DESCRIPTOR_LIST_ADDRESS (rw) register accessor: Receive Descriptor Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`receive_descriptor_list_address::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`receive_descriptor_list_address::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@receive_descriptor_list_address`] +module"] pub type RECEIVE_DESCRIPTOR_LIST_ADDRESS = crate::Reg; #[doc = "Receive Descriptor Address Register"] pub mod receive_descriptor_list_address; -#[doc = "TRANSMIT_DESCRIPTOR_LIST_ADDRESS (rw) register accessor: an alias for `Reg`"] +#[doc = "TRANSMIT_DESCRIPTOR_LIST_ADDRESS (rw) register accessor: Transmit descripter Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`transmit_descriptor_list_address::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`transmit_descriptor_list_address::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@transmit_descriptor_list_address`] +module"] pub type TRANSMIT_DESCRIPTOR_LIST_ADDRESS = crate::Reg; #[doc = "Transmit descripter Address Register"] pub mod transmit_descriptor_list_address; -#[doc = "STATUS (rw) register accessor: an alias for `Reg`"] +#[doc = "STATUS (rw) register accessor: Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`status::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`status::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@status`] +module"] pub type STATUS = crate::Reg; #[doc = "Status Register"] pub mod status; -#[doc = "OPERATION_MODE (rw) register accessor: an alias for `Reg`"] +#[doc = "OPERATION_MODE (rw) register accessor: Operation Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`operation_mode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`operation_mode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@operation_mode`] +module"] pub type OPERATION_MODE = crate::Reg; #[doc = "Operation Mode Register"] pub mod operation_mode; -#[doc = "INTERRUPT_ENABLE (rw) register accessor: an alias for `Reg`"] +#[doc = "INTERRUPT_ENABLE (rw) register accessor: Interrupt Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`interrupt_enable::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`interrupt_enable::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@interrupt_enable`] +module"] pub type INTERRUPT_ENABLE = crate::Reg; #[doc = "Interrupt Enable Register"] pub mod interrupt_enable; -#[doc = "MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER (r) register accessor: an alias for `Reg`"] +#[doc = "MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER (r) register accessor: Missed Frame and Buffer Overflow Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`missed_frame_and_buffer_overflow_counter::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@missed_frame_and_buffer_overflow_counter`] +module"] pub type MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER = crate::Reg; #[doc = "Missed Frame and Buffer Overflow Counter Register"] pub mod missed_frame_and_buffer_overflow_counter; -#[doc = "RECEIVE_INTERRUPT_WATCHDOG_TIMER (rw) register accessor: an alias for `Reg`"] +#[doc = "RECEIVE_INTERRUPT_WATCHDOG_TIMER (rw) register accessor: Receive Interrupt Watchdog Timer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`receive_interrupt_watchdog_timer::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`receive_interrupt_watchdog_timer::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@receive_interrupt_watchdog_timer`] +module"] pub type RECEIVE_INTERRUPT_WATCHDOG_TIMER = crate::Reg; #[doc = "Receive Interrupt Watchdog Timer Register"] pub mod receive_interrupt_watchdog_timer; -#[doc = "AHB_STATUS (r) register accessor: an alias for `Reg`"] +#[doc = "AHB_STATUS (r) register accessor: AHB Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ahb_status::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ahb_status`] +module"] pub type AHB_STATUS = crate::Reg; #[doc = "AHB Status Register"] pub mod ahb_status; -#[doc = "CURRENT_HOST_TRANSMIT_DESCRIPTOR (r) register accessor: an alias for `Reg`"] +#[doc = "CURRENT_HOST_TRANSMIT_DESCRIPTOR (r) register accessor: Current Host Transmit Descriptor Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`current_host_transmit_descriptor::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@current_host_transmit_descriptor`] +module"] pub type CURRENT_HOST_TRANSMIT_DESCRIPTOR = crate::Reg; #[doc = "Current Host Transmit Descriptor Register"] pub mod current_host_transmit_descriptor; -#[doc = "CURRENT_HOST_RECEIVE_DESCRIPTOR (r) register accessor: an alias for `Reg`"] +#[doc = "CURRENT_HOST_RECEIVE_DESCRIPTOR (r) register accessor: Current Host Receive Descriptor Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`current_host_receive_descriptor::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@current_host_receive_descriptor`] +module"] pub type CURRENT_HOST_RECEIVE_DESCRIPTOR = crate::Reg; #[doc = "Current Host Receive Descriptor Register"] pub mod current_host_receive_descriptor; -#[doc = "CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS (r) register accessor: an alias for `Reg`"] +#[doc = "CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS (r) register accessor: Current Host Transmit Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`current_host_transmit_buffer_address::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@current_host_transmit_buffer_address`] +module"] pub type CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS = crate::Reg; #[doc = "Current Host Transmit Buffer Address Register"] pub mod current_host_transmit_buffer_address; -#[doc = "CURRENT_HOST_RECEIVE_BUFFER_ADDRESS (r) register accessor: an alias for `Reg`"] +#[doc = "CURRENT_HOST_RECEIVE_BUFFER_ADDRESS (r) register accessor: Current Host Receive Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`current_host_receive_buffer_address::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@current_host_receive_buffer_address`] +module"] pub type CURRENT_HOST_RECEIVE_BUFFER_ADDRESS = crate::Reg; #[doc = "Current Host Receive Buffer Address Register"] pub mod current_host_receive_buffer_address; -#[doc = "HW_FEATURE (rw) register accessor: an alias for `Reg`"] +#[doc = "HW_FEATURE (rw) register accessor: HW Feature Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hw_feature::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hw_feature::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hw_feature`] +module"] pub type HW_FEATURE = crate::Reg; #[doc = "HW Feature Register"] pub mod hw_feature; diff --git a/src/eth0/ahb_status.rs b/src/eth0/ahb_status.rs index 5b4ae9a3..c7837d5a 100644 --- a/src/eth0/ahb_status.rs +++ b/src/eth0/ahb_status.rs @@ -1,20 +1,7 @@ #[doc = "Register `AHB_STATUS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `AHBMS` reader - AHB Master Status"] -pub type AHBMS_R = crate::BitReader; +pub type AHBMS_R = crate::BitReader; impl R { #[doc = "Bit 0 - AHB Master Status"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { AHBMS_R::new((self.bits & 1) != 0) } } -#[doc = "AHB 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 [ahb_status](index.html) module"] +#[doc = "AHB Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ahb_status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct AHB_STATUS_SPEC; impl crate::RegisterSpec for AHB_STATUS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [ahb_status::R](R) reader structure"] -impl crate::Readable for AHB_STATUS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`ahb_status::R`](R) reader structure"] +impl crate::Readable for AHB_STATUS_SPEC {} #[doc = "`reset()` method sets AHB_STATUS to value 0"] impl crate::Resettable for AHB_STATUS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/bus_mode.rs b/src/eth0/bus_mode.rs index c8c09673..9cba5858 100644 --- a/src/eth0/bus_mode.rs +++ b/src/eth0/bus_mode.rs @@ -1,93 +1,61 @@ #[doc = "Register `BUS_MODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `BUS_MODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SWR` reader - Software Reset"] -pub type SWR_R = crate::BitReader; +pub type SWR_R = crate::BitReader; #[doc = "Field `SWR` writer - Software Reset"] -pub type SWR_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type SWR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DA` reader - DMA Arbitration Scheme"] -pub type DA_R = crate::BitReader; +pub type DA_R = crate::BitReader; #[doc = "Field `DA` writer - DMA Arbitration Scheme"] -pub type DA_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type DA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DSL` reader - Descriptor Skip Length"] -pub type DSL_R = crate::FieldReader; +pub type DSL_R = crate::FieldReader; #[doc = "Field `DSL` writer - Descriptor Skip Length"] -pub type DSL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BUS_MODE_SPEC, u8, u8, 5, O>; +pub type DSL_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `ATDS` reader - Alternate Descriptor Size"] -pub type ATDS_R = crate::BitReader; +pub type ATDS_R = crate::BitReader; #[doc = "Field `ATDS` writer - Alternate Descriptor Size"] -pub type ATDS_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type ATDS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PBL` reader - Programmable Burst Length"] -pub type PBL_R = crate::FieldReader; +pub type PBL_R = crate::FieldReader; #[doc = "Field `PBL` writer - Programmable Burst Length"] -pub type PBL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BUS_MODE_SPEC, u8, u8, 6, O>; +pub type PBL_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `PR` reader - Priority Ratio"] -pub type PR_R = crate::FieldReader; +pub type PR_R = crate::FieldReader; #[doc = "Field `PR` writer - Priority Ratio"] -pub type PR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BUS_MODE_SPEC, u8, u8, 2, O>; +pub type PR_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `FB` reader - Fixed Burst"] -pub type FB_R = crate::BitReader; +pub type FB_R = crate::BitReader; #[doc = "Field `FB` writer - Fixed Burst"] -pub type FB_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type FB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RPBL` reader - Rx DMA PBL"] -pub type RPBL_R = crate::FieldReader; +pub type RPBL_R = crate::FieldReader; #[doc = "Field `RPBL` writer - Rx DMA PBL"] -pub type RPBL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BUS_MODE_SPEC, u8, u8, 6, O>; +pub type RPBL_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `USP` reader - Use Seperate PBL"] -pub type USP_R = crate::BitReader; +pub type USP_R = crate::BitReader; #[doc = "Field `USP` writer - Use Seperate PBL"] -pub type USP_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type USP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EIGHTxPBL` reader - 8xPBL Mode"] -pub type EIGHTX_PBL_R = crate::BitReader; +pub type EIGHTX_PBL_R = crate::BitReader; #[doc = "Field `EIGHTxPBL` writer - 8xPBL Mode"] -pub type EIGHTX_PBL_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type EIGHTX_PBL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AAL` reader - Address Aligned Beats"] -pub type AAL_R = crate::BitReader; +pub type AAL_R = crate::BitReader; #[doc = "Field `AAL` writer - Address Aligned Beats"] -pub type AAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type AAL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MB` reader - Mixed Burst"] -pub type MB_R = crate::BitReader; +pub type MB_R = crate::BitReader; #[doc = "Field `MB` writer - Mixed Burst"] -pub type MB_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type MB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXPR` reader - Transmit Priority"] -pub type TXPR_R = crate::BitReader; +pub type TXPR_R = crate::BitReader; #[doc = "Field `TXPR` writer - Transmit Priority"] -pub type TXPR_W<'a, const O: u8> = crate::BitWriter<'a, u32, BUS_MODE_SPEC, bool, O>; +pub type TXPR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PRWG` reader - Channel Priority Weights"] -pub type PRWG_R = crate::FieldReader; +pub type PRWG_R = crate::FieldReader; impl R { #[doc = "Bit 0 - Software Reset"] #[inline(always)] @@ -164,100 +132,101 @@ impl W { #[doc = "Bit 0 - Software Reset"] #[inline(always)] #[must_use] - pub fn swr(&mut self) -> SWR_W<0> { - SWR_W::new(self) + pub fn swr(&mut self) -> SWR_W { + SWR_W::new(self, 0) } #[doc = "Bit 1 - DMA Arbitration Scheme"] #[inline(always)] #[must_use] - pub fn da(&mut self) -> DA_W<1> { - DA_W::new(self) + pub fn da(&mut self) -> DA_W { + DA_W::new(self, 1) } #[doc = "Bits 2:6 - Descriptor Skip Length"] #[inline(always)] #[must_use] - pub fn dsl(&mut self) -> DSL_W<2> { - DSL_W::new(self) + pub fn dsl(&mut self) -> DSL_W { + DSL_W::new(self, 2) } #[doc = "Bit 7 - Alternate Descriptor Size"] #[inline(always)] #[must_use] - pub fn atds(&mut self) -> ATDS_W<7> { - ATDS_W::new(self) + pub fn atds(&mut self) -> ATDS_W { + ATDS_W::new(self, 7) } #[doc = "Bits 8:13 - Programmable Burst Length"] #[inline(always)] #[must_use] - pub fn pbl(&mut self) -> PBL_W<8> { - PBL_W::new(self) + pub fn pbl(&mut self) -> PBL_W { + PBL_W::new(self, 8) } #[doc = "Bits 14:15 - Priority Ratio"] #[inline(always)] #[must_use] - pub fn pr(&mut self) -> PR_W<14> { - PR_W::new(self) + pub fn pr(&mut self) -> PR_W { + PR_W::new(self, 14) } #[doc = "Bit 16 - Fixed Burst"] #[inline(always)] #[must_use] - pub fn fb(&mut self) -> FB_W<16> { - FB_W::new(self) + pub fn fb(&mut self) -> FB_W { + FB_W::new(self, 16) } #[doc = "Bits 17:22 - Rx DMA PBL"] #[inline(always)] #[must_use] - pub fn rpbl(&mut self) -> RPBL_W<17> { - RPBL_W::new(self) + pub fn rpbl(&mut self) -> RPBL_W { + RPBL_W::new(self, 17) } #[doc = "Bit 23 - Use Seperate PBL"] #[inline(always)] #[must_use] - pub fn usp(&mut self) -> USP_W<23> { - USP_W::new(self) + pub fn usp(&mut self) -> USP_W { + USP_W::new(self, 23) } #[doc = "Bit 24 - 8xPBL Mode"] #[inline(always)] #[must_use] - pub fn eightx_pbl(&mut self) -> EIGHTX_PBL_W<24> { - EIGHTX_PBL_W::new(self) + pub fn eightx_pbl(&mut self) -> EIGHTX_PBL_W { + EIGHTX_PBL_W::new(self, 24) } #[doc = "Bit 25 - Address Aligned Beats"] #[inline(always)] #[must_use] - pub fn aal(&mut self) -> AAL_W<25> { - AAL_W::new(self) + pub fn aal(&mut self) -> AAL_W { + AAL_W::new(self, 25) } #[doc = "Bit 26 - Mixed Burst"] #[inline(always)] #[must_use] - pub fn mb(&mut self) -> MB_W<26> { - MB_W::new(self) + pub fn mb(&mut self) -> MB_W { + MB_W::new(self, 26) } #[doc = "Bit 27 - Transmit Priority"] #[inline(always)] #[must_use] - pub fn txpr(&mut self) -> TXPR_W<27> { - TXPR_W::new(self) + pub fn txpr(&mut self) -> TXPR_W { + TXPR_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Bus 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 [bus_mode](index.html) module"] +#[doc = "Bus Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bus_mode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bus_mode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct BUS_MODE_SPEC; impl crate::RegisterSpec for BUS_MODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [bus_mode::R](R) reader structure"] -impl crate::Readable for BUS_MODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [bus_mode::W](W) writer structure"] +#[doc = "`read()` method returns [`bus_mode::R`](R) reader structure"] +impl crate::Readable for BUS_MODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`bus_mode::W`](W) writer structure"] impl crate::Writable for BUS_MODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/current_host_receive_buffer_address.rs b/src/eth0/current_host_receive_buffer_address.rs index d3296455..26d6dc63 100644 --- a/src/eth0/current_host_receive_buffer_address.rs +++ b/src/eth0/current_host_receive_buffer_address.rs @@ -1,20 +1,7 @@ #[doc = "Register `CURRENT_HOST_RECEIVE_BUFFER_ADDRESS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `CURRBUFAPTR` reader - Host Receive Buffer Address Pointer"] -pub type CURRBUFAPTR_R = crate::FieldReader; +pub type CURRBUFAPTR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Host Receive Buffer Address Pointer"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { CURRBUFAPTR_R::new(self.bits) } } -#[doc = "Current Host Receive 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 [current_host_receive_buffer_address](index.html) module"] +#[doc = "Current Host Receive Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`current_host_receive_buffer_address::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CURRENT_HOST_RECEIVE_BUFFER_ADDRESS_SPEC; impl crate::RegisterSpec for CURRENT_HOST_RECEIVE_BUFFER_ADDRESS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [current_host_receive_buffer_address::R](R) reader structure"] -impl crate::Readable for CURRENT_HOST_RECEIVE_BUFFER_ADDRESS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`current_host_receive_buffer_address::R`](R) reader structure"] +impl crate::Readable for CURRENT_HOST_RECEIVE_BUFFER_ADDRESS_SPEC {} #[doc = "`reset()` method sets CURRENT_HOST_RECEIVE_BUFFER_ADDRESS to value 0"] impl crate::Resettable for CURRENT_HOST_RECEIVE_BUFFER_ADDRESS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/current_host_receive_descriptor.rs b/src/eth0/current_host_receive_descriptor.rs index 11081357..a240541b 100644 --- a/src/eth0/current_host_receive_descriptor.rs +++ b/src/eth0/current_host_receive_descriptor.rs @@ -1,20 +1,7 @@ #[doc = "Register `CURRENT_HOST_RECEIVE_DESCRIPTOR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `CURRDESAPTR` reader - Host Receive Descriptor Address Pointer"] -pub type CURRDESAPTR_R = crate::FieldReader; +pub type CURRDESAPTR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Host Receive Descriptor Address Pointer"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { CURRDESAPTR_R::new(self.bits) } } -#[doc = "Current Host Receive Descriptor 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 [current_host_receive_descriptor](index.html) module"] +#[doc = "Current Host Receive Descriptor Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`current_host_receive_descriptor::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CURRENT_HOST_RECEIVE_DESCRIPTOR_SPEC; impl crate::RegisterSpec for CURRENT_HOST_RECEIVE_DESCRIPTOR_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [current_host_receive_descriptor::R](R) reader structure"] -impl crate::Readable for CURRENT_HOST_RECEIVE_DESCRIPTOR_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`current_host_receive_descriptor::R`](R) reader structure"] +impl crate::Readable for CURRENT_HOST_RECEIVE_DESCRIPTOR_SPEC {} #[doc = "`reset()` method sets CURRENT_HOST_RECEIVE_DESCRIPTOR to value 0"] impl crate::Resettable for CURRENT_HOST_RECEIVE_DESCRIPTOR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/current_host_transmit_buffer_address.rs b/src/eth0/current_host_transmit_buffer_address.rs index ede45c65..4eda9260 100644 --- a/src/eth0/current_host_transmit_buffer_address.rs +++ b/src/eth0/current_host_transmit_buffer_address.rs @@ -1,20 +1,7 @@ #[doc = "Register `CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `CURTBUFAPTR` reader - Host Transmit Buffer Address Pointer"] -pub type CURTBUFAPTR_R = crate::FieldReader; +pub type CURTBUFAPTR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Host Transmit Buffer Address Pointer"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { CURTBUFAPTR_R::new(self.bits) } } -#[doc = "Current Host Transmit 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 [current_host_transmit_buffer_address](index.html) module"] +#[doc = "Current Host Transmit Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`current_host_transmit_buffer_address::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS_SPEC; impl crate::RegisterSpec for CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [current_host_transmit_buffer_address::R](R) reader structure"] -impl crate::Readable for CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`current_host_transmit_buffer_address::R`](R) reader structure"] +impl crate::Readable for CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS_SPEC {} #[doc = "`reset()` method sets CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS to value 0"] impl crate::Resettable for CURRENT_HOST_TRANSMIT_BUFFER_ADDRESS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/current_host_transmit_descriptor.rs b/src/eth0/current_host_transmit_descriptor.rs index 82bd7b79..7daae092 100644 --- a/src/eth0/current_host_transmit_descriptor.rs +++ b/src/eth0/current_host_transmit_descriptor.rs @@ -1,20 +1,7 @@ #[doc = "Register `CURRENT_HOST_TRANSMIT_DESCRIPTOR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `CURTDESAPTR` reader - Host Transmit Descriptor Address Pointer"] -pub type CURTDESAPTR_R = crate::FieldReader; +pub type CURTDESAPTR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Host Transmit Descriptor Address Pointer"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { CURTDESAPTR_R::new(self.bits) } } -#[doc = "Current Host Transmit Descriptor 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 [current_host_transmit_descriptor](index.html) module"] +#[doc = "Current Host Transmit Descriptor Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`current_host_transmit_descriptor::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CURRENT_HOST_TRANSMIT_DESCRIPTOR_SPEC; impl crate::RegisterSpec for CURRENT_HOST_TRANSMIT_DESCRIPTOR_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [current_host_transmit_descriptor::R](R) reader structure"] -impl crate::Readable for CURRENT_HOST_TRANSMIT_DESCRIPTOR_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`current_host_transmit_descriptor::R`](R) reader structure"] +impl crate::Readable for CURRENT_HOST_TRANSMIT_DESCRIPTOR_SPEC {} #[doc = "`reset()` method sets CURRENT_HOST_TRANSMIT_DESCRIPTOR to value 0"] impl crate::Resettable for CURRENT_HOST_TRANSMIT_DESCRIPTOR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/debug.rs b/src/eth0/debug.rs index 22a9647c..61c8c342 100644 --- a/src/eth0/debug.rs +++ b/src/eth0/debug.rs @@ -1,42 +1,29 @@ #[doc = "Register `DEBUG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RPESTS` reader - MAC MII Receive Protocol Engine Status"] -pub type RPESTS_R = crate::BitReader; +pub type RPESTS_R = crate::BitReader; #[doc = "Field `RFCFCSTS` reader - MAC Receive Frame Controller FIFO Status"] -pub type RFCFCSTS_R = crate::FieldReader; +pub type RFCFCSTS_R = crate::FieldReader; #[doc = "Field `RWCSTS` reader - MTL Rx FIFO Write Controller Active Status"] -pub type RWCSTS_R = crate::BitReader; +pub type RWCSTS_R = crate::BitReader; #[doc = "Field `RRCSTS` reader - MTL Rx FIFO Read Controller State"] -pub type RRCSTS_R = crate::FieldReader; +pub type RRCSTS_R = crate::FieldReader; #[doc = "Field `RXFSTS` reader - MTL Rx FIFO Fill-level Status"] -pub type RXFSTS_R = crate::FieldReader; +pub type RXFSTS_R = crate::FieldReader; #[doc = "Field `TPESTS` reader - MAC MII Transmit Protocol Engine Status"] -pub type TPESTS_R = crate::BitReader; +pub type TPESTS_R = crate::BitReader; #[doc = "Field `TFCSTS` reader - MAC Transmit Frame Controller Status"] -pub type TFCSTS_R = crate::FieldReader; +pub type TFCSTS_R = crate::FieldReader; #[doc = "Field `TXPAUSED` reader - MAC transmitter in PAUSE"] -pub type TXPAUSED_R = crate::BitReader; +pub type TXPAUSED_R = crate::BitReader; #[doc = "Field `TRCSTS` reader - MTL Tx FIFO Read Controller Status"] -pub type TRCSTS_R = crate::FieldReader; +pub type TRCSTS_R = crate::FieldReader; #[doc = "Field `TWCSTS` reader - MTL Tx FIFO Write Controller Active Status"] -pub type TWCSTS_R = crate::BitReader; +pub type TWCSTS_R = crate::BitReader; #[doc = "Field `TXFSTS` reader - MTL Tx FIFO Not Empty Status"] -pub type TXFSTS_R = crate::BitReader; +pub type TXFSTS_R = crate::BitReader; #[doc = "Field `TXSTSFSTS` reader - MTL TxStatus FIFO Full Status"] -pub type TXSTSFSTS_R = crate::BitReader; +pub type TXSTSFSTS_R = crate::BitReader; impl R { #[doc = "Bit 0 - MAC MII Receive Protocol Engine Status"] #[inline(always)] @@ -99,15 +86,13 @@ impl R { TXSTSFSTS_R::new(((self.bits >> 25) & 1) != 0) } } -#[doc = "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 [debug](index.html) module"] +#[doc = "Debug Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`debug::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct DEBUG_SPEC; impl crate::RegisterSpec for DEBUG_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [debug::R](R) reader structure"] -impl crate::Readable for DEBUG_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`debug::R`](R) reader structure"] +impl crate::Readable for DEBUG_SPEC {} #[doc = "`reset()` method sets DEBUG to value 0"] impl crate::Resettable for DEBUG_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/flow_control.rs b/src/eth0/flow_control.rs index d6ee27c3..83a6665d 100644 --- a/src/eth0/flow_control.rs +++ b/src/eth0/flow_control.rs @@ -1,67 +1,35 @@ #[doc = "Register `FLOW_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) - } -} +pub type R = crate::R; #[doc = "Register `FLOW_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) - } -} +pub type W = crate::W; #[doc = "Field `FCA_BPA` reader - Flow Control Busy or Backpressure Activate"] -pub type FCA_BPA_R = crate::BitReader; +pub type FCA_BPA_R = crate::BitReader; #[doc = "Field `FCA_BPA` writer - Flow Control Busy or Backpressure Activate"] -pub type FCA_BPA_W<'a, const O: u8> = crate::BitWriter<'a, u32, FLOW_CONTROL_SPEC, bool, O>; +pub type FCA_BPA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TFE` reader - Transmit Flow Control Enable"] -pub type TFE_R = crate::BitReader; +pub type TFE_R = crate::BitReader; #[doc = "Field `TFE` writer - Transmit Flow Control Enable"] -pub type TFE_W<'a, const O: u8> = crate::BitWriter<'a, u32, FLOW_CONTROL_SPEC, bool, O>; +pub type TFE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RFE` reader - Receive Flow Control Enable"] -pub type RFE_R = crate::BitReader; +pub type RFE_R = crate::BitReader; #[doc = "Field `RFE` writer - Receive Flow Control Enable"] -pub type RFE_W<'a, const O: u8> = crate::BitWriter<'a, u32, FLOW_CONTROL_SPEC, bool, O>; +pub type RFE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `UP` reader - Unicast Pause Frame Detect"] -pub type UP_R = crate::BitReader; +pub type UP_R = crate::BitReader; #[doc = "Field `UP` writer - Unicast Pause Frame Detect"] -pub type UP_W<'a, const O: u8> = crate::BitWriter<'a, u32, FLOW_CONTROL_SPEC, bool, O>; +pub type UP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PLT` reader - Pause Low Threshold"] -pub type PLT_R = crate::FieldReader; +pub type PLT_R = crate::FieldReader; #[doc = "Field `PLT` writer - Pause Low Threshold"] -pub type PLT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FLOW_CONTROL_SPEC, u8, u8, 2, O>; +pub type PLT_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `DZPQ` reader - Disable Zero-Quanta Pause"] -pub type DZPQ_R = crate::BitReader; +pub type DZPQ_R = crate::BitReader; #[doc = "Field `DZPQ` writer - Disable Zero-Quanta Pause"] -pub type DZPQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, FLOW_CONTROL_SPEC, bool, O>; +pub type DZPQ_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PT` reader - Pause Time"] -pub type PT_R = crate::FieldReader; +pub type PT_R = crate::FieldReader; #[doc = "Field `PT` writer - Pause Time"] -pub type PT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FLOW_CONTROL_SPEC, u16, u16, 16, O>; +pub type PT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bit 0 - Flow Control Busy or Backpressure Activate"] #[inline(always)] @@ -103,64 +71,65 @@ impl W { #[doc = "Bit 0 - Flow Control Busy or Backpressure Activate"] #[inline(always)] #[must_use] - pub fn fca_bpa(&mut self) -> FCA_BPA_W<0> { - FCA_BPA_W::new(self) + pub fn fca_bpa(&mut self) -> FCA_BPA_W { + FCA_BPA_W::new(self, 0) } #[doc = "Bit 1 - Transmit Flow Control Enable"] #[inline(always)] #[must_use] - pub fn tfe(&mut self) -> TFE_W<1> { - TFE_W::new(self) + pub fn tfe(&mut self) -> TFE_W { + TFE_W::new(self, 1) } #[doc = "Bit 2 - Receive Flow Control Enable"] #[inline(always)] #[must_use] - pub fn rfe(&mut self) -> RFE_W<2> { - RFE_W::new(self) + pub fn rfe(&mut self) -> RFE_W { + RFE_W::new(self, 2) } #[doc = "Bit 3 - Unicast Pause Frame Detect"] #[inline(always)] #[must_use] - pub fn up(&mut self) -> UP_W<3> { - UP_W::new(self) + pub fn up(&mut self) -> UP_W { + UP_W::new(self, 3) } #[doc = "Bits 4:5 - Pause Low Threshold"] #[inline(always)] #[must_use] - pub fn plt(&mut self) -> PLT_W<4> { - PLT_W::new(self) + pub fn plt(&mut self) -> PLT_W { + PLT_W::new(self, 4) } #[doc = "Bit 7 - Disable Zero-Quanta Pause"] #[inline(always)] #[must_use] - pub fn dzpq(&mut self) -> DZPQ_W<7> { - DZPQ_W::new(self) + pub fn dzpq(&mut self) -> DZPQ_W { + DZPQ_W::new(self, 7) } #[doc = "Bits 16:31 - Pause Time"] #[inline(always)] #[must_use] - pub fn pt(&mut self) -> PT_W<16> { - PT_W::new(self) + pub fn pt(&mut self) -> PT_W { + PT_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Flow 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 [flow_control](index.html) module"] +#[doc = "Flow Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`flow_control::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`flow_control::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct FLOW_CONTROL_SPEC; impl crate::RegisterSpec for FLOW_CONTROL_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [flow_control::R](R) reader structure"] -impl crate::Readable for FLOW_CONTROL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [flow_control::W](W) writer structure"] +#[doc = "`read()` method returns [`flow_control::R`](R) reader structure"] +impl crate::Readable for FLOW_CONTROL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`flow_control::W`](W) writer structure"] impl crate::Writable for FLOW_CONTROL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/gmii_address.rs b/src/eth0/gmii_address.rs index 869acc43..0bed4580 100644 --- a/src/eth0/gmii_address.rs +++ b/src/eth0/gmii_address.rs @@ -1,59 +1,27 @@ #[doc = "Register `GMII_ADDRESS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GMII_ADDRESS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `MB` reader - MII Busy"] -pub type MB_R = crate::BitReader; +pub type MB_R = crate::BitReader; #[doc = "Field `MB` writer - MII Busy"] -pub type MB_W<'a, const O: u8> = crate::BitWriter<'a, u32, GMII_ADDRESS_SPEC, bool, O>; +pub type MB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MW` reader - MII Write"] -pub type MW_R = crate::BitReader; +pub type MW_R = crate::BitReader; #[doc = "Field `MW` writer - MII Write"] -pub type MW_W<'a, const O: u8> = crate::BitWriter<'a, u32, GMII_ADDRESS_SPEC, bool, O>; +pub type MW_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CR` reader - CSR Clock Range"] -pub type CR_R = crate::FieldReader; +pub type CR_R = crate::FieldReader; #[doc = "Field `CR` writer - CSR Clock Range"] -pub type CR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GMII_ADDRESS_SPEC, u8, u8, 4, O>; +pub type CR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `MR` reader - MII Register"] -pub type MR_R = crate::FieldReader; +pub type MR_R = crate::FieldReader; #[doc = "Field `MR` writer - MII Register"] -pub type MR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GMII_ADDRESS_SPEC, u8, u8, 5, O>; +pub type MR_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PA` reader - Physical Layer Address"] -pub type PA_R = crate::FieldReader; +pub type PA_R = crate::FieldReader; #[doc = "Field `PA` writer - Physical Layer Address"] -pub type PA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GMII_ADDRESS_SPEC, u8, u8, 5, O>; +pub type PA_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; impl R { #[doc = "Bit 0 - MII Busy"] #[inline(always)] @@ -85,52 +53,53 @@ impl W { #[doc = "Bit 0 - MII Busy"] #[inline(always)] #[must_use] - pub fn mb(&mut self) -> MB_W<0> { - MB_W::new(self) + pub fn mb(&mut self) -> MB_W { + MB_W::new(self, 0) } #[doc = "Bit 1 - MII Write"] #[inline(always)] #[must_use] - pub fn mw(&mut self) -> MW_W<1> { - MW_W::new(self) + pub fn mw(&mut self) -> MW_W { + MW_W::new(self, 1) } #[doc = "Bits 2:5 - CSR Clock Range"] #[inline(always)] #[must_use] - pub fn cr(&mut self) -> CR_W<2> { - CR_W::new(self) + pub fn cr(&mut self) -> CR_W { + CR_W::new(self, 2) } #[doc = "Bits 6:10 - MII Register"] #[inline(always)] #[must_use] - pub fn mr(&mut self) -> MR_W<6> { - MR_W::new(self) + pub fn mr(&mut self) -> MR_W { + MR_W::new(self, 6) } #[doc = "Bits 11:15 - Physical Layer Address"] #[inline(always)] #[must_use] - pub fn pa(&mut self) -> PA_W<11> { - PA_W::new(self) + pub fn pa(&mut self) -> PA_W { + PA_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MII 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 [gmii_address](index.html) module"] +#[doc = "MII Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gmii_address::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gmii_address::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GMII_ADDRESS_SPEC; impl crate::RegisterSpec for GMII_ADDRESS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gmii_address::R](R) reader structure"] -impl crate::Readable for GMII_ADDRESS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gmii_address::W](W) writer structure"] +#[doc = "`read()` method returns [`gmii_address::R`](R) reader structure"] +impl crate::Readable for GMII_ADDRESS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gmii_address::W`](W) writer structure"] impl crate::Writable for GMII_ADDRESS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/gmii_data.rs b/src/eth0/gmii_data.rs index 8418ca9a..101971ae 100644 --- a/src/eth0/gmii_data.rs +++ b/src/eth0/gmii_data.rs @@ -1,43 +1,11 @@ #[doc = "Register `GMII_DATA` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GMII_DATA` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `MD` reader - MII Data"] -pub type MD_R = crate::FieldReader; +pub type MD_R = crate::FieldReader; #[doc = "Field `MD` writer - MII Data"] -pub type MD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GMII_DATA_SPEC, u16, u16, 16, O>; +pub type MD_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - MII Data"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - MII Data"] #[inline(always)] #[must_use] - pub fn md(&mut self) -> MD_W<0> { - MD_W::new(self) + pub fn md(&mut self) -> MD_W { + MD_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MII 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 [gmii_data](index.html) module"] +#[doc = "MII Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gmii_data::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gmii_data::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GMII_DATA_SPEC; impl crate::RegisterSpec for GMII_DATA_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gmii_data::R](R) reader structure"] -impl crate::Readable for GMII_DATA_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gmii_data::W](W) writer structure"] +#[doc = "`read()` method returns [`gmii_data::R`](R) reader structure"] +impl crate::Readable for GMII_DATA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gmii_data::W`](W) writer structure"] impl crate::Writable for GMII_DATA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/hash_table_high.rs b/src/eth0/hash_table_high.rs index 51a0501b..087f90a3 100644 --- a/src/eth0/hash_table_high.rs +++ b/src/eth0/hash_table_high.rs @@ -1,43 +1,11 @@ #[doc = "Register `HASH_TABLE_HIGH` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HASH_TABLE_HIGH` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `HTH` reader - Hash Table High"] -pub type HTH_R = crate::FieldReader; +pub type HTH_R = crate::FieldReader; #[doc = "Field `HTH` writer - Hash Table High"] -pub type HTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HASH_TABLE_HIGH_SPEC, u32, u32, 32, O>; +pub type HTH_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Hash Table High"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Hash Table High"] #[inline(always)] #[must_use] - pub fn hth(&mut self) -> HTH_W<0> { - HTH_W::new(self) + pub fn hth(&mut self) -> HTH_W { + HTH_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Hash Table High 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 [hash_table_high](index.html) module"] +#[doc = "Hash Table High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hash_table_high::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hash_table_high::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HASH_TABLE_HIGH_SPEC; impl crate::RegisterSpec for HASH_TABLE_HIGH_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hash_table_high::R](R) reader structure"] -impl crate::Readable for HASH_TABLE_HIGH_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hash_table_high::W](W) writer structure"] +#[doc = "`read()` method returns [`hash_table_high::R`](R) reader structure"] +impl crate::Readable for HASH_TABLE_HIGH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hash_table_high::W`](W) writer structure"] impl crate::Writable for HASH_TABLE_HIGH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/hash_table_low.rs b/src/eth0/hash_table_low.rs index ca079113..be3f6115 100644 --- a/src/eth0/hash_table_low.rs +++ b/src/eth0/hash_table_low.rs @@ -1,43 +1,11 @@ #[doc = "Register `HASH_TABLE_LOW` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HASH_TABLE_LOW` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `HTL` reader - Hash Table Low"] -pub type HTL_R = crate::FieldReader; +pub type HTL_R = crate::FieldReader; #[doc = "Field `HTL` writer - Hash Table Low"] -pub type HTL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HASH_TABLE_LOW_SPEC, u32, u32, 32, O>; +pub type HTL_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Hash Table Low"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Hash Table Low"] #[inline(always)] #[must_use] - pub fn htl(&mut self) -> HTL_W<0> { - HTL_W::new(self) + pub fn htl(&mut self) -> HTL_W { + HTL_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Hash Table Low 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 [hash_table_low](index.html) module"] +#[doc = "Hash Table Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hash_table_low::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hash_table_low::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HASH_TABLE_LOW_SPEC; impl crate::RegisterSpec for HASH_TABLE_LOW_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hash_table_low::R](R) reader structure"] -impl crate::Readable for HASH_TABLE_LOW_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hash_table_low::W](W) writer structure"] +#[doc = "`read()` method returns [`hash_table_low::R`](R) reader structure"] +impl crate::Readable for HASH_TABLE_LOW_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hash_table_low::W`](W) writer structure"] impl crate::Writable for HASH_TABLE_LOW_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/hw_feature.rs b/src/eth0/hw_feature.rs index 5ef4f29e..e370d752 100644 --- a/src/eth0/hw_feature.rs +++ b/src/eth0/hw_feature.rs @@ -1,95 +1,63 @@ #[doc = "Register `HW_FEATURE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HW_FEATURE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `MIISEL` reader - 10 or 100 Mbps support"] -pub type MIISEL_R = crate::BitReader; +pub type MIISEL_R = crate::BitReader; #[doc = "Field `GMIISEL` reader - 1000 Mbps support"] -pub type GMIISEL_R = crate::BitReader; +pub type GMIISEL_R = crate::BitReader; #[doc = "Field `HDSEL` reader - Half-Duplex support"] -pub type HDSEL_R = crate::BitReader; +pub type HDSEL_R = crate::BitReader; #[doc = "Field `EXTHASHEN` reader - Expanded DA Hash Filter"] -pub type EXTHASHEN_R = crate::BitReader; +pub type EXTHASHEN_R = crate::BitReader; #[doc = "Field `HASHSEL` reader - HASH Filter"] -pub type HASHSEL_R = crate::BitReader; +pub type HASHSEL_R = crate::BitReader; #[doc = "Field `ADDMACADRSEL` reader - Multiple MAC Address Registers"] -pub type ADDMACADRSEL_R = crate::BitReader; +pub type ADDMACADRSEL_R = crate::BitReader; #[doc = "Field `PCSSEL` reader - PCS registers (TBI, SGMII, or RTBI PHY interface)"] -pub type PCSSEL_R = crate::BitReader; +pub type PCSSEL_R = crate::BitReader; #[doc = "Field `L3L4FLTREN` reader - Layer 3 and Layer 4 Filter Feature"] -pub type L3L4FLTREN_R = crate::BitReader; +pub type L3L4FLTREN_R = crate::BitReader; #[doc = "Field `SMASEL` reader - SMA (MDIO) Interface"] -pub type SMASEL_R = crate::BitReader; +pub type SMASEL_R = crate::BitReader; #[doc = "Field `RWKSEL` reader - PMT Remote Wakeup"] -pub type RWKSEL_R = crate::BitReader; +pub type RWKSEL_R = crate::BitReader; #[doc = "Field `MGKSEL` reader - PMT Magic Packet"] -pub type MGKSEL_R = crate::BitReader; +pub type MGKSEL_R = crate::BitReader; #[doc = "Field `MMCSEL` reader - RMON Module"] -pub type MMCSEL_R = crate::BitReader; +pub type MMCSEL_R = crate::BitReader; #[doc = "Field `TSVER1SEL` reader - Only IEEE 1588-2002 Timestamp"] -pub type TSVER1SEL_R = crate::BitReader; +pub type TSVER1SEL_R = crate::BitReader; #[doc = "Field `TSVER2SEL` reader - IEEE 1588-2008 Advanced Timestamp"] -pub type TSVER2SEL_R = crate::BitReader; +pub type TSVER2SEL_R = crate::BitReader; #[doc = "Field `EEESEL` reader - Energy Efficient Ethernet"] -pub type EEESEL_R = crate::BitReader; +pub type EEESEL_R = crate::BitReader; #[doc = "Field `AVSEL` reader - AV Feature"] -pub type AVSEL_R = crate::BitReader; +pub type AVSEL_R = crate::BitReader; #[doc = "Field `TXCOESEL` reader - Checksum Offload in Tx"] -pub type TXCOESEL_R = crate::BitReader; +pub type TXCOESEL_R = crate::BitReader; #[doc = "Field `RXTYP1COE` reader - IP Checksum Offload (Type 1) in Rx"] -pub type RXTYP1COE_R = crate::BitReader; +pub type RXTYP1COE_R = crate::BitReader; #[doc = "Field `RXTYP2COE` reader - IP Checksum Offload (Type 2) in Rx"] -pub type RXTYP2COE_R = crate::BitReader; +pub type RXTYP2COE_R = crate::BitReader; #[doc = "Field `RXFIFOSIZE` reader - Rx FIFO > 2,048 Bytes"] -pub type RXFIFOSIZE_R = crate::BitReader; +pub type RXFIFOSIZE_R = crate::BitReader; #[doc = "Field `RXFIFOSIZE` writer - Rx FIFO > 2,048 Bytes"] -pub type RXFIFOSIZE_W<'a, const O: u8> = crate::BitWriter<'a, u32, HW_FEATURE_SPEC, bool, O>; +pub type RXFIFOSIZE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXCHCNT` reader - Number of additional Rx channels"] -pub type RXCHCNT_R = crate::FieldReader; +pub type RXCHCNT_R = crate::FieldReader; #[doc = "Field `TXCHCNT` reader - Number of additional Tx channels"] -pub type TXCHCNT_R = crate::FieldReader; +pub type TXCHCNT_R = crate::FieldReader; #[doc = "Field `ENHDESSEL` reader - Alternate (Enhanced Descriptor)"] -pub type ENHDESSEL_R = crate::BitReader; +pub type ENHDESSEL_R = crate::BitReader; #[doc = "Field `INTTSEN` reader - Timestamping with Internal System Time"] -pub type INTTSEN_R = crate::BitReader; +pub type INTTSEN_R = crate::BitReader; #[doc = "Field `FLEXIPPSEN` reader - Flexible Pulse-Per-Second Output"] -pub type FLEXIPPSEN_R = crate::BitReader; +pub type FLEXIPPSEN_R = crate::BitReader; #[doc = "Field `SAVLANINS` reader - Source Address or VLAN Insertion"] -pub type SAVLANINS_R = crate::BitReader; +pub type SAVLANINS_R = crate::BitReader; #[doc = "Field `ACTPHYIF` reader - Active or Selected PHY interface"] -pub type ACTPHYIF_R = crate::FieldReader; +pub type ACTPHYIF_R = crate::FieldReader; impl R { #[doc = "Bit 0 - 10 or 100 Mbps support"] #[inline(always)] @@ -231,28 +199,29 @@ impl W { #[doc = "Bit 19 - Rx FIFO > 2,048 Bytes"] #[inline(always)] #[must_use] - pub fn rxfifosize(&mut self) -> RXFIFOSIZE_W<19> { - RXFIFOSIZE_W::new(self) + pub fn rxfifosize(&mut self) -> RXFIFOSIZE_W { + RXFIFOSIZE_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "HW Feature 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 [hw_feature](index.html) module"] +#[doc = "HW Feature Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hw_feature::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hw_feature::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HW_FEATURE_SPEC; impl crate::RegisterSpec for HW_FEATURE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hw_feature::R](R) reader structure"] -impl crate::Readable for HW_FEATURE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hw_feature::W](W) writer structure"] +#[doc = "`read()` method returns [`hw_feature::R`](R) reader structure"] +impl crate::Readable for HW_FEATURE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hw_feature::W`](W) writer structure"] impl crate::Writable for HW_FEATURE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/interrupt_enable.rs b/src/eth0/interrupt_enable.rs index 36a0e641..8d21d5c2 100644 --- a/src/eth0/interrupt_enable.rs +++ b/src/eth0/interrupt_enable.rs @@ -1,99 +1,67 @@ #[doc = "Register `INTERRUPT_ENABLE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `INTERRUPT_ENABLE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TIE` reader - Transmit Interrupt Enable"] -pub type TIE_R = crate::BitReader; +pub type TIE_R = crate::BitReader; #[doc = "Field `TIE` writer - Transmit Interrupt Enable"] -pub type TIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type TIE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSE` reader - Transmit Stopped Enable"] -pub type TSE_R = crate::BitReader; +pub type TSE_R = crate::BitReader; #[doc = "Field `TSE` writer - Transmit Stopped Enable"] -pub type TSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type TSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TUE` reader - Transmit Buffer Unvailable Enable"] -pub type TUE_R = crate::BitReader; +pub type TUE_R = crate::BitReader; #[doc = "Field `TUE` writer - Transmit Buffer Unvailable Enable"] -pub type TUE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type TUE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TJE` reader - Transmit Jabber Timeout Enable"] -pub type TJE_R = crate::BitReader; +pub type TJE_R = crate::BitReader; #[doc = "Field `TJE` writer - Transmit Jabber Timeout Enable"] -pub type TJE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type TJE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OVE` reader - Overflow Interrupt Enable"] -pub type OVE_R = crate::BitReader; +pub type OVE_R = crate::BitReader; #[doc = "Field `OVE` writer - Overflow Interrupt Enable"] -pub type OVE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type OVE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `UNE` reader - Underflow Interrupt Enable"] -pub type UNE_R = crate::BitReader; +pub type UNE_R = crate::BitReader; #[doc = "Field `UNE` writer - Underflow Interrupt Enable"] -pub type UNE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type UNE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RIE` reader - Receive Interrupt Enable"] -pub type RIE_R = crate::BitReader; +pub type RIE_R = crate::BitReader; #[doc = "Field `RIE` writer - Receive Interrupt Enable"] -pub type RIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type RIE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RUE` reader - Receive Buffer Unavailable Enable"] -pub type RUE_R = crate::BitReader; +pub type RUE_R = crate::BitReader; #[doc = "Field `RUE` writer - Receive Buffer Unavailable Enable"] -pub type RUE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type RUE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RSE` reader - Receive Stopped Enable"] -pub type RSE_R = crate::BitReader; +pub type RSE_R = crate::BitReader; #[doc = "Field `RSE` writer - Receive Stopped Enable"] -pub type RSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type RSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RWE` reader - Receive Watchdog Timeout Enable"] -pub type RWE_R = crate::BitReader; +pub type RWE_R = crate::BitReader; #[doc = "Field `RWE` writer - Receive Watchdog Timeout Enable"] -pub type RWE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type RWE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ETE` reader - Early Transmit Interrupt Enable"] -pub type ETE_R = crate::BitReader; +pub type ETE_R = crate::BitReader; #[doc = "Field `ETE` writer - Early Transmit Interrupt Enable"] -pub type ETE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type ETE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FBE` reader - Fatal Bus Error Enable"] -pub type FBE_R = crate::BitReader; +pub type FBE_R = crate::BitReader; #[doc = "Field `FBE` writer - Fatal Bus Error Enable"] -pub type FBE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type FBE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ERE` reader - Early Receive Interrupt Enable"] -pub type ERE_R = crate::BitReader; +pub type ERE_R = crate::BitReader; #[doc = "Field `ERE` writer - Early Receive Interrupt Enable"] -pub type ERE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type ERE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AIE` reader - Abnormal Interrupt Summary Enable"] -pub type AIE_R = crate::BitReader; +pub type AIE_R = crate::BitReader; #[doc = "Field `AIE` writer - Abnormal Interrupt Summary Enable"] -pub type AIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type AIE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NIE` reader - Normal Interrupt Summary Enable"] -pub type NIE_R = crate::BitReader; +pub type NIE_R = crate::BitReader; #[doc = "Field `NIE` writer - Normal Interrupt Summary Enable"] -pub type NIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_ENABLE_SPEC, bool, O>; +pub type NIE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transmit Interrupt Enable"] #[inline(always)] @@ -175,112 +143,113 @@ impl W { #[doc = "Bit 0 - Transmit Interrupt Enable"] #[inline(always)] #[must_use] - pub fn tie(&mut self) -> TIE_W<0> { - TIE_W::new(self) + pub fn tie(&mut self) -> TIE_W { + TIE_W::new(self, 0) } #[doc = "Bit 1 - Transmit Stopped Enable"] #[inline(always)] #[must_use] - pub fn tse(&mut self) -> TSE_W<1> { - TSE_W::new(self) + pub fn tse(&mut self) -> TSE_W { + TSE_W::new(self, 1) } #[doc = "Bit 2 - Transmit Buffer Unvailable Enable"] #[inline(always)] #[must_use] - pub fn tue(&mut self) -> TUE_W<2> { - TUE_W::new(self) + pub fn tue(&mut self) -> TUE_W { + TUE_W::new(self, 2) } #[doc = "Bit 3 - Transmit Jabber Timeout Enable"] #[inline(always)] #[must_use] - pub fn tje(&mut self) -> TJE_W<3> { - TJE_W::new(self) + pub fn tje(&mut self) -> TJE_W { + TJE_W::new(self, 3) } #[doc = "Bit 4 - Overflow Interrupt Enable"] #[inline(always)] #[must_use] - pub fn ove(&mut self) -> OVE_W<4> { - OVE_W::new(self) + pub fn ove(&mut self) -> OVE_W { + OVE_W::new(self, 4) } #[doc = "Bit 5 - Underflow Interrupt Enable"] #[inline(always)] #[must_use] - pub fn une(&mut self) -> UNE_W<5> { - UNE_W::new(self) + pub fn une(&mut self) -> UNE_W { + UNE_W::new(self, 5) } #[doc = "Bit 6 - Receive Interrupt Enable"] #[inline(always)] #[must_use] - pub fn rie(&mut self) -> RIE_W<6> { - RIE_W::new(self) + pub fn rie(&mut self) -> RIE_W { + RIE_W::new(self, 6) } #[doc = "Bit 7 - Receive Buffer Unavailable Enable"] #[inline(always)] #[must_use] - pub fn rue(&mut self) -> RUE_W<7> { - RUE_W::new(self) + pub fn rue(&mut self) -> RUE_W { + RUE_W::new(self, 7) } #[doc = "Bit 8 - Receive Stopped Enable"] #[inline(always)] #[must_use] - pub fn rse(&mut self) -> RSE_W<8> { - RSE_W::new(self) + pub fn rse(&mut self) -> RSE_W { + RSE_W::new(self, 8) } #[doc = "Bit 9 - Receive Watchdog Timeout Enable"] #[inline(always)] #[must_use] - pub fn rwe(&mut self) -> RWE_W<9> { - RWE_W::new(self) + pub fn rwe(&mut self) -> RWE_W { + RWE_W::new(self, 9) } #[doc = "Bit 10 - Early Transmit Interrupt Enable"] #[inline(always)] #[must_use] - pub fn ete(&mut self) -> ETE_W<10> { - ETE_W::new(self) + pub fn ete(&mut self) -> ETE_W { + ETE_W::new(self, 10) } #[doc = "Bit 13 - Fatal Bus Error Enable"] #[inline(always)] #[must_use] - pub fn fbe(&mut self) -> FBE_W<13> { - FBE_W::new(self) + pub fn fbe(&mut self) -> FBE_W { + FBE_W::new(self, 13) } #[doc = "Bit 14 - Early Receive Interrupt Enable"] #[inline(always)] #[must_use] - pub fn ere(&mut self) -> ERE_W<14> { - ERE_W::new(self) + pub fn ere(&mut self) -> ERE_W { + ERE_W::new(self, 14) } #[doc = "Bit 15 - Abnormal Interrupt Summary Enable"] #[inline(always)] #[must_use] - pub fn aie(&mut self) -> AIE_W<15> { - AIE_W::new(self) + pub fn aie(&mut self) -> AIE_W { + AIE_W::new(self, 15) } #[doc = "Bit 16 - Normal Interrupt Summary Enable"] #[inline(always)] #[must_use] - pub fn nie(&mut self) -> NIE_W<16> { - NIE_W::new(self) + pub fn nie(&mut self) -> NIE_W { + NIE_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Interrupt 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 [interrupt_enable](index.html) module"] +#[doc = "Interrupt Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`interrupt_enable::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`interrupt_enable::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct INTERRUPT_ENABLE_SPEC; impl crate::RegisterSpec for INTERRUPT_ENABLE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [interrupt_enable::R](R) reader structure"] -impl crate::Readable for INTERRUPT_ENABLE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [interrupt_enable::W](W) writer structure"] +#[doc = "`read()` method returns [`interrupt_enable::R`](R) reader structure"] +impl crate::Readable for INTERRUPT_ENABLE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`interrupt_enable::W`](W) writer structure"] impl crate::Writable for INTERRUPT_ENABLE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/interrupt_mask.rs b/src/eth0/interrupt_mask.rs index 9cf29103..cd9d57c4 100644 --- a/src/eth0/interrupt_mask.rs +++ b/src/eth0/interrupt_mask.rs @@ -1,47 +1,15 @@ #[doc = "Register `INTERRUPT_MASK` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `INTERRUPT_MASK` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PMTIM` reader - PMT Interrupt Mask"] -pub type PMTIM_R = crate::BitReader; +pub type PMTIM_R = crate::BitReader; #[doc = "Field `PMTIM` writer - PMT Interrupt Mask"] -pub type PMTIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_MASK_SPEC, bool, O>; +pub type PMTIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSIM` reader - Timestamp Interrupt Mask"] -pub type TSIM_R = crate::BitReader; +pub type TSIM_R = crate::BitReader; #[doc = "Field `TSIM` writer - Timestamp Interrupt Mask"] -pub type TSIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTERRUPT_MASK_SPEC, bool, O>; +pub type TSIM_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 3 - PMT Interrupt Mask"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bit 3 - PMT Interrupt Mask"] #[inline(always)] #[must_use] - pub fn pmtim(&mut self) -> PMTIM_W<3> { - PMTIM_W::new(self) + pub fn pmtim(&mut self) -> PMTIM_W { + PMTIM_W::new(self, 3) } #[doc = "Bit 9 - Timestamp Interrupt Mask"] #[inline(always)] #[must_use] - pub fn tsim(&mut self) -> TSIM_W<9> { - TSIM_W::new(self) + pub fn tsim(&mut self) -> TSIM_W { + TSIM_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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 [interrupt_mask](index.html) module"] +#[doc = "Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`interrupt_mask::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`interrupt_mask::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct INTERRUPT_MASK_SPEC; impl crate::RegisterSpec for INTERRUPT_MASK_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [interrupt_mask::R](R) reader structure"] -impl crate::Readable for INTERRUPT_MASK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [interrupt_mask::W](W) writer structure"] +#[doc = "`read()` method returns [`interrupt_mask::R`](R) reader structure"] +impl crate::Readable for INTERRUPT_MASK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`interrupt_mask::W`](W) writer structure"] impl crate::Writable for INTERRUPT_MASK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/interrupt_status.rs b/src/eth0/interrupt_status.rs index c78c1177..72d9ebdb 100644 --- a/src/eth0/interrupt_status.rs +++ b/src/eth0/interrupt_status.rs @@ -1,30 +1,17 @@ #[doc = "Register `INTERRUPT_STATUS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `PMTIS` reader - PMT Interrupt Status"] -pub type PMTIS_R = crate::BitReader; +pub type PMTIS_R = crate::BitReader; #[doc = "Field `MMCIS` reader - MMC Interrupt Status"] -pub type MMCIS_R = crate::BitReader; +pub type MMCIS_R = crate::BitReader; #[doc = "Field `MMCRXIS` reader - MMC Receive Interrupt Status"] -pub type MMCRXIS_R = crate::BitReader; +pub type MMCRXIS_R = crate::BitReader; #[doc = "Field `MMCTXIS` reader - MMC Transmit Interrupt Status"] -pub type MMCTXIS_R = crate::BitReader; +pub type MMCTXIS_R = crate::BitReader; #[doc = "Field `MMCRXIPIS` reader - MMC Receive Checksum Offload Interrupt Status"] -pub type MMCRXIPIS_R = crate::BitReader; +pub type MMCRXIPIS_R = crate::BitReader; #[doc = "Field `TSIS` reader - Timestamp Interrupt Status"] -pub type TSIS_R = crate::BitReader; +pub type TSIS_R = crate::BitReader; impl R { #[doc = "Bit 3 - PMT Interrupt Status"] #[inline(always)] @@ -57,15 +44,13 @@ impl R { TSIS_R::new(((self.bits >> 9) & 1) != 0) } } -#[doc = "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 [interrupt_status](index.html) module"] +#[doc = "Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`interrupt_status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct INTERRUPT_STATUS_SPEC; impl crate::RegisterSpec for INTERRUPT_STATUS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [interrupt_status::R](R) reader structure"] -impl crate::Readable for INTERRUPT_STATUS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`interrupt_status::R`](R) reader structure"] +impl crate::Readable for INTERRUPT_STATUS_SPEC {} #[doc = "`reset()` method sets INTERRUPT_STATUS to value 0"] impl crate::Resettable for INTERRUPT_STATUS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/mac_address0_high.rs b/src/eth0/mac_address0_high.rs index c8c529c6..df2cc865 100644 --- a/src/eth0/mac_address0_high.rs +++ b/src/eth0/mac_address0_high.rs @@ -1,45 +1,13 @@ #[doc = "Register `MAC_ADDRESS0_HIGH` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_ADDRESS0_HIGH` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ADDRHI` reader - MAC Address0 \\[47:32\\]"] -pub type ADDRHI_R = crate::FieldReader; +pub type ADDRHI_R = crate::FieldReader; #[doc = "Field `ADDRHI` writer - MAC Address0 \\[47:32\\]"] -pub type ADDRHI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS0_HIGH_SPEC, u16, u16, 16, O>; +pub type ADDRHI_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `AE` reader - Address Enable"] -pub type AE_R = crate::BitReader; +pub type AE_R = crate::BitReader; impl R { #[doc = "Bits 0:15 - MAC Address0 \\[47:32\\]"] #[inline(always)] @@ -56,28 +24,29 @@ impl W { #[doc = "Bits 0:15 - MAC Address0 \\[47:32\\]"] #[inline(always)] #[must_use] - pub fn addrhi(&mut self) -> ADDRHI_W<0> { - ADDRHI_W::new(self) + pub fn addrhi(&mut self) -> ADDRHI_W { + ADDRHI_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Address0 High 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 [mac_address0_high](index.html) module"] +#[doc = "MAC Address0 High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address0_high::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address0_high::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_ADDRESS0_HIGH_SPEC; impl crate::RegisterSpec for MAC_ADDRESS0_HIGH_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_address0_high::R](R) reader structure"] -impl crate::Readable for MAC_ADDRESS0_HIGH_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_address0_high::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_address0_high::R`](R) reader structure"] +impl crate::Readable for MAC_ADDRESS0_HIGH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_address0_high::W`](W) writer structure"] impl crate::Writable for MAC_ADDRESS0_HIGH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_address0_low.rs b/src/eth0/mac_address0_low.rs index 5dfda75d..863e8083 100644 --- a/src/eth0/mac_address0_low.rs +++ b/src/eth0/mac_address0_low.rs @@ -1,43 +1,11 @@ #[doc = "Register `MAC_ADDRESS0_LOW` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_ADDRESS0_LOW` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ADDRLO` reader - MAC Address0 \\[31:0\\]"] -pub type ADDRLO_R = crate::FieldReader; +pub type ADDRLO_R = crate::FieldReader; #[doc = "Field `ADDRLO` writer - MAC Address0 \\[31:0\\]"] -pub type ADDRLO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS0_LOW_SPEC, u32, u32, 32, O>; +pub type ADDRLO_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - MAC Address0 \\[31:0\\]"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - MAC Address0 \\[31:0\\]"] #[inline(always)] #[must_use] - pub fn addrlo(&mut self) -> ADDRLO_W<0> { - ADDRLO_W::new(self) + pub fn addrlo(&mut self) -> ADDRLO_W { + ADDRLO_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Address0 Low 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 [mac_address0_low](index.html) module"] +#[doc = "MAC Address0 Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address0_low::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address0_low::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_ADDRESS0_LOW_SPEC; impl crate::RegisterSpec for MAC_ADDRESS0_LOW_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_address0_low::R](R) reader structure"] -impl crate::Readable for MAC_ADDRESS0_LOW_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_address0_low::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_address0_low::R`](R) reader structure"] +impl crate::Readable for MAC_ADDRESS0_LOW_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_address0_low::W`](W) writer structure"] impl crate::Writable for MAC_ADDRESS0_LOW_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_address1_high.rs b/src/eth0/mac_address1_high.rs index 4b15f2ab..3f5813cf 100644 --- a/src/eth0/mac_address1_high.rs +++ b/src/eth0/mac_address1_high.rs @@ -1,55 +1,23 @@ #[doc = "Register `MAC_ADDRESS1_HIGH` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_ADDRESS1_HIGH` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ADDRHI` reader - MAC Address1 \\[47:32\\]"] -pub type ADDRHI_R = crate::FieldReader; +pub type ADDRHI_R = crate::FieldReader; #[doc = "Field `ADDRHI` writer - MAC Address1 \\[47:32\\]"] -pub type ADDRHI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS1_HIGH_SPEC, u16, u16, 16, O>; +pub type ADDRHI_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `MBC` reader - Mask Byte Control"] -pub type MBC_R = crate::FieldReader; +pub type MBC_R = crate::FieldReader; #[doc = "Field `MBC` writer - Mask Byte Control"] -pub type MBC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS1_HIGH_SPEC, u8, u8, 6, O>; +pub type MBC_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `SA` reader - Source Address"] -pub type SA_R = crate::BitReader; +pub type SA_R = crate::BitReader; #[doc = "Field `SA` writer - Source Address"] -pub type SA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_ADDRESS1_HIGH_SPEC, bool, O>; +pub type SA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AE` reader - Address Enable"] -pub type AE_R = crate::BitReader; +pub type AE_R = crate::BitReader; #[doc = "Field `AE` writer - Address Enable"] -pub type AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_ADDRESS1_HIGH_SPEC, bool, O>; +pub type AE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:15 - MAC Address1 \\[47:32\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:15 - MAC Address1 \\[47:32\\]"] #[inline(always)] #[must_use] - pub fn addrhi(&mut self) -> ADDRHI_W<0> { - ADDRHI_W::new(self) + pub fn addrhi(&mut self) -> ADDRHI_W { + ADDRHI_W::new(self, 0) } #[doc = "Bits 24:29 - Mask Byte Control"] #[inline(always)] #[must_use] - pub fn mbc(&mut self) -> MBC_W<24> { - MBC_W::new(self) + pub fn mbc(&mut self) -> MBC_W { + MBC_W::new(self, 24) } #[doc = "Bit 30 - Source Address"] #[inline(always)] #[must_use] - pub fn sa(&mut self) -> SA_W<30> { - SA_W::new(self) + pub fn sa(&mut self) -> SA_W { + SA_W::new(self, 30) } #[doc = "Bit 31 - Address Enable"] #[inline(always)] #[must_use] - pub fn ae(&mut self) -> AE_W<31> { - AE_W::new(self) + pub fn ae(&mut self) -> AE_W { + AE_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Address1 High 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 [mac_address1_high](index.html) module"] +#[doc = "MAC Address1 High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address1_high::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address1_high::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_ADDRESS1_HIGH_SPEC; impl crate::RegisterSpec for MAC_ADDRESS1_HIGH_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_address1_high::R](R) reader structure"] -impl crate::Readable for MAC_ADDRESS1_HIGH_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_address1_high::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_address1_high::R`](R) reader structure"] +impl crate::Readable for MAC_ADDRESS1_HIGH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_address1_high::W`](W) writer structure"] impl crate::Writable for MAC_ADDRESS1_HIGH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_address1_low.rs b/src/eth0/mac_address1_low.rs index 1f3e857e..16289e47 100644 --- a/src/eth0/mac_address1_low.rs +++ b/src/eth0/mac_address1_low.rs @@ -1,43 +1,11 @@ #[doc = "Register `MAC_ADDRESS1_LOW` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_ADDRESS1_LOW` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ADDRLO` reader - MAC Address1 \\[31:0\\]"] -pub type ADDRLO_R = crate::FieldReader; +pub type ADDRLO_R = crate::FieldReader; #[doc = "Field `ADDRLO` writer - MAC Address1 \\[31:0\\]"] -pub type ADDRLO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS1_LOW_SPEC, u32, u32, 32, O>; +pub type ADDRLO_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - MAC Address1 \\[31:0\\]"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - MAC Address1 \\[31:0\\]"] #[inline(always)] #[must_use] - pub fn addrlo(&mut self) -> ADDRLO_W<0> { - ADDRLO_W::new(self) + pub fn addrlo(&mut self) -> ADDRLO_W { + ADDRLO_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Address1 Low 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 [mac_address1_low](index.html) module"] +#[doc = "MAC Address1 Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address1_low::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address1_low::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_ADDRESS1_LOW_SPEC; impl crate::RegisterSpec for MAC_ADDRESS1_LOW_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_address1_low::R](R) reader structure"] -impl crate::Readable for MAC_ADDRESS1_LOW_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_address1_low::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_address1_low::R`](R) reader structure"] +impl crate::Readable for MAC_ADDRESS1_LOW_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_address1_low::W`](W) writer structure"] impl crate::Writable for MAC_ADDRESS1_LOW_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_address2_high.rs b/src/eth0/mac_address2_high.rs index 4bd28d2b..34df44fd 100644 --- a/src/eth0/mac_address2_high.rs +++ b/src/eth0/mac_address2_high.rs @@ -1,55 +1,23 @@ #[doc = "Register `MAC_ADDRESS2_HIGH` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_ADDRESS2_HIGH` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ADDRHI` reader - MAC Address2 \\[47:32\\]"] -pub type ADDRHI_R = crate::FieldReader; +pub type ADDRHI_R = crate::FieldReader; #[doc = "Field `ADDRHI` writer - MAC Address2 \\[47:32\\]"] -pub type ADDRHI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS2_HIGH_SPEC, u16, u16, 16, O>; +pub type ADDRHI_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `MBC` reader - Mask Byte Control"] -pub type MBC_R = crate::FieldReader; +pub type MBC_R = crate::FieldReader; #[doc = "Field `MBC` writer - Mask Byte Control"] -pub type MBC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS2_HIGH_SPEC, u8, u8, 6, O>; +pub type MBC_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `SA` reader - Source Address"] -pub type SA_R = crate::BitReader; +pub type SA_R = crate::BitReader; #[doc = "Field `SA` writer - Source Address"] -pub type SA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_ADDRESS2_HIGH_SPEC, bool, O>; +pub type SA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AE` reader - Address Enable"] -pub type AE_R = crate::BitReader; +pub type AE_R = crate::BitReader; #[doc = "Field `AE` writer - Address Enable"] -pub type AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_ADDRESS2_HIGH_SPEC, bool, O>; +pub type AE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:15 - MAC Address2 \\[47:32\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:15 - MAC Address2 \\[47:32\\]"] #[inline(always)] #[must_use] - pub fn addrhi(&mut self) -> ADDRHI_W<0> { - ADDRHI_W::new(self) + pub fn addrhi(&mut self) -> ADDRHI_W { + ADDRHI_W::new(self, 0) } #[doc = "Bits 24:29 - Mask Byte Control"] #[inline(always)] #[must_use] - pub fn mbc(&mut self) -> MBC_W<24> { - MBC_W::new(self) + pub fn mbc(&mut self) -> MBC_W { + MBC_W::new(self, 24) } #[doc = "Bit 30 - Source Address"] #[inline(always)] #[must_use] - pub fn sa(&mut self) -> SA_W<30> { - SA_W::new(self) + pub fn sa(&mut self) -> SA_W { + SA_W::new(self, 30) } #[doc = "Bit 31 - Address Enable"] #[inline(always)] #[must_use] - pub fn ae(&mut self) -> AE_W<31> { - AE_W::new(self) + pub fn ae(&mut self) -> AE_W { + AE_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Address2 High 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 [mac_address2_high](index.html) module"] +#[doc = "MAC Address2 High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address2_high::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address2_high::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_ADDRESS2_HIGH_SPEC; impl crate::RegisterSpec for MAC_ADDRESS2_HIGH_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_address2_high::R](R) reader structure"] -impl crate::Readable for MAC_ADDRESS2_HIGH_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_address2_high::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_address2_high::R`](R) reader structure"] +impl crate::Readable for MAC_ADDRESS2_HIGH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_address2_high::W`](W) writer structure"] impl crate::Writable for MAC_ADDRESS2_HIGH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_address2_low.rs b/src/eth0/mac_address2_low.rs index 132a2a49..35b2fe87 100644 --- a/src/eth0/mac_address2_low.rs +++ b/src/eth0/mac_address2_low.rs @@ -1,43 +1,11 @@ #[doc = "Register `MAC_ADDRESS2_LOW` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_ADDRESS2_LOW` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ADDRLO` reader - MAC Address2 \\[31:0\\]"] -pub type ADDRLO_R = crate::FieldReader; +pub type ADDRLO_R = crate::FieldReader; #[doc = "Field `ADDRLO` writer - MAC Address2 \\[31:0\\]"] -pub type ADDRLO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS2_LOW_SPEC, u32, u32, 32, O>; +pub type ADDRLO_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - MAC Address2 \\[31:0\\]"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - MAC Address2 \\[31:0\\]"] #[inline(always)] #[must_use] - pub fn addrlo(&mut self) -> ADDRLO_W<0> { - ADDRLO_W::new(self) + pub fn addrlo(&mut self) -> ADDRLO_W { + ADDRLO_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Address2 Low 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 [mac_address2_low](index.html) module"] +#[doc = "MAC Address2 Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address2_low::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address2_low::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_ADDRESS2_LOW_SPEC; impl crate::RegisterSpec for MAC_ADDRESS2_LOW_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_address2_low::R](R) reader structure"] -impl crate::Readable for MAC_ADDRESS2_LOW_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_address2_low::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_address2_low::R`](R) reader structure"] +impl crate::Readable for MAC_ADDRESS2_LOW_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_address2_low::W`](W) writer structure"] impl crate::Writable for MAC_ADDRESS2_LOW_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_address3_high.rs b/src/eth0/mac_address3_high.rs index efba1ba6..ba3350bb 100644 --- a/src/eth0/mac_address3_high.rs +++ b/src/eth0/mac_address3_high.rs @@ -1,55 +1,23 @@ #[doc = "Register `MAC_ADDRESS3_HIGH` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_ADDRESS3_HIGH` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ADDRHI` reader - MAC Address3 \\[47:32\\]"] -pub type ADDRHI_R = crate::FieldReader; +pub type ADDRHI_R = crate::FieldReader; #[doc = "Field `ADDRHI` writer - MAC Address3 \\[47:32\\]"] -pub type ADDRHI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS3_HIGH_SPEC, u16, u16, 16, O>; +pub type ADDRHI_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `MBC` reader - Mask Byte Control"] -pub type MBC_R = crate::FieldReader; +pub type MBC_R = crate::FieldReader; #[doc = "Field `MBC` writer - Mask Byte Control"] -pub type MBC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS3_HIGH_SPEC, u8, u8, 6, O>; +pub type MBC_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `SA` reader - Source Address"] -pub type SA_R = crate::BitReader; +pub type SA_R = crate::BitReader; #[doc = "Field `SA` writer - Source Address"] -pub type SA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_ADDRESS3_HIGH_SPEC, bool, O>; +pub type SA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AE` reader - Address Enable"] -pub type AE_R = crate::BitReader; +pub type AE_R = crate::BitReader; #[doc = "Field `AE` writer - Address Enable"] -pub type AE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_ADDRESS3_HIGH_SPEC, bool, O>; +pub type AE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:15 - MAC Address3 \\[47:32\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:15 - MAC Address3 \\[47:32\\]"] #[inline(always)] #[must_use] - pub fn addrhi(&mut self) -> ADDRHI_W<0> { - ADDRHI_W::new(self) + pub fn addrhi(&mut self) -> ADDRHI_W { + ADDRHI_W::new(self, 0) } #[doc = "Bits 24:29 - Mask Byte Control"] #[inline(always)] #[must_use] - pub fn mbc(&mut self) -> MBC_W<24> { - MBC_W::new(self) + pub fn mbc(&mut self) -> MBC_W { + MBC_W::new(self, 24) } #[doc = "Bit 30 - Source Address"] #[inline(always)] #[must_use] - pub fn sa(&mut self) -> SA_W<30> { - SA_W::new(self) + pub fn sa(&mut self) -> SA_W { + SA_W::new(self, 30) } #[doc = "Bit 31 - Address Enable"] #[inline(always)] #[must_use] - pub fn ae(&mut self) -> AE_W<31> { - AE_W::new(self) + pub fn ae(&mut self) -> AE_W { + AE_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Address3 High 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 [mac_address3_high](index.html) module"] +#[doc = "MAC Address3 High Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address3_high::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address3_high::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_ADDRESS3_HIGH_SPEC; impl crate::RegisterSpec for MAC_ADDRESS3_HIGH_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_address3_high::R](R) reader structure"] -impl crate::Readable for MAC_ADDRESS3_HIGH_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_address3_high::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_address3_high::R`](R) reader structure"] +impl crate::Readable for MAC_ADDRESS3_HIGH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_address3_high::W`](W) writer structure"] impl crate::Writable for MAC_ADDRESS3_HIGH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_address3_low.rs b/src/eth0/mac_address3_low.rs index a1628ab0..ceb19698 100644 --- a/src/eth0/mac_address3_low.rs +++ b/src/eth0/mac_address3_low.rs @@ -1,43 +1,11 @@ #[doc = "Register `MAC_ADDRESS3_LOW` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_ADDRESS3_LOW` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ADDRLO` reader - MAC Address3 \\[31:0\\]"] -pub type ADDRLO_R = crate::FieldReader; +pub type ADDRLO_R = crate::FieldReader; #[doc = "Field `ADDRLO` writer - MAC Address3 \\[31:0\\]"] -pub type ADDRLO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_ADDRESS3_LOW_SPEC, u32, u32, 32, O>; +pub type ADDRLO_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - MAC Address3 \\[31:0\\]"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - MAC Address3 \\[31:0\\]"] #[inline(always)] #[must_use] - pub fn addrlo(&mut self) -> ADDRLO_W<0> { - ADDRLO_W::new(self) + pub fn addrlo(&mut self) -> ADDRLO_W { + ADDRLO_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Address3 Low 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 [mac_address3_low](index.html) module"] +#[doc = "MAC Address3 Low Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_address3_low::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_address3_low::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_ADDRESS3_LOW_SPEC; impl crate::RegisterSpec for MAC_ADDRESS3_LOW_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_address3_low::R](R) reader structure"] -impl crate::Readable for MAC_ADDRESS3_LOW_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_address3_low::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_address3_low::R`](R) reader structure"] +impl crate::Readable for MAC_ADDRESS3_LOW_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_address3_low::W`](W) writer structure"] impl crate::Writable for MAC_ADDRESS3_LOW_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_configuration.rs b/src/eth0/mac_configuration.rs index 8df46da8..7b2eff5c 100644 --- a/src/eth0/mac_configuration.rs +++ b/src/eth0/mac_configuration.rs @@ -1,121 +1,89 @@ #[doc = "Register `MAC_CONFIGURATION` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_CONFIGURATION` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRELEN` reader - Preamble Length for Transmit Frames"] -pub type PRELEN_R = crate::FieldReader; +pub type PRELEN_R = crate::FieldReader; #[doc = "Field `PRELEN` writer - Preamble Length for Transmit Frames"] -pub type PRELEN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_CONFIGURATION_SPEC, u8, u8, 2, O>; +pub type PRELEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `RE` reader - Receiver Enable"] -pub type RE_R = crate::BitReader; +pub type RE_R = crate::BitReader; #[doc = "Field `RE` writer - Receiver Enable"] -pub type RE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type RE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TE` reader - Transmitter Enable"] -pub type TE_R = crate::BitReader; +pub type TE_R = crate::BitReader; #[doc = "Field `TE` writer - Transmitter Enable"] -pub type TE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type TE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DC` reader - Deferral Check"] -pub type DC_R = crate::BitReader; +pub type DC_R = crate::BitReader; #[doc = "Field `DC` writer - Deferral Check"] -pub type DC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type DC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BL` reader - Back-Off Limit"] -pub type BL_R = crate::FieldReader; +pub type BL_R = crate::FieldReader; #[doc = "Field `BL` writer - Back-Off Limit"] -pub type BL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_CONFIGURATION_SPEC, u8, u8, 2, O>; +pub type BL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `ACS` reader - Automatic Pad or CRC Stripping"] -pub type ACS_R = crate::BitReader; +pub type ACS_R = crate::BitReader; #[doc = "Field `ACS` writer - Automatic Pad or CRC Stripping"] -pub type ACS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type ACS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DR` reader - Disable Retry"] -pub type DR_R = crate::BitReader; +pub type DR_R = crate::BitReader; #[doc = "Field `DR` writer - Disable Retry"] -pub type DR_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type DR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `IPC` reader - Checksum Offload"] -pub type IPC_R = crate::BitReader; +pub type IPC_R = crate::BitReader; #[doc = "Field `IPC` writer - Checksum Offload"] -pub type IPC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type IPC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DM` reader - Duplex Mode"] -pub type DM_R = crate::BitReader; +pub type DM_R = crate::BitReader; #[doc = "Field `DM` writer - Duplex Mode"] -pub type DM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type DM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LM` reader - Loopback Mode"] -pub type LM_R = crate::BitReader; +pub type LM_R = crate::BitReader; #[doc = "Field `LM` writer - Loopback Mode"] -pub type LM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type LM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DO` reader - Disable Receive Own"] -pub type DO_R = crate::BitReader; +pub type DO_R = crate::BitReader; #[doc = "Field `DO` writer - Disable Receive Own"] -pub type DO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type DO_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FES` reader - Speed"] -pub type FES_R = crate::BitReader; +pub type FES_R = crate::BitReader; #[doc = "Field `FES` writer - Speed"] -pub type FES_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type FES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DCRS` reader - Disable Carrier Sense During Transmission"] -pub type DCRS_R = crate::BitReader; +pub type DCRS_R = crate::BitReader; #[doc = "Field `DCRS` writer - Disable Carrier Sense During Transmission"] -pub type DCRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type DCRS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `IFG` reader - Inter-Frame Gap"] -pub type IFG_R = crate::FieldReader; +pub type IFG_R = crate::FieldReader; #[doc = "Field `IFG` writer - Inter-Frame Gap"] -pub type IFG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_CONFIGURATION_SPEC, u8, u8, 3, O>; +pub type IFG_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `JE` reader - Jumbo Frame Enable"] -pub type JE_R = crate::BitReader; +pub type JE_R = crate::BitReader; #[doc = "Field `JE` writer - Jumbo Frame Enable"] -pub type JE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type JE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BE` reader - Frame Burst Enable"] -pub type BE_R = crate::BitReader; +pub type BE_R = crate::BitReader; #[doc = "Field `JD` reader - Jabber Disable"] -pub type JD_R = crate::BitReader; +pub type JD_R = crate::BitReader; #[doc = "Field `JD` writer - Jabber Disable"] -pub type JD_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type JD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `WD` reader - Watchdog Disable"] -pub type WD_R = crate::BitReader; +pub type WD_R = crate::BitReader; #[doc = "Field `WD` writer - Watchdog Disable"] -pub type WD_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type WD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TC` reader - Transmit Configuration in RMII"] -pub type TC_R = crate::BitReader; +pub type TC_R = crate::BitReader; #[doc = "Field `CST` reader - CRC Stripping of Type Frames"] -pub type CST_R = crate::BitReader; +pub type CST_R = crate::BitReader; #[doc = "Field `CST` writer - CRC Stripping of Type Frames"] -pub type CST_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type CST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TWOKPE` reader - IEEE 802.3as support for 2K packets Enable"] -pub type TWOKPE_R = crate::BitReader; +pub type TWOKPE_R = crate::BitReader; #[doc = "Field `TWOKPE` writer - IEEE 802.3as support for 2K packets Enable"] -pub type TWOKPE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_CONFIGURATION_SPEC, bool, O>; +pub type TWOKPE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SARC` reader - Source Address Insertion or Replacement Control"] -pub type SARC_R = crate::FieldReader; +pub type SARC_R = crate::FieldReader; impl R { #[doc = "Bits 0:1 - Preamble Length for Transmit Frames"] #[inline(always)] @@ -232,136 +200,137 @@ impl W { #[doc = "Bits 0:1 - Preamble Length for Transmit Frames"] #[inline(always)] #[must_use] - pub fn prelen(&mut self) -> PRELEN_W<0> { - PRELEN_W::new(self) + pub fn prelen(&mut self) -> PRELEN_W { + PRELEN_W::new(self, 0) } #[doc = "Bit 2 - Receiver Enable"] #[inline(always)] #[must_use] - pub fn re(&mut self) -> RE_W<2> { - RE_W::new(self) + pub fn re(&mut self) -> RE_W { + RE_W::new(self, 2) } #[doc = "Bit 3 - Transmitter Enable"] #[inline(always)] #[must_use] - pub fn te(&mut self) -> TE_W<3> { - TE_W::new(self) + pub fn te(&mut self) -> TE_W { + TE_W::new(self, 3) } #[doc = "Bit 4 - Deferral Check"] #[inline(always)] #[must_use] - pub fn dc(&mut self) -> DC_W<4> { - DC_W::new(self) + pub fn dc(&mut self) -> DC_W { + DC_W::new(self, 4) } #[doc = "Bits 5:6 - Back-Off Limit"] #[inline(always)] #[must_use] - pub fn bl(&mut self) -> BL_W<5> { - BL_W::new(self) + pub fn bl(&mut self) -> BL_W { + BL_W::new(self, 5) } #[doc = "Bit 7 - Automatic Pad or CRC Stripping"] #[inline(always)] #[must_use] - pub fn acs(&mut self) -> ACS_W<7> { - ACS_W::new(self) + pub fn acs(&mut self) -> ACS_W { + ACS_W::new(self, 7) } #[doc = "Bit 9 - Disable Retry"] #[inline(always)] #[must_use] - pub fn dr(&mut self) -> DR_W<9> { - DR_W::new(self) + pub fn dr(&mut self) -> DR_W { + DR_W::new(self, 9) } #[doc = "Bit 10 - Checksum Offload"] #[inline(always)] #[must_use] - pub fn ipc(&mut self) -> IPC_W<10> { - IPC_W::new(self) + pub fn ipc(&mut self) -> IPC_W { + IPC_W::new(self, 10) } #[doc = "Bit 11 - Duplex Mode"] #[inline(always)] #[must_use] - pub fn dm(&mut self) -> DM_W<11> { - DM_W::new(self) + pub fn dm(&mut self) -> DM_W { + DM_W::new(self, 11) } #[doc = "Bit 12 - Loopback Mode"] #[inline(always)] #[must_use] - pub fn lm(&mut self) -> LM_W<12> { - LM_W::new(self) + pub fn lm(&mut self) -> LM_W { + LM_W::new(self, 12) } #[doc = "Bit 13 - Disable Receive Own"] #[inline(always)] #[must_use] - pub fn do_(&mut self) -> DO_W<13> { - DO_W::new(self) + pub fn do_(&mut self) -> DO_W { + DO_W::new(self, 13) } #[doc = "Bit 14 - Speed"] #[inline(always)] #[must_use] - pub fn fes(&mut self) -> FES_W<14> { - FES_W::new(self) + pub fn fes(&mut self) -> FES_W { + FES_W::new(self, 14) } #[doc = "Bit 16 - Disable Carrier Sense During Transmission"] #[inline(always)] #[must_use] - pub fn dcrs(&mut self) -> DCRS_W<16> { - DCRS_W::new(self) + pub fn dcrs(&mut self) -> DCRS_W { + DCRS_W::new(self, 16) } #[doc = "Bits 17:19 - Inter-Frame Gap"] #[inline(always)] #[must_use] - pub fn ifg(&mut self) -> IFG_W<17> { - IFG_W::new(self) + pub fn ifg(&mut self) -> IFG_W { + IFG_W::new(self, 17) } #[doc = "Bit 20 - Jumbo Frame Enable"] #[inline(always)] #[must_use] - pub fn je(&mut self) -> JE_W<20> { - JE_W::new(self) + pub fn je(&mut self) -> JE_W { + JE_W::new(self, 20) } #[doc = "Bit 22 - Jabber Disable"] #[inline(always)] #[must_use] - pub fn jd(&mut self) -> JD_W<22> { - JD_W::new(self) + pub fn jd(&mut self) -> JD_W { + JD_W::new(self, 22) } #[doc = "Bit 23 - Watchdog Disable"] #[inline(always)] #[must_use] - pub fn wd(&mut self) -> WD_W<23> { - WD_W::new(self) + pub fn wd(&mut self) -> WD_W { + WD_W::new(self, 23) } #[doc = "Bit 25 - CRC Stripping of Type Frames"] #[inline(always)] #[must_use] - pub fn cst(&mut self) -> CST_W<25> { - CST_W::new(self) + pub fn cst(&mut self) -> CST_W { + CST_W::new(self, 25) } #[doc = "Bit 27 - IEEE 802.3as support for 2K packets Enable"] #[inline(always)] #[must_use] - pub fn twokpe(&mut self) -> TWOKPE_W<27> { - TWOKPE_W::new(self) + pub fn twokpe(&mut self) -> TWOKPE_W { + TWOKPE_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC 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 [mac_configuration](index.html) module"] +#[doc = "MAC Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_configuration::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_configuration::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_CONFIGURATION_SPEC; impl crate::RegisterSpec for MAC_CONFIGURATION_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_configuration::R](R) reader structure"] -impl crate::Readable for MAC_CONFIGURATION_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_configuration::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_configuration::R`](R) reader structure"] +impl crate::Readable for MAC_CONFIGURATION_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_configuration::W`](W) writer structure"] impl crate::Writable for MAC_CONFIGURATION_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mac_frame_filter.rs b/src/eth0/mac_frame_filter.rs index def6e0d8..644b3d4f 100644 --- a/src/eth0/mac_frame_filter.rs +++ b/src/eth0/mac_frame_filter.rs @@ -1,91 +1,59 @@ #[doc = "Register `MAC_FRAME_FILTER` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MAC_FRAME_FILTER` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PR` reader - Promiscuous Mode"] -pub type PR_R = crate::BitReader; +pub type PR_R = crate::BitReader; #[doc = "Field `PR` writer - Promiscuous Mode"] -pub type PR_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type PR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `HUC` reader - Hash Unicast"] -pub type HUC_R = crate::BitReader; +pub type HUC_R = crate::BitReader; #[doc = "Field `HUC` writer - Hash Unicast"] -pub type HUC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type HUC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `HMC` reader - Hash Multicast"] -pub type HMC_R = crate::BitReader; +pub type HMC_R = crate::BitReader; #[doc = "Field `HMC` writer - Hash Multicast"] -pub type HMC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type HMC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DAIF` reader - DA Inverse Filtering"] -pub type DAIF_R = crate::BitReader; +pub type DAIF_R = crate::BitReader; #[doc = "Field `DAIF` writer - DA Inverse Filtering"] -pub type DAIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type DAIF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PM` reader - Pass All Multicast"] -pub type PM_R = crate::BitReader; +pub type PM_R = crate::BitReader; #[doc = "Field `PM` writer - Pass All Multicast"] -pub type PM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type PM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DBF` reader - Disable Broadcast Frames"] -pub type DBF_R = crate::BitReader; +pub type DBF_R = crate::BitReader; #[doc = "Field `DBF` writer - Disable Broadcast Frames"] -pub type DBF_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type DBF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PCF` reader - Pass Control Frames"] -pub type PCF_R = crate::FieldReader; +pub type PCF_R = crate::FieldReader; #[doc = "Field `PCF` writer - Pass Control Frames"] -pub type PCF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MAC_FRAME_FILTER_SPEC, u8, u8, 2, O>; +pub type PCF_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `SAIF` reader - SA Inverse Filtering"] -pub type SAIF_R = crate::BitReader; +pub type SAIF_R = crate::BitReader; #[doc = "Field `SAIF` writer - SA Inverse Filtering"] -pub type SAIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type SAIF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SAF` reader - Source Address Filter Enable"] -pub type SAF_R = crate::BitReader; +pub type SAF_R = crate::BitReader; #[doc = "Field `SAF` writer - Source Address Filter Enable"] -pub type SAF_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type SAF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `HPF` reader - Hash or Perfect Filter"] -pub type HPF_R = crate::BitReader; +pub type HPF_R = crate::BitReader; #[doc = "Field `HPF` writer - Hash or Perfect Filter"] -pub type HPF_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type HPF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `VTFE` reader - VLAN Tag Filter Enable"] -pub type VTFE_R = crate::BitReader; +pub type VTFE_R = crate::BitReader; #[doc = "Field `VTFE` writer - VLAN Tag Filter Enable"] -pub type VTFE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type VTFE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `IPFE` reader - Layer 3 and Layer 4 Filter Enable"] -pub type IPFE_R = crate::BitReader; +pub type IPFE_R = crate::BitReader; #[doc = "Field `DNTU` reader - Drop non-TCP/UDP over IP Frames"] -pub type DNTU_R = crate::BitReader; +pub type DNTU_R = crate::BitReader; #[doc = "Field `RA` reader - Receive All"] -pub type RA_R = crate::BitReader; +pub type RA_R = crate::BitReader; #[doc = "Field `RA` writer - Receive All"] -pub type RA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MAC_FRAME_FILTER_SPEC, bool, O>; +pub type RA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Promiscuous Mode"] #[inline(always)] @@ -162,94 +130,95 @@ impl W { #[doc = "Bit 0 - Promiscuous Mode"] #[inline(always)] #[must_use] - pub fn pr(&mut self) -> PR_W<0> { - PR_W::new(self) + pub fn pr(&mut self) -> PR_W { + PR_W::new(self, 0) } #[doc = "Bit 1 - Hash Unicast"] #[inline(always)] #[must_use] - pub fn huc(&mut self) -> HUC_W<1> { - HUC_W::new(self) + pub fn huc(&mut self) -> HUC_W { + HUC_W::new(self, 1) } #[doc = "Bit 2 - Hash Multicast"] #[inline(always)] #[must_use] - pub fn hmc(&mut self) -> HMC_W<2> { - HMC_W::new(self) + pub fn hmc(&mut self) -> HMC_W { + HMC_W::new(self, 2) } #[doc = "Bit 3 - DA Inverse Filtering"] #[inline(always)] #[must_use] - pub fn daif(&mut self) -> DAIF_W<3> { - DAIF_W::new(self) + pub fn daif(&mut self) -> DAIF_W { + DAIF_W::new(self, 3) } #[doc = "Bit 4 - Pass All Multicast"] #[inline(always)] #[must_use] - pub fn pm(&mut self) -> PM_W<4> { - PM_W::new(self) + pub fn pm(&mut self) -> PM_W { + PM_W::new(self, 4) } #[doc = "Bit 5 - Disable Broadcast Frames"] #[inline(always)] #[must_use] - pub fn dbf(&mut self) -> DBF_W<5> { - DBF_W::new(self) + pub fn dbf(&mut self) -> DBF_W { + DBF_W::new(self, 5) } #[doc = "Bits 6:7 - Pass Control Frames"] #[inline(always)] #[must_use] - pub fn pcf(&mut self) -> PCF_W<6> { - PCF_W::new(self) + pub fn pcf(&mut self) -> PCF_W { + PCF_W::new(self, 6) } #[doc = "Bit 8 - SA Inverse Filtering"] #[inline(always)] #[must_use] - pub fn saif(&mut self) -> SAIF_W<8> { - SAIF_W::new(self) + pub fn saif(&mut self) -> SAIF_W { + SAIF_W::new(self, 8) } #[doc = "Bit 9 - Source Address Filter Enable"] #[inline(always)] #[must_use] - pub fn saf(&mut self) -> SAF_W<9> { - SAF_W::new(self) + pub fn saf(&mut self) -> SAF_W { + SAF_W::new(self, 9) } #[doc = "Bit 10 - Hash or Perfect Filter"] #[inline(always)] #[must_use] - pub fn hpf(&mut self) -> HPF_W<10> { - HPF_W::new(self) + pub fn hpf(&mut self) -> HPF_W { + HPF_W::new(self, 10) } #[doc = "Bit 16 - VLAN Tag Filter Enable"] #[inline(always)] #[must_use] - pub fn vtfe(&mut self) -> VTFE_W<16> { - VTFE_W::new(self) + pub fn vtfe(&mut self) -> VTFE_W { + VTFE_W::new(self, 16) } #[doc = "Bit 31 - Receive All"] #[inline(always)] #[must_use] - pub fn ra(&mut self) -> RA_W<31> { - RA_W::new(self) + pub fn ra(&mut self) -> RA_W { + RA_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MAC Frame Filter\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mac_frame_filter](index.html) module"] +#[doc = "MAC Frame Filter\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mac_frame_filter::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mac_frame_filter::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MAC_FRAME_FILTER_SPEC; impl crate::RegisterSpec for MAC_FRAME_FILTER_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mac_frame_filter::R](R) reader structure"] -impl crate::Readable for MAC_FRAME_FILTER_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mac_frame_filter::W](W) writer structure"] +#[doc = "`read()` method returns [`mac_frame_filter::R`](R) reader structure"] +impl crate::Readable for MAC_FRAME_FILTER_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mac_frame_filter::W`](W) writer structure"] impl crate::Writable for MAC_FRAME_FILTER_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/missed_frame_and_buffer_overflow_counter.rs b/src/eth0/missed_frame_and_buffer_overflow_counter.rs index aaea8ee0..7f9bd73b 100644 --- a/src/eth0/missed_frame_and_buffer_overflow_counter.rs +++ b/src/eth0/missed_frame_and_buffer_overflow_counter.rs @@ -1,26 +1,13 @@ #[doc = "Register `MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `MISFRMCNT` reader - This field indicates the number of frames missed by the controller because of the RAM Receive Buffer being unavailable. This counter is incremented each time the DMA discards an incoming frame. The counter is cleared when this register is read."] -pub type MISFRMCNT_R = crate::FieldReader; +pub type MISFRMCNT_R = crate::FieldReader; #[doc = "Field `MISCNTOVF` reader - Overflow bit for Missed Frame Counter"] -pub type MISCNTOVF_R = crate::BitReader; +pub type MISCNTOVF_R = crate::BitReader; #[doc = "Field `OVFFRMCNT` reader - This field indicates the number of frames missed by the application. The counter is cleared when this register is read."] -pub type OVFFRMCNT_R = crate::FieldReader; +pub type OVFFRMCNT_R = crate::FieldReader; #[doc = "Field `OVFCNTOVF` reader - Overflow bit for FIFO Overflow Counter"] -pub type OVFCNTOVF_R = crate::BitReader; +pub type OVFCNTOVF_R = crate::BitReader; impl R { #[doc = "Bits 0:15 - This field indicates the number of frames missed by the controller because of the RAM Receive Buffer being unavailable. This counter is incremented each time the DMA discards an incoming frame. The counter is cleared when this register is read."] #[inline(always)] @@ -43,15 +30,13 @@ impl R { OVFCNTOVF_R::new(((self.bits >> 28) & 1) != 0) } } -#[doc = "Missed Frame and Buffer Overflow Counter 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 [missed_frame_and_buffer_overflow_counter](index.html) module"] +#[doc = "Missed Frame and Buffer Overflow Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`missed_frame_and_buffer_overflow_counter::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER_SPEC; impl crate::RegisterSpec for MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [missed_frame_and_buffer_overflow_counter::R](R) reader structure"] -impl crate::Readable for MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`missed_frame_and_buffer_overflow_counter::R`](R) reader structure"] +impl crate::Readable for MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER_SPEC {} #[doc = "`reset()` method sets MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER to value 0"] impl crate::Resettable for MISSED_FRAME_AND_BUFFER_OVERFLOW_COUNTER_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/mmc_control.rs b/src/eth0/mmc_control.rs index 63ea389d..103e58a9 100644 --- a/src/eth0/mmc_control.rs +++ b/src/eth0/mmc_control.rs @@ -1,67 +1,35 @@ #[doc = "Register `MMC_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) - } -} +pub type R = crate::R; #[doc = "Register `MMC_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) - } -} +pub type W = crate::W; #[doc = "Field `CNTRST` reader - Counters Reset"] -pub type CNTRST_R = crate::BitReader; +pub type CNTRST_R = crate::BitReader; #[doc = "Field `CNTRST` writer - Counters Reset"] -pub type CNTRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_CONTROL_SPEC, bool, O>; +pub type CNTRST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CNTSTOPRO` reader - Counters Stop Rollover"] -pub type CNTSTOPRO_R = crate::BitReader; +pub type CNTSTOPRO_R = crate::BitReader; #[doc = "Field `CNTSTOPRO` writer - Counters Stop Rollover"] -pub type CNTSTOPRO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_CONTROL_SPEC, bool, O>; +pub type CNTSTOPRO_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RSTONRD` reader - Reset on Read"] -pub type RSTONRD_R = crate::BitReader; +pub type RSTONRD_R = crate::BitReader; #[doc = "Field `RSTONRD` writer - Reset on Read"] -pub type RSTONRD_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_CONTROL_SPEC, bool, O>; +pub type RSTONRD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CNTFREEZ` reader - MMC Counter Freeze"] -pub type CNTFREEZ_R = crate::BitReader; +pub type CNTFREEZ_R = crate::BitReader; #[doc = "Field `CNTFREEZ` writer - MMC Counter Freeze"] -pub type CNTFREEZ_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_CONTROL_SPEC, bool, O>; +pub type CNTFREEZ_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CNTPRST` reader - Counters Preset"] -pub type CNTPRST_R = crate::BitReader; +pub type CNTPRST_R = crate::BitReader; #[doc = "Field `CNTPRST` writer - Counters Preset"] -pub type CNTPRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_CONTROL_SPEC, bool, O>; +pub type CNTPRST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CNTPRSTLVL` reader - Full-Half Preset"] -pub type CNTPRSTLVL_R = crate::BitReader; +pub type CNTPRSTLVL_R = crate::BitReader; #[doc = "Field `CNTPRSTLVL` writer - Full-Half Preset"] -pub type CNTPRSTLVL_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_CONTROL_SPEC, bool, O>; +pub type CNTPRSTLVL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `UCDBC` reader - Update MMC Counters for Dropped Broadcast Frames"] -pub type UCDBC_R = crate::BitReader; +pub type UCDBC_R = crate::BitReader; #[doc = "Field `UCDBC` writer - Update MMC Counters for Dropped Broadcast Frames"] -pub type UCDBC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_CONTROL_SPEC, bool, O>; +pub type UCDBC_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Counters Reset"] #[inline(always)] @@ -103,64 +71,65 @@ impl W { #[doc = "Bit 0 - Counters Reset"] #[inline(always)] #[must_use] - pub fn cntrst(&mut self) -> CNTRST_W<0> { - CNTRST_W::new(self) + pub fn cntrst(&mut self) -> CNTRST_W { + CNTRST_W::new(self, 0) } #[doc = "Bit 1 - Counters Stop Rollover"] #[inline(always)] #[must_use] - pub fn cntstopro(&mut self) -> CNTSTOPRO_W<1> { - CNTSTOPRO_W::new(self) + pub fn cntstopro(&mut self) -> CNTSTOPRO_W { + CNTSTOPRO_W::new(self, 1) } #[doc = "Bit 2 - Reset on Read"] #[inline(always)] #[must_use] - pub fn rstonrd(&mut self) -> RSTONRD_W<2> { - RSTONRD_W::new(self) + pub fn rstonrd(&mut self) -> RSTONRD_W { + RSTONRD_W::new(self, 2) } #[doc = "Bit 3 - MMC Counter Freeze"] #[inline(always)] #[must_use] - pub fn cntfreez(&mut self) -> CNTFREEZ_W<3> { - CNTFREEZ_W::new(self) + pub fn cntfreez(&mut self) -> CNTFREEZ_W { + CNTFREEZ_W::new(self, 3) } #[doc = "Bit 4 - Counters Preset"] #[inline(always)] #[must_use] - pub fn cntprst(&mut self) -> CNTPRST_W<4> { - CNTPRST_W::new(self) + pub fn cntprst(&mut self) -> CNTPRST_W { + CNTPRST_W::new(self, 4) } #[doc = "Bit 5 - Full-Half Preset"] #[inline(always)] #[must_use] - pub fn cntprstlvl(&mut self) -> CNTPRSTLVL_W<5> { - CNTPRSTLVL_W::new(self) + pub fn cntprstlvl(&mut self) -> CNTPRSTLVL_W { + CNTPRSTLVL_W::new(self, 5) } #[doc = "Bit 8 - Update MMC Counters for Dropped Broadcast Frames"] #[inline(always)] #[must_use] - pub fn ucdbc(&mut self) -> UCDBC_W<8> { - UCDBC_W::new(self) + pub fn ucdbc(&mut self) -> UCDBC_W { + UCDBC_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MMC 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 [mmc_control](index.html) module"] +#[doc = "MMC Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_control::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmc_control::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MMC_CONTROL_SPEC; impl crate::RegisterSpec for MMC_CONTROL_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mmc_control::R](R) reader structure"] -impl crate::Readable for MMC_CONTROL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mmc_control::W](W) writer structure"] +#[doc = "`read()` method returns [`mmc_control::R`](R) reader structure"] +impl crate::Readable for MMC_CONTROL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mmc_control::W`](W) writer structure"] impl crate::Writable for MMC_CONTROL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mmc_ipc_receive_interrupt.rs b/src/eth0/mmc_ipc_receive_interrupt.rs index f3732aea..5c64ac7d 100644 --- a/src/eth0/mmc_ipc_receive_interrupt.rs +++ b/src/eth0/mmc_ipc_receive_interrupt.rs @@ -1,74 +1,61 @@ #[doc = "Register `MMC_IPC_RECEIVE_INTERRUPT` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4GFIS` reader - MMC Receive IPV4 Good Frame Counter Interrupt Status"] -pub type RXIPV4GFIS_R = crate::BitReader; +pub type RXIPV4GFIS_R = crate::BitReader; #[doc = "Field `RXIPV4HERFIS` reader - MMC Receive IPV4 Header Error Frame Counter Interrupt Status"] -pub type RXIPV4HERFIS_R = crate::BitReader; +pub type RXIPV4HERFIS_R = crate::BitReader; #[doc = "Field `RXIPV4NOPAYFIS` reader - MMC Receive IPV4 No Payload Frame Counter Interrupt Status"] -pub type RXIPV4NOPAYFIS_R = crate::BitReader; +pub type RXIPV4NOPAYFIS_R = crate::BitReader; #[doc = "Field `RXIPV4FRAGFIS` reader - MMC Receive IPV4 Fragmented Frame Counter Interrupt Status"] -pub type RXIPV4FRAGFIS_R = crate::BitReader; +pub type RXIPV4FRAGFIS_R = crate::BitReader; #[doc = "Field `RXIPV4UDSBLFIS` reader - MMC Receive IPV4 UDP Checksum Disabled Frame Counter Interrupt Status"] -pub type RXIPV4UDSBLFIS_R = crate::BitReader; +pub type RXIPV4UDSBLFIS_R = crate::BitReader; #[doc = "Field `RXIPV6GFIS` reader - MMC Receive IPV6 Good Frame Counter Interrupt Status"] -pub type RXIPV6GFIS_R = crate::BitReader; +pub type RXIPV6GFIS_R = crate::BitReader; #[doc = "Field `RXIPV6HERFIS` reader - MMC Receive IPV6 Header Error Frame Counter Interrupt Status"] -pub type RXIPV6HERFIS_R = crate::BitReader; +pub type RXIPV6HERFIS_R = crate::BitReader; #[doc = "Field `RXIPV6NOPAYFIS` reader - MMC Receive IPV6 No Payload Frame Counter Interrupt Status"] -pub type RXIPV6NOPAYFIS_R = crate::BitReader; +pub type RXIPV6NOPAYFIS_R = crate::BitReader; #[doc = "Field `RXUDPGFIS` reader - MMC Receive UDP Good Frame Counter Interrupt Status"] -pub type RXUDPGFIS_R = crate::BitReader; +pub type RXUDPGFIS_R = crate::BitReader; #[doc = "Field `RXUDPERFIS` reader - MMC Receive UDP Error Frame Counter Interrupt Status"] -pub type RXUDPERFIS_R = crate::BitReader; +pub type RXUDPERFIS_R = crate::BitReader; #[doc = "Field `RXTCPGFIS` reader - MMC Receive TCP Good Frame Counter Interrupt Status"] -pub type RXTCPGFIS_R = crate::BitReader; +pub type RXTCPGFIS_R = crate::BitReader; #[doc = "Field `RXTCPERFIS` reader - MMC Receive TCP Error Frame Counter Interrupt Status"] -pub type RXTCPERFIS_R = crate::BitReader; +pub type RXTCPERFIS_R = crate::BitReader; #[doc = "Field `RXICMPGFIS` reader - MMC Receive ICMP Good Frame Counter Interrupt Status"] -pub type RXICMPGFIS_R = crate::BitReader; +pub type RXICMPGFIS_R = crate::BitReader; #[doc = "Field `RXICMPERFIS` reader - MMC Receive ICMP Error Frame Counter Interrupt Status"] -pub type RXICMPERFIS_R = crate::BitReader; +pub type RXICMPERFIS_R = crate::BitReader; #[doc = "Field `RXIPV4GOIS` reader - MMC Receive IPV4 Good Octet Counter Interrupt Status"] -pub type RXIPV4GOIS_R = crate::BitReader; +pub type RXIPV4GOIS_R = crate::BitReader; #[doc = "Field `RXIPV4HEROIS` reader - MMC Receive IPV4 Header Error Octet Counter Interrupt Status"] -pub type RXIPV4HEROIS_R = crate::BitReader; +pub type RXIPV4HEROIS_R = crate::BitReader; #[doc = "Field `RXIPV4NOPAYOIS` reader - MMC Receive IPV4 No Payload Octet Counter Interrupt Status"] -pub type RXIPV4NOPAYOIS_R = crate::BitReader; +pub type RXIPV4NOPAYOIS_R = crate::BitReader; #[doc = "Field `RXIPV4FRAGOIS` reader - MMC Receive IPV4 Fragmented Octet Counter Interrupt Status"] -pub type RXIPV4FRAGOIS_R = crate::BitReader; +pub type RXIPV4FRAGOIS_R = crate::BitReader; #[doc = "Field `RXIPV4UDSBLOIS` reader - MMC Receive IPV4 UDP Checksum Disabled Octet Counter Interrupt Status"] -pub type RXIPV4UDSBLOIS_R = crate::BitReader; +pub type RXIPV4UDSBLOIS_R = crate::BitReader; #[doc = "Field `RXIPV6GOIS` reader - MMC Receive IPV6 Good Octet Counter Interrupt Status"] -pub type RXIPV6GOIS_R = crate::BitReader; +pub type RXIPV6GOIS_R = crate::BitReader; #[doc = "Field `RXIPV6HEROIS` reader - MMC Receive IPV6 Header Error Octet Counter Interrupt Status"] -pub type RXIPV6HEROIS_R = crate::BitReader; +pub type RXIPV6HEROIS_R = crate::BitReader; #[doc = "Field `RXIPV6NOPAYOIS` reader - MMC Receive IPV6 No Payload Octet Counter Interrupt Status"] -pub type RXIPV6NOPAYOIS_R = crate::BitReader; +pub type RXIPV6NOPAYOIS_R = crate::BitReader; #[doc = "Field `RXUDPGOIS` reader - MMC Receive UDP Good Octet Counter Interrupt Status"] -pub type RXUDPGOIS_R = crate::BitReader; +pub type RXUDPGOIS_R = crate::BitReader; #[doc = "Field `RXUDPEROIS` reader - MMC Receive UDP Error Octet Counter Interrupt Status"] -pub type RXUDPEROIS_R = crate::BitReader; +pub type RXUDPEROIS_R = crate::BitReader; #[doc = "Field `RXTCPGOIS` reader - MMC Receive TCP Good Octet Counter Interrupt Status"] -pub type RXTCPGOIS_R = crate::BitReader; +pub type RXTCPGOIS_R = crate::BitReader; #[doc = "Field `RXTCPEROIS` reader - MMC Receive TCP Error Octet Counter Interrupt Status"] -pub type RXTCPEROIS_R = crate::BitReader; +pub type RXTCPEROIS_R = crate::BitReader; #[doc = "Field `RXICMPGOIS` reader - MMC Receive ICMP Good Octet Counter Interrupt Status"] -pub type RXICMPGOIS_R = crate::BitReader; +pub type RXICMPGOIS_R = crate::BitReader; #[doc = "Field `RXICMPEROIS` reader - MMC Receive ICMP Error Octet Counter Interrupt Status"] -pub type RXICMPEROIS_R = crate::BitReader; +pub type RXICMPEROIS_R = crate::BitReader; impl R { #[doc = "Bit 0 - MMC Receive IPV4 Good Frame Counter Interrupt Status"] #[inline(always)] @@ -211,15 +198,13 @@ impl R { RXICMPEROIS_R::new(((self.bits >> 29) & 1) != 0) } } -#[doc = "MMC Receive Checksum Offload 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 [mmc_ipc_receive_interrupt](index.html) module"] +#[doc = "MMC Receive Checksum Offload Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_ipc_receive_interrupt::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MMC_IPC_RECEIVE_INTERRUPT_SPEC; impl crate::RegisterSpec for MMC_IPC_RECEIVE_INTERRUPT_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mmc_ipc_receive_interrupt::R](R) reader structure"] -impl crate::Readable for MMC_IPC_RECEIVE_INTERRUPT_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`mmc_ipc_receive_interrupt::R`](R) reader structure"] +impl crate::Readable for MMC_IPC_RECEIVE_INTERRUPT_SPEC {} #[doc = "`reset()` method sets MMC_IPC_RECEIVE_INTERRUPT to value 0"] impl crate::Resettable for MMC_IPC_RECEIVE_INTERRUPT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/mmc_ipc_receive_interrupt_mask.rs b/src/eth0/mmc_ipc_receive_interrupt_mask.rs index 63bd87bb..f31b2a1e 100644 --- a/src/eth0/mmc_ipc_receive_interrupt_mask.rs +++ b/src/eth0/mmc_ipc_receive_interrupt_mask.rs @@ -1,151 +1,119 @@ #[doc = "Register `MMC_IPC_RECEIVE_INTERRUPT_MASK` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MMC_IPC_RECEIVE_INTERRUPT_MASK` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RXIPV4GFIM` reader - MMC Receive IPV4 Good Frame Counter Interrupt Mask"] -pub type RXIPV4GFIM_R = crate::BitReader; +pub type RXIPV4GFIM_R = crate::BitReader; #[doc = "Field `RXIPV4GFIM` writer - MMC Receive IPV4 Good Frame Counter Interrupt Mask"] -pub type RXIPV4GFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4GFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4HERFIM` reader - MMC Receive IPV4 Header Error Frame Counter Interrupt Mask"] -pub type RXIPV4HERFIM_R = crate::BitReader; +pub type RXIPV4HERFIM_R = crate::BitReader; #[doc = "Field `RXIPV4HERFIM` writer - MMC Receive IPV4 Header Error Frame Counter Interrupt Mask"] -pub type RXIPV4HERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4HERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4NOPAYFIM` reader - MMC Receive IPV4 No Payload Frame Counter Interrupt Mask"] -pub type RXIPV4NOPAYFIM_R = crate::BitReader; +pub type RXIPV4NOPAYFIM_R = crate::BitReader; #[doc = "Field `RXIPV4NOPAYFIM` writer - MMC Receive IPV4 No Payload Frame Counter Interrupt Mask"] -pub type RXIPV4NOPAYFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4NOPAYFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4FRAGFIM` reader - MMC Receive IPV4 Fragmented Frame Counter Interrupt Mask"] -pub type RXIPV4FRAGFIM_R = crate::BitReader; +pub type RXIPV4FRAGFIM_R = crate::BitReader; #[doc = "Field `RXIPV4FRAGFIM` writer - MMC Receive IPV4 Fragmented Frame Counter Interrupt Mask"] -pub type RXIPV4FRAGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4FRAGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4UDSBLFIM` reader - MMC Receive IPV4 UDP Checksum Disabled Frame Counter Interrupt Mask"] -pub type RXIPV4UDSBLFIM_R = crate::BitReader; +pub type RXIPV4UDSBLFIM_R = crate::BitReader; #[doc = "Field `RXIPV4UDSBLFIM` writer - MMC Receive IPV4 UDP Checksum Disabled Frame Counter Interrupt Mask"] -pub type RXIPV4UDSBLFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4UDSBLFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV6GFIM` reader - MMC Receive IPV6 Good Frame Counter Interrupt Mask"] -pub type RXIPV6GFIM_R = crate::BitReader; +pub type RXIPV6GFIM_R = crate::BitReader; #[doc = "Field `RXIPV6GFIM` writer - MMC Receive IPV6 Good Frame Counter Interrupt Mask"] -pub type RXIPV6GFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV6GFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV6HERFIM` reader - MMC Receive IPV6 Header Error Frame Counter Interrupt Mask"] -pub type RXIPV6HERFIM_R = crate::BitReader; +pub type RXIPV6HERFIM_R = crate::BitReader; #[doc = "Field `RXIPV6HERFIM` writer - MMC Receive IPV6 Header Error Frame Counter Interrupt Mask"] -pub type RXIPV6HERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV6HERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV6NOPAYFIM` reader - MMC Receive IPV6 No Payload Frame Counter Interrupt Mask"] -pub type RXIPV6NOPAYFIM_R = crate::BitReader; +pub type RXIPV6NOPAYFIM_R = crate::BitReader; #[doc = "Field `RXIPV6NOPAYFIM` writer - MMC Receive IPV6 No Payload Frame Counter Interrupt Mask"] -pub type RXIPV6NOPAYFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV6NOPAYFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXUDPGFIM` reader - MMC Receive UDP Good Frame Counter Interrupt Mask"] -pub type RXUDPGFIM_R = crate::BitReader; +pub type RXUDPGFIM_R = crate::BitReader; #[doc = "Field `RXUDPGFIM` writer - MMC Receive UDP Good Frame Counter Interrupt Mask"] -pub type RXUDPGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXUDPGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXUDPERFIM` reader - MMC Receive UDP Error Frame Counter Interrupt Mask"] -pub type RXUDPERFIM_R = crate::BitReader; +pub type RXUDPERFIM_R = crate::BitReader; #[doc = "Field `RXUDPERFIM` writer - MMC Receive UDP Error Frame Counter Interrupt Mask"] -pub type RXUDPERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXUDPERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXTCPGFIM` reader - MMC Receive TCP Good Frame Counter Interrupt Mask"] -pub type RXTCPGFIM_R = crate::BitReader; +pub type RXTCPGFIM_R = crate::BitReader; #[doc = "Field `RXTCPGFIM` writer - MMC Receive TCP Good Frame Counter Interrupt Mask"] -pub type RXTCPGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXTCPGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXTCPERFIM` reader - MMC Receive TCP Error Frame Counter Interrupt Mask"] -pub type RXTCPERFIM_R = crate::BitReader; +pub type RXTCPERFIM_R = crate::BitReader; #[doc = "Field `RXTCPERFIM` writer - MMC Receive TCP Error Frame Counter Interrupt Mask"] -pub type RXTCPERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXTCPERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXICMPGFIM` reader - MMC Receive ICMP Good Frame Counter Interrupt Mask"] -pub type RXICMPGFIM_R = crate::BitReader; +pub type RXICMPGFIM_R = crate::BitReader; #[doc = "Field `RXICMPGFIM` writer - MMC Receive ICMP Good Frame Counter Interrupt Mask"] -pub type RXICMPGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXICMPGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXICMPERFIM` reader - MMC Receive ICMP Error Frame Counter Interrupt Mask"] -pub type RXICMPERFIM_R = crate::BitReader; +pub type RXICMPERFIM_R = crate::BitReader; #[doc = "Field `RXICMPERFIM` writer - MMC Receive ICMP Error Frame Counter Interrupt Mask"] -pub type RXICMPERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXICMPERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4GOIM` reader - MMC Receive IPV4 Good Octet Counter Interrupt Mask"] -pub type RXIPV4GOIM_R = crate::BitReader; +pub type RXIPV4GOIM_R = crate::BitReader; #[doc = "Field `RXIPV4GOIM` writer - MMC Receive IPV4 Good Octet Counter Interrupt Mask"] -pub type RXIPV4GOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4GOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4HEROIM` reader - MMC Receive IPV4 Header Error Octet Counter Interrupt Mask"] -pub type RXIPV4HEROIM_R = crate::BitReader; +pub type RXIPV4HEROIM_R = crate::BitReader; #[doc = "Field `RXIPV4HEROIM` writer - MMC Receive IPV4 Header Error Octet Counter Interrupt Mask"] -pub type RXIPV4HEROIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4HEROIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4NOPAYOIM` reader - MMC Receive IPV4 No Payload Octet Counter Interrupt Mask"] -pub type RXIPV4NOPAYOIM_R = crate::BitReader; +pub type RXIPV4NOPAYOIM_R = crate::BitReader; #[doc = "Field `RXIPV4NOPAYOIM` writer - MMC Receive IPV4 No Payload Octet Counter Interrupt Mask"] -pub type RXIPV4NOPAYOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4NOPAYOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4FRAGOIM` reader - MMC Receive IPV4 Fragmented Octet Counter Interrupt Mask"] -pub type RXIPV4FRAGOIM_R = crate::BitReader; +pub type RXIPV4FRAGOIM_R = crate::BitReader; #[doc = "Field `RXIPV4FRAGOIM` writer - MMC Receive IPV4 Fragmented Octet Counter Interrupt Mask"] -pub type RXIPV4FRAGOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4FRAGOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV4UDSBLOIM` reader - MMC Receive IPV4 UDP Checksum Disabled Octet Counter Interrupt Mask"] -pub type RXIPV4UDSBLOIM_R = crate::BitReader; +pub type RXIPV4UDSBLOIM_R = crate::BitReader; #[doc = "Field `RXIPV4UDSBLOIM` writer - MMC Receive IPV4 UDP Checksum Disabled Octet Counter Interrupt Mask"] -pub type RXIPV4UDSBLOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV4UDSBLOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV6GOIM` reader - MMC Receive IPV6 Good Octet Counter Interrupt Mask"] -pub type RXIPV6GOIM_R = crate::BitReader; +pub type RXIPV6GOIM_R = crate::BitReader; #[doc = "Field `RXIPV6GOIM` writer - MMC Receive IPV6 Good Octet Counter Interrupt Mask"] -pub type RXIPV6GOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV6GOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV6HEROIM` reader - MMC Receive IPV6 Header Error Octet Counter Interrupt Mask"] -pub type RXIPV6HEROIM_R = crate::BitReader; +pub type RXIPV6HEROIM_R = crate::BitReader; #[doc = "Field `RXIPV6HEROIM` writer - MMC Receive IPV6 Header Error Octet Counter Interrupt Mask"] -pub type RXIPV6HEROIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV6HEROIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXIPV6NOPAYOIM` reader - MMC Receive IPV6 No Payload Octet Counter Interrupt Mask"] -pub type RXIPV6NOPAYOIM_R = crate::BitReader; +pub type RXIPV6NOPAYOIM_R = crate::BitReader; #[doc = "Field `RXIPV6NOPAYOIM` writer - MMC Receive IPV6 No Payload Octet Counter Interrupt Mask"] -pub type RXIPV6NOPAYOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXIPV6NOPAYOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXUDPGOIM` reader - MMC Receive UDP Good Octet Counter Interrupt Mask"] -pub type RXUDPGOIM_R = crate::BitReader; +pub type RXUDPGOIM_R = crate::BitReader; #[doc = "Field `RXUDPGOIM` writer - MMC Receive UDP Good Octet Counter Interrupt Mask"] -pub type RXUDPGOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXUDPGOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXUDPEROIM` reader - MMC Receive UDP Error Octet Counter Interrupt Mask"] -pub type RXUDPEROIM_R = crate::BitReader; +pub type RXUDPEROIM_R = crate::BitReader; #[doc = "Field `RXUDPEROIM` writer - MMC Receive UDP Error Octet Counter Interrupt Mask"] -pub type RXUDPEROIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXUDPEROIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXTCPGOIM` reader - MMC Receive TCP Good Octet Counter Interrupt Mask"] -pub type RXTCPGOIM_R = crate::BitReader; +pub type RXTCPGOIM_R = crate::BitReader; #[doc = "Field `RXTCPGOIM` writer - MMC Receive TCP Good Octet Counter Interrupt Mask"] -pub type RXTCPGOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXTCPGOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXTCPEROIM` reader - MMC Receive TCP Error Octet Counter Interrupt Mask"] -pub type RXTCPEROIM_R = crate::BitReader; +pub type RXTCPEROIM_R = crate::BitReader; #[doc = "Field `RXTCPEROIM` writer - MMC Receive TCP Error Octet Counter Interrupt Mask"] -pub type RXTCPEROIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXTCPEROIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXICMPGOIM` reader - MMC Receive ICMP Good Octet Counter Interrupt Mask"] -pub type RXICMPGOIM_R = crate::BitReader; +pub type RXICMPGOIM_R = crate::BitReader; #[doc = "Field `RXICMPGOIM` writer - MMC Receive ICMP Good Octet Counter Interrupt Mask"] -pub type RXICMPGOIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXICMPGOIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXICMPEROIM` reader - MMC Receive ICMP Error Octet Counter Interrupt Mask"] -pub type RXICMPEROIM_R = crate::BitReader; +pub type RXICMPEROIM_R = crate::BitReader; #[doc = "Field `RXICMPEROIM` writer - MMC Receive ICMP Error Octet Counter Interrupt Mask"] -pub type RXICMPEROIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXICMPEROIM_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - MMC Receive IPV4 Good Frame Counter Interrupt Mask"] #[inline(always)] @@ -292,190 +260,191 @@ impl W { #[doc = "Bit 0 - MMC Receive IPV4 Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4gfim(&mut self) -> RXIPV4GFIM_W<0> { - RXIPV4GFIM_W::new(self) + pub fn rxipv4gfim(&mut self) -> RXIPV4GFIM_W { + RXIPV4GFIM_W::new(self, 0) } #[doc = "Bit 1 - MMC Receive IPV4 Header Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4herfim(&mut self) -> RXIPV4HERFIM_W<1> { - RXIPV4HERFIM_W::new(self) + pub fn rxipv4herfim(&mut self) -> RXIPV4HERFIM_W { + RXIPV4HERFIM_W::new(self, 1) } #[doc = "Bit 2 - MMC Receive IPV4 No Payload Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4nopayfim(&mut self) -> RXIPV4NOPAYFIM_W<2> { - RXIPV4NOPAYFIM_W::new(self) + pub fn rxipv4nopayfim(&mut self) -> RXIPV4NOPAYFIM_W { + RXIPV4NOPAYFIM_W::new(self, 2) } #[doc = "Bit 3 - MMC Receive IPV4 Fragmented Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4fragfim(&mut self) -> RXIPV4FRAGFIM_W<3> { - RXIPV4FRAGFIM_W::new(self) + pub fn rxipv4fragfim(&mut self) -> RXIPV4FRAGFIM_W { + RXIPV4FRAGFIM_W::new(self, 3) } #[doc = "Bit 4 - MMC Receive IPV4 UDP Checksum Disabled Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4udsblfim(&mut self) -> RXIPV4UDSBLFIM_W<4> { - RXIPV4UDSBLFIM_W::new(self) + pub fn rxipv4udsblfim(&mut self) -> RXIPV4UDSBLFIM_W { + RXIPV4UDSBLFIM_W::new(self, 4) } #[doc = "Bit 5 - MMC Receive IPV6 Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv6gfim(&mut self) -> RXIPV6GFIM_W<5> { - RXIPV6GFIM_W::new(self) + pub fn rxipv6gfim(&mut self) -> RXIPV6GFIM_W { + RXIPV6GFIM_W::new(self, 5) } #[doc = "Bit 6 - MMC Receive IPV6 Header Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv6herfim(&mut self) -> RXIPV6HERFIM_W<6> { - RXIPV6HERFIM_W::new(self) + pub fn rxipv6herfim(&mut self) -> RXIPV6HERFIM_W { + RXIPV6HERFIM_W::new(self, 6) } #[doc = "Bit 7 - MMC Receive IPV6 No Payload Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv6nopayfim(&mut self) -> RXIPV6NOPAYFIM_W<7> { - RXIPV6NOPAYFIM_W::new(self) + pub fn rxipv6nopayfim(&mut self) -> RXIPV6NOPAYFIM_W { + RXIPV6NOPAYFIM_W::new(self, 7) } #[doc = "Bit 8 - MMC Receive UDP Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxudpgfim(&mut self) -> RXUDPGFIM_W<8> { - RXUDPGFIM_W::new(self) + pub fn rxudpgfim(&mut self) -> RXUDPGFIM_W { + RXUDPGFIM_W::new(self, 8) } #[doc = "Bit 9 - MMC Receive UDP Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxudperfim(&mut self) -> RXUDPERFIM_W<9> { - RXUDPERFIM_W::new(self) + pub fn rxudperfim(&mut self) -> RXUDPERFIM_W { + RXUDPERFIM_W::new(self, 9) } #[doc = "Bit 10 - MMC Receive TCP Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxtcpgfim(&mut self) -> RXTCPGFIM_W<10> { - RXTCPGFIM_W::new(self) + pub fn rxtcpgfim(&mut self) -> RXTCPGFIM_W { + RXTCPGFIM_W::new(self, 10) } #[doc = "Bit 11 - MMC Receive TCP Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxtcperfim(&mut self) -> RXTCPERFIM_W<11> { - RXTCPERFIM_W::new(self) + pub fn rxtcperfim(&mut self) -> RXTCPERFIM_W { + RXTCPERFIM_W::new(self, 11) } #[doc = "Bit 12 - MMC Receive ICMP Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxicmpgfim(&mut self) -> RXICMPGFIM_W<12> { - RXICMPGFIM_W::new(self) + pub fn rxicmpgfim(&mut self) -> RXICMPGFIM_W { + RXICMPGFIM_W::new(self, 12) } #[doc = "Bit 13 - MMC Receive ICMP Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxicmperfim(&mut self) -> RXICMPERFIM_W<13> { - RXICMPERFIM_W::new(self) + pub fn rxicmperfim(&mut self) -> RXICMPERFIM_W { + RXICMPERFIM_W::new(self, 13) } #[doc = "Bit 16 - MMC Receive IPV4 Good Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4goim(&mut self) -> RXIPV4GOIM_W<16> { - RXIPV4GOIM_W::new(self) + pub fn rxipv4goim(&mut self) -> RXIPV4GOIM_W { + RXIPV4GOIM_W::new(self, 16) } #[doc = "Bit 17 - MMC Receive IPV4 Header Error Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4heroim(&mut self) -> RXIPV4HEROIM_W<17> { - RXIPV4HEROIM_W::new(self) + pub fn rxipv4heroim(&mut self) -> RXIPV4HEROIM_W { + RXIPV4HEROIM_W::new(self, 17) } #[doc = "Bit 18 - MMC Receive IPV4 No Payload Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4nopayoim(&mut self) -> RXIPV4NOPAYOIM_W<18> { - RXIPV4NOPAYOIM_W::new(self) + pub fn rxipv4nopayoim(&mut self) -> RXIPV4NOPAYOIM_W { + RXIPV4NOPAYOIM_W::new(self, 18) } #[doc = "Bit 19 - MMC Receive IPV4 Fragmented Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4fragoim(&mut self) -> RXIPV4FRAGOIM_W<19> { - RXIPV4FRAGOIM_W::new(self) + pub fn rxipv4fragoim(&mut self) -> RXIPV4FRAGOIM_W { + RXIPV4FRAGOIM_W::new(self, 19) } #[doc = "Bit 20 - MMC Receive IPV4 UDP Checksum Disabled Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv4udsbloim(&mut self) -> RXIPV4UDSBLOIM_W<20> { - RXIPV4UDSBLOIM_W::new(self) + pub fn rxipv4udsbloim(&mut self) -> RXIPV4UDSBLOIM_W { + RXIPV4UDSBLOIM_W::new(self, 20) } #[doc = "Bit 21 - MMC Receive IPV6 Good Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv6goim(&mut self) -> RXIPV6GOIM_W<21> { - RXIPV6GOIM_W::new(self) + pub fn rxipv6goim(&mut self) -> RXIPV6GOIM_W { + RXIPV6GOIM_W::new(self, 21) } #[doc = "Bit 22 - MMC Receive IPV6 Header Error Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv6heroim(&mut self) -> RXIPV6HEROIM_W<22> { - RXIPV6HEROIM_W::new(self) + pub fn rxipv6heroim(&mut self) -> RXIPV6HEROIM_W { + RXIPV6HEROIM_W::new(self, 22) } #[doc = "Bit 23 - MMC Receive IPV6 No Payload Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxipv6nopayoim(&mut self) -> RXIPV6NOPAYOIM_W<23> { - RXIPV6NOPAYOIM_W::new(self) + pub fn rxipv6nopayoim(&mut self) -> RXIPV6NOPAYOIM_W { + RXIPV6NOPAYOIM_W::new(self, 23) } #[doc = "Bit 24 - MMC Receive UDP Good Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxudpgoim(&mut self) -> RXUDPGOIM_W<24> { - RXUDPGOIM_W::new(self) + pub fn rxudpgoim(&mut self) -> RXUDPGOIM_W { + RXUDPGOIM_W::new(self, 24) } #[doc = "Bit 25 - MMC Receive UDP Error Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxudperoim(&mut self) -> RXUDPEROIM_W<25> { - RXUDPEROIM_W::new(self) + pub fn rxudperoim(&mut self) -> RXUDPEROIM_W { + RXUDPEROIM_W::new(self, 25) } #[doc = "Bit 26 - MMC Receive TCP Good Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxtcpgoim(&mut self) -> RXTCPGOIM_W<26> { - RXTCPGOIM_W::new(self) + pub fn rxtcpgoim(&mut self) -> RXTCPGOIM_W { + RXTCPGOIM_W::new(self, 26) } #[doc = "Bit 27 - MMC Receive TCP Error Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxtcperoim(&mut self) -> RXTCPEROIM_W<27> { - RXTCPEROIM_W::new(self) + pub fn rxtcperoim(&mut self) -> RXTCPEROIM_W { + RXTCPEROIM_W::new(self, 27) } #[doc = "Bit 28 - MMC Receive ICMP Good Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxicmpgoim(&mut self) -> RXICMPGOIM_W<28> { - RXICMPGOIM_W::new(self) + pub fn rxicmpgoim(&mut self) -> RXICMPGOIM_W { + RXICMPGOIM_W::new(self, 28) } #[doc = "Bit 29 - MMC Receive ICMP Error Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxicmperoim(&mut self) -> RXICMPEROIM_W<29> { - RXICMPEROIM_W::new(self) + pub fn rxicmperoim(&mut self) -> RXICMPEROIM_W { + RXICMPEROIM_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MMC Receive Checksum Offload 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 [mmc_ipc_receive_interrupt_mask](index.html) module"] +#[doc = "MMC Receive Checksum Offload Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_ipc_receive_interrupt_mask::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmc_ipc_receive_interrupt_mask::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC; impl crate::RegisterSpec for MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mmc_ipc_receive_interrupt_mask::R](R) reader structure"] -impl crate::Readable for MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mmc_ipc_receive_interrupt_mask::W](W) writer structure"] +#[doc = "`read()` method returns [`mmc_ipc_receive_interrupt_mask::R`](R) reader structure"] +impl crate::Readable for MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mmc_ipc_receive_interrupt_mask::W`](W) writer structure"] impl crate::Writable for MMC_IPC_RECEIVE_INTERRUPT_MASK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mmc_receive_interrupt.rs b/src/eth0/mmc_receive_interrupt.rs index 6d276e2d..a502763f 100644 --- a/src/eth0/mmc_receive_interrupt.rs +++ b/src/eth0/mmc_receive_interrupt.rs @@ -1,70 +1,57 @@ #[doc = "Register `MMC_RECEIVE_INTERRUPT` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXGBFRMIS` reader - MMC Receive Good Bad Frame Counter Interrupt Status"] -pub type RXGBFRMIS_R = crate::BitReader; +pub type RXGBFRMIS_R = crate::BitReader; #[doc = "Field `RXGBOCTIS` reader - MMC Receive Good Bad Octet Counter Interrupt Status"] -pub type RXGBOCTIS_R = crate::BitReader; +pub type RXGBOCTIS_R = crate::BitReader; #[doc = "Field `RXGOCTIS` reader - MMC Receive Good Octet Counter Interrupt Status."] -pub type RXGOCTIS_R = crate::BitReader; +pub type RXGOCTIS_R = crate::BitReader; #[doc = "Field `RXBCGFIS` reader - MMC Receive Broadcast Good Frame Counter Interrupt Status."] -pub type RXBCGFIS_R = crate::BitReader; +pub type RXBCGFIS_R = crate::BitReader; #[doc = "Field `RXMCGFIS` reader - MMC Receive Multicast Good Frame Counter Interrupt Status"] -pub type RXMCGFIS_R = crate::BitReader; +pub type RXMCGFIS_R = crate::BitReader; #[doc = "Field `RXCRCERFIS` reader - MMC Receive CRC Error Frame Counter Interrupt Status"] -pub type RXCRCERFIS_R = crate::BitReader; +pub type RXCRCERFIS_R = crate::BitReader; #[doc = "Field `RXALGNERFIS` reader - MMC Receive Alignment Error Frame Counter Interrupt Status"] -pub type RXALGNERFIS_R = crate::BitReader; +pub type RXALGNERFIS_R = crate::BitReader; #[doc = "Field `RXRUNTFIS` reader - MMC Receive Runt Frame Counter Interrupt Status"] -pub type RXRUNTFIS_R = crate::BitReader; +pub type RXRUNTFIS_R = crate::BitReader; #[doc = "Field `RXJABERFIS` reader - MMC Receive Jabber Error Frame Counter Interrupt Status"] -pub type RXJABERFIS_R = crate::BitReader; +pub type RXJABERFIS_R = crate::BitReader; #[doc = "Field `RXUSIZEGFIS` reader - MMC Receive Undersize Good Frame Counter Interrupt Status"] -pub type RXUSIZEGFIS_R = crate::BitReader; +pub type RXUSIZEGFIS_R = crate::BitReader; #[doc = "Field `RXOSIZEGFIS` reader - MMC Receive Oversize Good Frame Counter Interrupt Status"] -pub type RXOSIZEGFIS_R = crate::BitReader; +pub type RXOSIZEGFIS_R = crate::BitReader; #[doc = "Field `RX64OCTGBFIS` reader - MMC Receive 64 Octet Good Bad Frame Counter Interrupt Status"] -pub type RX64OCTGBFIS_R = crate::BitReader; +pub type RX64OCTGBFIS_R = crate::BitReader; #[doc = "Field `RX65T127OCTGBFIS` reader - MMC Receive 65 to 127 Octet Good Bad Frame Counter Interrupt Status"] -pub type RX65T127OCTGBFIS_R = crate::BitReader; +pub type RX65T127OCTGBFIS_R = crate::BitReader; #[doc = "Field `RX128T255OCTGBFIS` reader - MMC Receive 128 to 255 Octet Good Bad Frame Counter Interrupt Status"] -pub type RX128T255OCTGBFIS_R = crate::BitReader; +pub type RX128T255OCTGBFIS_R = crate::BitReader; #[doc = "Field `RX256T511OCTGBFIS` reader - MMC Receive 256 to 511 Octet Good Bad Frame Counter Interrupt Status"] -pub type RX256T511OCTGBFIS_R = crate::BitReader; +pub type RX256T511OCTGBFIS_R = crate::BitReader; #[doc = "Field `RX512T1023OCTGBFIS` reader - MMC Receive 512 to 1023 Octet Good Bad Frame Counter Interrupt Status"] -pub type RX512T1023OCTGBFIS_R = crate::BitReader; +pub type RX512T1023OCTGBFIS_R = crate::BitReader; #[doc = "Field `RX1024TMAXOCTGBFIS` reader - MMC Receive 1024 to Maximum Octet Good Bad Frame Counter Interrupt Status"] -pub type RX1024TMAXOCTGBFIS_R = crate::BitReader; +pub type RX1024TMAXOCTGBFIS_R = crate::BitReader; #[doc = "Field `RXUCGFIS` reader - MMC Receive Unicast Good Frame Counter Interrupt Status"] -pub type RXUCGFIS_R = crate::BitReader; +pub type RXUCGFIS_R = crate::BitReader; #[doc = "Field `RXLENERFIS` reader - MMC Receive Length Error Frame Counter Interrupt Status"] -pub type RXLENERFIS_R = crate::BitReader; +pub type RXLENERFIS_R = crate::BitReader; #[doc = "Field `RXORANGEFIS` reader - MMC Receive Out Of Range Error Frame Counter Interrupt Status"] -pub type RXORANGEFIS_R = crate::BitReader; +pub type RXORANGEFIS_R = crate::BitReader; #[doc = "Field `RXPAUSFIS` reader - MMC Receive Pause Frame Counter Interrupt Status"] -pub type RXPAUSFIS_R = crate::BitReader; +pub type RXPAUSFIS_R = crate::BitReader; #[doc = "Field `RXFOVFIS` reader - MMC Receive FIFO Overflow Frame Counter Interrupt Status"] -pub type RXFOVFIS_R = crate::BitReader; +pub type RXFOVFIS_R = crate::BitReader; #[doc = "Field `RXVLANGBFIS` reader - MMC Receive VLAN Good Bad Frame Counter Interrupt Status"] -pub type RXVLANGBFIS_R = crate::BitReader; +pub type RXVLANGBFIS_R = crate::BitReader; #[doc = "Field `RXWDOGFIS` reader - MMC Receive Watchdog Error Frame Counter Interrupt Status"] -pub type RXWDOGFIS_R = crate::BitReader; +pub type RXWDOGFIS_R = crate::BitReader; #[doc = "Field `RXRCVERRFIS` reader - MMC Receive Error Frame Counter Interrupt Status"] -pub type RXRCVERRFIS_R = crate::BitReader; +pub type RXRCVERRFIS_R = crate::BitReader; #[doc = "Field `RXCTRLFIS` reader - MMC Receive Control Frame Counter Interrupt Status"] -pub type RXCTRLFIS_R = crate::BitReader; +pub type RXCTRLFIS_R = crate::BitReader; impl R { #[doc = "Bit 0 - MMC Receive Good Bad Frame Counter Interrupt Status"] #[inline(always)] @@ -197,15 +184,13 @@ impl R { RXCTRLFIS_R::new(((self.bits >> 25) & 1) != 0) } } -#[doc = "MMC Receive 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 [mmc_receive_interrupt](index.html) module"] +#[doc = "MMC Receive Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_receive_interrupt::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MMC_RECEIVE_INTERRUPT_SPEC; impl crate::RegisterSpec for MMC_RECEIVE_INTERRUPT_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mmc_receive_interrupt::R](R) reader structure"] -impl crate::Readable for MMC_RECEIVE_INTERRUPT_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`mmc_receive_interrupt::R`](R) reader structure"] +impl crate::Readable for MMC_RECEIVE_INTERRUPT_SPEC {} #[doc = "`reset()` method sets MMC_RECEIVE_INTERRUPT to value 0"] impl crate::Resettable for MMC_RECEIVE_INTERRUPT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/mmc_receive_interrupt_mask.rs b/src/eth0/mmc_receive_interrupt_mask.rs index 7c695917..7e2a8ca1 100644 --- a/src/eth0/mmc_receive_interrupt_mask.rs +++ b/src/eth0/mmc_receive_interrupt_mask.rs @@ -1,143 +1,111 @@ #[doc = "Register `MMC_RECEIVE_INTERRUPT_MASK` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MMC_RECEIVE_INTERRUPT_MASK` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RXGBFRMIM` reader - MMC Receive Good Bad Frame Counter Interrupt Mask"] -pub type RXGBFRMIM_R = crate::BitReader; +pub type RXGBFRMIM_R = crate::BitReader; #[doc = "Field `RXGBFRMIM` writer - MMC Receive Good Bad Frame Counter Interrupt Mask"] -pub type RXGBFRMIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXGBFRMIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXGBOCTIM` reader - MMC Receive Good Bad Octet Counter Interrupt Mask"] -pub type RXGBOCTIM_R = crate::BitReader; +pub type RXGBOCTIM_R = crate::BitReader; #[doc = "Field `RXGBOCTIM` writer - MMC Receive Good Bad Octet Counter Interrupt Mask"] -pub type RXGBOCTIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXGBOCTIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXGOCTIM` reader - MMC Receive Good Octet Counter Interrupt Mask"] -pub type RXGOCTIM_R = crate::BitReader; +pub type RXGOCTIM_R = crate::BitReader; #[doc = "Field `RXGOCTIM` writer - MMC Receive Good Octet Counter Interrupt Mask"] -pub type RXGOCTIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXGOCTIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXBCGFIM` reader - MMC Receive Broadcast Good Frame Counter Interrupt Mask"] -pub type RXBCGFIM_R = crate::BitReader; +pub type RXBCGFIM_R = crate::BitReader; #[doc = "Field `RXBCGFIM` writer - MMC Receive Broadcast Good Frame Counter Interrupt Mask"] -pub type RXBCGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXBCGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXMCGFIM` reader - MMC Receive Multicast Good Frame Counter Interrupt Mask"] -pub type RXMCGFIM_R = crate::BitReader; +pub type RXMCGFIM_R = crate::BitReader; #[doc = "Field `RXMCGFIM` writer - MMC Receive Multicast Good Frame Counter Interrupt Mask"] -pub type RXMCGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXMCGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXCRCERFIM` reader - MMC Receive CRC Error Frame Counter Interrupt Mask"] -pub type RXCRCERFIM_R = crate::BitReader; +pub type RXCRCERFIM_R = crate::BitReader; #[doc = "Field `RXCRCERFIM` writer - MMC Receive CRC Error Frame Counter Interrupt Mask"] -pub type RXCRCERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXCRCERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXALGNERFIM` reader - MMC Receive Alignment Error Frame Counter Interrupt Mask"] -pub type RXALGNERFIM_R = crate::BitReader; +pub type RXALGNERFIM_R = crate::BitReader; #[doc = "Field `RXALGNERFIM` writer - MMC Receive Alignment Error Frame Counter Interrupt Mask"] -pub type RXALGNERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXALGNERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXRUNTFIM` reader - MMC Receive Runt Frame Counter Interrupt Mask"] -pub type RXRUNTFIM_R = crate::BitReader; +pub type RXRUNTFIM_R = crate::BitReader; #[doc = "Field `RXRUNTFIM` writer - MMC Receive Runt Frame Counter Interrupt Mask"] -pub type RXRUNTFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXRUNTFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXJABERFIM` reader - MMC Receive Jabber Error Frame Counter Interrupt Mask"] -pub type RXJABERFIM_R = crate::BitReader; +pub type RXJABERFIM_R = crate::BitReader; #[doc = "Field `RXJABERFIM` writer - MMC Receive Jabber Error Frame Counter Interrupt Mask"] -pub type RXJABERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXJABERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXUSIZEGFIM` reader - MMC Receive Undersize Good Frame Counter Interrupt Mask"] -pub type RXUSIZEGFIM_R = crate::BitReader; +pub type RXUSIZEGFIM_R = crate::BitReader; #[doc = "Field `RXUSIZEGFIM` writer - MMC Receive Undersize Good Frame Counter Interrupt Mask"] -pub type RXUSIZEGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXUSIZEGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXOSIZEGFIM` reader - MMC Receive Oversize Good Frame Counter Interrupt Mask"] -pub type RXOSIZEGFIM_R = crate::BitReader; +pub type RXOSIZEGFIM_R = crate::BitReader; #[doc = "Field `RXOSIZEGFIM` writer - MMC Receive Oversize Good Frame Counter Interrupt Mask"] -pub type RXOSIZEGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXOSIZEGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RX64OCTGBFIM` reader - MMC Receive 64 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX64OCTGBFIM_R = crate::BitReader; +pub type RX64OCTGBFIM_R = crate::BitReader; #[doc = "Field `RX64OCTGBFIM` writer - MMC Receive 64 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX64OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RX64OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RX65T127OCTGBFIM` reader - MMC Receive 65 to 127 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX65T127OCTGBFIM_R = crate::BitReader; +pub type RX65T127OCTGBFIM_R = crate::BitReader; #[doc = "Field `RX65T127OCTGBFIM` writer - MMC Receive 65 to 127 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX65T127OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RX65T127OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RX128T255OCTGBFIM` reader - MMC Receive 128 to 255 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX128T255OCTGBFIM_R = crate::BitReader; +pub type RX128T255OCTGBFIM_R = crate::BitReader; #[doc = "Field `RX128T255OCTGBFIM` writer - MMC Receive 128 to 255 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX128T255OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RX128T255OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RX256T511OCTGBFIM` reader - MMC Receive 256 to 511 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX256T511OCTGBFIM_R = crate::BitReader; +pub type RX256T511OCTGBFIM_R = crate::BitReader; #[doc = "Field `RX256T511OCTGBFIM` writer - MMC Receive 256 to 511 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX256T511OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RX256T511OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RX512T1023OCTGBFIM` reader - MMC Receive 512 to 1023 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX512T1023OCTGBFIM_R = crate::BitReader; +pub type RX512T1023OCTGBFIM_R = crate::BitReader; #[doc = "Field `RX512T1023OCTGBFIM` writer - MMC Receive 512 to 1023 Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX512T1023OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RX512T1023OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RX1024TMAXOCTGBFIM` reader - MMC Receive 1024 to Maximum Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX1024TMAXOCTGBFIM_R = crate::BitReader; +pub type RX1024TMAXOCTGBFIM_R = crate::BitReader; #[doc = "Field `RX1024TMAXOCTGBFIM` writer - MMC Receive 1024 to Maximum Octet Good Bad Frame Counter Interrupt Mask"] -pub type RX1024TMAXOCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RX1024TMAXOCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXUCGFIM` reader - MMC Receive Unicast Good Frame Counter Interrupt Mask"] -pub type RXUCGFIM_R = crate::BitReader; +pub type RXUCGFIM_R = crate::BitReader; #[doc = "Field `RXUCGFIM` writer - MMC Receive Unicast Good Frame Counter Interrupt Mask"] -pub type RXUCGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXUCGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXLENERFIM` reader - MMC Receive Length Error Frame Counter Interrupt Mask"] -pub type RXLENERFIM_R = crate::BitReader; +pub type RXLENERFIM_R = crate::BitReader; #[doc = "Field `RXLENERFIM` writer - MMC Receive Length Error Frame Counter Interrupt Mask"] -pub type RXLENERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXLENERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXORANGEFIM` reader - MMC Receive Out Of Range Error Frame Counter Interrupt Mask"] -pub type RXORANGEFIM_R = crate::BitReader; +pub type RXORANGEFIM_R = crate::BitReader; #[doc = "Field `RXORANGEFIM` writer - MMC Receive Out Of Range Error Frame Counter Interrupt Mask"] -pub type RXORANGEFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXORANGEFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXPAUSFIM` reader - MMC Receive Pause Frame Counter Interrupt Mask"] -pub type RXPAUSFIM_R = crate::BitReader; +pub type RXPAUSFIM_R = crate::BitReader; #[doc = "Field `RXPAUSFIM` writer - MMC Receive Pause Frame Counter Interrupt Mask"] -pub type RXPAUSFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXPAUSFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXFOVFIM` reader - MMC Receive FIFO Overflow Frame Counter Interrupt Mask"] -pub type RXFOVFIM_R = crate::BitReader; +pub type RXFOVFIM_R = crate::BitReader; #[doc = "Field `RXFOVFIM` writer - MMC Receive FIFO Overflow Frame Counter Interrupt Mask"] -pub type RXFOVFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXFOVFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXVLANGBFIM` reader - MMC Receive VLAN Good Bad Frame Counter Interrupt Mask"] -pub type RXVLANGBFIM_R = crate::BitReader; +pub type RXVLANGBFIM_R = crate::BitReader; #[doc = "Field `RXVLANGBFIM` writer - MMC Receive VLAN Good Bad Frame Counter Interrupt Mask"] -pub type RXVLANGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXVLANGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXWDOGFIM` reader - MMC Receive Watchdog Error Frame Counter Interrupt Mask"] -pub type RXWDOGFIM_R = crate::BitReader; +pub type RXWDOGFIM_R = crate::BitReader; #[doc = "Field `RXWDOGFIM` writer - MMC Receive Watchdog Error Frame Counter Interrupt Mask"] -pub type RXWDOGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXWDOGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXRCVERRFIM` reader - MMC Receive Error Frame Counter Interrupt Mask"] -pub type RXRCVERRFIM_R = crate::BitReader; +pub type RXRCVERRFIM_R = crate::BitReader; #[doc = "Field `RXRCVERRFIM` writer - MMC Receive Error Frame Counter Interrupt Mask"] -pub type RXRCVERRFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXRCVERRFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RXCTRLFIM` reader - MMC Receive Control Frame Counter Interrupt Mask"] -pub type RXCTRLFIM_R = crate::BitReader; +pub type RXCTRLFIM_R = crate::BitReader; #[doc = "Field `RXCTRLFIM` writer - MMC Receive Control Frame Counter Interrupt Mask"] -pub type RXCTRLFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_RECEIVE_INTERRUPT_MASK_SPEC, bool, O>; +pub type RXCTRLFIM_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - MMC Receive Good Bad Frame Counter Interrupt Mask"] #[inline(always)] @@ -274,178 +242,179 @@ impl W { #[doc = "Bit 0 - MMC Receive Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxgbfrmim(&mut self) -> RXGBFRMIM_W<0> { - RXGBFRMIM_W::new(self) + pub fn rxgbfrmim(&mut self) -> RXGBFRMIM_W { + RXGBFRMIM_W::new(self, 0) } #[doc = "Bit 1 - MMC Receive Good Bad Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxgboctim(&mut self) -> RXGBOCTIM_W<1> { - RXGBOCTIM_W::new(self) + pub fn rxgboctim(&mut self) -> RXGBOCTIM_W { + RXGBOCTIM_W::new(self, 1) } #[doc = "Bit 2 - MMC Receive Good Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxgoctim(&mut self) -> RXGOCTIM_W<2> { - RXGOCTIM_W::new(self) + pub fn rxgoctim(&mut self) -> RXGOCTIM_W { + RXGOCTIM_W::new(self, 2) } #[doc = "Bit 3 - MMC Receive Broadcast Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxbcgfim(&mut self) -> RXBCGFIM_W<3> { - RXBCGFIM_W::new(self) + pub fn rxbcgfim(&mut self) -> RXBCGFIM_W { + RXBCGFIM_W::new(self, 3) } #[doc = "Bit 4 - MMC Receive Multicast Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxmcgfim(&mut self) -> RXMCGFIM_W<4> { - RXMCGFIM_W::new(self) + pub fn rxmcgfim(&mut self) -> RXMCGFIM_W { + RXMCGFIM_W::new(self, 4) } #[doc = "Bit 5 - MMC Receive CRC Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxcrcerfim(&mut self) -> RXCRCERFIM_W<5> { - RXCRCERFIM_W::new(self) + pub fn rxcrcerfim(&mut self) -> RXCRCERFIM_W { + RXCRCERFIM_W::new(self, 5) } #[doc = "Bit 6 - MMC Receive Alignment Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxalgnerfim(&mut self) -> RXALGNERFIM_W<6> { - RXALGNERFIM_W::new(self) + pub fn rxalgnerfim(&mut self) -> RXALGNERFIM_W { + RXALGNERFIM_W::new(self, 6) } #[doc = "Bit 7 - MMC Receive Runt Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxruntfim(&mut self) -> RXRUNTFIM_W<7> { - RXRUNTFIM_W::new(self) + pub fn rxruntfim(&mut self) -> RXRUNTFIM_W { + RXRUNTFIM_W::new(self, 7) } #[doc = "Bit 8 - MMC Receive Jabber Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxjaberfim(&mut self) -> RXJABERFIM_W<8> { - RXJABERFIM_W::new(self) + pub fn rxjaberfim(&mut self) -> RXJABERFIM_W { + RXJABERFIM_W::new(self, 8) } #[doc = "Bit 9 - MMC Receive Undersize Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxusizegfim(&mut self) -> RXUSIZEGFIM_W<9> { - RXUSIZEGFIM_W::new(self) + pub fn rxusizegfim(&mut self) -> RXUSIZEGFIM_W { + RXUSIZEGFIM_W::new(self, 9) } #[doc = "Bit 10 - MMC Receive Oversize Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxosizegfim(&mut self) -> RXOSIZEGFIM_W<10> { - RXOSIZEGFIM_W::new(self) + pub fn rxosizegfim(&mut self) -> RXOSIZEGFIM_W { + RXOSIZEGFIM_W::new(self, 10) } #[doc = "Bit 11 - MMC Receive 64 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rx64octgbfim(&mut self) -> RX64OCTGBFIM_W<11> { - RX64OCTGBFIM_W::new(self) + pub fn rx64octgbfim(&mut self) -> RX64OCTGBFIM_W { + RX64OCTGBFIM_W::new(self, 11) } #[doc = "Bit 12 - MMC Receive 65 to 127 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rx65t127octgbfim(&mut self) -> RX65T127OCTGBFIM_W<12> { - RX65T127OCTGBFIM_W::new(self) + pub fn rx65t127octgbfim(&mut self) -> RX65T127OCTGBFIM_W { + RX65T127OCTGBFIM_W::new(self, 12) } #[doc = "Bit 13 - MMC Receive 128 to 255 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rx128t255octgbfim(&mut self) -> RX128T255OCTGBFIM_W<13> { - RX128T255OCTGBFIM_W::new(self) + pub fn rx128t255octgbfim(&mut self) -> RX128T255OCTGBFIM_W { + RX128T255OCTGBFIM_W::new(self, 13) } #[doc = "Bit 14 - MMC Receive 256 to 511 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rx256t511octgbfim(&mut self) -> RX256T511OCTGBFIM_W<14> { - RX256T511OCTGBFIM_W::new(self) + pub fn rx256t511octgbfim(&mut self) -> RX256T511OCTGBFIM_W { + RX256T511OCTGBFIM_W::new(self, 14) } #[doc = "Bit 15 - MMC Receive 512 to 1023 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rx512t1023octgbfim(&mut self) -> RX512T1023OCTGBFIM_W<15> { - RX512T1023OCTGBFIM_W::new(self) + pub fn rx512t1023octgbfim(&mut self) -> RX512T1023OCTGBFIM_W { + RX512T1023OCTGBFIM_W::new(self, 15) } #[doc = "Bit 16 - MMC Receive 1024 to Maximum Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rx1024tmaxoctgbfim(&mut self) -> RX1024TMAXOCTGBFIM_W<16> { - RX1024TMAXOCTGBFIM_W::new(self) + pub fn rx1024tmaxoctgbfim(&mut self) -> RX1024TMAXOCTGBFIM_W { + RX1024TMAXOCTGBFIM_W::new(self, 16) } #[doc = "Bit 17 - MMC Receive Unicast Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxucgfim(&mut self) -> RXUCGFIM_W<17> { - RXUCGFIM_W::new(self) + pub fn rxucgfim(&mut self) -> RXUCGFIM_W { + RXUCGFIM_W::new(self, 17) } #[doc = "Bit 18 - MMC Receive Length Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxlenerfim(&mut self) -> RXLENERFIM_W<18> { - RXLENERFIM_W::new(self) + pub fn rxlenerfim(&mut self) -> RXLENERFIM_W { + RXLENERFIM_W::new(self, 18) } #[doc = "Bit 19 - MMC Receive Out Of Range Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxorangefim(&mut self) -> RXORANGEFIM_W<19> { - RXORANGEFIM_W::new(self) + pub fn rxorangefim(&mut self) -> RXORANGEFIM_W { + RXORANGEFIM_W::new(self, 19) } #[doc = "Bit 20 - MMC Receive Pause Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxpausfim(&mut self) -> RXPAUSFIM_W<20> { - RXPAUSFIM_W::new(self) + pub fn rxpausfim(&mut self) -> RXPAUSFIM_W { + RXPAUSFIM_W::new(self, 20) } #[doc = "Bit 21 - MMC Receive FIFO Overflow Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxfovfim(&mut self) -> RXFOVFIM_W<21> { - RXFOVFIM_W::new(self) + pub fn rxfovfim(&mut self) -> RXFOVFIM_W { + RXFOVFIM_W::new(self, 21) } #[doc = "Bit 22 - MMC Receive VLAN Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxvlangbfim(&mut self) -> RXVLANGBFIM_W<22> { - RXVLANGBFIM_W::new(self) + pub fn rxvlangbfim(&mut self) -> RXVLANGBFIM_W { + RXVLANGBFIM_W::new(self, 22) } #[doc = "Bit 23 - MMC Receive Watchdog Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxwdogfim(&mut self) -> RXWDOGFIM_W<23> { - RXWDOGFIM_W::new(self) + pub fn rxwdogfim(&mut self) -> RXWDOGFIM_W { + RXWDOGFIM_W::new(self, 23) } #[doc = "Bit 24 - MMC Receive Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxrcverrfim(&mut self) -> RXRCVERRFIM_W<24> { - RXRCVERRFIM_W::new(self) + pub fn rxrcverrfim(&mut self) -> RXRCVERRFIM_W { + RXRCVERRFIM_W::new(self, 24) } #[doc = "Bit 25 - MMC Receive Control Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn rxctrlfim(&mut self) -> RXCTRLFIM_W<25> { - RXCTRLFIM_W::new(self) + pub fn rxctrlfim(&mut self) -> RXCTRLFIM_W { + RXCTRLFIM_W::new(self, 25) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MMC Reveive 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 [mmc_receive_interrupt_mask](index.html) module"] +#[doc = "MMC Reveive Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_receive_interrupt_mask::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmc_receive_interrupt_mask::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MMC_RECEIVE_INTERRUPT_MASK_SPEC; impl crate::RegisterSpec for MMC_RECEIVE_INTERRUPT_MASK_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mmc_receive_interrupt_mask::R](R) reader structure"] -impl crate::Readable for MMC_RECEIVE_INTERRUPT_MASK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mmc_receive_interrupt_mask::W](W) writer structure"] +#[doc = "`read()` method returns [`mmc_receive_interrupt_mask::R`](R) reader structure"] +impl crate::Readable for MMC_RECEIVE_INTERRUPT_MASK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mmc_receive_interrupt_mask::W`](W) writer structure"] impl crate::Writable for MMC_RECEIVE_INTERRUPT_MASK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/mmc_transmit_interrupt.rs b/src/eth0/mmc_transmit_interrupt.rs index aebf00fa..3d0f00ce 100644 --- a/src/eth0/mmc_transmit_interrupt.rs +++ b/src/eth0/mmc_transmit_interrupt.rs @@ -1,70 +1,57 @@ #[doc = "Register `MMC_TRANSMIT_INTERRUPT` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXGBOCTIS` reader - MMC Transmit Good Bad Octet Counter Interrupt Status"] -pub type TXGBOCTIS_R = crate::BitReader; +pub type TXGBOCTIS_R = crate::BitReader; #[doc = "Field `TXGBFRMIS` reader - MMC Transmit Good Bad Frame Counter Interrupt Status"] -pub type TXGBFRMIS_R = crate::BitReader; +pub type TXGBFRMIS_R = crate::BitReader; #[doc = "Field `TXBCGFIS` reader - MMC Transmit Broadcast Good Frame Counter Interrupt Status"] -pub type TXBCGFIS_R = crate::BitReader; +pub type TXBCGFIS_R = crate::BitReader; #[doc = "Field `TXMCGFIS` reader - MMC Transmit Multicast Good Frame Counter Interrupt Status"] -pub type TXMCGFIS_R = crate::BitReader; +pub type TXMCGFIS_R = crate::BitReader; #[doc = "Field `TX64OCTGBFIS` reader - MMC Transmit 64 Octet Good Bad Frame Counter Interrupt Status."] -pub type TX64OCTGBFIS_R = crate::BitReader; +pub type TX64OCTGBFIS_R = crate::BitReader; #[doc = "Field `TX65T127OCTGBFIS` reader - MMC Transmit 65 to 127 Octet Good Bad Frame Counter Interrupt Status"] -pub type TX65T127OCTGBFIS_R = crate::BitReader; +pub type TX65T127OCTGBFIS_R = crate::BitReader; #[doc = "Field `TX128T255OCTGBFIS` reader - MMC Transmit 128 to 255 Octet Good Bad Frame Counter Interrupt Status"] -pub type TX128T255OCTGBFIS_R = crate::BitReader; +pub type TX128T255OCTGBFIS_R = crate::BitReader; #[doc = "Field `TX256T511OCTGBFIS` reader - MMC Transmit 256 to 511 Octet Good Bad Frame Counter Interrupt Status"] -pub type TX256T511OCTGBFIS_R = crate::BitReader; +pub type TX256T511OCTGBFIS_R = crate::BitReader; #[doc = "Field `TX512T1023OCTGBFIS` reader - MMC Transmit 512 to 1023 Octet Good Bad Frame Counter Interrupt Status"] -pub type TX512T1023OCTGBFIS_R = crate::BitReader; +pub type TX512T1023OCTGBFIS_R = crate::BitReader; #[doc = "Field `TX1024TMAXOCTGBFIS` reader - MMC Transmit 1024 to Maximum Octet Good Bad Frame Counter Interrupt Status"] -pub type TX1024TMAXOCTGBFIS_R = crate::BitReader; +pub type TX1024TMAXOCTGBFIS_R = crate::BitReader; #[doc = "Field `TXUCGBFIS` reader - MMC Transmit Unicast Good Bad Frame Counter Interrupt Status"] -pub type TXUCGBFIS_R = crate::BitReader; +pub type TXUCGBFIS_R = crate::BitReader; #[doc = "Field `TXMCGBFIS` reader - MMC Transmit Multicast Good Bad Frame Counter Interrupt Status"] -pub type TXMCGBFIS_R = crate::BitReader; +pub type TXMCGBFIS_R = crate::BitReader; #[doc = "Field `TXBCGBFIS` reader - MMC Transmit Broadcast Good Bad Frame Counter Interrupt Status"] -pub type TXBCGBFIS_R = crate::BitReader; +pub type TXBCGBFIS_R = crate::BitReader; #[doc = "Field `TXUFLOWERFIS` reader - MMC Transmit Underflow Error Frame Counter Interrupt Status"] -pub type TXUFLOWERFIS_R = crate::BitReader; +pub type TXUFLOWERFIS_R = crate::BitReader; #[doc = "Field `TXSCOLGFIS` reader - MMC Transmit Single Collision Good Frame Counter Interrupt Status"] -pub type TXSCOLGFIS_R = crate::BitReader; +pub type TXSCOLGFIS_R = crate::BitReader; #[doc = "Field `TXMCOLGFIS` reader - MMC Transmit Multiple Collision Good Frame Counter Interrupt Status"] -pub type TXMCOLGFIS_R = crate::BitReader; +pub type TXMCOLGFIS_R = crate::BitReader; #[doc = "Field `TXDEFFIS` reader - MMC Transmit Deferred Frame Counter Interrupt Status"] -pub type TXDEFFIS_R = crate::BitReader; +pub type TXDEFFIS_R = crate::BitReader; #[doc = "Field `TXLATCOLFIS` reader - MMC Transmit Late Collision Frame Counter Interrupt Status"] -pub type TXLATCOLFIS_R = crate::BitReader; +pub type TXLATCOLFIS_R = crate::BitReader; #[doc = "Field `TXEXCOLFIS` reader - MMC Transmit Excessive Collision Frame Counter Interrupt Status"] -pub type TXEXCOLFIS_R = crate::BitReader; +pub type TXEXCOLFIS_R = crate::BitReader; #[doc = "Field `TXCARERFIS` reader - MMC Transmit Carrier Error Frame Counter Interrupt Status"] -pub type TXCARERFIS_R = crate::BitReader; +pub type TXCARERFIS_R = crate::BitReader; #[doc = "Field `TXGOCTIS` reader - MMC Transmit Good Octet Counter Interrupt Status"] -pub type TXGOCTIS_R = crate::BitReader; +pub type TXGOCTIS_R = crate::BitReader; #[doc = "Field `TXGFRMIS` reader - MMC Transmit Good Frame Counter Interrupt Status"] -pub type TXGFRMIS_R = crate::BitReader; +pub type TXGFRMIS_R = crate::BitReader; #[doc = "Field `TXEXDEFFIS` reader - MMC Transmit Excessive Deferral Frame Counter Interrupt Status"] -pub type TXEXDEFFIS_R = crate::BitReader; +pub type TXEXDEFFIS_R = crate::BitReader; #[doc = "Field `TXPAUSFIS` reader - MMC Transmit Pause Frame Counter Interrupt Status"] -pub type TXPAUSFIS_R = crate::BitReader; +pub type TXPAUSFIS_R = crate::BitReader; #[doc = "Field `TXVLANGFIS` reader - MMC Transmit VLAN Good Frame Counter Interrupt Status"] -pub type TXVLANGFIS_R = crate::BitReader; +pub type TXVLANGFIS_R = crate::BitReader; #[doc = "Field `TXOSIZEGFIS` reader - MMC Transmit Oversize Good Frame Counter Interrupt Status"] -pub type TXOSIZEGFIS_R = crate::BitReader; +pub type TXOSIZEGFIS_R = crate::BitReader; impl R { #[doc = "Bit 0 - MMC Transmit Good Bad Octet Counter Interrupt Status"] #[inline(always)] @@ -197,15 +184,13 @@ impl R { TXOSIZEGFIS_R::new(((self.bits >> 25) & 1) != 0) } } -#[doc = "MMC Transmit 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 [mmc_transmit_interrupt](index.html) module"] +#[doc = "MMC Transmit Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_transmit_interrupt::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MMC_TRANSMIT_INTERRUPT_SPEC; impl crate::RegisterSpec for MMC_TRANSMIT_INTERRUPT_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mmc_transmit_interrupt::R](R) reader structure"] -impl crate::Readable for MMC_TRANSMIT_INTERRUPT_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`mmc_transmit_interrupt::R`](R) reader structure"] +impl crate::Readable for MMC_TRANSMIT_INTERRUPT_SPEC {} #[doc = "`reset()` method sets MMC_TRANSMIT_INTERRUPT to value 0"] impl crate::Resettable for MMC_TRANSMIT_INTERRUPT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/mmc_transmit_interrupt_mask.rs b/src/eth0/mmc_transmit_interrupt_mask.rs index 20c4c6e6..797aa32a 100644 --- a/src/eth0/mmc_transmit_interrupt_mask.rs +++ b/src/eth0/mmc_transmit_interrupt_mask.rs @@ -1,143 +1,111 @@ #[doc = "Register `MMC_TRANSMIT_INTERRUPT_MASK` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `MMC_TRANSMIT_INTERRUPT_MASK` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TXGBOCTIM` reader - MMC Transmit Good Bad Octet Counter Interrupt Mask"] -pub type TXGBOCTIM_R = crate::BitReader; +pub type TXGBOCTIM_R = crate::BitReader; #[doc = "Field `TXGBOCTIM` writer - MMC Transmit Good Bad Octet Counter Interrupt Mask"] -pub type TXGBOCTIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXGBOCTIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXGBFRMIM` reader - MMC Transmit Good Bad Frame Counter Interrupt Mask"] -pub type TXGBFRMIM_R = crate::BitReader; +pub type TXGBFRMIM_R = crate::BitReader; #[doc = "Field `TXGBFRMIM` writer - MMC Transmit Good Bad Frame Counter Interrupt Mask"] -pub type TXGBFRMIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXGBFRMIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXBCGFIM` reader - MMC Transmit Broadcast Good Frame Counter Interrupt Mask"] -pub type TXBCGFIM_R = crate::BitReader; +pub type TXBCGFIM_R = crate::BitReader; #[doc = "Field `TXBCGFIM` writer - MMC Transmit Broadcast Good Frame Counter Interrupt Mask"] -pub type TXBCGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXBCGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXMCGFIM` reader - MMC Transmit Multicast Good Frame Counter Interrupt Mask"] -pub type TXMCGFIM_R = crate::BitReader; +pub type TXMCGFIM_R = crate::BitReader; #[doc = "Field `TXMCGFIM` writer - MMC Transmit Multicast Good Frame Counter Interrupt Mask"] -pub type TXMCGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXMCGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TX64OCTGBFIM` reader - MMC Transmit 64 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX64OCTGBFIM_R = crate::BitReader; +pub type TX64OCTGBFIM_R = crate::BitReader; #[doc = "Field `TX64OCTGBFIM` writer - MMC Transmit 64 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX64OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TX64OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TX65T127OCTGBFIM` reader - MMC Transmit 65 to 127 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX65T127OCTGBFIM_R = crate::BitReader; +pub type TX65T127OCTGBFIM_R = crate::BitReader; #[doc = "Field `TX65T127OCTGBFIM` writer - MMC Transmit 65 to 127 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX65T127OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TX65T127OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TX128T255OCTGBFIM` reader - MMC Transmit 128 to 255 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX128T255OCTGBFIM_R = crate::BitReader; +pub type TX128T255OCTGBFIM_R = crate::BitReader; #[doc = "Field `TX128T255OCTGBFIM` writer - MMC Transmit 128 to 255 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX128T255OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TX128T255OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TX256T511OCTGBFIM` reader - MMC Transmit 256 to 511 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX256T511OCTGBFIM_R = crate::BitReader; +pub type TX256T511OCTGBFIM_R = crate::BitReader; #[doc = "Field `TX256T511OCTGBFIM` writer - MMC Transmit 256 to 511 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX256T511OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TX256T511OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TX512T1023OCTGBFIM` reader - MMC Transmit 512 to 1023 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX512T1023OCTGBFIM_R = crate::BitReader; +pub type TX512T1023OCTGBFIM_R = crate::BitReader; #[doc = "Field `TX512T1023OCTGBFIM` writer - MMC Transmit 512 to 1023 Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX512T1023OCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TX512T1023OCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TX1024TMAXOCTGBFIM` reader - MMC Transmit 1024 to Maximum Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX1024TMAXOCTGBFIM_R = crate::BitReader; +pub type TX1024TMAXOCTGBFIM_R = crate::BitReader; #[doc = "Field `TX1024TMAXOCTGBFIM` writer - MMC Transmit 1024 to Maximum Octet Good Bad Frame Counter Interrupt Mask"] -pub type TX1024TMAXOCTGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TX1024TMAXOCTGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXUCGBFIM` reader - MMC Transmit Unicast Good Bad Frame Counter Interrupt Mask"] -pub type TXUCGBFIM_R = crate::BitReader; +pub type TXUCGBFIM_R = crate::BitReader; #[doc = "Field `TXUCGBFIM` writer - MMC Transmit Unicast Good Bad Frame Counter Interrupt Mask"] -pub type TXUCGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXUCGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXMCGBFIM` reader - MMC Transmit Multicast Good Bad Frame Counter Interrupt Mask"] -pub type TXMCGBFIM_R = crate::BitReader; +pub type TXMCGBFIM_R = crate::BitReader; #[doc = "Field `TXMCGBFIM` writer - MMC Transmit Multicast Good Bad Frame Counter Interrupt Mask"] -pub type TXMCGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXMCGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXBCGBFIM` reader - MMC Transmit Broadcast Good Bad Frame Counter Interrupt Mask"] -pub type TXBCGBFIM_R = crate::BitReader; +pub type TXBCGBFIM_R = crate::BitReader; #[doc = "Field `TXBCGBFIM` writer - MMC Transmit Broadcast Good Bad Frame Counter Interrupt Mask"] -pub type TXBCGBFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXBCGBFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXUFLOWERFIM` reader - MMC Transmit Underflow Error Frame Counter Interrupt Mask"] -pub type TXUFLOWERFIM_R = crate::BitReader; +pub type TXUFLOWERFIM_R = crate::BitReader; #[doc = "Field `TXUFLOWERFIM` writer - MMC Transmit Underflow Error Frame Counter Interrupt Mask"] -pub type TXUFLOWERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXUFLOWERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXSCOLGFIM` reader - MMC Transmit Single Collision Good Frame Counter Interrupt Mask"] -pub type TXSCOLGFIM_R = crate::BitReader; +pub type TXSCOLGFIM_R = crate::BitReader; #[doc = "Field `TXSCOLGFIM` writer - MMC Transmit Single Collision Good Frame Counter Interrupt Mask"] -pub type TXSCOLGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXSCOLGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXMCOLGFIM` reader - MMC Transmit Multiple Collision Good Frame Counter Interrupt Mask"] -pub type TXMCOLGFIM_R = crate::BitReader; +pub type TXMCOLGFIM_R = crate::BitReader; #[doc = "Field `TXMCOLGFIM` writer - MMC Transmit Multiple Collision Good Frame Counter Interrupt Mask"] -pub type TXMCOLGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXMCOLGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXDEFFIM` reader - MMC Transmit Deferred Frame Counter Interrupt Mask"] -pub type TXDEFFIM_R = crate::BitReader; +pub type TXDEFFIM_R = crate::BitReader; #[doc = "Field `TXDEFFIM` writer - MMC Transmit Deferred Frame Counter Interrupt Mask"] -pub type TXDEFFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXDEFFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXLATCOLFIM` reader - MMC Transmit Late Collision Frame Counter Interrupt Mask"] -pub type TXLATCOLFIM_R = crate::BitReader; +pub type TXLATCOLFIM_R = crate::BitReader; #[doc = "Field `TXLATCOLFIM` writer - MMC Transmit Late Collision Frame Counter Interrupt Mask"] -pub type TXLATCOLFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXLATCOLFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXEXCOLFIM` reader - MMC Transmit Excessive Collision Frame Counter Interrupt Mask"] -pub type TXEXCOLFIM_R = crate::BitReader; +pub type TXEXCOLFIM_R = crate::BitReader; #[doc = "Field `TXEXCOLFIM` writer - MMC Transmit Excessive Collision Frame Counter Interrupt Mask"] -pub type TXEXCOLFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXEXCOLFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXCARERFIM` reader - MMC Transmit Carrier Error Frame Counter Interrupt Mask"] -pub type TXCARERFIM_R = crate::BitReader; +pub type TXCARERFIM_R = crate::BitReader; #[doc = "Field `TXCARERFIM` writer - MMC Transmit Carrier Error Frame Counter Interrupt Mask"] -pub type TXCARERFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXCARERFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXGOCTIM` reader - MMC Transmit Good Octet Counter Interrupt Mask"] -pub type TXGOCTIM_R = crate::BitReader; +pub type TXGOCTIM_R = crate::BitReader; #[doc = "Field `TXGOCTIM` writer - MMC Transmit Good Octet Counter Interrupt Mask"] -pub type TXGOCTIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXGOCTIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXGFRMIM` reader - MMC Transmit Good Frame Counter Interrupt Mask"] -pub type TXGFRMIM_R = crate::BitReader; +pub type TXGFRMIM_R = crate::BitReader; #[doc = "Field `TXGFRMIM` writer - MMC Transmit Good Frame Counter Interrupt Mask"] -pub type TXGFRMIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXGFRMIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXEXDEFFIM` reader - MMC Transmit Excessive Deferral Frame Counter Interrupt Mask"] -pub type TXEXDEFFIM_R = crate::BitReader; +pub type TXEXDEFFIM_R = crate::BitReader; #[doc = "Field `TXEXDEFFIM` writer - MMC Transmit Excessive Deferral Frame Counter Interrupt Mask"] -pub type TXEXDEFFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXEXDEFFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXPAUSFIM` reader - MMC Transmit Pause Frame Counter Interrupt Mask"] -pub type TXPAUSFIM_R = crate::BitReader; +pub type TXPAUSFIM_R = crate::BitReader; #[doc = "Field `TXPAUSFIM` writer - MMC Transmit Pause Frame Counter Interrupt Mask"] -pub type TXPAUSFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXPAUSFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXVLANGFIM` reader - MMC Transmit VLAN Good Frame Counter Interrupt Mask"] -pub type TXVLANGFIM_R = crate::BitReader; +pub type TXVLANGFIM_R = crate::BitReader; #[doc = "Field `TXVLANGFIM` writer - MMC Transmit VLAN Good Frame Counter Interrupt Mask"] -pub type TXVLANGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXVLANGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TXOSIZEGFIM` reader - MMC Transmit Oversize Good Frame Counter Interrupt Mask"] -pub type TXOSIZEGFIM_R = crate::BitReader; +pub type TXOSIZEGFIM_R = crate::BitReader; #[doc = "Field `TXOSIZEGFIM` writer - MMC Transmit Oversize Good Frame Counter Interrupt Mask"] -pub type TXOSIZEGFIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, MMC_TRANSMIT_INTERRUPT_MASK_SPEC, bool, O>; +pub type TXOSIZEGFIM_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - MMC Transmit Good Bad Octet Counter Interrupt Mask"] #[inline(always)] @@ -274,178 +242,179 @@ impl W { #[doc = "Bit 0 - MMC Transmit Good Bad Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txgboctim(&mut self) -> TXGBOCTIM_W<0> { - TXGBOCTIM_W::new(self) + pub fn txgboctim(&mut self) -> TXGBOCTIM_W { + TXGBOCTIM_W::new(self, 0) } #[doc = "Bit 1 - MMC Transmit Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txgbfrmim(&mut self) -> TXGBFRMIM_W<1> { - TXGBFRMIM_W::new(self) + pub fn txgbfrmim(&mut self) -> TXGBFRMIM_W { + TXGBFRMIM_W::new(self, 1) } #[doc = "Bit 2 - MMC Transmit Broadcast Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txbcgfim(&mut self) -> TXBCGFIM_W<2> { - TXBCGFIM_W::new(self) + pub fn txbcgfim(&mut self) -> TXBCGFIM_W { + TXBCGFIM_W::new(self, 2) } #[doc = "Bit 3 - MMC Transmit Multicast Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txmcgfim(&mut self) -> TXMCGFIM_W<3> { - TXMCGFIM_W::new(self) + pub fn txmcgfim(&mut self) -> TXMCGFIM_W { + TXMCGFIM_W::new(self, 3) } #[doc = "Bit 4 - MMC Transmit 64 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn tx64octgbfim(&mut self) -> TX64OCTGBFIM_W<4> { - TX64OCTGBFIM_W::new(self) + pub fn tx64octgbfim(&mut self) -> TX64OCTGBFIM_W { + TX64OCTGBFIM_W::new(self, 4) } #[doc = "Bit 5 - MMC Transmit 65 to 127 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn tx65t127octgbfim(&mut self) -> TX65T127OCTGBFIM_W<5> { - TX65T127OCTGBFIM_W::new(self) + pub fn tx65t127octgbfim(&mut self) -> TX65T127OCTGBFIM_W { + TX65T127OCTGBFIM_W::new(self, 5) } #[doc = "Bit 6 - MMC Transmit 128 to 255 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn tx128t255octgbfim(&mut self) -> TX128T255OCTGBFIM_W<6> { - TX128T255OCTGBFIM_W::new(self) + pub fn tx128t255octgbfim(&mut self) -> TX128T255OCTGBFIM_W { + TX128T255OCTGBFIM_W::new(self, 6) } #[doc = "Bit 7 - MMC Transmit 256 to 511 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn tx256t511octgbfim(&mut self) -> TX256T511OCTGBFIM_W<7> { - TX256T511OCTGBFIM_W::new(self) + pub fn tx256t511octgbfim(&mut self) -> TX256T511OCTGBFIM_W { + TX256T511OCTGBFIM_W::new(self, 7) } #[doc = "Bit 8 - MMC Transmit 512 to 1023 Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn tx512t1023octgbfim(&mut self) -> TX512T1023OCTGBFIM_W<8> { - TX512T1023OCTGBFIM_W::new(self) + pub fn tx512t1023octgbfim(&mut self) -> TX512T1023OCTGBFIM_W { + TX512T1023OCTGBFIM_W::new(self, 8) } #[doc = "Bit 9 - MMC Transmit 1024 to Maximum Octet Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn tx1024tmaxoctgbfim(&mut self) -> TX1024TMAXOCTGBFIM_W<9> { - TX1024TMAXOCTGBFIM_W::new(self) + pub fn tx1024tmaxoctgbfim(&mut self) -> TX1024TMAXOCTGBFIM_W { + TX1024TMAXOCTGBFIM_W::new(self, 9) } #[doc = "Bit 10 - MMC Transmit Unicast Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txucgbfim(&mut self) -> TXUCGBFIM_W<10> { - TXUCGBFIM_W::new(self) + pub fn txucgbfim(&mut self) -> TXUCGBFIM_W { + TXUCGBFIM_W::new(self, 10) } #[doc = "Bit 11 - MMC Transmit Multicast Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txmcgbfim(&mut self) -> TXMCGBFIM_W<11> { - TXMCGBFIM_W::new(self) + pub fn txmcgbfim(&mut self) -> TXMCGBFIM_W { + TXMCGBFIM_W::new(self, 11) } #[doc = "Bit 12 - MMC Transmit Broadcast Good Bad Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txbcgbfim(&mut self) -> TXBCGBFIM_W<12> { - TXBCGBFIM_W::new(self) + pub fn txbcgbfim(&mut self) -> TXBCGBFIM_W { + TXBCGBFIM_W::new(self, 12) } #[doc = "Bit 13 - MMC Transmit Underflow Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txuflowerfim(&mut self) -> TXUFLOWERFIM_W<13> { - TXUFLOWERFIM_W::new(self) + pub fn txuflowerfim(&mut self) -> TXUFLOWERFIM_W { + TXUFLOWERFIM_W::new(self, 13) } #[doc = "Bit 14 - MMC Transmit Single Collision Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txscolgfim(&mut self) -> TXSCOLGFIM_W<14> { - TXSCOLGFIM_W::new(self) + pub fn txscolgfim(&mut self) -> TXSCOLGFIM_W { + TXSCOLGFIM_W::new(self, 14) } #[doc = "Bit 15 - MMC Transmit Multiple Collision Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txmcolgfim(&mut self) -> TXMCOLGFIM_W<15> { - TXMCOLGFIM_W::new(self) + pub fn txmcolgfim(&mut self) -> TXMCOLGFIM_W { + TXMCOLGFIM_W::new(self, 15) } #[doc = "Bit 16 - MMC Transmit Deferred Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txdeffim(&mut self) -> TXDEFFIM_W<16> { - TXDEFFIM_W::new(self) + pub fn txdeffim(&mut self) -> TXDEFFIM_W { + TXDEFFIM_W::new(self, 16) } #[doc = "Bit 17 - MMC Transmit Late Collision Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txlatcolfim(&mut self) -> TXLATCOLFIM_W<17> { - TXLATCOLFIM_W::new(self) + pub fn txlatcolfim(&mut self) -> TXLATCOLFIM_W { + TXLATCOLFIM_W::new(self, 17) } #[doc = "Bit 18 - MMC Transmit Excessive Collision Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txexcolfim(&mut self) -> TXEXCOLFIM_W<18> { - TXEXCOLFIM_W::new(self) + pub fn txexcolfim(&mut self) -> TXEXCOLFIM_W { + TXEXCOLFIM_W::new(self, 18) } #[doc = "Bit 19 - MMC Transmit Carrier Error Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txcarerfim(&mut self) -> TXCARERFIM_W<19> { - TXCARERFIM_W::new(self) + pub fn txcarerfim(&mut self) -> TXCARERFIM_W { + TXCARERFIM_W::new(self, 19) } #[doc = "Bit 20 - MMC Transmit Good Octet Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txgoctim(&mut self) -> TXGOCTIM_W<20> { - TXGOCTIM_W::new(self) + pub fn txgoctim(&mut self) -> TXGOCTIM_W { + TXGOCTIM_W::new(self, 20) } #[doc = "Bit 21 - MMC Transmit Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txgfrmim(&mut self) -> TXGFRMIM_W<21> { - TXGFRMIM_W::new(self) + pub fn txgfrmim(&mut self) -> TXGFRMIM_W { + TXGFRMIM_W::new(self, 21) } #[doc = "Bit 22 - MMC Transmit Excessive Deferral Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txexdeffim(&mut self) -> TXEXDEFFIM_W<22> { - TXEXDEFFIM_W::new(self) + pub fn txexdeffim(&mut self) -> TXEXDEFFIM_W { + TXEXDEFFIM_W::new(self, 22) } #[doc = "Bit 23 - MMC Transmit Pause Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txpausfim(&mut self) -> TXPAUSFIM_W<23> { - TXPAUSFIM_W::new(self) + pub fn txpausfim(&mut self) -> TXPAUSFIM_W { + TXPAUSFIM_W::new(self, 23) } #[doc = "Bit 24 - MMC Transmit VLAN Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txvlangfim(&mut self) -> TXVLANGFIM_W<24> { - TXVLANGFIM_W::new(self) + pub fn txvlangfim(&mut self) -> TXVLANGFIM_W { + TXVLANGFIM_W::new(self, 24) } #[doc = "Bit 25 - MMC Transmit Oversize Good Frame Counter Interrupt Mask"] #[inline(always)] #[must_use] - pub fn txosizegfim(&mut self) -> TXOSIZEGFIM_W<25> { - TXOSIZEGFIM_W::new(self) + pub fn txosizegfim(&mut self) -> TXOSIZEGFIM_W { + TXOSIZEGFIM_W::new(self, 25) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "MMC Transmit 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 [mmc_transmit_interrupt_mask](index.html) module"] +#[doc = "MMC Transmit Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmc_transmit_interrupt_mask::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmc_transmit_interrupt_mask::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MMC_TRANSMIT_INTERRUPT_MASK_SPEC; impl crate::RegisterSpec for MMC_TRANSMIT_INTERRUPT_MASK_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [mmc_transmit_interrupt_mask::R](R) reader structure"] -impl crate::Readable for MMC_TRANSMIT_INTERRUPT_MASK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [mmc_transmit_interrupt_mask::W](W) writer structure"] +#[doc = "`read()` method returns [`mmc_transmit_interrupt_mask::R`](R) reader structure"] +impl crate::Readable for MMC_TRANSMIT_INTERRUPT_MASK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mmc_transmit_interrupt_mask::W`](W) writer structure"] impl crate::Writable for MMC_TRANSMIT_INTERRUPT_MASK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/operation_mode.rs b/src/eth0/operation_mode.rs index 5b67cd6a..23556ca1 100644 --- a/src/eth0/operation_mode.rs +++ b/src/eth0/operation_mode.rs @@ -1,87 +1,55 @@ #[doc = "Register `OPERATION_MODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `OPERATION_MODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SR` reader - Start or Stop Receive"] -pub type SR_R = crate::BitReader; +pub type SR_R = crate::BitReader; #[doc = "Field `SR` writer - Start or Stop Receive"] -pub type SR_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type SR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OSF` reader - Operate on Second Frame"] -pub type OSF_R = crate::BitReader; +pub type OSF_R = crate::BitReader; #[doc = "Field `OSF` writer - Operate on Second Frame"] -pub type OSF_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type OSF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RTC` reader - Receive Threshold Control"] -pub type RTC_R = crate::FieldReader; +pub type RTC_R = crate::FieldReader; #[doc = "Field `RTC` writer - Receive Threshold Control"] -pub type RTC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OPERATION_MODE_SPEC, u8, u8, 2, O>; +pub type RTC_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `FUF` reader - Forward Undersized Good Frames"] -pub type FUF_R = crate::BitReader; +pub type FUF_R = crate::BitReader; #[doc = "Field `FUF` writer - Forward Undersized Good Frames"] -pub type FUF_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type FUF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FEF` reader - Forward Error Frames"] -pub type FEF_R = crate::BitReader; +pub type FEF_R = crate::BitReader; #[doc = "Field `FEF` writer - Forward Error Frames"] -pub type FEF_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type FEF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST` reader - Start or Stop Transmission Command"] -pub type ST_R = crate::BitReader; +pub type ST_R = crate::BitReader; #[doc = "Field `ST` writer - Start or Stop Transmission Command"] -pub type ST_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type ST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TTC` reader - Transmit Threshold Control"] -pub type TTC_R = crate::FieldReader; +pub type TTC_R = crate::FieldReader; #[doc = "Field `TTC` writer - Transmit Threshold Control"] -pub type TTC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OPERATION_MODE_SPEC, u8, u8, 3, O>; +pub type TTC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `FTF` reader - Flush Transmit FIFO"] -pub type FTF_R = crate::BitReader; +pub type FTF_R = crate::BitReader; #[doc = "Field `FTF` writer - Flush Transmit FIFO"] -pub type FTF_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type FTF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSF` reader - Transmit Store and Forward"] -pub type TSF_R = crate::BitReader; +pub type TSF_R = crate::BitReader; #[doc = "Field `TSF` writer - Transmit Store and Forward"] -pub type TSF_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type TSF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DFF` reader - Disable Flushing of Received Frames"] -pub type DFF_R = crate::BitReader; +pub type DFF_R = crate::BitReader; #[doc = "Field `DFF` writer - Disable Flushing of Received Frames"] -pub type DFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type DFF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RSF` reader - Receive Store and Forward"] -pub type RSF_R = crate::BitReader; +pub type RSF_R = crate::BitReader; #[doc = "Field `RSF` writer - Receive Store and Forward"] -pub type RSF_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type RSF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DT` reader - Disable Dropping of TCP/IP Checksum Error Frames"] -pub type DT_R = crate::BitReader; +pub type DT_R = crate::BitReader; #[doc = "Field `DT` writer - Disable Dropping of TCP/IP Checksum Error Frames"] -pub type DT_W<'a, const O: u8> = crate::BitWriter<'a, u32, OPERATION_MODE_SPEC, bool, O>; +pub type DT_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 1 - Start or Stop Receive"] #[inline(always)] @@ -148,94 +116,95 @@ impl W { #[doc = "Bit 1 - Start or Stop Receive"] #[inline(always)] #[must_use] - pub fn sr(&mut self) -> SR_W<1> { - SR_W::new(self) + pub fn sr(&mut self) -> SR_W { + SR_W::new(self, 1) } #[doc = "Bit 2 - Operate on Second Frame"] #[inline(always)] #[must_use] - pub fn osf(&mut self) -> OSF_W<2> { - OSF_W::new(self) + pub fn osf(&mut self) -> OSF_W { + OSF_W::new(self, 2) } #[doc = "Bits 3:4 - Receive Threshold Control"] #[inline(always)] #[must_use] - pub fn rtc(&mut self) -> RTC_W<3> { - RTC_W::new(self) + pub fn rtc(&mut self) -> RTC_W { + RTC_W::new(self, 3) } #[doc = "Bit 6 - Forward Undersized Good Frames"] #[inline(always)] #[must_use] - pub fn fuf(&mut self) -> FUF_W<6> { - FUF_W::new(self) + pub fn fuf(&mut self) -> FUF_W { + FUF_W::new(self, 6) } #[doc = "Bit 7 - Forward Error Frames"] #[inline(always)] #[must_use] - pub fn fef(&mut self) -> FEF_W<7> { - FEF_W::new(self) + pub fn fef(&mut self) -> FEF_W { + FEF_W::new(self, 7) } #[doc = "Bit 13 - Start or Stop Transmission Command"] #[inline(always)] #[must_use] - pub fn st(&mut self) -> ST_W<13> { - ST_W::new(self) + pub fn st(&mut self) -> ST_W { + ST_W::new(self, 13) } #[doc = "Bits 14:16 - Transmit Threshold Control"] #[inline(always)] #[must_use] - pub fn ttc(&mut self) -> TTC_W<14> { - TTC_W::new(self) + pub fn ttc(&mut self) -> TTC_W { + TTC_W::new(self, 14) } #[doc = "Bit 20 - Flush Transmit FIFO"] #[inline(always)] #[must_use] - pub fn ftf(&mut self) -> FTF_W<20> { - FTF_W::new(self) + pub fn ftf(&mut self) -> FTF_W { + FTF_W::new(self, 20) } #[doc = "Bit 21 - Transmit Store and Forward"] #[inline(always)] #[must_use] - pub fn tsf(&mut self) -> TSF_W<21> { - TSF_W::new(self) + pub fn tsf(&mut self) -> TSF_W { + TSF_W::new(self, 21) } #[doc = "Bit 24 - Disable Flushing of Received Frames"] #[inline(always)] #[must_use] - pub fn dff(&mut self) -> DFF_W<24> { - DFF_W::new(self) + pub fn dff(&mut self) -> DFF_W { + DFF_W::new(self, 24) } #[doc = "Bit 25 - Receive Store and Forward"] #[inline(always)] #[must_use] - pub fn rsf(&mut self) -> RSF_W<25> { - RSF_W::new(self) + pub fn rsf(&mut self) -> RSF_W { + RSF_W::new(self, 25) } #[doc = "Bit 26 - Disable Dropping of TCP/IP Checksum Error Frames"] #[inline(always)] #[must_use] - pub fn dt(&mut self) -> DT_W<26> { - DT_W::new(self) + pub fn dt(&mut self) -> DT_W { + DT_W::new(self, 26) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Operation 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 [operation_mode](index.html) module"] +#[doc = "Operation Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`operation_mode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`operation_mode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OPERATION_MODE_SPEC; impl crate::RegisterSpec for OPERATION_MODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [operation_mode::R](R) reader structure"] -impl crate::Readable for OPERATION_MODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [operation_mode::W](W) writer structure"] +#[doc = "`read()` method returns [`operation_mode::R`](R) reader structure"] +impl crate::Readable for OPERATION_MODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`operation_mode::W`](W) writer structure"] impl crate::Writable for OPERATION_MODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/pmt_control_status.rs b/src/eth0/pmt_control_status.rs index 442e538f..30aa10d1 100644 --- a/src/eth0/pmt_control_status.rs +++ b/src/eth0/pmt_control_status.rs @@ -1,63 +1,31 @@ #[doc = "Register `PMT_CONTROL_STATUS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `PMT_CONTROL_STATUS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PWRDWN` reader - Power Down"] -pub type PWRDWN_R = crate::BitReader; +pub type PWRDWN_R = crate::BitReader; #[doc = "Field `PWRDWN` writer - Power Down"] -pub type PWRDWN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMT_CONTROL_STATUS_SPEC, bool, O>; +pub type PWRDWN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MGKPKTEN` reader - Magic Packet Enable"] -pub type MGKPKTEN_R = crate::BitReader; +pub type MGKPKTEN_R = crate::BitReader; #[doc = "Field `MGKPKTEN` writer - Magic Packet Enable"] -pub type MGKPKTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMT_CONTROL_STATUS_SPEC, bool, O>; +pub type MGKPKTEN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RWKPKTEN` reader - Wake-Up Frame Enable"] -pub type RWKPKTEN_R = crate::BitReader; +pub type RWKPKTEN_R = crate::BitReader; #[doc = "Field `RWKPKTEN` writer - Wake-Up Frame Enable"] -pub type RWKPKTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMT_CONTROL_STATUS_SPEC, bool, O>; +pub type RWKPKTEN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MGKPRCVD` reader - Magic Packet Received"] -pub type MGKPRCVD_R = crate::BitReader; +pub type MGKPRCVD_R = crate::BitReader; #[doc = "Field `RWKPRCVD` reader - Wake-Up Frame Received"] -pub type RWKPRCVD_R = crate::BitReader; +pub type RWKPRCVD_R = crate::BitReader; #[doc = "Field `GLBLUCAST` reader - Global Unicast"] -pub type GLBLUCAST_R = crate::BitReader; +pub type GLBLUCAST_R = crate::BitReader; #[doc = "Field `GLBLUCAST` writer - Global Unicast"] -pub type GLBLUCAST_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMT_CONTROL_STATUS_SPEC, bool, O>; +pub type GLBLUCAST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RWKFILTRST` reader - Wake-Up Frame Filter Register Pointer Reset"] -pub type RWKFILTRST_R = crate::BitReader; +pub type RWKFILTRST_R = crate::BitReader; #[doc = "Field `RWKFILTRST` writer - Wake-Up Frame Filter Register Pointer Reset"] -pub type RWKFILTRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMT_CONTROL_STATUS_SPEC, bool, O>; +pub type RWKFILTRST_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Power Down"] #[inline(always)] @@ -99,52 +67,53 @@ impl W { #[doc = "Bit 0 - Power Down"] #[inline(always)] #[must_use] - pub fn pwrdwn(&mut self) -> PWRDWN_W<0> { - PWRDWN_W::new(self) + pub fn pwrdwn(&mut self) -> PWRDWN_W { + PWRDWN_W::new(self, 0) } #[doc = "Bit 1 - Magic Packet Enable"] #[inline(always)] #[must_use] - pub fn mgkpkten(&mut self) -> MGKPKTEN_W<1> { - MGKPKTEN_W::new(self) + pub fn mgkpkten(&mut self) -> MGKPKTEN_W { + MGKPKTEN_W::new(self, 1) } #[doc = "Bit 2 - Wake-Up Frame Enable"] #[inline(always)] #[must_use] - pub fn rwkpkten(&mut self) -> RWKPKTEN_W<2> { - RWKPKTEN_W::new(self) + pub fn rwkpkten(&mut self) -> RWKPKTEN_W { + RWKPKTEN_W::new(self, 2) } #[doc = "Bit 9 - Global Unicast"] #[inline(always)] #[must_use] - pub fn glblucast(&mut self) -> GLBLUCAST_W<9> { - GLBLUCAST_W::new(self) + pub fn glblucast(&mut self) -> GLBLUCAST_W { + GLBLUCAST_W::new(self, 9) } #[doc = "Bit 31 - Wake-Up Frame Filter Register Pointer Reset"] #[inline(always)] #[must_use] - pub fn rwkfiltrst(&mut self) -> RWKFILTRST_W<31> { - RWKFILTRST_W::new(self) + pub fn rwkfiltrst(&mut self) -> RWKFILTRST_W { + RWKFILTRST_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "PMT 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 [pmt_control_status](index.html) module"] +#[doc = "PMT Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pmt_control_status::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pmt_control_status::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PMT_CONTROL_STATUS_SPEC; impl crate::RegisterSpec for PMT_CONTROL_STATUS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [pmt_control_status::R](R) reader structure"] -impl crate::Readable for PMT_CONTROL_STATUS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pmt_control_status::W](W) writer structure"] +#[doc = "`read()` method returns [`pmt_control_status::R`](R) reader structure"] +impl crate::Readable for PMT_CONTROL_STATUS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pmt_control_status::W`](W) writer structure"] impl crate::Writable for PMT_CONTROL_STATUS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/pps_control.rs b/src/eth0/pps_control.rs index bfff6b97..484313b7 100644 --- a/src/eth0/pps_control.rs +++ b/src/eth0/pps_control.rs @@ -1,59 +1,27 @@ #[doc = "Register `PPS_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) - } -} +pub type R = crate::R; #[doc = "Register `PPS_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) - } -} +pub type W = crate::W; #[doc = "Field `PPSCTRL_PPSCMD` reader - PPSCTRL0 or PPSCMD0"] -pub type PPSCTRL_PPSCMD_R = crate::FieldReader; +pub type PPSCTRL_PPSCMD_R = crate::FieldReader; #[doc = "Field `PPSCTRL_PPSCMD` writer - PPSCTRL0 or PPSCMD0"] -pub type PPSCTRL_PPSCMD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PPS_CONTROL_SPEC, u8, u8, 4, O>; +pub type PPSCTRL_PPSCMD_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `PPSEN0` reader - Flexible PPS Output Mode Enable"] -pub type PPSEN0_R = crate::BitReader; +pub type PPSEN0_R = crate::BitReader; #[doc = "Field `TRGTMODSEL0` reader - Target Time Register Mode for PPS0 Output"] -pub type TRGTMODSEL0_R = crate::FieldReader; +pub type TRGTMODSEL0_R = crate::FieldReader; #[doc = "Field `PPSCMD1` reader - Flexible PPS1 Output Control"] -pub type PPSCMD1_R = crate::FieldReader; +pub type PPSCMD1_R = crate::FieldReader; #[doc = "Field `TRGTMODSEL1` reader - Target Time Register Mode for PPS1 Output"] -pub type TRGTMODSEL1_R = crate::FieldReader; +pub type TRGTMODSEL1_R = crate::FieldReader; #[doc = "Field `PPSCMD2` reader - Flexible PPS2 Output Control"] -pub type PPSCMD2_R = crate::FieldReader; +pub type PPSCMD2_R = crate::FieldReader; #[doc = "Field `TRGTMODSEL2` reader - Target Time Register Mode for PPS2 Output"] -pub type TRGTMODSEL2_R = crate::FieldReader; +pub type TRGTMODSEL2_R = crate::FieldReader; #[doc = "Field `PPSCMD3` reader - Flexible PPS3 Output Control"] -pub type PPSCMD3_R = crate::FieldReader; +pub type PPSCMD3_R = crate::FieldReader; #[doc = "Field `TRGTMODSEL3` reader - Target Time Register Mode for PPS3 Output"] -pub type TRGTMODSEL3_R = crate::FieldReader; +pub type TRGTMODSEL3_R = crate::FieldReader; impl R { #[doc = "Bits 0:3 - PPSCTRL0 or PPSCMD0"] #[inline(always)] @@ -105,28 +73,29 @@ impl W { #[doc = "Bits 0:3 - PPSCTRL0 or PPSCMD0"] #[inline(always)] #[must_use] - pub fn ppsctrl_ppscmd(&mut self) -> PPSCTRL_PPSCMD_W<0> { - PPSCTRL_PPSCMD_W::new(self) + pub fn ppsctrl_ppscmd(&mut self) -> PPSCTRL_PPSCMD_W { + PPSCTRL_PPSCMD_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "PPS 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 [pps_control](index.html) module"] +#[doc = "PPS Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps_control::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps_control::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PPS_CONTROL_SPEC; impl crate::RegisterSpec for PPS_CONTROL_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [pps_control::R](R) reader structure"] -impl crate::Readable for PPS_CONTROL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [pps_control::W](W) writer structure"] +#[doc = "`read()` method returns [`pps_control::R`](R) reader structure"] +impl crate::Readable for PPS_CONTROL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps_control::W`](W) writer structure"] impl crate::Writable for PPS_CONTROL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/receive_descriptor_list_address.rs b/src/eth0/receive_descriptor_list_address.rs index a4d504cb..3aed7f6e 100644 --- a/src/eth0/receive_descriptor_list_address.rs +++ b/src/eth0/receive_descriptor_list_address.rs @@ -1,43 +1,11 @@ #[doc = "Register `RECEIVE_DESCRIPTOR_LIST_ADDRESS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `RECEIVE_DESCRIPTOR_LIST_ADDRESS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RDESLA_32bit` reader - Start of Receive List"] -pub type RDESLA_32BIT_R = crate::FieldReader; +pub type RDESLA_32BIT_R = crate::FieldReader; #[doc = "Field `RDESLA_32bit` writer - Start of Receive List"] -pub type RDESLA_32BIT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RECEIVE_DESCRIPTOR_LIST_ADDRESS_SPEC, u32, u32, 30, O>; +pub type RDESLA_32BIT_W<'a, REG> = crate::FieldWriter<'a, REG, 30, u32>; impl R { #[doc = "Bits 2:31 - Start of Receive List"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 2:31 - Start of Receive List"] #[inline(always)] #[must_use] - pub fn rdesla_32bit(&mut self) -> RDESLA_32BIT_W<2> { - RDESLA_32BIT_W::new(self) + pub fn rdesla_32bit(&mut self) -> RDESLA_32BIT_W { + RDESLA_32BIT_W::new(self, 2) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Receive Descriptor 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 [receive_descriptor_list_address](index.html) module"] +#[doc = "Receive Descriptor Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`receive_descriptor_list_address::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`receive_descriptor_list_address::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RECEIVE_DESCRIPTOR_LIST_ADDRESS_SPEC; impl crate::RegisterSpec for RECEIVE_DESCRIPTOR_LIST_ADDRESS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [receive_descriptor_list_address::R](R) reader structure"] -impl crate::Readable for RECEIVE_DESCRIPTOR_LIST_ADDRESS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [receive_descriptor_list_address::W](W) writer structure"] +#[doc = "`read()` method returns [`receive_descriptor_list_address::R`](R) reader structure"] +impl crate::Readable for RECEIVE_DESCRIPTOR_LIST_ADDRESS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`receive_descriptor_list_address::W`](W) writer structure"] impl crate::Writable for RECEIVE_DESCRIPTOR_LIST_ADDRESS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/receive_interrupt_watchdog_timer.rs b/src/eth0/receive_interrupt_watchdog_timer.rs index 0b862ecb..f67a4f0e 100644 --- a/src/eth0/receive_interrupt_watchdog_timer.rs +++ b/src/eth0/receive_interrupt_watchdog_timer.rs @@ -1,43 +1,11 @@ #[doc = "Register `RECEIVE_INTERRUPT_WATCHDOG_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) - } -} +pub type R = crate::R; #[doc = "Register `RECEIVE_INTERRUPT_WATCHDOG_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) - } -} +pub type W = crate::W; #[doc = "Field `RIWT` reader - RI Watchdog Timer Count"] -pub type RIWT_R = crate::FieldReader; +pub type RIWT_R = crate::FieldReader; #[doc = "Field `RIWT` writer - RI Watchdog Timer Count"] -pub type RIWT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RECEIVE_INTERRUPT_WATCHDOG_TIMER_SPEC, u8, u8, 8, O>; +pub type RIWT_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - RI Watchdog Timer Count"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:7 - RI Watchdog Timer Count"] #[inline(always)] #[must_use] - pub fn riwt(&mut self) -> RIWT_W<0> { - RIWT_W::new(self) + pub fn riwt(&mut self) -> RIWT_W { + RIWT_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Receive Interrupt Watchdog 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 [receive_interrupt_watchdog_timer](index.html) module"] +#[doc = "Receive Interrupt Watchdog Timer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`receive_interrupt_watchdog_timer::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`receive_interrupt_watchdog_timer::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RECEIVE_INTERRUPT_WATCHDOG_TIMER_SPEC; impl crate::RegisterSpec for RECEIVE_INTERRUPT_WATCHDOG_TIMER_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [receive_interrupt_watchdog_timer::R](R) reader structure"] -impl crate::Readable for RECEIVE_INTERRUPT_WATCHDOG_TIMER_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [receive_interrupt_watchdog_timer::W](W) writer structure"] +#[doc = "`read()` method returns [`receive_interrupt_watchdog_timer::R`](R) reader structure"] +impl crate::Readable for RECEIVE_INTERRUPT_WATCHDOG_TIMER_SPEC {} +#[doc = "`write(|w| ..)` method takes [`receive_interrupt_watchdog_timer::W`](W) writer structure"] impl crate::Writable for RECEIVE_INTERRUPT_WATCHDOG_TIMER_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/receive_poll_demand.rs b/src/eth0/receive_poll_demand.rs index fc5c0685..8d6f7134 100644 --- a/src/eth0/receive_poll_demand.rs +++ b/src/eth0/receive_poll_demand.rs @@ -1,43 +1,11 @@ #[doc = "Register `RECEIVE_POLL_DEMAND` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `RECEIVE_POLL_DEMAND` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RPD` reader - Receive Poll Demand"] -pub type RPD_R = crate::FieldReader; +pub type RPD_R = crate::FieldReader; #[doc = "Field `RPD` writer - Receive Poll Demand"] -pub type RPD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RECEIVE_POLL_DEMAND_SPEC, u32, u32, 32, O>; +pub type RPD_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Receive Poll Demand"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Receive Poll Demand"] #[inline(always)] #[must_use] - pub fn rpd(&mut self) -> RPD_W<0> { - RPD_W::new(self) + pub fn rpd(&mut self) -> RPD_W { + RPD_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Receive Poll Demand 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 [receive_poll_demand](index.html) module"] +#[doc = "Receive Poll Demand Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`receive_poll_demand::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`receive_poll_demand::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RECEIVE_POLL_DEMAND_SPEC; impl crate::RegisterSpec for RECEIVE_POLL_DEMAND_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [receive_poll_demand::R](R) reader structure"] -impl crate::Readable for RECEIVE_POLL_DEMAND_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [receive_poll_demand::W](W) writer structure"] +#[doc = "`read()` method returns [`receive_poll_demand::R`](R) reader structure"] +impl crate::Readable for RECEIVE_POLL_DEMAND_SPEC {} +#[doc = "`write(|w| ..)` method takes [`receive_poll_demand::W`](W) writer structure"] impl crate::Writable for RECEIVE_POLL_DEMAND_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/remote_wake_up_frame_filter.rs b/src/eth0/remote_wake_up_frame_filter.rs index 581bbf9d..78d3e8b9 100644 --- a/src/eth0/remote_wake_up_frame_filter.rs +++ b/src/eth0/remote_wake_up_frame_filter.rs @@ -1,43 +1,11 @@ #[doc = "Register `REMOTE_WAKE_UP_FRAME_FILTER` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `REMOTE_WAKE_UP_FRAME_FILTER` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `WKUPFRMFTR` reader - Remote Wake-Up Frame Filter"] -pub type WKUPFRMFTR_R = crate::FieldReader; +pub type WKUPFRMFTR_R = crate::FieldReader; #[doc = "Field `WKUPFRMFTR` writer - Remote Wake-Up Frame Filter"] -pub type WKUPFRMFTR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REMOTE_WAKE_UP_FRAME_FILTER_SPEC, u32, u32, 32, O>; +pub type WKUPFRMFTR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Remote Wake-Up Frame Filter"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Remote Wake-Up Frame Filter"] #[inline(always)] #[must_use] - pub fn wkupfrmftr(&mut self) -> WKUPFRMFTR_W<0> { - WKUPFRMFTR_W::new(self) + pub fn wkupfrmftr(&mut self) -> WKUPFRMFTR_W { + WKUPFRMFTR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Remote Wake Up Frame Filter 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 [remote_wake_up_frame_filter](index.html) module"] +#[doc = "Remote Wake Up Frame Filter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`remote_wake_up_frame_filter::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`remote_wake_up_frame_filter::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct REMOTE_WAKE_UP_FRAME_FILTER_SPEC; impl crate::RegisterSpec for REMOTE_WAKE_UP_FRAME_FILTER_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [remote_wake_up_frame_filter::R](R) reader structure"] -impl crate::Readable for REMOTE_WAKE_UP_FRAME_FILTER_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [remote_wake_up_frame_filter::W](W) writer structure"] +#[doc = "`read()` method returns [`remote_wake_up_frame_filter::R`](R) reader structure"] +impl crate::Readable for REMOTE_WAKE_UP_FRAME_FILTER_SPEC {} +#[doc = "`write(|w| ..)` method takes [`remote_wake_up_frame_filter::W`](W) writer structure"] impl crate::Writable for REMOTE_WAKE_UP_FRAME_FILTER_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/rx_1024tomaxoctets_frames_good_bad.rs b/src/eth0/rx_1024tomaxoctets_frames_good_bad.rs index 047c8bd2..cd99d749 100644 --- a/src/eth0/rx_1024tomaxoctets_frames_good_bad.rs +++ b/src/eth0/rx_1024tomaxoctets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RX1024_MAXOCTGB` reader - This field indicates the number of received good and bad frames with length between 1,024 and maxsize (inclusive) bytes, exclusive of preamble and retried frames."] -pub type RX1024_MAXOCTGB_R = crate::FieldReader; +pub type RX1024_MAXOCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and bad frames with length between 1,024 and maxsize (inclusive) bytes, exclusive of preamble and retried frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RX1024_MAXOCTGB_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good and Bad 1,024 to Maxsize Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_1024tomaxoctets_frames_good_bad](index.html) module"] +#[doc = "Receive Frame Count for Good and Bad 1,024 to Maxsize Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_1024tomaxoctets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_1024tomaxoctets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_1024tomaxoctets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for RX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_128to255octets_frames_good_bad.rs b/src/eth0/rx_128to255octets_frames_good_bad.rs index e4c00d6a..d1d1860a 100644 --- a/src/eth0/rx_128to255octets_frames_good_bad.rs +++ b/src/eth0/rx_128to255octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_128TO255OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RX128_255OCTGB` reader - This field indicates the number of received good and bad frames with length between 128 and 255 (inclusive) bytes, exclusive of preamble."] -pub type RX128_255OCTGB_R = crate::FieldReader; +pub type RX128_255OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and bad frames with length between 128 and 255 (inclusive) bytes, exclusive of preamble."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RX128_255OCTGB_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good and Bad 128 to 255 Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_128to255octets_frames_good_bad](index.html) module"] +#[doc = "Receive Frame Count for Good and Bad 128 to 255 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_128to255octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_128to255octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for RX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_128to255octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_128TO255OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for RX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_256to511octets_frames_good_bad.rs b/src/eth0/rx_256to511octets_frames_good_bad.rs index 0ea3a3f5..2d9dc335 100644 --- a/src/eth0/rx_256to511octets_frames_good_bad.rs +++ b/src/eth0/rx_256to511octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_256TO511OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RX256_511OCTGB` reader - This field indicates the number of received good and bad frames with length between 256 and 511 (inclusive) bytes, exclusive of preamble."] -pub type RX256_511OCTGB_R = crate::FieldReader; +pub type RX256_511OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and bad frames with length between 256 and 511 (inclusive) bytes, exclusive of preamble."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RX256_511OCTGB_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good and Bad 256 to 511 Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_256to511octets_frames_good_bad](index.html) module"] +#[doc = "Receive Frame Count for Good and Bad 256 to 511 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_256to511octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_256to511octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for RX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_256to511octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_256TO511OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for RX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_512to1023octets_frames_good_bad.rs b/src/eth0/rx_512to1023octets_frames_good_bad.rs index 2cf3cb19..2710cdbf 100644 --- a/src/eth0/rx_512to1023octets_frames_good_bad.rs +++ b/src/eth0/rx_512to1023octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_512TO1023OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RX512_1023OCTGB` reader - This field indicates the number of received good and bad frames with length between 512 and 1,023 (inclusive) bytes, exclusive of preamble."] -pub type RX512_1023OCTGB_R = crate::FieldReader; +pub type RX512_1023OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and bad frames with length between 512 and 1,023 (inclusive) bytes, exclusive of preamble."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RX512_1023OCTGB_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good and Bad 512 to 1,023 Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_512to1023octets_frames_good_bad](index.html) module"] +#[doc = "Receive Frame Count for Good and Bad 512 to 1,023 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_512to1023octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_512to1023octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for RX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_512to1023octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_512TO1023OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for RX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_64octets_frames_good_bad.rs b/src/eth0/rx_64octets_frames_good_bad.rs index 33ad17d3..fa4140ce 100644 --- a/src/eth0/rx_64octets_frames_good_bad.rs +++ b/src/eth0/rx_64octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_64OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RX64OCTGB` reader - This field indicates the number of received good and bad frames with length 64 bytes, exclusive of preamble."] -pub type RX64OCTGB_R = crate::FieldReader; +pub type RX64OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and bad frames with length 64 bytes, exclusive of preamble."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RX64OCTGB_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good and Bad 64 Byte Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_64octets_frames_good_bad](index.html) module"] +#[doc = "Receive Frame Count for Good and Bad 64 Byte Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_64octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_64OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_64OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_64octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for RX_64OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_64octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_64OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_64OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for RX_64OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_65to127octets_frames_good_bad.rs b/src/eth0/rx_65to127octets_frames_good_bad.rs index 0f0a6a47..2fdd1e47 100644 --- a/src/eth0/rx_65to127octets_frames_good_bad.rs +++ b/src/eth0/rx_65to127octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_65TO127OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RX65_127OCTGB` reader - This field indicates the number of received good and bad frames received with length between 65 and 127 (inclusive) bytes, exclusive of preamble."] -pub type RX65_127OCTGB_R = crate::FieldReader; +pub type RX65_127OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and bad frames received with length between 65 and 127 (inclusive) bytes, exclusive of preamble."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RX65_127OCTGB_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good and Bad 65 to 127 Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_65to127octets_frames_good_bad](index.html) module"] +#[doc = "Receive Frame Count for Good and Bad 65 to 127 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_65to127octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_65to127octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for RX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_65to127octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_65TO127OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for RX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_alignment_error_frames.rs b/src/eth0/rx_alignment_error_frames.rs index 8c229ba5..6c98e41a 100644 --- a/src/eth0/rx_alignment_error_frames.rs +++ b/src/eth0/rx_alignment_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_ALIGNMENT_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXALGNERR` reader - This field indicates the number of frames received with alignment (dribble) error."] -pub type RXALGNERR_R = crate::FieldReader; +pub type RXALGNERR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames received with alignment (dribble) error."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXALGNERR_R::new(self.bits) } } -#[doc = "Receive Frame Count for Alignment Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_alignment_error_frames](index.html) module"] +#[doc = "Receive Frame Count for Alignment Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_alignment_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_ALIGNMENT_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RX_ALIGNMENT_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_alignment_error_frames::R](R) reader structure"] -impl crate::Readable for RX_ALIGNMENT_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_alignment_error_frames::R`](R) reader structure"] +impl crate::Readable for RX_ALIGNMENT_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_ALIGNMENT_ERROR_FRAMES to value 0"] impl crate::Resettable for RX_ALIGNMENT_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_broadcast_frames_good.rs b/src/eth0/rx_broadcast_frames_good.rs index 1096eebb..742f0326 100644 --- a/src/eth0/rx_broadcast_frames_good.rs +++ b/src/eth0/rx_broadcast_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_BROADCAST_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXBCASTG` reader - This field indicates the number of received good broadcast frames."] -pub type RXBCASTG_R = crate::FieldReader; +pub type RXBCASTG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good broadcast frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXBCASTG_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good Broadcast Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_broadcast_frames_good](index.html) module"] +#[doc = "Receive Frame Count for Good Broadcast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_broadcast_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_BROADCAST_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for RX_BROADCAST_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_broadcast_frames_good::R](R) reader structure"] -impl crate::Readable for RX_BROADCAST_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_broadcast_frames_good::R`](R) reader structure"] +impl crate::Readable for RX_BROADCAST_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets RX_BROADCAST_FRAMES_GOOD to value 0"] impl crate::Resettable for RX_BROADCAST_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_control_frames_good.rs b/src/eth0/rx_control_frames_good.rs index 59db01be..b7158607 100644 --- a/src/eth0/rx_control_frames_good.rs +++ b/src/eth0/rx_control_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_CONTROL_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXCTRLG` reader - This field indicates the number of frames received with error because of the watchdog timeout error (frames with more than 2,048 bytes data load)."] -pub type RXCTRLG_R = crate::FieldReader; +pub type RXCTRLG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames received with error because of the watchdog timeout error (frames with more than 2,048 bytes data load)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXCTRLG_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good Control Frames Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_control_frames_good](index.html) module"] +#[doc = "Receive Frame Count for Good Control Frames Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_control_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_CONTROL_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for RX_CONTROL_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_control_frames_good::R](R) reader structure"] -impl crate::Readable for RX_CONTROL_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_control_frames_good::R`](R) reader structure"] +impl crate::Readable for RX_CONTROL_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets RX_CONTROL_FRAMES_GOOD to value 0"] impl crate::Resettable for RX_CONTROL_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_crc_error_frames.rs b/src/eth0/rx_crc_error_frames.rs index 19a10b41..10caad5b 100644 --- a/src/eth0/rx_crc_error_frames.rs +++ b/src/eth0/rx_crc_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_CRC_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXCRCERR` reader - This field indicates the number of frames received with CRC error."] -pub type RXCRCERR_R = crate::FieldReader; +pub type RXCRCERR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames received with CRC error."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXCRCERR_R::new(self.bits) } } -#[doc = "Receive Frame Count for CRC Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_crc_error_frames](index.html) module"] +#[doc = "Receive Frame Count for CRC Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_crc_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_CRC_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RX_CRC_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_crc_error_frames::R](R) reader structure"] -impl crate::Readable for RX_CRC_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_crc_error_frames::R`](R) reader structure"] +impl crate::Readable for RX_CRC_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_CRC_ERROR_FRAMES to value 0"] impl crate::Resettable for RX_CRC_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_fifo_overflow_frames.rs b/src/eth0/rx_fifo_overflow_frames.rs index bd84c269..fd0a5564 100644 --- a/src/eth0/rx_fifo_overflow_frames.rs +++ b/src/eth0/rx_fifo_overflow_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_FIFO_OVERFLOW_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXFIFOOVFL` reader - This field indicates the number of received frames missed because of FIFO overflow."] -pub type RXFIFOOVFL_R = crate::FieldReader; +pub type RXFIFOOVFL_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received frames missed because of FIFO overflow."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXFIFOOVFL_R::new(self.bits) } } -#[doc = "Receive Frame Count for FIFO Overflow Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_fifo_overflow_frames](index.html) module"] +#[doc = "Receive Frame Count for FIFO Overflow Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_fifo_overflow_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_FIFO_OVERFLOW_FRAMES_SPEC; impl crate::RegisterSpec for RX_FIFO_OVERFLOW_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_fifo_overflow_frames::R](R) reader structure"] -impl crate::Readable for RX_FIFO_OVERFLOW_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_fifo_overflow_frames::R`](R) reader structure"] +impl crate::Readable for RX_FIFO_OVERFLOW_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_FIFO_OVERFLOW_FRAMES to value 0"] impl crate::Resettable for RX_FIFO_OVERFLOW_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_frames_count_good_bad.rs b/src/eth0/rx_frames_count_good_bad.rs index 580220cb..cb14e16e 100644 --- a/src/eth0/rx_frames_count_good_bad.rs +++ b/src/eth0/rx_frames_count_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_FRAMES_COUNT_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXFRMGB` reader - This field indicates the number of received good and bad frames."] -pub type RXFRMGB_R = crate::FieldReader; +pub type RXFRMGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and bad frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXFRMGB_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good and Bad Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_frames_count_good_bad](index.html) module"] +#[doc = "Receive Frame Count for Good and Bad Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_frames_count_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_FRAMES_COUNT_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_FRAMES_COUNT_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_frames_count_good_bad::R](R) reader structure"] -impl crate::Readable for RX_FRAMES_COUNT_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_frames_count_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_FRAMES_COUNT_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_FRAMES_COUNT_GOOD_BAD to value 0"] impl crate::Resettable for RX_FRAMES_COUNT_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_jabber_error_frames.rs b/src/eth0/rx_jabber_error_frames.rs index 936c88f4..a886c1e1 100644 --- a/src/eth0/rx_jabber_error_frames.rs +++ b/src/eth0/rx_jabber_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_JABBER_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXJABERR` reader - This field indicates the number of giant frames received with length (including CRC) greater than 1,518 bytes (1,522 bytes for VLAN tagged) and with CRC error. If Jumbo Frame mode is enabled, then frames of length greater than 9,018 bytes (9,022 for VLAN tagged) are considered as giant frames."] -pub type RXJABERR_R = crate::FieldReader; +pub type RXJABERR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of giant frames received with length (including CRC) greater than 1,518 bytes (1,522 bytes for VLAN tagged) and with CRC error. If Jumbo Frame mode is enabled, then frames of length greater than 9,018 bytes (9,022 for VLAN tagged) are considered as giant frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXJABERR_R::new(self.bits) } } -#[doc = "Receive Frame Count for Jabber Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_jabber_error_frames](index.html) module"] +#[doc = "Receive Frame Count for Jabber Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_jabber_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_JABBER_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RX_JABBER_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_jabber_error_frames::R](R) reader structure"] -impl crate::Readable for RX_JABBER_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_jabber_error_frames::R`](R) reader structure"] +impl crate::Readable for RX_JABBER_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_JABBER_ERROR_FRAMES to value 0"] impl crate::Resettable for RX_JABBER_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_length_error_frames.rs b/src/eth0/rx_length_error_frames.rs index cfe576a8..8ed6c046 100644 --- a/src/eth0/rx_length_error_frames.rs +++ b/src/eth0/rx_length_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_LENGTH_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXLENERR` reader - This field indicates the number of frames received with length error (Length type field not equal to frame size) for all frames with valid length field."] -pub type RXLENERR_R = crate::FieldReader; +pub type RXLENERR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames received with length error (Length type field not equal to frame size) for all frames with valid length field."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXLENERR_R::new(self.bits) } } -#[doc = "Receive Frame Count for Length Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_length_error_frames](index.html) module"] +#[doc = "Receive Frame Count for Length Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_length_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_LENGTH_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RX_LENGTH_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_length_error_frames::R](R) reader structure"] -impl crate::Readable for RX_LENGTH_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_length_error_frames::R`](R) reader structure"] +impl crate::Readable for RX_LENGTH_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_LENGTH_ERROR_FRAMES to value 0"] impl crate::Resettable for RX_LENGTH_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_multicast_frames_good.rs b/src/eth0/rx_multicast_frames_good.rs index 92801de1..553b8d76 100644 --- a/src/eth0/rx_multicast_frames_good.rs +++ b/src/eth0/rx_multicast_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_MULTICAST_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXMCASTG` reader - This field indicates the number of received good multicast frames."] -pub type RXMCASTG_R = crate::FieldReader; +pub type RXMCASTG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good multicast frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXMCASTG_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good Multicast Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_multicast_frames_good](index.html) module"] +#[doc = "Receive Frame Count for Good Multicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_multicast_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_MULTICAST_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for RX_MULTICAST_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_multicast_frames_good::R](R) reader structure"] -impl crate::Readable for RX_MULTICAST_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_multicast_frames_good::R`](R) reader structure"] +impl crate::Readable for RX_MULTICAST_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets RX_MULTICAST_FRAMES_GOOD to value 0"] impl crate::Resettable for RX_MULTICAST_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_octet_count_good.rs b/src/eth0/rx_octet_count_good.rs index 080ca4b6..57482c38 100644 --- a/src/eth0/rx_octet_count_good.rs +++ b/src/eth0/rx_octet_count_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_OCTET_COUNT_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXOCTG` reader - This field indicates the number of bytes received, exclusive of preamble, only in good frames."] -pub type RXOCTG_R = crate::FieldReader; +pub type RXOCTG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received, exclusive of preamble, only in good frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXOCTG_R::new(self.bits) } } -#[doc = "Rx Octet Count Good 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 [rx_octet_count_good](index.html) module"] +#[doc = "Rx Octet Count Good Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_octet_count_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_OCTET_COUNT_GOOD_SPEC; impl crate::RegisterSpec for RX_OCTET_COUNT_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_octet_count_good::R](R) reader structure"] -impl crate::Readable for RX_OCTET_COUNT_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_octet_count_good::R`](R) reader structure"] +impl crate::Readable for RX_OCTET_COUNT_GOOD_SPEC {} #[doc = "`reset()` method sets RX_OCTET_COUNT_GOOD to value 0"] impl crate::Resettable for RX_OCTET_COUNT_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_octet_count_good_bad.rs b/src/eth0/rx_octet_count_good_bad.rs index feaeab9c..3459a5d6 100644 --- a/src/eth0/rx_octet_count_good_bad.rs +++ b/src/eth0/rx_octet_count_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_OCTET_COUNT_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXOCTGB` reader - This field indicates the number of bytes received, exclusive of preamble, in good and bad frames."] -pub type RXOCTGB_R = crate::FieldReader; +pub type RXOCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received, exclusive of preamble, in good and bad frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXOCTGB_R::new(self.bits) } } -#[doc = "Receive Octet Count for Good and Bad Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_octet_count_good_bad](index.html) module"] +#[doc = "Receive Octet Count for Good and Bad Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_octet_count_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_OCTET_COUNT_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_OCTET_COUNT_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_octet_count_good_bad::R](R) reader structure"] -impl crate::Readable for RX_OCTET_COUNT_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_octet_count_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_OCTET_COUNT_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_OCTET_COUNT_GOOD_BAD to value 0"] impl crate::Resettable for RX_OCTET_COUNT_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_out_of_range_type_frames.rs b/src/eth0/rx_out_of_range_type_frames.rs index 15372d79..8571487a 100644 --- a/src/eth0/rx_out_of_range_type_frames.rs +++ b/src/eth0/rx_out_of_range_type_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_OUT_OF_RANGE_TYPE_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXOUTOFRNG` reader - This field indicates the number of received frames with length field not equal to the valid frame size (greater than 1,500 but less than 1,536)."] -pub type RXOUTOFRNG_R = crate::FieldReader; +pub type RXOUTOFRNG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received frames with length field not equal to the valid frame size (greater than 1,500 but less than 1,536)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXOUTOFRNG_R::new(self.bits) } } -#[doc = "Receive Frame Count for Out of Range Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_out_of_range_type_frames](index.html) module"] +#[doc = "Receive Frame Count for Out of Range Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_out_of_range_type_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_OUT_OF_RANGE_TYPE_FRAMES_SPEC; impl crate::RegisterSpec for RX_OUT_OF_RANGE_TYPE_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_out_of_range_type_frames::R](R) reader structure"] -impl crate::Readable for RX_OUT_OF_RANGE_TYPE_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_out_of_range_type_frames::R`](R) reader structure"] +impl crate::Readable for RX_OUT_OF_RANGE_TYPE_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_OUT_OF_RANGE_TYPE_FRAMES to value 0"] impl crate::Resettable for RX_OUT_OF_RANGE_TYPE_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_oversize_frames_good.rs b/src/eth0/rx_oversize_frames_good.rs index 2421c7e4..96ef48f0 100644 --- a/src/eth0/rx_oversize_frames_good.rs +++ b/src/eth0/rx_oversize_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_OVERSIZE_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXOVERSZG` reader - This field indicates the number of frames received without errors, with length greater than the maxsize (1,518 or 1,522 for VLAN tagged frames; 2,000 bytes if enabled by setting MAC Configuration.2KPE)."] -pub type RXOVERSZG_R = crate::FieldReader; +pub type RXOVERSZG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames received without errors, with length greater than the maxsize (1,518 or 1,522 for VLAN tagged frames; 2,000 bytes if enabled by setting MAC Configuration.2KPE)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXOVERSZG_R::new(self.bits) } } -#[doc = "Rx Oversize Frames Good 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 [rx_oversize_frames_good](index.html) module"] +#[doc = "Rx Oversize Frames Good Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_oversize_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_OVERSIZE_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for RX_OVERSIZE_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_oversize_frames_good::R](R) reader structure"] -impl crate::Readable for RX_OVERSIZE_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_oversize_frames_good::R`](R) reader structure"] +impl crate::Readable for RX_OVERSIZE_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets RX_OVERSIZE_FRAMES_GOOD to value 0"] impl crate::Resettable for RX_OVERSIZE_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_pause_frames.rs b/src/eth0/rx_pause_frames.rs index 8715d0f6..985cec3f 100644 --- a/src/eth0/rx_pause_frames.rs +++ b/src/eth0/rx_pause_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_PAUSE_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXPAUSEFRM` reader - This field indicates the number of received good and valid PAUSE frames."] -pub type RXPAUSEFRM_R = crate::FieldReader; +pub type RXPAUSEFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and valid PAUSE frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXPAUSEFRM_R::new(self.bits) } } -#[doc = "Receive Frame Count for PAUSE Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_pause_frames](index.html) module"] +#[doc = "Receive Frame Count for PAUSE Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_pause_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_PAUSE_FRAMES_SPEC; impl crate::RegisterSpec for RX_PAUSE_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_pause_frames::R](R) reader structure"] -impl crate::Readable for RX_PAUSE_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_pause_frames::R`](R) reader structure"] +impl crate::Readable for RX_PAUSE_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_PAUSE_FRAMES to value 0"] impl crate::Resettable for RX_PAUSE_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_receive_error_frames.rs b/src/eth0/rx_receive_error_frames.rs index 3eb9a835..06e09a65 100644 --- a/src/eth0/rx_receive_error_frames.rs +++ b/src/eth0/rx_receive_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_RECEIVE_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXRCVERR` reader - This field indicates the number of frames received with error because of the watchdog timeout error (frames with more than 2,048 bytes data load)."] -pub type RXRCVERR_R = crate::FieldReader; +pub type RXRCVERR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames received with error because of the watchdog timeout error (frames with more than 2,048 bytes data load)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXRCVERR_R::new(self.bits) } } -#[doc = "Receive Frame Count for Receive Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_receive_error_frames](index.html) module"] +#[doc = "Receive Frame Count for Receive Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_receive_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_RECEIVE_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RX_RECEIVE_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_receive_error_frames::R](R) reader structure"] -impl crate::Readable for RX_RECEIVE_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_receive_error_frames::R`](R) reader structure"] +impl crate::Readable for RX_RECEIVE_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_RECEIVE_ERROR_FRAMES to value 0"] impl crate::Resettable for RX_RECEIVE_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_runt_error_frames.rs b/src/eth0/rx_runt_error_frames.rs index 2b1d1a65..fc01b04b 100644 --- a/src/eth0/rx_runt_error_frames.rs +++ b/src/eth0/rx_runt_error_frames.rs @@ -1,36 +1,21 @@ #[doc = "Register `RX_RUNT_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[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 `RXRUNTERR` reader - This field indicates the number of frames received with runt error(<64 bytes and CRC error)."] -pub type RXRUNTERR_R = crate::FieldReader; +pub type R = crate::R; +#[doc = "Field `RXRUNTERR` reader - This field indicates the number of frames received with runt error(<64 bytes and CRC error)."] +pub type RXRUNTERR_R = crate::FieldReader; impl R { - #[doc = "Bits 0:31 - This field indicates the number of frames received with runt error(<64 bytes and CRC error)."] + #[doc = "Bits 0:31 - This field indicates the number of frames received with runt error(<64 bytes and CRC error)."] #[inline(always)] pub fn rxrunterr(&self) -> RXRUNTERR_R { RXRUNTERR_R::new(self.bits) } } -#[doc = "Receive Frame Count for Runt Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_runt_error_frames](index.html) module"] +#[doc = "Receive Frame Count for Runt Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_runt_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_RUNT_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RX_RUNT_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_runt_error_frames::R](R) reader structure"] -impl crate::Readable for RX_RUNT_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_runt_error_frames::R`](R) reader structure"] +impl crate::Readable for RX_RUNT_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_RUNT_ERROR_FRAMES to value 0"] impl crate::Resettable for RX_RUNT_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_undersize_frames_good.rs b/src/eth0/rx_undersize_frames_good.rs index 6f1354ab..5ce5676b 100644 --- a/src/eth0/rx_undersize_frames_good.rs +++ b/src/eth0/rx_undersize_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_UNDERSIZE_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXUNDERSZG` reader - This field indicates the number of frames received with length less than 64 bytes and without errors."] -pub type RXUNDERSZG_R = crate::FieldReader; +pub type RXUNDERSZG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames received with length less than 64 bytes and without errors."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXUNDERSZG_R::new(self.bits) } } -#[doc = "Receive Frame Count for Undersize Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_undersize_frames_good](index.html) module"] +#[doc = "Receive Frame Count for Undersize Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_undersize_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_UNDERSIZE_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for RX_UNDERSIZE_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_undersize_frames_good::R](R) reader structure"] -impl crate::Readable for RX_UNDERSIZE_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_undersize_frames_good::R`](R) reader structure"] +impl crate::Readable for RX_UNDERSIZE_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets RX_UNDERSIZE_FRAMES_GOOD to value 0"] impl crate::Resettable for RX_UNDERSIZE_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_unicast_frames_good.rs b/src/eth0/rx_unicast_frames_good.rs index aca2585f..33d61f72 100644 --- a/src/eth0/rx_unicast_frames_good.rs +++ b/src/eth0/rx_unicast_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_UNICAST_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXUCASTG` reader - This field indicates the number of received good unicast frames."] -pub type RXUCASTG_R = crate::FieldReader; +pub type RXUCASTG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good unicast frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXUCASTG_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good Unicast Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_unicast_frames_good](index.html) module"] +#[doc = "Receive Frame Count for Good Unicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_unicast_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_UNICAST_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for RX_UNICAST_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_unicast_frames_good::R](R) reader structure"] -impl crate::Readable for RX_UNICAST_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_unicast_frames_good::R`](R) reader structure"] +impl crate::Readable for RX_UNICAST_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets RX_UNICAST_FRAMES_GOOD to value 0"] impl crate::Resettable for RX_UNICAST_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_vlan_frames_good_bad.rs b/src/eth0/rx_vlan_frames_good_bad.rs index 75ab608c..43c20e1c 100644 --- a/src/eth0/rx_vlan_frames_good_bad.rs +++ b/src/eth0/rx_vlan_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_VLAN_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXVLANFRGB` reader - This field indicates the number of received good and bad VLAN frames."] -pub type RXVLANFRGB_R = crate::FieldReader; +pub type RXVLANFRGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good and bad VLAN frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXVLANFRGB_R::new(self.bits) } } -#[doc = "Receive Frame Count for Good and Bad VLAN Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_vlan_frames_good_bad](index.html) module"] +#[doc = "Receive Frame Count for Good and Bad VLAN Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_vlan_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_VLAN_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for RX_VLAN_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_vlan_frames_good_bad::R](R) reader structure"] -impl crate::Readable for RX_VLAN_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_vlan_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for RX_VLAN_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets RX_VLAN_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for RX_VLAN_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rx_watchdog_error_frames.rs b/src/eth0/rx_watchdog_error_frames.rs index aac19e74..b83b7110 100644 --- a/src/eth0/rx_watchdog_error_frames.rs +++ b/src/eth0/rx_watchdog_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RX_WATCHDOG_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXWDGERR` reader - This field indicates the number of frames received with error because of the watchdog timeout error (frames with more than 2,048 bytes data load)."] -pub type RXWDGERR_R = crate::FieldReader; +pub type RXWDGERR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames received with error because of the watchdog timeout error (frames with more than 2,048 bytes data load)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXWDGERR_R::new(self.bits) } } -#[doc = "Receive Frame Count for Watchdog Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx_watchdog_error_frames](index.html) module"] +#[doc = "Receive Frame Count for Watchdog Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rx_watchdog_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RX_WATCHDOG_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RX_WATCHDOG_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rx_watchdog_error_frames::R](R) reader structure"] -impl crate::Readable for RX_WATCHDOG_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rx_watchdog_error_frames::R`](R) reader structure"] +impl crate::Readable for RX_WATCHDOG_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RX_WATCHDOG_ERROR_FRAMES to value 0"] impl crate::Resettable for RX_WATCHDOG_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxicmp_error_frames.rs b/src/eth0/rxicmp_error_frames.rs index 52c95aa3..a6262309 100644 --- a/src/eth0/rxicmp_error_frames.rs +++ b/src/eth0/rxicmp_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXICMP_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXICMPERRFRM` reader - This field indicates the number of good IP datagrams whose ICMP payload has a checksum error."] -pub type RXICMPERRFRM_R = crate::FieldReader; +pub type RXICMPERRFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IP datagrams whose ICMP payload has a checksum error."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXICMPERRFRM_R::new(self.bits) } } -#[doc = "RxICMP Error Frames 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 [rxicmp_error_frames](index.html) module"] +#[doc = "RxICMP Error Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxicmp_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXICMP_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RXICMP_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxicmp_error_frames::R](R) reader structure"] -impl crate::Readable for RXICMP_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxicmp_error_frames::R`](R) reader structure"] +impl crate::Readable for RXICMP_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RXICMP_ERROR_FRAMES to value 0"] impl crate::Resettable for RXICMP_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxicmp_error_octets.rs b/src/eth0/rxicmp_error_octets.rs index 42c7b9e8..21dcfb39 100644 --- a/src/eth0/rxicmp_error_octets.rs +++ b/src/eth0/rxicmp_error_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXICMP_ERROR_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXICMPERROCT` reader - Number of bytes received in an ICMP segment with checksum errors"] -pub type RXICMPERROCT_R = crate::FieldReader; +pub type RXICMPERROCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Number of bytes received in an ICMP segment with checksum errors"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXICMPERROCT_R::new(self.bits) } } -#[doc = "Receive ICMP Error Octets 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 [rxicmp_error_octets](index.html) module"] +#[doc = "Receive ICMP Error Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxicmp_error_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXICMP_ERROR_OCTETS_SPEC; impl crate::RegisterSpec for RXICMP_ERROR_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxicmp_error_octets::R](R) reader structure"] -impl crate::Readable for RXICMP_ERROR_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxicmp_error_octets::R`](R) reader structure"] +impl crate::Readable for RXICMP_ERROR_OCTETS_SPEC {} #[doc = "`reset()` method sets RXICMP_ERROR_OCTETS to value 0"] impl crate::Resettable for RXICMP_ERROR_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxicmp_good_frames.rs b/src/eth0/rxicmp_good_frames.rs index 1c9bda91..f6fcd6ae 100644 --- a/src/eth0/rxicmp_good_frames.rs +++ b/src/eth0/rxicmp_good_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXICMP_GOOD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXICMPGDFRM` reader - This field indicates the number of good IP datagrams with a good ICMP payload."] -pub type RXICMPGDFRM_R = crate::FieldReader; +pub type RXICMPGDFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IP datagrams with a good ICMP payload."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXICMPGDFRM_R::new(self.bits) } } -#[doc = "RxICMP Good Frames 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 [rxicmp_good_frames](index.html) module"] +#[doc = "RxICMP Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxicmp_good_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXICMP_GOOD_FRAMES_SPEC; impl crate::RegisterSpec for RXICMP_GOOD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxicmp_good_frames::R](R) reader structure"] -impl crate::Readable for RXICMP_GOOD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxicmp_good_frames::R`](R) reader structure"] +impl crate::Readable for RXICMP_GOOD_FRAMES_SPEC {} #[doc = "`reset()` method sets RXICMP_GOOD_FRAMES to value 0"] impl crate::Resettable for RXICMP_GOOD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxicmp_good_octets.rs b/src/eth0/rxicmp_good_octets.rs index 23af4b22..6dd851d5 100644 --- a/src/eth0/rxicmp_good_octets.rs +++ b/src/eth0/rxicmp_good_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXICMP_GOOD_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXICMPGDOCT` reader - This field indicates the number of bytes received in a good ICMP segment. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] -pub type RXICMPGDOCT_R = crate::FieldReader; +pub type RXICMPGDOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in a good ICMP segment. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXICMPGDOCT_R::new(self.bits) } } -#[doc = "Receive ICMP Good Octets 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 [rxicmp_good_octets](index.html) module"] +#[doc = "Receive ICMP Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxicmp_good_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXICMP_GOOD_OCTETS_SPEC; impl crate::RegisterSpec for RXICMP_GOOD_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxicmp_good_octets::R](R) reader structure"] -impl crate::Readable for RXICMP_GOOD_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxicmp_good_octets::R`](R) reader structure"] +impl crate::Readable for RXICMP_GOOD_OCTETS_SPEC {} #[doc = "`reset()` method sets RXICMP_GOOD_OCTETS to value 0"] impl crate::Resettable for RXICMP_GOOD_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_fragmented_frames.rs b/src/eth0/rxipv4_fragmented_frames.rs index 61f2bd8f..ac65f8fd 100644 --- a/src/eth0/rxipv4_fragmented_frames.rs +++ b/src/eth0/rxipv4_fragmented_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_FRAGMENTED_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4FRAGFRM` reader - This field indicates the number of good IPv4 datagrams received with fragmentation."] -pub type RXIPV4FRAGFRM_R = crate::FieldReader; +pub type RXIPV4FRAGFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IPv4 datagrams received with fragmentation."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4FRAGFRM_R::new(self.bits) } } -#[doc = "Receive IPV4 Fragmented Frame Counter 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 [rxipv4_fragmented_frames](index.html) module"] +#[doc = "Receive IPV4 Fragmented Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_fragmented_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_FRAGMENTED_FRAMES_SPEC; impl crate::RegisterSpec for RXIPV4_FRAGMENTED_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_fragmented_frames::R](R) reader structure"] -impl crate::Readable for RXIPV4_FRAGMENTED_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_fragmented_frames::R`](R) reader structure"] +impl crate::Readable for RXIPV4_FRAGMENTED_FRAMES_SPEC {} #[doc = "`reset()` method sets RXIPV4_FRAGMENTED_FRAMES to value 0"] impl crate::Resettable for RXIPV4_FRAGMENTED_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_fragmented_octets.rs b/src/eth0/rxipv4_fragmented_octets.rs index 8161ad9a..c8fbc3b9 100644 --- a/src/eth0/rxipv4_fragmented_octets.rs +++ b/src/eth0/rxipv4_fragmented_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_FRAGMENTED_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4FRAGOCT` reader - This field indicates the number of bytes received in fragmented IPv4 datagrams. The value in the IPv4 headers Length field is used to update this counter."] -pub type RXIPV4FRAGOCT_R = crate::FieldReader; +pub type RXIPV4FRAGOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in fragmented IPv4 datagrams. The value in the IPv4 headers Length field is used to update this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4FRAGOCT_R::new(self.bits) } } -#[doc = "Receive IPV4 Fragmented Octet Counter 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 [rxipv4_fragmented_octets](index.html) module"] +#[doc = "Receive IPV4 Fragmented Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_fragmented_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_FRAGMENTED_OCTETS_SPEC; impl crate::RegisterSpec for RXIPV4_FRAGMENTED_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_fragmented_octets::R](R) reader structure"] -impl crate::Readable for RXIPV4_FRAGMENTED_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_fragmented_octets::R`](R) reader structure"] +impl crate::Readable for RXIPV4_FRAGMENTED_OCTETS_SPEC {} #[doc = "`reset()` method sets RXIPV4_FRAGMENTED_OCTETS to value 0"] impl crate::Resettable for RXIPV4_FRAGMENTED_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_good_frames.rs b/src/eth0/rxipv4_good_frames.rs index e3331a20..b9c086a7 100644 --- a/src/eth0/rxipv4_good_frames.rs +++ b/src/eth0/rxipv4_good_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_GOOD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4GDFRM` reader - This field indicates the number of good IPv4 datagrams received with the TCP, UDP, or ICMP payload."] -pub type RXIPV4GDFRM_R = crate::FieldReader; +pub type RXIPV4GDFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IPv4 datagrams received with the TCP, UDP, or ICMP payload."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4GDFRM_R::new(self.bits) } } -#[doc = "RxIPv4 Good Frames 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 [rxipv4_good_frames](index.html) module"] +#[doc = "RxIPv4 Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_good_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_GOOD_FRAMES_SPEC; impl crate::RegisterSpec for RXIPV4_GOOD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_good_frames::R](R) reader structure"] -impl crate::Readable for RXIPV4_GOOD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_good_frames::R`](R) reader structure"] +impl crate::Readable for RXIPV4_GOOD_FRAMES_SPEC {} #[doc = "`reset()` method sets RXIPV4_GOOD_FRAMES to value 0"] impl crate::Resettable for RXIPV4_GOOD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_good_octets.rs b/src/eth0/rxipv4_good_octets.rs index 50a73d14..15b9384b 100644 --- a/src/eth0/rxipv4_good_octets.rs +++ b/src/eth0/rxipv4_good_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_GOOD_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4GDOCT` reader - This field indicates the number of bytes received in good IPv4 datagrams encapsulating TCP, UDP, or ICMP data. The Ethernet header, FCS, pad, or IP pad"] -pub type RXIPV4GDOCT_R = crate::FieldReader; +pub type RXIPV4GDOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in good IPv4 datagrams encapsulating TCP, UDP, or ICMP data. The Ethernet header, FCS, pad, or IP pad"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4GDOCT_R::new(self.bits) } } -#[doc = "RxIPv4 Good Octets 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 [rxipv4_good_octets](index.html) module"] +#[doc = "RxIPv4 Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_good_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_GOOD_OCTETS_SPEC; impl crate::RegisterSpec for RXIPV4_GOOD_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_good_octets::R](R) reader structure"] -impl crate::Readable for RXIPV4_GOOD_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_good_octets::R`](R) reader structure"] +impl crate::Readable for RXIPV4_GOOD_OCTETS_SPEC {} #[doc = "`reset()` method sets RXIPV4_GOOD_OCTETS to value 0"] impl crate::Resettable for RXIPV4_GOOD_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_header_error_frames.rs b/src/eth0/rxipv4_header_error_frames.rs index 2f6e614c..86e9c3be 100644 --- a/src/eth0/rxipv4_header_error_frames.rs +++ b/src/eth0/rxipv4_header_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_HEADER_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4HDRERRFRM` reader - This field indicates the number of IPv4 datagrams received with header errors (checksum, length, or version mismatch)."] -pub type RXIPV4HDRERRFRM_R = crate::FieldReader; +pub type RXIPV4HDRERRFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of IPv4 datagrams received with header errors (checksum, length, or version mismatch)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4HDRERRFRM_R::new(self.bits) } } -#[doc = "Receive IPV4 Header Error Frame Counter 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 [rxipv4_header_error_frames](index.html) module"] +#[doc = "Receive IPV4 Header Error Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_header_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_HEADER_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RXIPV4_HEADER_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_header_error_frames::R](R) reader structure"] -impl crate::Readable for RXIPV4_HEADER_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_header_error_frames::R`](R) reader structure"] +impl crate::Readable for RXIPV4_HEADER_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RXIPV4_HEADER_ERROR_FRAMES to value 0"] impl crate::Resettable for RXIPV4_HEADER_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_header_error_octets.rs b/src/eth0/rxipv4_header_error_octets.rs index e83710c9..d8606d55 100644 --- a/src/eth0/rxipv4_header_error_octets.rs +++ b/src/eth0/rxipv4_header_error_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_HEADER_ERROR_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4HDRERROCT` reader - This field indicates the number of bytes received in the IPv4 datagrams with header errors (checksum, length, or version mismatch). The value in the Length field of IPv4 header is used to update this counter."] -pub type RXIPV4HDRERROCT_R = crate::FieldReader; +pub type RXIPV4HDRERROCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in the IPv4 datagrams with header errors (checksum, length, or version mismatch). The value in the Length field of IPv4 header is used to update this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4HDRERROCT_R::new(self.bits) } } -#[doc = "Receive IPV4 Header Error Octet Counter 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 [rxipv4_header_error_octets](index.html) module"] +#[doc = "Receive IPV4 Header Error Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_header_error_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_HEADER_ERROR_OCTETS_SPEC; impl crate::RegisterSpec for RXIPV4_HEADER_ERROR_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_header_error_octets::R](R) reader structure"] -impl crate::Readable for RXIPV4_HEADER_ERROR_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_header_error_octets::R`](R) reader structure"] +impl crate::Readable for RXIPV4_HEADER_ERROR_OCTETS_SPEC {} #[doc = "`reset()` method sets RXIPV4_HEADER_ERROR_OCTETS to value 0"] impl crate::Resettable for RXIPV4_HEADER_ERROR_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_no_payload_frames.rs b/src/eth0/rxipv4_no_payload_frames.rs index b00dd356..78406fd8 100644 --- a/src/eth0/rxipv4_no_payload_frames.rs +++ b/src/eth0/rxipv4_no_payload_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_NO_PAYLOAD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4NOPAYFRM` reader - This field indicates the number of IPv4 datagram frames received that did not have a TCP, UDP, or ICMP payload processed by the Checksum engine."] -pub type RXIPV4NOPAYFRM_R = crate::FieldReader; +pub type RXIPV4NOPAYFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of IPv4 datagram frames received that did not have a TCP, UDP, or ICMP payload processed by the Checksum engine."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4NOPAYFRM_R::new(self.bits) } } -#[doc = "Receive IPV4 No Payload Frame Counter 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 [rxipv4_no_payload_frames](index.html) module"] +#[doc = "Receive IPV4 No Payload Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_no_payload_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_NO_PAYLOAD_FRAMES_SPEC; impl crate::RegisterSpec for RXIPV4_NO_PAYLOAD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_no_payload_frames::R](R) reader structure"] -impl crate::Readable for RXIPV4_NO_PAYLOAD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_no_payload_frames::R`](R) reader structure"] +impl crate::Readable for RXIPV4_NO_PAYLOAD_FRAMES_SPEC {} #[doc = "`reset()` method sets RXIPV4_NO_PAYLOAD_FRAMES to value 0"] impl crate::Resettable for RXIPV4_NO_PAYLOAD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_no_payload_octets.rs b/src/eth0/rxipv4_no_payload_octets.rs index b5d2a402..0c9c550a 100644 --- a/src/eth0/rxipv4_no_payload_octets.rs +++ b/src/eth0/rxipv4_no_payload_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_NO_PAYLOAD_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4NOPAYOCT` reader - This field indicates the number of bytes received in IPv4 datagrams that did not have a TCP, UDP, or ICMP payload. The value in the IPv4 headers Length field is used to update this counter."] -pub type RXIPV4NOPAYOCT_R = crate::FieldReader; +pub type RXIPV4NOPAYOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in IPv4 datagrams that did not have a TCP, UDP, or ICMP payload. The value in the IPv4 headers Length field is used to update this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4NOPAYOCT_R::new(self.bits) } } -#[doc = "Receive IPV4 No Payload Octet Counter 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 [rxipv4_no_payload_octets](index.html) module"] +#[doc = "Receive IPV4 No Payload Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_no_payload_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_NO_PAYLOAD_OCTETS_SPEC; impl crate::RegisterSpec for RXIPV4_NO_PAYLOAD_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_no_payload_octets::R](R) reader structure"] -impl crate::Readable for RXIPV4_NO_PAYLOAD_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_no_payload_octets::R`](R) reader structure"] +impl crate::Readable for RXIPV4_NO_PAYLOAD_OCTETS_SPEC {} #[doc = "`reset()` method sets RXIPV4_NO_PAYLOAD_OCTETS to value 0"] impl crate::Resettable for RXIPV4_NO_PAYLOAD_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_udp_checksum_disable_octets.rs b/src/eth0/rxipv4_udp_checksum_disable_octets.rs index 58361d8d..90aeb965 100644 --- a/src/eth0/rxipv4_udp_checksum_disable_octets.rs +++ b/src/eth0/rxipv4_udp_checksum_disable_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4UDSBLOCT` reader - This field indicates the number of bytes received in a UDP segment that had the UDP checksum disabled. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] -pub type RXIPV4UDSBLOCT_R = crate::FieldReader; +pub type RXIPV4UDSBLOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in a UDP segment that had the UDP checksum disabled. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4UDSBLOCT_R::new(self.bits) } } -#[doc = "Receive IPV4 Fragmented Octet Counter 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 [rxipv4_udp_checksum_disable_octets](index.html) module"] +#[doc = "Receive IPV4 Fragmented Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_udp_checksum_disable_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS_SPEC; impl crate::RegisterSpec for RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_udp_checksum_disable_octets::R](R) reader structure"] -impl crate::Readable for RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_udp_checksum_disable_octets::R`](R) reader structure"] +impl crate::Readable for RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS_SPEC {} #[doc = "`reset()` method sets RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS to value 0"] impl crate::Resettable for RXIPV4_UDP_CHECKSUM_DISABLE_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv4_udp_checksum_disabled_frames.rs b/src/eth0/rxipv4_udp_checksum_disabled_frames.rs index 0cb57b4c..7b419e7f 100644 --- a/src/eth0/rxipv4_udp_checksum_disabled_frames.rs +++ b/src/eth0/rxipv4_udp_checksum_disabled_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV4UDSBLFRM` reader - This field indicates the number of received good IPv4 datagrams which have the UDP payload with checksum disabled."] -pub type RXIPV4UDSBLFRM_R = crate::FieldReader; +pub type RXIPV4UDSBLFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of received good IPv4 datagrams which have the UDP payload with checksum disabled."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV4UDSBLFRM_R::new(self.bits) } } -#[doc = "Receive IPV4 UDP Checksum Disabled Frame Counter 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 [rxipv4_udp_checksum_disabled_frames](index.html) module"] +#[doc = "Receive IPV4 UDP Checksum Disabled Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv4_udp_checksum_disabled_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES_SPEC; impl crate::RegisterSpec for RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv4_udp_checksum_disabled_frames::R](R) reader structure"] -impl crate::Readable for RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv4_udp_checksum_disabled_frames::R`](R) reader structure"] +impl crate::Readable for RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES_SPEC {} #[doc = "`reset()` method sets RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES to value 0"] impl crate::Resettable for RXIPV4_UDP_CHECKSUM_DISABLED_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv6_good_frames.rs b/src/eth0/rxipv6_good_frames.rs index b71d3692..8f0f6ed2 100644 --- a/src/eth0/rxipv6_good_frames.rs +++ b/src/eth0/rxipv6_good_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV6_GOOD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV6GDFRM` reader - This field indicates the number of good IPv6 datagrams received with TCP, UDP, or ICMP payloads."] -pub type RXIPV6GDFRM_R = crate::FieldReader; +pub type RXIPV6GDFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IPv6 datagrams received with TCP, UDP, or ICMP payloads."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV6GDFRM_R::new(self.bits) } } -#[doc = "RxIPv6 Good Frames 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 [rxipv6_good_frames](index.html) module"] +#[doc = "RxIPv6 Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_good_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV6_GOOD_FRAMES_SPEC; impl crate::RegisterSpec for RXIPV6_GOOD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv6_good_frames::R](R) reader structure"] -impl crate::Readable for RXIPV6_GOOD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv6_good_frames::R`](R) reader structure"] +impl crate::Readable for RXIPV6_GOOD_FRAMES_SPEC {} #[doc = "`reset()` method sets RXIPV6_GOOD_FRAMES to value 0"] impl crate::Resettable for RXIPV6_GOOD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv6_good_octets.rs b/src/eth0/rxipv6_good_octets.rs index c629d65c..f2bb6d4b 100644 --- a/src/eth0/rxipv6_good_octets.rs +++ b/src/eth0/rxipv6_good_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV6_GOOD_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV6GDOCT` reader - Thsi field indicates the number of bytes received in good IPv6 datagrams encapsulating TCP, UDP or ICMPv6 data."] -pub type RXIPV6GDOCT_R = crate::FieldReader; +pub type RXIPV6GDOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Thsi field indicates the number of bytes received in good IPv6 datagrams encapsulating TCP, UDP or ICMPv6 data."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV6GDOCT_R::new(self.bits) } } -#[doc = "RxIPv6 Good Octets 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 [rxipv6_good_octets](index.html) module"] +#[doc = "RxIPv6 Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_good_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV6_GOOD_OCTETS_SPEC; impl crate::RegisterSpec for RXIPV6_GOOD_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv6_good_octets::R](R) reader structure"] -impl crate::Readable for RXIPV6_GOOD_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv6_good_octets::R`](R) reader structure"] +impl crate::Readable for RXIPV6_GOOD_OCTETS_SPEC {} #[doc = "`reset()` method sets RXIPV6_GOOD_OCTETS to value 0"] impl crate::Resettable for RXIPV6_GOOD_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv6_header_error_frames.rs b/src/eth0/rxipv6_header_error_frames.rs index a8f57b1a..278844a9 100644 --- a/src/eth0/rxipv6_header_error_frames.rs +++ b/src/eth0/rxipv6_header_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV6_HEADER_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV6HDRERRFRM` reader - This field indicates the number of IPv6 datagrams received with header errors (length or version mismatch)."] -pub type RXIPV6HDRERRFRM_R = crate::FieldReader; +pub type RXIPV6HDRERRFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of IPv6 datagrams received with header errors (length or version mismatch)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV6HDRERRFRM_R::new(self.bits) } } -#[doc = "Receive IPV6 Header Error Frame Counter 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 [rxipv6_header_error_frames](index.html) module"] +#[doc = "Receive IPV6 Header Error Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_header_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV6_HEADER_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RXIPV6_HEADER_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv6_header_error_frames::R](R) reader structure"] -impl crate::Readable for RXIPV6_HEADER_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv6_header_error_frames::R`](R) reader structure"] +impl crate::Readable for RXIPV6_HEADER_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RXIPV6_HEADER_ERROR_FRAMES to value 0"] impl crate::Resettable for RXIPV6_HEADER_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv6_header_error_octets.rs b/src/eth0/rxipv6_header_error_octets.rs index 713ed914..576ce95d 100644 --- a/src/eth0/rxipv6_header_error_octets.rs +++ b/src/eth0/rxipv6_header_error_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV6_HEADER_ERROR_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV6HDRERROCT` reader - This field indicates the number of bytes received in IPv6 datagrams with header errors (length or version mismatch). The value in the IPv6 headers Length field is used to update this counter."] -pub type RXIPV6HDRERROCT_R = crate::FieldReader; +pub type RXIPV6HDRERROCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in IPv6 datagrams with header errors (length or version mismatch). The value in the IPv6 headers Length field is used to update this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV6HDRERROCT_R::new(self.bits) } } -#[doc = "Receive IPV6 Header Error Octet Counter 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 [rxipv6_header_error_octets](index.html) module"] +#[doc = "Receive IPV6 Header Error Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_header_error_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV6_HEADER_ERROR_OCTETS_SPEC; impl crate::RegisterSpec for RXIPV6_HEADER_ERROR_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv6_header_error_octets::R](R) reader structure"] -impl crate::Readable for RXIPV6_HEADER_ERROR_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv6_header_error_octets::R`](R) reader structure"] +impl crate::Readable for RXIPV6_HEADER_ERROR_OCTETS_SPEC {} #[doc = "`reset()` method sets RXIPV6_HEADER_ERROR_OCTETS to value 0"] impl crate::Resettable for RXIPV6_HEADER_ERROR_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv6_no_payload_frames.rs b/src/eth0/rxipv6_no_payload_frames.rs index da4dd000..c943a82a 100644 --- a/src/eth0/rxipv6_no_payload_frames.rs +++ b/src/eth0/rxipv6_no_payload_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV6_NO_PAYLOAD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV6NOPAYFRM` reader - This field indicates the number of IPv6 datagram frames received that did not have a TCP, UDP, or ICMP payload. This includes all IPv6 datagrams with fragmentation or security extension headers."] -pub type RXIPV6NOPAYFRM_R = crate::FieldReader; +pub type RXIPV6NOPAYFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of IPv6 datagram frames received that did not have a TCP, UDP, or ICMP payload. This includes all IPv6 datagrams with fragmentation or security extension headers."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV6NOPAYFRM_R::new(self.bits) } } -#[doc = "Receive IPV6 No Payload Frame Counter 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 [rxipv6_no_payload_frames](index.html) module"] +#[doc = "Receive IPV6 No Payload Frame Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_no_payload_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV6_NO_PAYLOAD_FRAMES_SPEC; impl crate::RegisterSpec for RXIPV6_NO_PAYLOAD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv6_no_payload_frames::R](R) reader structure"] -impl crate::Readable for RXIPV6_NO_PAYLOAD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv6_no_payload_frames::R`](R) reader structure"] +impl crate::Readable for RXIPV6_NO_PAYLOAD_FRAMES_SPEC {} #[doc = "`reset()` method sets RXIPV6_NO_PAYLOAD_FRAMES to value 0"] impl crate::Resettable for RXIPV6_NO_PAYLOAD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxipv6_no_payload_octets.rs b/src/eth0/rxipv6_no_payload_octets.rs index 4d848264..4e2741b6 100644 --- a/src/eth0/rxipv6_no_payload_octets.rs +++ b/src/eth0/rxipv6_no_payload_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXIPV6_NO_PAYLOAD_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXIPV6NOPAYOCT` reader - This field indicates the number of bytes received in IPv6 datagrams that did not have a TCP, UDP, or ICMP payload. The value in the IPv6 headers Length field is used to update this counter."] -pub type RXIPV6NOPAYOCT_R = crate::FieldReader; +pub type RXIPV6NOPAYOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in IPv6 datagrams that did not have a TCP, UDP, or ICMP payload. The value in the IPv6 headers Length field is used to update this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXIPV6NOPAYOCT_R::new(self.bits) } } -#[doc = "Receive IPV6 No Payload Octet Counter 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 [rxipv6_no_payload_octets](index.html) module"] +#[doc = "Receive IPV6 No Payload Octet Counter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxipv6_no_payload_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXIPV6_NO_PAYLOAD_OCTETS_SPEC; impl crate::RegisterSpec for RXIPV6_NO_PAYLOAD_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxipv6_no_payload_octets::R](R) reader structure"] -impl crate::Readable for RXIPV6_NO_PAYLOAD_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxipv6_no_payload_octets::R`](R) reader structure"] +impl crate::Readable for RXIPV6_NO_PAYLOAD_OCTETS_SPEC {} #[doc = "`reset()` method sets RXIPV6_NO_PAYLOAD_OCTETS to value 0"] impl crate::Resettable for RXIPV6_NO_PAYLOAD_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxtcp_error_frames.rs b/src/eth0/rxtcp_error_frames.rs index 5f27246f..c49b153f 100644 --- a/src/eth0/rxtcp_error_frames.rs +++ b/src/eth0/rxtcp_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXTCP_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXTCPERRFRM` reader - This field indicates the number of good IP datagrams whose TCP payload has a checksum error."] -pub type RXTCPERRFRM_R = crate::FieldReader; +pub type RXTCPERRFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IP datagrams whose TCP payload has a checksum error."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXTCPERRFRM_R::new(self.bits) } } -#[doc = "RxTCP Error Frames 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 [rxtcp_error_frames](index.html) module"] +#[doc = "RxTCP Error Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxtcp_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXTCP_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RXTCP_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxtcp_error_frames::R](R) reader structure"] -impl crate::Readable for RXTCP_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxtcp_error_frames::R`](R) reader structure"] +impl crate::Readable for RXTCP_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RXTCP_ERROR_FRAMES to value 0"] impl crate::Resettable for RXTCP_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxtcp_error_octets.rs b/src/eth0/rxtcp_error_octets.rs index 987dd314..807f9459 100644 --- a/src/eth0/rxtcp_error_octets.rs +++ b/src/eth0/rxtcp_error_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXTCP_ERROR_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXTCPERROCT` reader - Thsi field indicates the number of bytes received in a TCP segment with checksum errors. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] -pub type RXTCPERROCT_R = crate::FieldReader; +pub type RXTCPERROCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Thsi field indicates the number of bytes received in a TCP segment with checksum errors. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXTCPERROCT_R::new(self.bits) } } -#[doc = "Receive TCP Error Octets 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 [rxtcp_error_octets](index.html) module"] +#[doc = "Receive TCP Error Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxtcp_error_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXTCP_ERROR_OCTETS_SPEC; impl crate::RegisterSpec for RXTCP_ERROR_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxtcp_error_octets::R](R) reader structure"] -impl crate::Readable for RXTCP_ERROR_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxtcp_error_octets::R`](R) reader structure"] +impl crate::Readable for RXTCP_ERROR_OCTETS_SPEC {} #[doc = "`reset()` method sets RXTCP_ERROR_OCTETS to value 0"] impl crate::Resettable for RXTCP_ERROR_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxtcp_good_frames.rs b/src/eth0/rxtcp_good_frames.rs index ca15de05..4003e357 100644 --- a/src/eth0/rxtcp_good_frames.rs +++ b/src/eth0/rxtcp_good_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXTCP_GOOD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXTCPGDFRM` reader - This field indicates the number of good IP datagrams with a good TCP payload."] -pub type RXTCPGDFRM_R = crate::FieldReader; +pub type RXTCPGDFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IP datagrams with a good TCP payload."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXTCPGDFRM_R::new(self.bits) } } -#[doc = "RxTCP Good Frames 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 [rxtcp_good_frames](index.html) module"] +#[doc = "RxTCP Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxtcp_good_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXTCP_GOOD_FRAMES_SPEC; impl crate::RegisterSpec for RXTCP_GOOD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxtcp_good_frames::R](R) reader structure"] -impl crate::Readable for RXTCP_GOOD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxtcp_good_frames::R`](R) reader structure"] +impl crate::Readable for RXTCP_GOOD_FRAMES_SPEC {} #[doc = "`reset()` method sets RXTCP_GOOD_FRAMES to value 0"] impl crate::Resettable for RXTCP_GOOD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxtcp_good_octets.rs b/src/eth0/rxtcp_good_octets.rs index 98f4d01c..5c57964a 100644 --- a/src/eth0/rxtcp_good_octets.rs +++ b/src/eth0/rxtcp_good_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXTCP_GOOD_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXTCPGDOCT` reader - This field indicates the number of bytes received in a good TCP segment. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] -pub type RXTCPGDOCT_R = crate::FieldReader; +pub type RXTCPGDOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in a good TCP segment. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXTCPGDOCT_R::new(self.bits) } } -#[doc = "Receive TCP Good Octets 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 [rxtcp_good_octets](index.html) module"] +#[doc = "Receive TCP Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxtcp_good_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXTCP_GOOD_OCTETS_SPEC; impl crate::RegisterSpec for RXTCP_GOOD_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxtcp_good_octets::R](R) reader structure"] -impl crate::Readable for RXTCP_GOOD_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxtcp_good_octets::R`](R) reader structure"] +impl crate::Readable for RXTCP_GOOD_OCTETS_SPEC {} #[doc = "`reset()` method sets RXTCP_GOOD_OCTETS to value 0"] impl crate::Resettable for RXTCP_GOOD_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxudp_error_frames.rs b/src/eth0/rxudp_error_frames.rs index d4860a99..9eed662a 100644 --- a/src/eth0/rxudp_error_frames.rs +++ b/src/eth0/rxudp_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXUDP_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXUDPERRFRM` reader - This field indicates the number of good IP datagrams whose UDP payload has a checksum error."] -pub type RXUDPERRFRM_R = crate::FieldReader; +pub type RXUDPERRFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IP datagrams whose UDP payload has a checksum error."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXUDPERRFRM_R::new(self.bits) } } -#[doc = "RxUDP Error Frames 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 [rxudp_error_frames](index.html) module"] +#[doc = "RxUDP Error Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxudp_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXUDP_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for RXUDP_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxudp_error_frames::R](R) reader structure"] -impl crate::Readable for RXUDP_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxudp_error_frames::R`](R) reader structure"] +impl crate::Readable for RXUDP_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets RXUDP_ERROR_FRAMES to value 0"] impl crate::Resettable for RXUDP_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxudp_error_octets.rs b/src/eth0/rxudp_error_octets.rs index 6cb3d7e0..87018d52 100644 --- a/src/eth0/rxudp_error_octets.rs +++ b/src/eth0/rxudp_error_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXUDP_ERROR_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXUDPERROCT` reader - This field indicates the number of bytes received in a UDP segment with checksum errors. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] -pub type RXUDPERROCT_R = crate::FieldReader; +pub type RXUDPERROCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in a UDP segment with checksum errors. This counter does not count the IP Header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXUDPERROCT_R::new(self.bits) } } -#[doc = "Receive UDP Error Octets 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 [rxudp_error_octets](index.html) module"] +#[doc = "Receive UDP Error Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxudp_error_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXUDP_ERROR_OCTETS_SPEC; impl crate::RegisterSpec for RXUDP_ERROR_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxudp_error_octets::R](R) reader structure"] -impl crate::Readable for RXUDP_ERROR_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxudp_error_octets::R`](R) reader structure"] +impl crate::Readable for RXUDP_ERROR_OCTETS_SPEC {} #[doc = "`reset()` method sets RXUDP_ERROR_OCTETS to value 0"] impl crate::Resettable for RXUDP_ERROR_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxudp_good_frames.rs b/src/eth0/rxudp_good_frames.rs index 2301d183..e47cdae6 100644 --- a/src/eth0/rxudp_good_frames.rs +++ b/src/eth0/rxudp_good_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXUDP_GOOD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXUDPGDFRM` reader - This field indicates the number of good IP datagrams with a good UDP payload. This counter is not updated when the counter is incremented."] -pub type RXUDPGDFRM_R = crate::FieldReader; +pub type RXUDPGDFRM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good IP datagrams with a good UDP payload. This counter is not updated when the counter is incremented."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXUDPGDFRM_R::new(self.bits) } } -#[doc = "RxUDP Good Frames 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 [rxudp_good_frames](index.html) module"] +#[doc = "RxUDP Good Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxudp_good_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXUDP_GOOD_FRAMES_SPEC; impl crate::RegisterSpec for RXUDP_GOOD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxudp_good_frames::R](R) reader structure"] -impl crate::Readable for RXUDP_GOOD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxudp_good_frames::R`](R) reader structure"] +impl crate::Readable for RXUDP_GOOD_FRAMES_SPEC {} #[doc = "`reset()` method sets RXUDP_GOOD_FRAMES to value 0"] impl crate::Resettable for RXUDP_GOOD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/rxudp_good_octets.rs b/src/eth0/rxudp_good_octets.rs index 817f8d37..7193549c 100644 --- a/src/eth0/rxudp_good_octets.rs +++ b/src/eth0/rxudp_good_octets.rs @@ -1,20 +1,7 @@ #[doc = "Register `RXUDP_GOOD_OCTETS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `RXUDPGDOCT` reader - This field indicates the number of bytes received in a good UDP segment. This counter does not count IP header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] -pub type RXUDPGDOCT_R = crate::FieldReader; +pub type RXUDPGDOCT_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes received in a good UDP segment. This counter does not count IP header bytes. The Ethernet header, FCS, pad, or IP pad bytes are not included in this counter."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RXUDPGDOCT_R::new(self.bits) } } -#[doc = "Receive UDP Good Octets 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 [rxudp_good_octets](index.html) module"] +#[doc = "Receive UDP Good Octets Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rxudp_good_octets::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RXUDP_GOOD_OCTETS_SPEC; impl crate::RegisterSpec for RXUDP_GOOD_OCTETS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [rxudp_good_octets::R](R) reader structure"] -impl crate::Readable for RXUDP_GOOD_OCTETS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`rxudp_good_octets::R`](R) reader structure"] +impl crate::Readable for RXUDP_GOOD_OCTETS_SPEC {} #[doc = "`reset()` method sets RXUDP_GOOD_OCTETS to value 0"] impl crate::Resettable for RXUDP_GOOD_OCTETS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/status.rs b/src/eth0/status.rs index fbb1aba1..b88257cc 100644 --- a/src/eth0/status.rs +++ b/src/eth0/status.rs @@ -1,111 +1,79 @@ #[doc = "Register `STATUS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `STATUS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TI` reader - Transmit Interrupt"] -pub type TI_R = crate::BitReader; +pub type TI_R = crate::BitReader; #[doc = "Field `TI` writer - Transmit Interrupt"] -pub type TI_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type TI_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TPS` reader - Transmit Process Stopped"] -pub type TPS_R = crate::BitReader; +pub type TPS_R = crate::BitReader; #[doc = "Field `TPS` writer - Transmit Process Stopped"] -pub type TPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type TPS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TU` reader - Transmit Buffer Unavailable"] -pub type TU_R = crate::BitReader; +pub type TU_R = crate::BitReader; #[doc = "Field `TU` writer - Transmit Buffer Unavailable"] -pub type TU_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type TU_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TJT` reader - Transmit Jabber Timeout"] -pub type TJT_R = crate::BitReader; +pub type TJT_R = crate::BitReader; #[doc = "Field `TJT` writer - Transmit Jabber Timeout"] -pub type TJT_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type TJT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OVF` reader - Receive Overflow"] -pub type OVF_R = crate::BitReader; +pub type OVF_R = crate::BitReader; #[doc = "Field `OVF` writer - Receive Overflow"] -pub type OVF_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type OVF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `UNF` reader - Transmit Underflow"] -pub type UNF_R = crate::BitReader; +pub type UNF_R = crate::BitReader; #[doc = "Field `UNF` writer - Transmit Underflow"] -pub type UNF_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type UNF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RI` reader - Receive Interrupt"] -pub type RI_R = crate::BitReader; +pub type RI_R = crate::BitReader; #[doc = "Field `RI` writer - Receive Interrupt"] -pub type RI_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type RI_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RU` reader - Receive Buffer Unavailable"] -pub type RU_R = crate::BitReader; +pub type RU_R = crate::BitReader; #[doc = "Field `RU` writer - Receive Buffer Unavailable"] -pub type RU_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type RU_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RPS` reader - Receive Process Stopped"] -pub type RPS_R = crate::BitReader; +pub type RPS_R = crate::BitReader; #[doc = "Field `RPS` writer - Receive Process Stopped"] -pub type RPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type RPS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RWT` reader - Receive Watchdog Timeout"] -pub type RWT_R = crate::BitReader; +pub type RWT_R = crate::BitReader; #[doc = "Field `RWT` writer - Receive Watchdog Timeout"] -pub type RWT_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type RWT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ETI` reader - Early Transmit Interrupt"] -pub type ETI_R = crate::BitReader; +pub type ETI_R = crate::BitReader; #[doc = "Field `ETI` writer - Early Transmit Interrupt"] -pub type ETI_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type ETI_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FBI` reader - Fatal Bus Error Interrupt"] -pub type FBI_R = crate::BitReader; +pub type FBI_R = crate::BitReader; #[doc = "Field `FBI` writer - Fatal Bus Error Interrupt"] -pub type FBI_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type FBI_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ERI` reader - Early Receive Interrupt"] -pub type ERI_R = crate::BitReader; +pub type ERI_R = crate::BitReader; #[doc = "Field `ERI` writer - Early Receive Interrupt"] -pub type ERI_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type ERI_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AIS` reader - Abnormal Interrupt Summary"] -pub type AIS_R = crate::BitReader; +pub type AIS_R = crate::BitReader; #[doc = "Field `AIS` writer - Abnormal Interrupt Summary"] -pub type AIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type AIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NIS` reader - Normal Interrupt Summary"] -pub type NIS_R = crate::BitReader; +pub type NIS_R = crate::BitReader; #[doc = "Field `NIS` writer - Normal Interrupt Summary"] -pub type NIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, STATUS_SPEC, bool, O>; +pub type NIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RS` reader - Received Process State"] -pub type RS_R = crate::FieldReader; +pub type RS_R = crate::FieldReader; #[doc = "Field `TS` reader - Transmit Process State"] -pub type TS_R = crate::FieldReader; +pub type TS_R = crate::FieldReader; #[doc = "Field `EB` reader - Error Bits"] -pub type EB_R = crate::FieldReader; +pub type EB_R = crate::FieldReader; #[doc = "Field `EMI` reader - ETH MMC Interrupt"] -pub type EMI_R = crate::BitReader; +pub type EMI_R = crate::BitReader; #[doc = "Field `EPI` reader - ETH PMT Interrupt"] -pub type EPI_R = crate::BitReader; +pub type EPI_R = crate::BitReader; #[doc = "Field `TTI` reader - Timestamp Trigger Interrupt"] -pub type TTI_R = crate::BitReader; +pub type TTI_R = crate::BitReader; impl R { #[doc = "Bit 0 - Transmit Interrupt"] #[inline(always)] @@ -217,112 +185,113 @@ impl W { #[doc = "Bit 0 - Transmit Interrupt"] #[inline(always)] #[must_use] - pub fn ti(&mut self) -> TI_W<0> { - TI_W::new(self) + pub fn ti(&mut self) -> TI_W { + TI_W::new(self, 0) } #[doc = "Bit 1 - Transmit Process Stopped"] #[inline(always)] #[must_use] - pub fn tps(&mut self) -> TPS_W<1> { - TPS_W::new(self) + pub fn tps(&mut self) -> TPS_W { + TPS_W::new(self, 1) } #[doc = "Bit 2 - Transmit Buffer Unavailable"] #[inline(always)] #[must_use] - pub fn tu(&mut self) -> TU_W<2> { - TU_W::new(self) + pub fn tu(&mut self) -> TU_W { + TU_W::new(self, 2) } #[doc = "Bit 3 - Transmit Jabber Timeout"] #[inline(always)] #[must_use] - pub fn tjt(&mut self) -> TJT_W<3> { - TJT_W::new(self) + pub fn tjt(&mut self) -> TJT_W { + TJT_W::new(self, 3) } #[doc = "Bit 4 - Receive Overflow"] #[inline(always)] #[must_use] - pub fn ovf(&mut self) -> OVF_W<4> { - OVF_W::new(self) + pub fn ovf(&mut self) -> OVF_W { + OVF_W::new(self, 4) } #[doc = "Bit 5 - Transmit Underflow"] #[inline(always)] #[must_use] - pub fn unf(&mut self) -> UNF_W<5> { - UNF_W::new(self) + pub fn unf(&mut self) -> UNF_W { + UNF_W::new(self, 5) } #[doc = "Bit 6 - Receive Interrupt"] #[inline(always)] #[must_use] - pub fn ri(&mut self) -> RI_W<6> { - RI_W::new(self) + pub fn ri(&mut self) -> RI_W { + RI_W::new(self, 6) } #[doc = "Bit 7 - Receive Buffer Unavailable"] #[inline(always)] #[must_use] - pub fn ru(&mut self) -> RU_W<7> { - RU_W::new(self) + pub fn ru(&mut self) -> RU_W { + RU_W::new(self, 7) } #[doc = "Bit 8 - Receive Process Stopped"] #[inline(always)] #[must_use] - pub fn rps(&mut self) -> RPS_W<8> { - RPS_W::new(self) + pub fn rps(&mut self) -> RPS_W { + RPS_W::new(self, 8) } #[doc = "Bit 9 - Receive Watchdog Timeout"] #[inline(always)] #[must_use] - pub fn rwt(&mut self) -> RWT_W<9> { - RWT_W::new(self) + pub fn rwt(&mut self) -> RWT_W { + RWT_W::new(self, 9) } #[doc = "Bit 10 - Early Transmit Interrupt"] #[inline(always)] #[must_use] - pub fn eti(&mut self) -> ETI_W<10> { - ETI_W::new(self) + pub fn eti(&mut self) -> ETI_W { + ETI_W::new(self, 10) } #[doc = "Bit 13 - Fatal Bus Error Interrupt"] #[inline(always)] #[must_use] - pub fn fbi(&mut self) -> FBI_W<13> { - FBI_W::new(self) + pub fn fbi(&mut self) -> FBI_W { + FBI_W::new(self, 13) } #[doc = "Bit 14 - Early Receive Interrupt"] #[inline(always)] #[must_use] - pub fn eri(&mut self) -> ERI_W<14> { - ERI_W::new(self) + pub fn eri(&mut self) -> ERI_W { + ERI_W::new(self, 14) } #[doc = "Bit 15 - Abnormal Interrupt Summary"] #[inline(always)] #[must_use] - pub fn ais(&mut self) -> AIS_W<15> { - AIS_W::new(self) + pub fn ais(&mut self) -> AIS_W { + AIS_W::new(self, 15) } #[doc = "Bit 16 - Normal Interrupt Summary"] #[inline(always)] #[must_use] - pub fn nis(&mut self) -> NIS_W<16> { - NIS_W::new(self) + pub fn nis(&mut self) -> NIS_W { + NIS_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "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 [status](index.html) module"] +#[doc = "Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`status::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`status::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct STATUS_SPEC; impl crate::RegisterSpec for STATUS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [status::R](R) reader structure"] -impl crate::Readable for STATUS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [status::W](W) writer structure"] +#[doc = "`read()` method returns [`status::R`](R) reader structure"] +impl crate::Readable for STATUS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"] impl crate::Writable for STATUS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/sub_second_increment.rs b/src/eth0/sub_second_increment.rs index 77e5d125..aa55108d 100644 --- a/src/eth0/sub_second_increment.rs +++ b/src/eth0/sub_second_increment.rs @@ -1,43 +1,11 @@ #[doc = "Register `SUB_SECOND_INCREMENT` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `SUB_SECOND_INCREMENT` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SSINC` reader - Sub-second Increment Value"] -pub type SSINC_R = crate::FieldReader; +pub type SSINC_R = crate::FieldReader; #[doc = "Field `SSINC` writer - Sub-second Increment Value"] -pub type SSINC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SUB_SECOND_INCREMENT_SPEC, u8, u8, 8, O>; +pub type SSINC_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Sub-second Increment Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:7 - Sub-second Increment Value"] #[inline(always)] #[must_use] - pub fn ssinc(&mut self) -> SSINC_W<0> { - SSINC_W::new(self) + pub fn ssinc(&mut self) -> SSINC_W { + SSINC_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Sub-Second Increment 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 [sub_second_increment](index.html) module"] +#[doc = "Sub-Second Increment Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sub_second_increment::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sub_second_increment::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SUB_SECOND_INCREMENT_SPEC; impl crate::RegisterSpec for SUB_SECOND_INCREMENT_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [sub_second_increment::R](R) reader structure"] -impl crate::Readable for SUB_SECOND_INCREMENT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [sub_second_increment::W](W) writer structure"] +#[doc = "`read()` method returns [`sub_second_increment::R`](R) reader structure"] +impl crate::Readable for SUB_SECOND_INCREMENT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sub_second_increment::W`](W) writer structure"] impl crate::Writable for SUB_SECOND_INCREMENT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/system_time_higher_word_seconds.rs b/src/eth0/system_time_higher_word_seconds.rs index 14b5f259..22e42230 100644 --- a/src/eth0/system_time_higher_word_seconds.rs +++ b/src/eth0/system_time_higher_word_seconds.rs @@ -1,43 +1,11 @@ #[doc = "Register `SYSTEM_TIME_HIGHER_WORD_SECONDS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `SYSTEM_TIME_HIGHER_WORD_SECONDS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TSHWR` reader - Timestamp Higher Word Register"] -pub type TSHWR_R = crate::FieldReader; +pub type TSHWR_R = crate::FieldReader; #[doc = "Field `TSHWR` writer - Timestamp Higher Word Register"] -pub type TSHWR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYSTEM_TIME_HIGHER_WORD_SECONDS_SPEC, u16, u16, 16, O>; +pub type TSHWR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Timestamp Higher Word Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Timestamp Higher Word Register"] #[inline(always)] #[must_use] - pub fn tshwr(&mut self) -> TSHWR_W<0> { - TSHWR_W::new(self) + pub fn tshwr(&mut self) -> TSHWR_W { + TSHWR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "System Time - Higher Word Seconds 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 [system_time_higher_word_seconds](index.html) module"] +#[doc = "System Time - Higher Word Seconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_higher_word_seconds::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`system_time_higher_word_seconds::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SYSTEM_TIME_HIGHER_WORD_SECONDS_SPEC; impl crate::RegisterSpec for SYSTEM_TIME_HIGHER_WORD_SECONDS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [system_time_higher_word_seconds::R](R) reader structure"] -impl crate::Readable for SYSTEM_TIME_HIGHER_WORD_SECONDS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [system_time_higher_word_seconds::W](W) writer structure"] +#[doc = "`read()` method returns [`system_time_higher_word_seconds::R`](R) reader structure"] +impl crate::Readable for SYSTEM_TIME_HIGHER_WORD_SECONDS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`system_time_higher_word_seconds::W`](W) writer structure"] impl crate::Writable for SYSTEM_TIME_HIGHER_WORD_SECONDS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/system_time_nanoseconds.rs b/src/eth0/system_time_nanoseconds.rs index 3cdea211..6dc29713 100644 --- a/src/eth0/system_time_nanoseconds.rs +++ b/src/eth0/system_time_nanoseconds.rs @@ -1,20 +1,7 @@ #[doc = "Register `SYSTEM_TIME_NANOSECONDS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TSSS` reader - Timestamp Sub Seconds"] -pub type TSSS_R = crate::FieldReader; +pub type TSSS_R = crate::FieldReader; impl R { #[doc = "Bits 0:30 - Timestamp Sub Seconds"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TSSS_R::new(self.bits & 0x7fff_ffff) } } -#[doc = "System Time Nanoseconds 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 [system_time_nanoseconds](index.html) module"] +#[doc = "System Time Nanoseconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_nanoseconds::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SYSTEM_TIME_NANOSECONDS_SPEC; impl crate::RegisterSpec for SYSTEM_TIME_NANOSECONDS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [system_time_nanoseconds::R](R) reader structure"] -impl crate::Readable for SYSTEM_TIME_NANOSECONDS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`system_time_nanoseconds::R`](R) reader structure"] +impl crate::Readable for SYSTEM_TIME_NANOSECONDS_SPEC {} #[doc = "`reset()` method sets SYSTEM_TIME_NANOSECONDS to value 0"] impl crate::Resettable for SYSTEM_TIME_NANOSECONDS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/system_time_nanoseconds_update.rs b/src/eth0/system_time_nanoseconds_update.rs index 1d5e5474..ff14d820 100644 --- a/src/eth0/system_time_nanoseconds_update.rs +++ b/src/eth0/system_time_nanoseconds_update.rs @@ -1,47 +1,15 @@ #[doc = "Register `SYSTEM_TIME_NANOSECONDS_UPDATE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `SYSTEM_TIME_NANOSECONDS_UPDATE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TSSS` reader - Timestamp Sub Second"] -pub type TSSS_R = crate::FieldReader; +pub type TSSS_R = crate::FieldReader; #[doc = "Field `TSSS` writer - Timestamp Sub Second"] -pub type TSSS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYSTEM_TIME_NANOSECONDS_UPDATE_SPEC, u32, u32, 31, O>; +pub type TSSS_W<'a, REG> = crate::FieldWriter<'a, REG, 31, u32>; #[doc = "Field `ADDSUB` reader - Add or subtract time"] -pub type ADDSUB_R = crate::BitReader; +pub type ADDSUB_R = crate::BitReader; #[doc = "Field `ADDSUB` writer - Add or subtract time"] -pub type ADDSUB_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYSTEM_TIME_NANOSECONDS_UPDATE_SPEC, bool, O>; +pub type ADDSUB_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:30 - Timestamp Sub Second"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:30 - Timestamp Sub Second"] #[inline(always)] #[must_use] - pub fn tsss(&mut self) -> TSSS_W<0> { - TSSS_W::new(self) + pub fn tsss(&mut self) -> TSSS_W { + TSSS_W::new(self, 0) } #[doc = "Bit 31 - Add or subtract time"] #[inline(always)] #[must_use] - pub fn addsub(&mut self) -> ADDSUB_W<31> { - ADDSUB_W::new(self) + pub fn addsub(&mut self) -> ADDSUB_W { + ADDSUB_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "System Time Nanoseconds Update 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 [system_time_nanoseconds_update](index.html) module"] +#[doc = "System Time Nanoseconds Update Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_nanoseconds_update::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`system_time_nanoseconds_update::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SYSTEM_TIME_NANOSECONDS_UPDATE_SPEC; impl crate::RegisterSpec for SYSTEM_TIME_NANOSECONDS_UPDATE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [system_time_nanoseconds_update::R](R) reader structure"] -impl crate::Readable for SYSTEM_TIME_NANOSECONDS_UPDATE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [system_time_nanoseconds_update::W](W) writer structure"] +#[doc = "`read()` method returns [`system_time_nanoseconds_update::R`](R) reader structure"] +impl crate::Readable for SYSTEM_TIME_NANOSECONDS_UPDATE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`system_time_nanoseconds_update::W`](W) writer structure"] impl crate::Writable for SYSTEM_TIME_NANOSECONDS_UPDATE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/system_time_seconds.rs b/src/eth0/system_time_seconds.rs index 59bf80bb..4f0b1cd3 100644 --- a/src/eth0/system_time_seconds.rs +++ b/src/eth0/system_time_seconds.rs @@ -1,20 +1,7 @@ #[doc = "Register `SYSTEM_TIME_SECONDS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TSS` reader - Timestamp Second"] -pub type TSS_R = crate::FieldReader; +pub type TSS_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Timestamp Second"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TSS_R::new(self.bits) } } -#[doc = "System Time - Seconds 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 [system_time_seconds](index.html) module"] +#[doc = "System Time - Seconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_seconds::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SYSTEM_TIME_SECONDS_SPEC; impl crate::RegisterSpec for SYSTEM_TIME_SECONDS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [system_time_seconds::R](R) reader structure"] -impl crate::Readable for SYSTEM_TIME_SECONDS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`system_time_seconds::R`](R) reader structure"] +impl crate::Readable for SYSTEM_TIME_SECONDS_SPEC {} #[doc = "`reset()` method sets SYSTEM_TIME_SECONDS to value 0"] impl crate::Resettable for SYSTEM_TIME_SECONDS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/system_time_seconds_update.rs b/src/eth0/system_time_seconds_update.rs index 97473715..7c9cdbfd 100644 --- a/src/eth0/system_time_seconds_update.rs +++ b/src/eth0/system_time_seconds_update.rs @@ -1,43 +1,11 @@ #[doc = "Register `SYSTEM_TIME_SECONDS_UPDATE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `SYSTEM_TIME_SECONDS_UPDATE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TSS` reader - Timestamp Second"] -pub type TSS_R = crate::FieldReader; +pub type TSS_R = crate::FieldReader; #[doc = "Field `TSS` writer - Timestamp Second"] -pub type TSS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYSTEM_TIME_SECONDS_UPDATE_SPEC, u32, u32, 32, O>; +pub type TSS_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Timestamp Second"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Timestamp Second"] #[inline(always)] #[must_use] - pub fn tss(&mut self) -> TSS_W<0> { - TSS_W::new(self) + pub fn tss(&mut self) -> TSS_W { + TSS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "System Time - Seconds Update 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 [system_time_seconds_update](index.html) module"] +#[doc = "System Time - Seconds Update Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`system_time_seconds_update::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`system_time_seconds_update::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SYSTEM_TIME_SECONDS_UPDATE_SPEC; impl crate::RegisterSpec for SYSTEM_TIME_SECONDS_UPDATE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [system_time_seconds_update::R](R) reader structure"] -impl crate::Readable for SYSTEM_TIME_SECONDS_UPDATE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [system_time_seconds_update::W](W) writer structure"] +#[doc = "`read()` method returns [`system_time_seconds_update::R`](R) reader structure"] +impl crate::Readable for SYSTEM_TIME_SECONDS_UPDATE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`system_time_seconds_update::W`](W) writer structure"] impl crate::Writable for SYSTEM_TIME_SECONDS_UPDATE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/target_time_nanoseconds.rs b/src/eth0/target_time_nanoseconds.rs index 83ae0849..d8413efb 100644 --- a/src/eth0/target_time_nanoseconds.rs +++ b/src/eth0/target_time_nanoseconds.rs @@ -1,45 +1,13 @@ #[doc = "Register `TARGET_TIME_NANOSECONDS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `TARGET_TIME_NANOSECONDS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TTSLO` reader - Target Timestamp Low Register"] -pub type TTSLO_R = crate::FieldReader; +pub type TTSLO_R = crate::FieldReader; #[doc = "Field `TTSLO` writer - Target Timestamp Low Register"] -pub type TTSLO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TARGET_TIME_NANOSECONDS_SPEC, u32, u32, 31, O>; +pub type TTSLO_W<'a, REG> = crate::FieldWriter<'a, REG, 31, u32>; #[doc = "Field `TRGTBUSY` reader - Target Time Register Busy"] -pub type TRGTBUSY_R = crate::BitReader; +pub type TRGTBUSY_R = crate::BitReader; impl R { #[doc = "Bits 0:30 - Target Timestamp Low Register"] #[inline(always)] @@ -56,28 +24,29 @@ impl W { #[doc = "Bits 0:30 - Target Timestamp Low Register"] #[inline(always)] #[must_use] - pub fn ttslo(&mut self) -> TTSLO_W<0> { - TTSLO_W::new(self) + pub fn ttslo(&mut self) -> TTSLO_W { + TTSLO_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Target Time Nanoseconds 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 [target_time_nanoseconds](index.html) module"] +#[doc = "Target Time Nanoseconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`target_time_nanoseconds::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`target_time_nanoseconds::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TARGET_TIME_NANOSECONDS_SPEC; impl crate::RegisterSpec for TARGET_TIME_NANOSECONDS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [target_time_nanoseconds::R](R) reader structure"] -impl crate::Readable for TARGET_TIME_NANOSECONDS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [target_time_nanoseconds::W](W) writer structure"] +#[doc = "`read()` method returns [`target_time_nanoseconds::R`](R) reader structure"] +impl crate::Readable for TARGET_TIME_NANOSECONDS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`target_time_nanoseconds::W`](W) writer structure"] impl crate::Writable for TARGET_TIME_NANOSECONDS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/target_time_seconds.rs b/src/eth0/target_time_seconds.rs index 50b290ab..8570de1e 100644 --- a/src/eth0/target_time_seconds.rs +++ b/src/eth0/target_time_seconds.rs @@ -1,43 +1,11 @@ #[doc = "Register `TARGET_TIME_SECONDS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `TARGET_TIME_SECONDS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TSTR` reader - Target Time Seconds Register"] -pub type TSTR_R = crate::FieldReader; +pub type TSTR_R = crate::FieldReader; #[doc = "Field `TSTR` writer - Target Time Seconds Register"] -pub type TSTR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TARGET_TIME_SECONDS_SPEC, u32, u32, 32, O>; +pub type TSTR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Target Time Seconds Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Target Time Seconds Register"] #[inline(always)] #[must_use] - pub fn tstr(&mut self) -> TSTR_W<0> { - TSTR_W::new(self) + pub fn tstr(&mut self) -> TSTR_W { + TSTR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Target Time Seconds 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 [target_time_seconds](index.html) module"] +#[doc = "Target Time Seconds Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`target_time_seconds::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`target_time_seconds::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TARGET_TIME_SECONDS_SPEC; impl crate::RegisterSpec for TARGET_TIME_SECONDS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [target_time_seconds::R](R) reader structure"] -impl crate::Readable for TARGET_TIME_SECONDS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [target_time_seconds::W](W) writer structure"] +#[doc = "`read()` method returns [`target_time_seconds::R`](R) reader structure"] +impl crate::Readable for TARGET_TIME_SECONDS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`target_time_seconds::W`](W) writer structure"] impl crate::Writable for TARGET_TIME_SECONDS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/timestamp_addend.rs b/src/eth0/timestamp_addend.rs index 48024f83..2c0d30e8 100644 --- a/src/eth0/timestamp_addend.rs +++ b/src/eth0/timestamp_addend.rs @@ -1,43 +1,11 @@ #[doc = "Register `TIMESTAMP_ADDEND` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `TIMESTAMP_ADDEND` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TSAR` reader - Timestamp Addend Register"] -pub type TSAR_R = crate::FieldReader; +pub type TSAR_R = crate::FieldReader; #[doc = "Field `TSAR` writer - Timestamp Addend Register"] -pub type TSAR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIMESTAMP_ADDEND_SPEC, u32, u32, 32, O>; +pub type TSAR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Timestamp Addend Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Timestamp Addend Register"] #[inline(always)] #[must_use] - pub fn tsar(&mut self) -> TSAR_W<0> { - TSAR_W::new(self) + pub fn tsar(&mut self) -> TSAR_W { + TSAR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Timestamp Addend 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 [timestamp_addend](index.html) module"] +#[doc = "Timestamp Addend Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timestamp_addend::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`timestamp_addend::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TIMESTAMP_ADDEND_SPEC; impl crate::RegisterSpec for TIMESTAMP_ADDEND_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [timestamp_addend::R](R) reader structure"] -impl crate::Readable for TIMESTAMP_ADDEND_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [timestamp_addend::W](W) writer structure"] +#[doc = "`read()` method returns [`timestamp_addend::R`](R) reader structure"] +impl crate::Readable for TIMESTAMP_ADDEND_SPEC {} +#[doc = "`write(|w| ..)` method takes [`timestamp_addend::W`](W) writer structure"] impl crate::Writable for TIMESTAMP_ADDEND_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/timestamp_control.rs b/src/eth0/timestamp_control.rs index be7653d1..cc6166b8 100644 --- a/src/eth0/timestamp_control.rs +++ b/src/eth0/timestamp_control.rs @@ -1,103 +1,71 @@ #[doc = "Register `TIMESTAMP_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) - } -} +pub type R = crate::R; #[doc = "Register `TIMESTAMP_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) - } -} +pub type W = crate::W; #[doc = "Field `TSENA` reader - Timestamp Enable"] -pub type TSENA_R = crate::BitReader; +pub type TSENA_R = crate::BitReader; #[doc = "Field `TSENA` writer - Timestamp Enable"] -pub type TSENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSCFUPDT` reader - Timestamp Fine or Coarse Update"] -pub type TSCFUPDT_R = crate::BitReader; +pub type TSCFUPDT_R = crate::BitReader; #[doc = "Field `TSCFUPDT` writer - Timestamp Fine or Coarse Update"] -pub type TSCFUPDT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSCFUPDT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSINIT` reader - Timestamp Initialize"] -pub type TSINIT_R = crate::BitReader; +pub type TSINIT_R = crate::BitReader; #[doc = "Field `TSINIT` writer - Timestamp Initialize"] -pub type TSINIT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSINIT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSUPDT` reader - Timestamp Update"] -pub type TSUPDT_R = crate::BitReader; +pub type TSUPDT_R = crate::BitReader; #[doc = "Field `TSUPDT` writer - Timestamp Update"] -pub type TSUPDT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSUPDT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSTRIG` reader - Timestamp Interrupt Trigger Enable"] -pub type TSTRIG_R = crate::BitReader; +pub type TSTRIG_R = crate::BitReader; #[doc = "Field `TSTRIG` writer - Timestamp Interrupt Trigger Enable"] -pub type TSTRIG_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSTRIG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSADDREG` reader - Addend Reg Update"] -pub type TSADDREG_R = crate::BitReader; +pub type TSADDREG_R = crate::BitReader; #[doc = "Field `TSADDREG` writer - Addend Reg Update"] -pub type TSADDREG_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSADDREG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSENALL` reader - Enable Timestamp for All Frames"] -pub type TSENALL_R = crate::BitReader; +pub type TSENALL_R = crate::BitReader; #[doc = "Field `TSENALL` writer - Enable Timestamp for All Frames"] -pub type TSENALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSENALL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSCTRLSSR` reader - Timestamp Digital or Binary Rollover Control"] -pub type TSCTRLSSR_R = crate::BitReader; +pub type TSCTRLSSR_R = crate::BitReader; #[doc = "Field `TSCTRLSSR` writer - Timestamp Digital or Binary Rollover Control"] -pub type TSCTRLSSR_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSCTRLSSR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSVER2ENA` reader - Enable PTP packet Processing for Version 2 Format"] -pub type TSVER2ENA_R = crate::BitReader; +pub type TSVER2ENA_R = crate::BitReader; #[doc = "Field `TSVER2ENA` writer - Enable PTP packet Processing for Version 2 Format"] -pub type TSVER2ENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSVER2ENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSIPENA` reader - Enable Processing of PTP over Ethernet Frames"] -pub type TSIPENA_R = crate::BitReader; +pub type TSIPENA_R = crate::BitReader; #[doc = "Field `TSIPENA` writer - Enable Processing of PTP over Ethernet Frames"] -pub type TSIPENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSIPENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSIPV6ENA` reader - Enable Processing of PTP Frames Sent Over IPv6-UDP"] -pub type TSIPV6ENA_R = crate::BitReader; +pub type TSIPV6ENA_R = crate::BitReader; #[doc = "Field `TSIPV6ENA` writer - Enable Processing of PTP Frames Sent Over IPv6-UDP"] -pub type TSIPV6ENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSIPV6ENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSIPV4ENA` reader - Enable Processing of PTP Frames Sent over IPv4-UDP"] -pub type TSIPV4ENA_R = crate::BitReader; +pub type TSIPV4ENA_R = crate::BitReader; #[doc = "Field `TSIPV4ENA` writer - Enable Processing of PTP Frames Sent over IPv4-UDP"] -pub type TSIPV4ENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSIPV4ENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSEVNTENA` reader - Enable Timestamp Snapshot for Event Messages"] -pub type TSEVNTENA_R = crate::BitReader; +pub type TSEVNTENA_R = crate::BitReader; #[doc = "Field `TSEVNTENA` writer - Enable Timestamp Snapshot for Event Messages"] -pub type TSEVNTENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSEVNTENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TSMSTRENA` reader - Enable Snapshot for Messages Relevant to Master"] -pub type TSMSTRENA_R = crate::BitReader; +pub type TSMSTRENA_R = crate::BitReader; #[doc = "Field `TSMSTRENA` writer - Enable Snapshot for Messages Relevant to Master"] -pub type TSMSTRENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSMSTRENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SNAPTYPSEL` reader - Select PTP packets for Taking Snapshots"] -pub type SNAPTYPSEL_R = crate::FieldReader; +pub type SNAPTYPSEL_R = crate::FieldReader; #[doc = "Field `SNAPTYPSEL` writer - Select PTP packets for Taking Snapshots"] -pub type SNAPTYPSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, u8, u8, 2, O>; +pub type SNAPTYPSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `TSENMACADDR` reader - Enable MAC address for PTP Frame Filtering"] -pub type TSENMACADDR_R = crate::BitReader; +pub type TSENMACADDR_R = crate::BitReader; #[doc = "Field `TSENMACADDR` writer - Enable MAC address for PTP Frame Filtering"] -pub type TSENMACADDR_W<'a, const O: u8> = crate::BitWriter<'a, u32, TIMESTAMP_CONTROL_SPEC, bool, O>; +pub type TSENMACADDR_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Timestamp Enable"] #[inline(always)] @@ -184,118 +152,119 @@ impl W { #[doc = "Bit 0 - Timestamp Enable"] #[inline(always)] #[must_use] - pub fn tsena(&mut self) -> TSENA_W<0> { - TSENA_W::new(self) + pub fn tsena(&mut self) -> TSENA_W { + TSENA_W::new(self, 0) } #[doc = "Bit 1 - Timestamp Fine or Coarse Update"] #[inline(always)] #[must_use] - pub fn tscfupdt(&mut self) -> TSCFUPDT_W<1> { - TSCFUPDT_W::new(self) + pub fn tscfupdt(&mut self) -> TSCFUPDT_W { + TSCFUPDT_W::new(self, 1) } #[doc = "Bit 2 - Timestamp Initialize"] #[inline(always)] #[must_use] - pub fn tsinit(&mut self) -> TSINIT_W<2> { - TSINIT_W::new(self) + pub fn tsinit(&mut self) -> TSINIT_W { + TSINIT_W::new(self, 2) } #[doc = "Bit 3 - Timestamp Update"] #[inline(always)] #[must_use] - pub fn tsupdt(&mut self) -> TSUPDT_W<3> { - TSUPDT_W::new(self) + pub fn tsupdt(&mut self) -> TSUPDT_W { + TSUPDT_W::new(self, 3) } #[doc = "Bit 4 - Timestamp Interrupt Trigger Enable"] #[inline(always)] #[must_use] - pub fn tstrig(&mut self) -> TSTRIG_W<4> { - TSTRIG_W::new(self) + pub fn tstrig(&mut self) -> TSTRIG_W { + TSTRIG_W::new(self, 4) } #[doc = "Bit 5 - Addend Reg Update"] #[inline(always)] #[must_use] - pub fn tsaddreg(&mut self) -> TSADDREG_W<5> { - TSADDREG_W::new(self) + pub fn tsaddreg(&mut self) -> TSADDREG_W { + TSADDREG_W::new(self, 5) } #[doc = "Bit 8 - Enable Timestamp for All Frames"] #[inline(always)] #[must_use] - pub fn tsenall(&mut self) -> TSENALL_W<8> { - TSENALL_W::new(self) + pub fn tsenall(&mut self) -> TSENALL_W { + TSENALL_W::new(self, 8) } #[doc = "Bit 9 - Timestamp Digital or Binary Rollover Control"] #[inline(always)] #[must_use] - pub fn tsctrlssr(&mut self) -> TSCTRLSSR_W<9> { - TSCTRLSSR_W::new(self) + pub fn tsctrlssr(&mut self) -> TSCTRLSSR_W { + TSCTRLSSR_W::new(self, 9) } #[doc = "Bit 10 - Enable PTP packet Processing for Version 2 Format"] #[inline(always)] #[must_use] - pub fn tsver2ena(&mut self) -> TSVER2ENA_W<10> { - TSVER2ENA_W::new(self) + pub fn tsver2ena(&mut self) -> TSVER2ENA_W { + TSVER2ENA_W::new(self, 10) } #[doc = "Bit 11 - Enable Processing of PTP over Ethernet Frames"] #[inline(always)] #[must_use] - pub fn tsipena(&mut self) -> TSIPENA_W<11> { - TSIPENA_W::new(self) + pub fn tsipena(&mut self) -> TSIPENA_W { + TSIPENA_W::new(self, 11) } #[doc = "Bit 12 - Enable Processing of PTP Frames Sent Over IPv6-UDP"] #[inline(always)] #[must_use] - pub fn tsipv6ena(&mut self) -> TSIPV6ENA_W<12> { - TSIPV6ENA_W::new(self) + pub fn tsipv6ena(&mut self) -> TSIPV6ENA_W { + TSIPV6ENA_W::new(self, 12) } #[doc = "Bit 13 - Enable Processing of PTP Frames Sent over IPv4-UDP"] #[inline(always)] #[must_use] - pub fn tsipv4ena(&mut self) -> TSIPV4ENA_W<13> { - TSIPV4ENA_W::new(self) + pub fn tsipv4ena(&mut self) -> TSIPV4ENA_W { + TSIPV4ENA_W::new(self, 13) } #[doc = "Bit 14 - Enable Timestamp Snapshot for Event Messages"] #[inline(always)] #[must_use] - pub fn tsevntena(&mut self) -> TSEVNTENA_W<14> { - TSEVNTENA_W::new(self) + pub fn tsevntena(&mut self) -> TSEVNTENA_W { + TSEVNTENA_W::new(self, 14) } #[doc = "Bit 15 - Enable Snapshot for Messages Relevant to Master"] #[inline(always)] #[must_use] - pub fn tsmstrena(&mut self) -> TSMSTRENA_W<15> { - TSMSTRENA_W::new(self) + pub fn tsmstrena(&mut self) -> TSMSTRENA_W { + TSMSTRENA_W::new(self, 15) } #[doc = "Bits 16:17 - Select PTP packets for Taking Snapshots"] #[inline(always)] #[must_use] - pub fn snaptypsel(&mut self) -> SNAPTYPSEL_W<16> { - SNAPTYPSEL_W::new(self) + pub fn snaptypsel(&mut self) -> SNAPTYPSEL_W { + SNAPTYPSEL_W::new(self, 16) } #[doc = "Bit 18 - Enable MAC address for PTP Frame Filtering"] #[inline(always)] #[must_use] - pub fn tsenmacaddr(&mut self) -> TSENMACADDR_W<18> { - TSENMACADDR_W::new(self) + pub fn tsenmacaddr(&mut self) -> TSENMACADDR_W { + TSENMACADDR_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Timestamp 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 [timestamp_control](index.html) module"] +#[doc = "Timestamp Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timestamp_control::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`timestamp_control::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TIMESTAMP_CONTROL_SPEC; impl crate::RegisterSpec for TIMESTAMP_CONTROL_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [timestamp_control::R](R) reader structure"] -impl crate::Readable for TIMESTAMP_CONTROL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [timestamp_control::W](W) writer structure"] +#[doc = "`read()` method returns [`timestamp_control::R`](R) reader structure"] +impl crate::Readable for TIMESTAMP_CONTROL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`timestamp_control::W`](W) writer structure"] impl crate::Writable for TIMESTAMP_CONTROL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/timestamp_status.rs b/src/eth0/timestamp_status.rs index 8abbf8a9..28e6b979 100644 --- a/src/eth0/timestamp_status.rs +++ b/src/eth0/timestamp_status.rs @@ -1,36 +1,23 @@ #[doc = "Register `TIMESTAMP_STATUS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TSSOVF` reader - Timestamp Seconds Overflow"] -pub type TSSOVF_R = crate::BitReader; +pub type TSSOVF_R = crate::BitReader; #[doc = "Field `TSTARGT` reader - Timestamp Target Time Reached"] -pub type TSTARGT_R = crate::BitReader; +pub type TSTARGT_R = crate::BitReader; #[doc = "Field `TSTRGTERR` reader - Timestamp Target Time Error"] -pub type TSTRGTERR_R = crate::BitReader; +pub type TSTRGTERR_R = crate::BitReader; #[doc = "Field `TSTARGT1` reader - Timestamp Target Time Reached for Target Time PPS1"] -pub type TSTARGT1_R = crate::BitReader; +pub type TSTARGT1_R = crate::BitReader; #[doc = "Field `TSTRGTERR1` reader - Timestamp Target Time Error"] -pub type TSTRGTERR1_R = crate::BitReader; +pub type TSTRGTERR1_R = crate::BitReader; #[doc = "Field `TSTARGT2` reader - Timestamp Target Time Reached for Target Time PPS2"] -pub type TSTARGT2_R = crate::BitReader; +pub type TSTARGT2_R = crate::BitReader; #[doc = "Field `TSTRGTERR2` reader - Timestamp Target Time Error"] -pub type TSTRGTERR2_R = crate::BitReader; +pub type TSTRGTERR2_R = crate::BitReader; #[doc = "Field `TSTARGT3` reader - Timestamp Target Time Reached for Target Time PPS3"] -pub type TSTARGT3_R = crate::BitReader; +pub type TSTARGT3_R = crate::BitReader; #[doc = "Field `TSTRGTERR3` reader - Timestamp Target Time Error"] -pub type TSTRGTERR3_R = crate::BitReader; +pub type TSTRGTERR3_R = crate::BitReader; impl R { #[doc = "Bit 0 - Timestamp Seconds Overflow"] #[inline(always)] @@ -78,15 +65,13 @@ impl R { TSTRGTERR3_R::new(((self.bits >> 9) & 1) != 0) } } -#[doc = "Timestamp 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 [timestamp_status](index.html) module"] +#[doc = "Timestamp Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`timestamp_status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TIMESTAMP_STATUS_SPEC; impl crate::RegisterSpec for TIMESTAMP_STATUS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [timestamp_status::R](R) reader structure"] -impl crate::Readable for TIMESTAMP_STATUS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`timestamp_status::R`](R) reader structure"] +impl crate::Readable for TIMESTAMP_STATUS_SPEC {} #[doc = "`reset()` method sets TIMESTAMP_STATUS to value 0"] impl crate::Resettable for TIMESTAMP_STATUS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/transmit_descriptor_list_address.rs b/src/eth0/transmit_descriptor_list_address.rs index 4c12ef4d..9cdb8763 100644 --- a/src/eth0/transmit_descriptor_list_address.rs +++ b/src/eth0/transmit_descriptor_list_address.rs @@ -1,43 +1,11 @@ #[doc = "Register `TRANSMIT_DESCRIPTOR_LIST_ADDRESS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `TRANSMIT_DESCRIPTOR_LIST_ADDRESS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TDESLA_32bit` reader - Start of Transmit List"] -pub type TDESLA_32BIT_R = crate::FieldReader; +pub type TDESLA_32BIT_R = crate::FieldReader; #[doc = "Field `TDESLA_32bit` writer - Start of Transmit List"] -pub type TDESLA_32BIT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TRANSMIT_DESCRIPTOR_LIST_ADDRESS_SPEC, u32, u32, 30, O>; +pub type TDESLA_32BIT_W<'a, REG> = crate::FieldWriter<'a, REG, 30, u32>; impl R { #[doc = "Bits 2:31 - Start of Transmit List"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 2:31 - Start of Transmit List"] #[inline(always)] #[must_use] - pub fn tdesla_32bit(&mut self) -> TDESLA_32BIT_W<2> { - TDESLA_32BIT_W::new(self) + pub fn tdesla_32bit(&mut self) -> TDESLA_32BIT_W { + TDESLA_32BIT_W::new(self, 2) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Transmit descripter 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 [transmit_descriptor_list_address](index.html) module"] +#[doc = "Transmit descripter Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`transmit_descriptor_list_address::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`transmit_descriptor_list_address::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TRANSMIT_DESCRIPTOR_LIST_ADDRESS_SPEC; impl crate::RegisterSpec for TRANSMIT_DESCRIPTOR_LIST_ADDRESS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [transmit_descriptor_list_address::R](R) reader structure"] -impl crate::Readable for TRANSMIT_DESCRIPTOR_LIST_ADDRESS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [transmit_descriptor_list_address::W](W) writer structure"] +#[doc = "`read()` method returns [`transmit_descriptor_list_address::R`](R) reader structure"] +impl crate::Readable for TRANSMIT_DESCRIPTOR_LIST_ADDRESS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`transmit_descriptor_list_address::W`](W) writer structure"] impl crate::Writable for TRANSMIT_DESCRIPTOR_LIST_ADDRESS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/transmit_poll_demand.rs b/src/eth0/transmit_poll_demand.rs index 72578753..982c458c 100644 --- a/src/eth0/transmit_poll_demand.rs +++ b/src/eth0/transmit_poll_demand.rs @@ -1,43 +1,11 @@ #[doc = "Register `TRANSMIT_POLL_DEMAND` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `TRANSMIT_POLL_DEMAND` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `TPD` reader - Transmit Poll Demand"] -pub type TPD_R = crate::FieldReader; +pub type TPD_R = crate::FieldReader; #[doc = "Field `TPD` writer - Transmit Poll Demand"] -pub type TPD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TRANSMIT_POLL_DEMAND_SPEC, u32, u32, 32, O>; +pub type TPD_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Transmit Poll Demand"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Transmit Poll Demand"] #[inline(always)] #[must_use] - pub fn tpd(&mut self) -> TPD_W<0> { - TPD_W::new(self) + pub fn tpd(&mut self) -> TPD_W { + TPD_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Transmit Poll Demand 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 [transmit_poll_demand](index.html) module"] +#[doc = "Transmit Poll Demand Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`transmit_poll_demand::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`transmit_poll_demand::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TRANSMIT_POLL_DEMAND_SPEC; impl crate::RegisterSpec for TRANSMIT_POLL_DEMAND_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [transmit_poll_demand::R](R) reader structure"] -impl crate::Readable for TRANSMIT_POLL_DEMAND_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [transmit_poll_demand::W](W) writer structure"] +#[doc = "`read()` method returns [`transmit_poll_demand::R`](R) reader structure"] +impl crate::Readable for TRANSMIT_POLL_DEMAND_SPEC {} +#[doc = "`write(|w| ..)` method takes [`transmit_poll_demand::W`](W) writer structure"] impl crate::Writable for TRANSMIT_POLL_DEMAND_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0/tx_1024tomaxoctets_frames_good_bad.rs b/src/eth0/tx_1024tomaxoctets_frames_good_bad.rs index 1ff94d0c..c5177ca4 100644 --- a/src/eth0/tx_1024tomaxoctets_frames_good_bad.rs +++ b/src/eth0/tx_1024tomaxoctets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TX1024_MAXOCTGB` reader - This field indicates the number of good and bad frames transmitted with length between 1,024 and maxsize (inclusive) bytes, exclusive of preamble and retried frames."] -pub type TX1024_MAXOCTGB_R = crate::FieldReader; +pub type TX1024_MAXOCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good and bad frames transmitted with length between 1,024 and maxsize (inclusive) bytes, exclusive of preamble and retried frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TX1024_MAXOCTGB_R::new(self.bits) } } -#[doc = "Transmit Octet Count for Good and Bad 1024 to Maxsize Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_1024tomaxoctets_frames_good_bad](index.html) module"] +#[doc = "Transmit Octet Count for Good and Bad 1024 to Maxsize Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_1024tomaxoctets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_1024tomaxoctets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_1024tomaxoctets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_1024TOMAXOCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_128to255octets_frames_good_bad.rs b/src/eth0/tx_128to255octets_frames_good_bad.rs index 5c1c9b7c..1f86c2a3 100644 --- a/src/eth0/tx_128to255octets_frames_good_bad.rs +++ b/src/eth0/tx_128to255octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_128TO255OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TX128_255OCTGB` reader - This field indicates the number of transmitted good and bad frames with length between 128 and 255 (inclusive) bytes, exclusive of preamble and retried frames."] -pub type TX128_255OCTGB_R = crate::FieldReader; +pub type TX128_255OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good and bad frames with length between 128 and 255 (inclusive) bytes, exclusive of preamble and retried frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TX128_255OCTGB_R::new(self.bits) } } -#[doc = "Transmit Octet Count for Good and Bad 128 to 255 Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_128to255octets_frames_good_bad](index.html) module"] +#[doc = "Transmit Octet Count for Good and Bad 128 to 255 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_128to255octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_128to255octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_128to255octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_128TO255OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_128TO255OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_256to511octets_frames_good_bad.rs b/src/eth0/tx_256to511octets_frames_good_bad.rs index 68a48795..55aae780 100644 --- a/src/eth0/tx_256to511octets_frames_good_bad.rs +++ b/src/eth0/tx_256to511octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_256TO511OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TX256_511OCTGB` reader - This field indicates the number of transmitted good and bad frames with length between 256 and 511 (inclusive) bytes, exclusive of preamble and retried frames."] -pub type TX256_511OCTGB_R = crate::FieldReader; +pub type TX256_511OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good and bad frames with length between 256 and 511 (inclusive) bytes, exclusive of preamble and retried frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TX256_511OCTGB_R::new(self.bits) } } -#[doc = "Transmit Octet Count for Good and Bad 256 to 511 Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_256to511octets_frames_good_bad](index.html) module"] +#[doc = "Transmit Octet Count for Good and Bad 256 to 511 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_256to511octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_256to511octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_256to511octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_256TO511OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_256TO511OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_512to1023octets_frames_good_bad.rs b/src/eth0/tx_512to1023octets_frames_good_bad.rs index 246a38de..3768172e 100644 --- a/src/eth0/tx_512to1023octets_frames_good_bad.rs +++ b/src/eth0/tx_512to1023octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_512TO1023OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TX512_1023OCTGB` reader - This field indicates the number of transmitted good and bad frames with length between 512 and 1,023 (inclusive) bytes, exclusive of preamble and retried frames."] -pub type TX512_1023OCTGB_R = crate::FieldReader; +pub type TX512_1023OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good and bad frames with length between 512 and 1,023 (inclusive) bytes, exclusive of preamble and retried frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TX512_1023OCTGB_R::new(self.bits) } } -#[doc = "Transmit Octet Count for Good and Bad 512 to 1023 Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_512to1023octets_frames_good_bad](index.html) module"] +#[doc = "Transmit Octet Count for Good and Bad 512 to 1023 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_512to1023octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_512to1023octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_512to1023octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_512TO1023OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_512TO1023OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_64octets_frames_good_bad.rs b/src/eth0/tx_64octets_frames_good_bad.rs index 4903794d..1a5f957e 100644 --- a/src/eth0/tx_64octets_frames_good_bad.rs +++ b/src/eth0/tx_64octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_64OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TX64OCTGB` reader - This field indicates the number of transmitted good and bad frames with length of 64 bytes, exclusive of preamble and retried frames."] -pub type TX64OCTGB_R = crate::FieldReader; +pub type TX64OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good and bad frames with length of 64 bytes, exclusive of preamble and retried frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TX64OCTGB_R::new(self.bits) } } -#[doc = "Transmit Octet Count for Good and Bad 64 Byte Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_64octets_frames_good_bad](index.html) module"] +#[doc = "Transmit Octet Count for Good and Bad 64 Byte Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_64octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_64OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_64OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_64octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_64OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_64octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_64OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_64OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_64OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_65to127octets_frames_good_bad.rs b/src/eth0/tx_65to127octets_frames_good_bad.rs index 4c49bea0..b9d00587 100644 --- a/src/eth0/tx_65to127octets_frames_good_bad.rs +++ b/src/eth0/tx_65to127octets_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_65TO127OCTETS_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TX65_127OCTGB` reader - This field indicates the number of transmitted good and bad frames with length between 65 and 127 (inclusive) bytes, exclusive of preamble and retried frames."] -pub type TX65_127OCTGB_R = crate::FieldReader; +pub type TX65_127OCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good and bad frames with length between 65 and 127 (inclusive) bytes, exclusive of preamble and retried frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TX65_127OCTGB_R::new(self.bits) } } -#[doc = "Transmit Octet Count for Good and Bad 65 to 127 Bytes Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_65to127octets_frames_good_bad](index.html) module"] +#[doc = "Transmit Octet Count for Good and Bad 65 to 127 Bytes Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_65to127octets_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_65to127octets_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_65to127octets_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_65TO127OCTETS_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_65TO127OCTETS_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_broadcast_frames_good.rs b/src/eth0/tx_broadcast_frames_good.rs index 6ee79d0f..fb21ea76 100644 --- a/src/eth0/tx_broadcast_frames_good.rs +++ b/src/eth0/tx_broadcast_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_BROADCAST_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXBCASTG` reader - This field indicates the number of transmitted good broadcast frames."] -pub type TXBCASTG_R = crate::FieldReader; +pub type TXBCASTG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good broadcast frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXBCASTG_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Good Broadcast Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_broadcast_frames_good](index.html) module"] +#[doc = "Transmit Frame Count for Good Broadcast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_broadcast_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_BROADCAST_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for TX_BROADCAST_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_broadcast_frames_good::R](R) reader structure"] -impl crate::Readable for TX_BROADCAST_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_broadcast_frames_good::R`](R) reader structure"] +impl crate::Readable for TX_BROADCAST_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets TX_BROADCAST_FRAMES_GOOD to value 0"] impl crate::Resettable for TX_BROADCAST_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_broadcast_frames_good_bad.rs b/src/eth0/tx_broadcast_frames_good_bad.rs index ecb8b83b..2aae79d3 100644 --- a/src/eth0/tx_broadcast_frames_good_bad.rs +++ b/src/eth0/tx_broadcast_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_BROADCAST_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXBCASTGB` reader - This field indicates the number of transmitted good and bad broadcast frames."] -pub type TXBCASTGB_R = crate::FieldReader; +pub type TXBCASTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good and bad broadcast frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXBCASTGB_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Good and Bad Broadcast Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_broadcast_frames_good_bad](index.html) module"] +#[doc = "Transmit Frame Count for Good and Bad Broadcast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_broadcast_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_BROADCAST_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_BROADCAST_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_broadcast_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_BROADCAST_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_broadcast_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_BROADCAST_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_BROADCAST_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_BROADCAST_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_carrier_error_frames.rs b/src/eth0/tx_carrier_error_frames.rs index c04cfe32..76066546 100644 --- a/src/eth0/tx_carrier_error_frames.rs +++ b/src/eth0/tx_carrier_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_CARRIER_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXCARR` reader - This field indicates the number of frames aborted because of carrier sense error (no carrier or loss of carrier)."] -pub type TXCARR_R = crate::FieldReader; +pub type TXCARR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames aborted because of carrier sense error (no carrier or loss of carrier)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXCARR_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Carrier Sense Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_carrier_error_frames](index.html) module"] +#[doc = "Transmit Frame Count for Carrier Sense Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_carrier_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_CARRIER_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for TX_CARRIER_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_carrier_error_frames::R](R) reader structure"] -impl crate::Readable for TX_CARRIER_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_carrier_error_frames::R`](R) reader structure"] +impl crate::Readable for TX_CARRIER_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets TX_CARRIER_ERROR_FRAMES to value 0"] impl crate::Resettable for TX_CARRIER_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_deferred_frames.rs b/src/eth0/tx_deferred_frames.rs index e3cffe1f..82c3a313 100644 --- a/src/eth0/tx_deferred_frames.rs +++ b/src/eth0/tx_deferred_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_DEFERRED_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXDEFRD` reader - This field indicates the number of successfully transmitted frames after a deferral in the half-duplex mode."] -pub type TXDEFRD_R = crate::FieldReader; +pub type TXDEFRD_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of successfully transmitted frames after a deferral in the half-duplex mode."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXDEFRD_R::new(self.bits) } } -#[doc = "Tx Deferred Frames 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 [tx_deferred_frames](index.html) module"] +#[doc = "Tx Deferred Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_deferred_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_DEFERRED_FRAMES_SPEC; impl crate::RegisterSpec for TX_DEFERRED_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_deferred_frames::R](R) reader structure"] -impl crate::Readable for TX_DEFERRED_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_deferred_frames::R`](R) reader structure"] +impl crate::Readable for TX_DEFERRED_FRAMES_SPEC {} #[doc = "`reset()` method sets TX_DEFERRED_FRAMES to value 0"] impl crate::Resettable for TX_DEFERRED_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_excessive_collision_frames.rs b/src/eth0/tx_excessive_collision_frames.rs index b8d1cb99..7f9ef05f 100644 --- a/src/eth0/tx_excessive_collision_frames.rs +++ b/src/eth0/tx_excessive_collision_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_EXCESSIVE_COLLISION_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXEXSCOL` reader - This field indicates the number of frames aborted because of excessive (16) collision error."] -pub type TXEXSCOL_R = crate::FieldReader; +pub type TXEXSCOL_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames aborted because of excessive (16) collision error."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXEXSCOL_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Excessive Collision Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_excessive_collision_frames](index.html) module"] +#[doc = "Transmit Frame Count for Excessive Collision Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_excessive_collision_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_EXCESSIVE_COLLISION_FRAMES_SPEC; impl crate::RegisterSpec for TX_EXCESSIVE_COLLISION_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_excessive_collision_frames::R](R) reader structure"] -impl crate::Readable for TX_EXCESSIVE_COLLISION_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_excessive_collision_frames::R`](R) reader structure"] +impl crate::Readable for TX_EXCESSIVE_COLLISION_FRAMES_SPEC {} #[doc = "`reset()` method sets TX_EXCESSIVE_COLLISION_FRAMES to value 0"] impl crate::Resettable for TX_EXCESSIVE_COLLISION_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_excessive_deferral_error.rs b/src/eth0/tx_excessive_deferral_error.rs index d8fa5d55..4b28e1d6 100644 --- a/src/eth0/tx_excessive_deferral_error.rs +++ b/src/eth0/tx_excessive_deferral_error.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_EXCESSIVE_DEFERRAL_ERROR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXEXSDEF` reader - This field indicates the number of frames aborted because of excessive deferral error, that is, frames deferred for more than two max-sized frame times."] -pub type TXEXSDEF_R = crate::FieldReader; +pub type TXEXSDEF_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames aborted because of excessive deferral error, that is, frames deferred for more than two max-sized frame times."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXEXSDEF_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Excessive Deferral Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_excessive_deferral_error](index.html) module"] +#[doc = "Transmit Frame Count for Excessive Deferral Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_excessive_deferral_error::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_EXCESSIVE_DEFERRAL_ERROR_SPEC; impl crate::RegisterSpec for TX_EXCESSIVE_DEFERRAL_ERROR_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_excessive_deferral_error::R](R) reader structure"] -impl crate::Readable for TX_EXCESSIVE_DEFERRAL_ERROR_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_excessive_deferral_error::R`](R) reader structure"] +impl crate::Readable for TX_EXCESSIVE_DEFERRAL_ERROR_SPEC {} #[doc = "`reset()` method sets TX_EXCESSIVE_DEFERRAL_ERROR to value 0"] impl crate::Resettable for TX_EXCESSIVE_DEFERRAL_ERROR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_frame_count_good.rs b/src/eth0/tx_frame_count_good.rs index 1b154d2a..8e929f94 100644 --- a/src/eth0/tx_frame_count_good.rs +++ b/src/eth0/tx_frame_count_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_FRAME_COUNT_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXFRMG` reader - This field indicates the number of transmitted good frames, exclusive of preamble."] -pub type TXFRMG_R = crate::FieldReader; +pub type TXFRMG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good frames, exclusive of preamble."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXFRMG_R::new(self.bits) } } -#[doc = "Tx Frame Count Good 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 [tx_frame_count_good](index.html) module"] +#[doc = "Tx Frame Count Good Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_frame_count_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_FRAME_COUNT_GOOD_SPEC; impl crate::RegisterSpec for TX_FRAME_COUNT_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_frame_count_good::R](R) reader structure"] -impl crate::Readable for TX_FRAME_COUNT_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_frame_count_good::R`](R) reader structure"] +impl crate::Readable for TX_FRAME_COUNT_GOOD_SPEC {} #[doc = "`reset()` method sets TX_FRAME_COUNT_GOOD to value 0"] impl crate::Resettable for TX_FRAME_COUNT_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_frame_count_good_bad.rs b/src/eth0/tx_frame_count_good_bad.rs index d0b8cef7..7f499370 100644 --- a/src/eth0/tx_frame_count_good_bad.rs +++ b/src/eth0/tx_frame_count_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_FRAME_COUNT_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXFRMGB` reader - This field indicates the number of good and bad frames transmitted, exclusive of retried frames"] -pub type TXFRMGB_R = crate::FieldReader; +pub type TXFRMGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of good and bad frames transmitted, exclusive of retried frames"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXFRMGB_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Goodand Bad Frames 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 [tx_frame_count_good_bad](index.html) module"] +#[doc = "Transmit Frame Count for Goodand Bad Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_frame_count_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_FRAME_COUNT_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_FRAME_COUNT_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_frame_count_good_bad::R](R) reader structure"] -impl crate::Readable for TX_FRAME_COUNT_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_frame_count_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_FRAME_COUNT_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_FRAME_COUNT_GOOD_BAD to value 0"] impl crate::Resettable for TX_FRAME_COUNT_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_late_collision_frames.rs b/src/eth0/tx_late_collision_frames.rs index e7a6e2cd..859ceca3 100644 --- a/src/eth0/tx_late_collision_frames.rs +++ b/src/eth0/tx_late_collision_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_LATE_COLLISION_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXLATECOL` reader - This field indicates the number of frames aborted because of late collision error."] -pub type TXLATECOL_R = crate::FieldReader; +pub type TXLATECOL_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames aborted because of late collision error."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXLATECOL_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Late Collision Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_late_collision_frames](index.html) module"] +#[doc = "Transmit Frame Count for Late Collision Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_late_collision_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_LATE_COLLISION_FRAMES_SPEC; impl crate::RegisterSpec for TX_LATE_COLLISION_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_late_collision_frames::R](R) reader structure"] -impl crate::Readable for TX_LATE_COLLISION_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_late_collision_frames::R`](R) reader structure"] +impl crate::Readable for TX_LATE_COLLISION_FRAMES_SPEC {} #[doc = "`reset()` method sets TX_LATE_COLLISION_FRAMES to value 0"] impl crate::Resettable for TX_LATE_COLLISION_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_multicast_frames_good.rs b/src/eth0/tx_multicast_frames_good.rs index a6102ca7..d7af3cfe 100644 --- a/src/eth0/tx_multicast_frames_good.rs +++ b/src/eth0/tx_multicast_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_MULTICAST_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXMCASTG` reader - This field indicates the number of transmitted good multicast frames."] -pub type TXMCASTG_R = crate::FieldReader; +pub type TXMCASTG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good multicast frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXMCASTG_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Good Multicast Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_multicast_frames_good](index.html) module"] +#[doc = "Transmit Frame Count for Good Multicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_multicast_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_MULTICAST_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for TX_MULTICAST_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_multicast_frames_good::R](R) reader structure"] -impl crate::Readable for TX_MULTICAST_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_multicast_frames_good::R`](R) reader structure"] +impl crate::Readable for TX_MULTICAST_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets TX_MULTICAST_FRAMES_GOOD to value 0"] impl crate::Resettable for TX_MULTICAST_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_multicast_frames_good_bad.rs b/src/eth0/tx_multicast_frames_good_bad.rs index ff862ef2..409afca4 100644 --- a/src/eth0/tx_multicast_frames_good_bad.rs +++ b/src/eth0/tx_multicast_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_MULTICAST_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXMCASTGB` reader - This field indicates the number of transmitted good and bad multicast frames."] -pub type TXMCASTGB_R = crate::FieldReader; +pub type TXMCASTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good and bad multicast frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXMCASTGB_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Good and Bad Multicast Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_multicast_frames_good_bad](index.html) module"] +#[doc = "Transmit Frame Count for Good and Bad Multicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_multicast_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_MULTICAST_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_MULTICAST_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_multicast_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_MULTICAST_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_multicast_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_MULTICAST_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_MULTICAST_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_MULTICAST_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_multiple_collision_good_frames.rs b/src/eth0/tx_multiple_collision_good_frames.rs index 823f1f3f..2fb0d839 100644 --- a/src/eth0/tx_multiple_collision_good_frames.rs +++ b/src/eth0/tx_multiple_collision_good_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_MULTIPLE_COLLISION_GOOD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXMULTCOLG` reader - This field indicates the number of successfully transmitted frames after multiple collisions in the half-duplex mode."] -pub type TXMULTCOLG_R = crate::FieldReader; +pub type TXMULTCOLG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of successfully transmitted frames after multiple collisions in the half-duplex mode."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXMULTCOLG_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Frames Transmitted after Multiple Collision\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_multiple_collision_good_frames](index.html) module"] +#[doc = "Transmit Frame Count for Frames Transmitted after Multiple Collision\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_multiple_collision_good_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_MULTIPLE_COLLISION_GOOD_FRAMES_SPEC; impl crate::RegisterSpec for TX_MULTIPLE_COLLISION_GOOD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_multiple_collision_good_frames::R](R) reader structure"] -impl crate::Readable for TX_MULTIPLE_COLLISION_GOOD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_multiple_collision_good_frames::R`](R) reader structure"] +impl crate::Readable for TX_MULTIPLE_COLLISION_GOOD_FRAMES_SPEC {} #[doc = "`reset()` method sets TX_MULTIPLE_COLLISION_GOOD_FRAMES to value 0"] impl crate::Resettable for TX_MULTIPLE_COLLISION_GOOD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_octet_count_good.rs b/src/eth0/tx_octet_count_good.rs index 42ae6b57..a20d34e9 100644 --- a/src/eth0/tx_octet_count_good.rs +++ b/src/eth0/tx_octet_count_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_OCTET_COUNT_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXOCTG` reader - This field indicates the number of bytes transmitted, exclusive of preamble, in good frames."] -pub type TXOCTG_R = crate::FieldReader; +pub type TXOCTG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes transmitted, exclusive of preamble, in good frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXOCTG_R::new(self.bits) } } -#[doc = "Tx Octet Count Good 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 [tx_octet_count_good](index.html) module"] +#[doc = "Tx Octet Count Good Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_octet_count_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_OCTET_COUNT_GOOD_SPEC; impl crate::RegisterSpec for TX_OCTET_COUNT_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_octet_count_good::R](R) reader structure"] -impl crate::Readable for TX_OCTET_COUNT_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_octet_count_good::R`](R) reader structure"] +impl crate::Readable for TX_OCTET_COUNT_GOOD_SPEC {} #[doc = "`reset()` method sets TX_OCTET_COUNT_GOOD to value 0"] impl crate::Resettable for TX_OCTET_COUNT_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_octet_count_good_bad.rs b/src/eth0/tx_octet_count_good_bad.rs index 7fd9811a..7fcb1c78 100644 --- a/src/eth0/tx_octet_count_good_bad.rs +++ b/src/eth0/tx_octet_count_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_OCTET_COUNT_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXOCTGB` reader - This field indicates the number of bytes transmitted in good and bad frames exclusive of preamble and retried bytes."] -pub type TXOCTGB_R = crate::FieldReader; +pub type TXOCTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of bytes transmitted in good and bad frames exclusive of preamble and retried bytes."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXOCTGB_R::new(self.bits) } } -#[doc = "Transmit Octet Count for Good and Bad Frames 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 [tx_octet_count_good_bad](index.html) module"] +#[doc = "Transmit Octet Count for Good and Bad Frames Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_octet_count_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_OCTET_COUNT_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_OCTET_COUNT_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_octet_count_good_bad::R](R) reader structure"] -impl crate::Readable for TX_OCTET_COUNT_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_octet_count_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_OCTET_COUNT_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_OCTET_COUNT_GOOD_BAD to value 0"] impl crate::Resettable for TX_OCTET_COUNT_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_osize_frames_good.rs b/src/eth0/tx_osize_frames_good.rs index 38c7ca19..4ba25fea 100644 --- a/src/eth0/tx_osize_frames_good.rs +++ b/src/eth0/tx_osize_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_OSIZE_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXOSIZG` reader - This field indicates the number of frames transmitted without errors and with length greater than the maxsize (1,518 or 1,522 bytes for VLAN tagged frames; 2000 bytes if enabled by setting MAC Configuration.2KPE)."] -pub type TXOSIZG_R = crate::FieldReader; +pub type TXOSIZG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames transmitted without errors and with length greater than the maxsize (1,518 or 1,522 bytes for VLAN tagged frames; 2000 bytes if enabled by setting MAC Configuration.2KPE)."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXOSIZG_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Good Oversize Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_osize_frames_good](index.html) module"] +#[doc = "Transmit Frame Count for Good Oversize Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_osize_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_OSIZE_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for TX_OSIZE_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_osize_frames_good::R](R) reader structure"] -impl crate::Readable for TX_OSIZE_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_osize_frames_good::R`](R) reader structure"] +impl crate::Readable for TX_OSIZE_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets TX_OSIZE_FRAMES_GOOD to value 0"] impl crate::Resettable for TX_OSIZE_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_pause_frames.rs b/src/eth0/tx_pause_frames.rs index 3b534da1..29ab009d 100644 --- a/src/eth0/tx_pause_frames.rs +++ b/src/eth0/tx_pause_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_PAUSE_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXPAUSE` reader - This field indicates the number of transmitted good PAUSE frames."] -pub type TXPAUSE_R = crate::FieldReader; +pub type TXPAUSE_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good PAUSE frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXPAUSE_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Good PAUSE Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_pause_frames](index.html) module"] +#[doc = "Transmit Frame Count for Good PAUSE Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_pause_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_PAUSE_FRAMES_SPEC; impl crate::RegisterSpec for TX_PAUSE_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_pause_frames::R](R) reader structure"] -impl crate::Readable for TX_PAUSE_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_pause_frames::R`](R) reader structure"] +impl crate::Readable for TX_PAUSE_FRAMES_SPEC {} #[doc = "`reset()` method sets TX_PAUSE_FRAMES to value 0"] impl crate::Resettable for TX_PAUSE_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_single_collision_good_frames.rs b/src/eth0/tx_single_collision_good_frames.rs index 18d6951c..287c4eac 100644 --- a/src/eth0/tx_single_collision_good_frames.rs +++ b/src/eth0/tx_single_collision_good_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_SINGLE_COLLISION_GOOD_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXSNGLCOLG` reader - This field indicates the number of successfully transmitted frames after a single collision in the half-duplex mode."] -pub type TXSNGLCOLG_R = crate::FieldReader; +pub type TXSNGLCOLG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of successfully transmitted frames after a single collision in the half-duplex mode."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXSNGLCOLG_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Frames Transmitted after Single Collision\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_single_collision_good_frames](index.html) module"] +#[doc = "Transmit Frame Count for Frames Transmitted after Single Collision\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_single_collision_good_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_SINGLE_COLLISION_GOOD_FRAMES_SPEC; impl crate::RegisterSpec for TX_SINGLE_COLLISION_GOOD_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_single_collision_good_frames::R](R) reader structure"] -impl crate::Readable for TX_SINGLE_COLLISION_GOOD_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_single_collision_good_frames::R`](R) reader structure"] +impl crate::Readable for TX_SINGLE_COLLISION_GOOD_FRAMES_SPEC {} #[doc = "`reset()` method sets TX_SINGLE_COLLISION_GOOD_FRAMES to value 0"] impl crate::Resettable for TX_SINGLE_COLLISION_GOOD_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_underflow_error_frames.rs b/src/eth0/tx_underflow_error_frames.rs index 27efa0cf..23e1b5ad 100644 --- a/src/eth0/tx_underflow_error_frames.rs +++ b/src/eth0/tx_underflow_error_frames.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_UNDERFLOW_ERROR_FRAMES` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXUNDRFLW` reader - This field indicates the number of frames aborted because of frame underflow error."] -pub type TXUNDRFLW_R = crate::FieldReader; +pub type TXUNDRFLW_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of frames aborted because of frame underflow error."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXUNDRFLW_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Underflow Error Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_underflow_error_frames](index.html) module"] +#[doc = "Transmit Frame Count for Underflow Error Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_underflow_error_frames::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_UNDERFLOW_ERROR_FRAMES_SPEC; impl crate::RegisterSpec for TX_UNDERFLOW_ERROR_FRAMES_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_underflow_error_frames::R](R) reader structure"] -impl crate::Readable for TX_UNDERFLOW_ERROR_FRAMES_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_underflow_error_frames::R`](R) reader structure"] +impl crate::Readable for TX_UNDERFLOW_ERROR_FRAMES_SPEC {} #[doc = "`reset()` method sets TX_UNDERFLOW_ERROR_FRAMES to value 0"] impl crate::Resettable for TX_UNDERFLOW_ERROR_FRAMES_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_unicast_frames_good_bad.rs b/src/eth0/tx_unicast_frames_good_bad.rs index 9145b733..c8ef4b9b 100644 --- a/src/eth0/tx_unicast_frames_good_bad.rs +++ b/src/eth0/tx_unicast_frames_good_bad.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_UNICAST_FRAMES_GOOD_BAD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXUCASTGB` reader - This field indicates the number of transmitted good and bad unicast frames."] -pub type TXUCASTGB_R = crate::FieldReader; +pub type TXUCASTGB_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This field indicates the number of transmitted good and bad unicast frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXUCASTGB_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Good and Bad Unicast Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_unicast_frames_good_bad](index.html) module"] +#[doc = "Transmit Frame Count for Good and Bad Unicast Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_unicast_frames_good_bad::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_UNICAST_FRAMES_GOOD_BAD_SPEC; impl crate::RegisterSpec for TX_UNICAST_FRAMES_GOOD_BAD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_unicast_frames_good_bad::R](R) reader structure"] -impl crate::Readable for TX_UNICAST_FRAMES_GOOD_BAD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_unicast_frames_good_bad::R`](R) reader structure"] +impl crate::Readable for TX_UNICAST_FRAMES_GOOD_BAD_SPEC {} #[doc = "`reset()` method sets TX_UNICAST_FRAMES_GOOD_BAD to value 0"] impl crate::Resettable for TX_UNICAST_FRAMES_GOOD_BAD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/tx_vlan_frames_good.rs b/src/eth0/tx_vlan_frames_good.rs index 86f4b155..0fcc26a6 100644 --- a/src/eth0/tx_vlan_frames_good.rs +++ b/src/eth0/tx_vlan_frames_good.rs @@ -1,20 +1,7 @@ #[doc = "Register `TX_VLAN_FRAMES_GOOD` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `TXVLANG` reader - This register maintains the number of transmitted good VLAN frames, exclusive of retried frames."] -pub type TXVLANG_R = crate::FieldReader; +pub type TXVLANG_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - This register maintains the number of transmitted good VLAN frames, exclusive of retried frames."] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TXVLANG_R::new(self.bits) } } -#[doc = "Transmit Frame Count for Good VLAN Frames\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tx_vlan_frames_good](index.html) module"] +#[doc = "Transmit Frame Count for Good VLAN Frames\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tx_vlan_frames_good::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TX_VLAN_FRAMES_GOOD_SPEC; impl crate::RegisterSpec for TX_VLAN_FRAMES_GOOD_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [tx_vlan_frames_good::R](R) reader structure"] -impl crate::Readable for TX_VLAN_FRAMES_GOOD_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`tx_vlan_frames_good::R`](R) reader structure"] +impl crate::Readable for TX_VLAN_FRAMES_GOOD_SPEC {} #[doc = "`reset()` method sets TX_VLAN_FRAMES_GOOD to value 0"] impl crate::Resettable for TX_VLAN_FRAMES_GOOD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/eth0/version.rs b/src/eth0/version.rs index e1163a5f..43c56d68 100644 --- a/src/eth0/version.rs +++ b/src/eth0/version.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `SNPSVER` reader - Synopsys-defined Version (3.7)"] -pub type SNPSVER_R = crate::FieldReader; +pub type SNPSVER_R = crate::FieldReader; #[doc = "Field `USERVER` reader - User-defined Version (Configured with the coreConsultant)"] -pub type USERVER_R = crate::FieldReader; +pub type USERVER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Synopsys-defined Version (3.7)"] #[inline(always)] @@ -29,15 +16,13 @@ impl R { USERVER_R::new(((self.bits >> 8) & 0xff) as u8) } } -#[doc = "Version 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 [version](index.html) module"] +#[doc = "Version Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`version::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`version::R`](R) reader structure"] +impl crate::Readable for VERSION_SPEC {} #[doc = "`reset()` method sets VERSION to value 0x1037"] impl crate::Resettable for VERSION_SPEC { const RESET_VALUE: Self::Ux = 0x1037; diff --git a/src/eth0/vlan_tag.rs b/src/eth0/vlan_tag.rs index 734ac5c3..4f0b1ebb 100644 --- a/src/eth0/vlan_tag.rs +++ b/src/eth0/vlan_tag.rs @@ -1,57 +1,25 @@ #[doc = "Register `VLAN_TAG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `VLAN_TAG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `VL` reader - VLAN Tag Identifier for Receive Frames"] -pub type VL_R = crate::FieldReader; +pub type VL_R = crate::FieldReader; #[doc = "Field `VL` writer - VLAN Tag Identifier for Receive Frames"] -pub type VL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VLAN_TAG_SPEC, u16, u16, 16, O>; +pub type VL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `ETV` reader - Enable 12-Bit VLAN Tag Comparison"] -pub type ETV_R = crate::BitReader; +pub type ETV_R = crate::BitReader; #[doc = "Field `ETV` writer - Enable 12-Bit VLAN Tag Comparison"] -pub type ETV_W<'a, const O: u8> = crate::BitWriter<'a, u32, VLAN_TAG_SPEC, bool, O>; +pub type ETV_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `VTIM` reader - VLAN Tag Inverse Match Enable"] -pub type VTIM_R = crate::BitReader; +pub type VTIM_R = crate::BitReader; #[doc = "Field `VTIM` writer - VLAN Tag Inverse Match Enable"] -pub type VTIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, VLAN_TAG_SPEC, bool, O>; +pub type VTIM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ESVL` reader - Enable S-VLAN"] -pub type ESVL_R = crate::BitReader; +pub type ESVL_R = crate::BitReader; #[doc = "Field `ESVL` writer - Enable S-VLAN"] -pub type ESVL_W<'a, const O: u8> = crate::BitWriter<'a, u32, VLAN_TAG_SPEC, bool, O>; +pub type ESVL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `VTHM` reader - VLAN Tag Hash Table Match Enable"] -pub type VTHM_R = crate::BitReader; +pub type VTHM_R = crate::BitReader; impl R { #[doc = "Bits 0:15 - VLAN Tag Identifier for Receive Frames"] #[inline(always)] @@ -83,46 +51,47 @@ impl W { #[doc = "Bits 0:15 - VLAN Tag Identifier for Receive Frames"] #[inline(always)] #[must_use] - pub fn vl(&mut self) -> VL_W<0> { - VL_W::new(self) + pub fn vl(&mut self) -> VL_W { + VL_W::new(self, 0) } #[doc = "Bit 16 - Enable 12-Bit VLAN Tag Comparison"] #[inline(always)] #[must_use] - pub fn etv(&mut self) -> ETV_W<16> { - ETV_W::new(self) + pub fn etv(&mut self) -> ETV_W { + ETV_W::new(self, 16) } #[doc = "Bit 17 - VLAN Tag Inverse Match Enable"] #[inline(always)] #[must_use] - pub fn vtim(&mut self) -> VTIM_W<17> { - VTIM_W::new(self) + pub fn vtim(&mut self) -> VTIM_W { + VTIM_W::new(self, 17) } #[doc = "Bit 18 - Enable S-VLAN"] #[inline(always)] #[must_use] - pub fn esvl(&mut self) -> ESVL_W<18> { - ESVL_W::new(self) + pub fn esvl(&mut self) -> ESVL_W { + ESVL_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "VLAN Tag 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 [vlan_tag](index.html) module"] +#[doc = "VLAN Tag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`vlan_tag::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`vlan_tag::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct VLAN_TAG_SPEC; impl crate::RegisterSpec for VLAN_TAG_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [vlan_tag::R](R) reader structure"] -impl crate::Readable for VLAN_TAG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [vlan_tag::W](W) writer structure"] +#[doc = "`read()` method returns [`vlan_tag::R`](R) reader structure"] +impl crate::Readable for VLAN_TAG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`vlan_tag::W`](W) writer structure"] impl crate::Writable for VLAN_TAG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/eth0_con.rs b/src/eth0_con.rs index b5a901a8..9a577abf 100644 --- a/src/eth0_con.rs +++ b/src/eth0_con.rs @@ -1,10 +1,17 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + eth0_con: ETH0_CON, +} +impl RegisterBlock { #[doc = "0x00 - Ethernet 0 Port Control Register"] - pub eth0_con: ETH0_CON, + #[inline(always)] + pub const fn eth0_con(&self) -> Ð0_CON { + &self.eth0_con + } } -#[doc = "ETH0_CON (rw) register accessor: an alias for `Reg`"] +#[doc = "ETH0_CON (rw) register accessor: Ethernet 0 Port Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`eth0_con::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`eth0_con::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@eth0_con`] +module"] pub type ETH0_CON = crate::Reg; #[doc = "Ethernet 0 Port Control Register"] pub mod eth0_con; diff --git a/src/eth0_con/eth0_con.rs b/src/eth0_con/eth0_con.rs index 4562542c..cb2a611c 100644 --- a/src/eth0_con/eth0_con.rs +++ b/src/eth0_con/eth0_con.rs @@ -1,41 +1,9 @@ #[doc = "Register `ETH0_CON` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `ETH0_CON` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RXD0` reader - MAC Receive Input 0"] -pub type RXD0_R = crate::FieldReader; +pub type RXD0_R = crate::FieldReader; #[doc = "MAC Receive Input 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RXD0_A { + type Ux = u8; +} impl RXD0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXD0_A { + pub const fn variant(&self) -> RXD0_A { match self.bits { 0 => RXD0_A::VALUE1, 1 => RXD0_A::VALUE2, @@ -67,53 +38,57 @@ impl RXD0_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input RXD0A is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXD0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input RXD0B is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXD0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input RXD0C is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RXD0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input RXD0D is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == RXD0_A::VALUE4 } } #[doc = "Field `RXD0` writer - MAC Receive Input 0"] -pub type RXD0_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, RXD0_A, 2, O>; -impl<'a, const O: u8> RXD0_W<'a, O> { +pub type RXD0_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RXD0_A>; +impl<'a, REG> RXD0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input RXD0A is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXD0_A::VALUE1) } #[doc = "Data input RXD0B is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXD0_A::VALUE2) } #[doc = "Data input RXD0C is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(RXD0_A::VALUE3) } #[doc = "Data input RXD0D is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(RXD0_A::VALUE4) } } #[doc = "Field `RXD1` reader - MAC Receive Input 1"] -pub type RXD1_R = crate::FieldReader; +pub type RXD1_R = crate::FieldReader; #[doc = "MAC Receive Input 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RXD1_A { + type Ux = u8; +} impl RXD1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXD1_A { + pub const fn variant(&self) -> RXD1_A { match self.bits { 0 => RXD1_A::VALUE1, 1 => RXD1_A::VALUE2, @@ -145,53 +123,57 @@ impl RXD1_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input RXD1A is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXD1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input RXD1B is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXD1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input RXD1C is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RXD1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input RXD1D is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == RXD1_A::VALUE4 } } #[doc = "Field `RXD1` writer - MAC Receive Input 1"] -pub type RXD1_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, RXD1_A, 2, O>; -impl<'a, const O: u8> RXD1_W<'a, O> { +pub type RXD1_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RXD1_A>; +impl<'a, REG> RXD1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input RXD1A is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXD1_A::VALUE1) } #[doc = "Data input RXD1B is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXD1_A::VALUE2) } #[doc = "Data input RXD1C is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(RXD1_A::VALUE3) } #[doc = "Data input RXD1D is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(RXD1_A::VALUE4) } } #[doc = "Field `RXD2` reader - MAC Receive Input 2"] -pub type RXD2_R = crate::FieldReader; +pub type RXD2_R = crate::FieldReader; #[doc = "MAC Receive Input 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RXD2_A { + type Ux = u8; +} impl RXD2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXD2_A { + pub const fn variant(&self) -> RXD2_A { match self.bits { 0 => RXD2_A::VALUE1, 1 => RXD2_A::VALUE2, @@ -223,53 +208,57 @@ impl RXD2_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input RXD2A is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXD2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input RXD2B is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXD2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input RXD2C is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RXD2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input RXD2D is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == RXD2_A::VALUE4 } } #[doc = "Field `RXD2` writer - MAC Receive Input 2"] -pub type RXD2_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, RXD2_A, 2, O>; -impl<'a, const O: u8> RXD2_W<'a, O> { +pub type RXD2_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RXD2_A>; +impl<'a, REG> RXD2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input RXD2A is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXD2_A::VALUE1) } #[doc = "Data input RXD2B is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXD2_A::VALUE2) } #[doc = "Data input RXD2C is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(RXD2_A::VALUE3) } #[doc = "Data input RXD2D is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(RXD2_A::VALUE4) } } #[doc = "Field `RXD3` reader - MAC Receive Input 3"] -pub type RXD3_R = crate::FieldReader; +pub type RXD3_R = crate::FieldReader; #[doc = "MAC Receive Input 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RXD3_A { + type Ux = u8; +} impl RXD3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXD3_A { + pub const fn variant(&self) -> RXD3_A { match self.bits { 0 => RXD3_A::VALUE1, 1 => RXD3_A::VALUE2, @@ -301,53 +293,57 @@ impl RXD3_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input RXD3A is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXD3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input RXD3B is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXD3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input RXD3C is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RXD3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input RXD3D is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == RXD3_A::VALUE4 } } #[doc = "Field `RXD3` writer - MAC Receive Input 3"] -pub type RXD3_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, RXD3_A, 2, O>; -impl<'a, const O: u8> RXD3_W<'a, O> { +pub type RXD3_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RXD3_A>; +impl<'a, REG> RXD3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input RXD3A is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXD3_A::VALUE1) } #[doc = "Data input RXD3B is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXD3_A::VALUE2) } #[doc = "Data input RXD3C is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(RXD3_A::VALUE3) } #[doc = "Data input RXD3D is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(RXD3_A::VALUE4) } } #[doc = "Field `CLK_RMII` reader - RMII clock input"] -pub type CLK_RMII_R = crate::FieldReader; +pub type CLK_RMII_R = crate::FieldReader; #[doc = "RMII clock input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CLK_RMII_A { + type Ux = u8; +} impl CLK_RMII_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CLK_RMII_A { + pub const fn variant(&self) -> CLK_RMII_A { match self.bits { 0 => CLK_RMII_A::VALUE1, 1 => CLK_RMII_A::VALUE2, @@ -379,53 +378,57 @@ impl CLK_RMII_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input RMIIA is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CLK_RMII_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input RMIIB is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CLK_RMII_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input RMIIC is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLK_RMII_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input RMIID is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLK_RMII_A::VALUE4 } } #[doc = "Field `CLK_RMII` writer - RMII clock input"] -pub type CLK_RMII_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, CLK_RMII_A, 2, O>; -impl<'a, const O: u8> CLK_RMII_W<'a, O> { +pub type CLK_RMII_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CLK_RMII_A>; +impl<'a, REG> CLK_RMII_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input RMIIA is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CLK_RMII_A::VALUE1) } #[doc = "Data input RMIIB is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CLK_RMII_A::VALUE2) } #[doc = "Data input RMIIC is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLK_RMII_A::VALUE3) } #[doc = "Data input RMIID is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLK_RMII_A::VALUE4) } } #[doc = "Field `CRS_DV` reader - CRS_DV input"] -pub type CRS_DV_R = crate::FieldReader; +pub type CRS_DV_R = crate::FieldReader; #[doc = "CRS_DV input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CRS_DV_A { + type Ux = u8; +} impl CRS_DV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CRS_DV_A { + pub const fn variant(&self) -> CRS_DV_A { match self.bits { 0 => CRS_DV_A::VALUE1, 1 => CRS_DV_A::VALUE2, @@ -457,53 +463,57 @@ impl CRS_DV_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input CRS_DVA is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CRS_DV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input CRS_DVB is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CRS_DV_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input CRS_DVC is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CRS_DV_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input CRS_DVD is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CRS_DV_A::VALUE4 } } #[doc = "Field `CRS_DV` writer - CRS_DV input"] -pub type CRS_DV_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, CRS_DV_A, 2, O>; -impl<'a, const O: u8> CRS_DV_W<'a, O> { +pub type CRS_DV_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CRS_DV_A>; +impl<'a, REG> CRS_DV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input CRS_DVA is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CRS_DV_A::VALUE1) } #[doc = "Data input CRS_DVB is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CRS_DV_A::VALUE2) } #[doc = "Data input CRS_DVC is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CRS_DV_A::VALUE3) } #[doc = "Data input CRS_DVD is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CRS_DV_A::VALUE4) } } #[doc = "Field `CRS` reader - CRS input"] -pub type CRS_R = crate::FieldReader; +pub type CRS_R = crate::FieldReader; #[doc = "CRS input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -523,10 +533,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CRS_A { + type Ux = u8; +} impl CRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CRS_A { + pub const fn variant(&self) -> CRS_A { match self.bits { 0 => CRS_A::VALUE1, 1 => CRS_A::VALUE2, @@ -535,53 +548,57 @@ impl CRS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input CRSA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input CRSB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CRS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input CRSC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CRS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input CRSD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CRS_A::VALUE4 } } #[doc = "Field `CRS` writer - CRS input"] -pub type CRS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, CRS_A, 2, O>; -impl<'a, const O: u8> CRS_W<'a, O> { +pub type CRS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CRS_A>; +impl<'a, REG> CRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input CRSA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CRS_A::VALUE1) } #[doc = "Data input CRSB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CRS_A::VALUE2) } #[doc = "Data input CRSC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CRS_A::VALUE3) } #[doc = "Data input CRSD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CRS_A::VALUE4) } } #[doc = "Field `RXER` reader - RXER Input"] -pub type RXER_R = crate::FieldReader; +pub type RXER_R = crate::FieldReader; #[doc = "RXER Input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -601,10 +618,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RXER_A { + type Ux = u8; +} impl RXER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXER_A { + pub const fn variant(&self) -> RXER_A { match self.bits { 0 => RXER_A::VALUE1, 1 => RXER_A::VALUE2, @@ -613,53 +633,57 @@ impl RXER_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input RXERA is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input RXERB is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXER_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input RXERC is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RXER_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input RXERD is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == RXER_A::VALUE4 } } #[doc = "Field `RXER` writer - RXER Input"] -pub type RXER_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, RXER_A, 2, O>; -impl<'a, const O: u8> RXER_W<'a, O> { +pub type RXER_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RXER_A>; +impl<'a, REG> RXER_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input RXERA is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXER_A::VALUE1) } #[doc = "Data input RXERB is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXER_A::VALUE2) } #[doc = "Data input RXERC is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(RXER_A::VALUE3) } #[doc = "Data input RXERD is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(RXER_A::VALUE4) } } #[doc = "Field `COL` reader - COL input"] -pub type COL_R = crate::FieldReader; +pub type COL_R = crate::FieldReader; #[doc = "COL input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -679,10 +703,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for COL_A { + type Ux = u8; +} impl COL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> COL_A { + pub const fn variant(&self) -> COL_A { match self.bits { 0 => COL_A::VALUE1, 1 => COL_A::VALUE2, @@ -691,53 +718,57 @@ impl COL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input COLA is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == COL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input COLB is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == COL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input COLC is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == COL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input COLD is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == COL_A::VALUE4 } } #[doc = "Field `COL` writer - COL input"] -pub type COL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, COL_A, 2, O>; -impl<'a, const O: u8> COL_W<'a, O> { +pub type COL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, COL_A>; +impl<'a, REG> COL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input COLA is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(COL_A::VALUE1) } #[doc = "Data input COLB is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(COL_A::VALUE2) } #[doc = "Data input COLC is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(COL_A::VALUE3) } #[doc = "Data input COLD is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(COL_A::VALUE4) } } #[doc = "Field `CLK_TX` reader - CLK_TX input"] -pub type CLK_TX_R = crate::FieldReader; +pub type CLK_TX_R = crate::FieldReader; #[doc = "CLK_TX input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -757,10 +788,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CLK_TX_A { + type Ux = u8; +} impl CLK_TX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CLK_TX_A { + pub const fn variant(&self) -> CLK_TX_A { match self.bits { 0 => CLK_TX_A::VALUE1, 1 => CLK_TX_A::VALUE2, @@ -769,53 +803,57 @@ impl CLK_TX_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input CLK_TXA is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CLK_TX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input CLK_TXB is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CLK_TX_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input CLK_TXC is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLK_TX_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input CLK_TXD is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLK_TX_A::VALUE4 } } #[doc = "Field `CLK_TX` writer - CLK_TX input"] -pub type CLK_TX_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, CLK_TX_A, 2, O>; -impl<'a, const O: u8> CLK_TX_W<'a, O> { +pub type CLK_TX_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CLK_TX_A>; +impl<'a, REG> CLK_TX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input CLK_TXA is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CLK_TX_A::VALUE1) } #[doc = "Data input CLK_TXB is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CLK_TX_A::VALUE2) } #[doc = "Data input CLK_TXC is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLK_TX_A::VALUE3) } #[doc = "Data input CLK_TXD is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLK_TX_A::VALUE4) } } #[doc = "Field `MDIO` reader - MDIO Input Select"] -pub type MDIO_R = crate::FieldReader; +pub type MDIO_R = crate::FieldReader; #[doc = "MDIO Input Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -835,10 +873,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MDIO_A { + type Ux = u8; +} impl MDIO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MDIO_A { + pub const fn variant(&self) -> MDIO_A { match self.bits { 0 => MDIO_A::VALUE1, 1 => MDIO_A::VALUE2, @@ -847,48 +888,52 @@ impl MDIO_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input MDIA is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MDIO_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input MDIB is selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MDIO_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data input MDIC is selected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MDIO_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Data input MDID is selected"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MDIO_A::VALUE4 } } #[doc = "Field `MDIO` writer - MDIO Input Select"] -pub type MDIO_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ETH0_CON_SPEC, u8, MDIO_A, 2, O>; -impl<'a, const O: u8> MDIO_W<'a, O> { +pub type MDIO_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, MDIO_A>; +impl<'a, REG> MDIO_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data input MDIA is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MDIO_A::VALUE1) } #[doc = "Data input MDIB is selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MDIO_A::VALUE2) } #[doc = "Data input MDIC is selected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MDIO_A::VALUE3) } #[doc = "Data input MDID is selected"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MDIO_A::VALUE4) } } @@ -911,34 +956,37 @@ impl From for bool { impl INFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INFSEL_A { + pub const fn variant(&self) -> INFSEL_A { match self.bits { false => INFSEL_A::VALUE1, true => INFSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "MII"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INFSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "RMII"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INFSEL_A::VALUE2 } } #[doc = "Field `INFSEL` writer - Ethernet MAC Interface Selection"] -pub type INFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, ETH0_CON_SPEC, INFSEL_A, O>; -impl<'a, const O: u8> INFSEL_W<'a, O> { +pub type INFSEL_W<'a, REG> = crate::BitWriter<'a, REG, INFSEL_A>; +impl<'a, REG> INFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "MII"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INFSEL_A::VALUE1) } #[doc = "RMII"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INFSEL_A::VALUE2) } } @@ -1008,94 +1056,95 @@ impl W { #[doc = "Bits 0:1 - MAC Receive Input 0"] #[inline(always)] #[must_use] - pub fn rxd0(&mut self) -> RXD0_W<0> { - RXD0_W::new(self) + pub fn rxd0(&mut self) -> RXD0_W { + RXD0_W::new(self, 0) } #[doc = "Bits 2:3 - MAC Receive Input 1"] #[inline(always)] #[must_use] - pub fn rxd1(&mut self) -> RXD1_W<2> { - RXD1_W::new(self) + pub fn rxd1(&mut self) -> RXD1_W { + RXD1_W::new(self, 2) } #[doc = "Bits 4:5 - MAC Receive Input 2"] #[inline(always)] #[must_use] - pub fn rxd2(&mut self) -> RXD2_W<4> { - RXD2_W::new(self) + pub fn rxd2(&mut self) -> RXD2_W { + RXD2_W::new(self, 4) } #[doc = "Bits 6:7 - MAC Receive Input 3"] #[inline(always)] #[must_use] - pub fn rxd3(&mut self) -> RXD3_W<6> { - RXD3_W::new(self) + pub fn rxd3(&mut self) -> RXD3_W { + RXD3_W::new(self, 6) } #[doc = "Bits 8:9 - RMII clock input"] #[inline(always)] #[must_use] - pub fn clk_rmii(&mut self) -> CLK_RMII_W<8> { - CLK_RMII_W::new(self) + pub fn clk_rmii(&mut self) -> CLK_RMII_W { + CLK_RMII_W::new(self, 8) } #[doc = "Bits 10:11 - CRS_DV input"] #[inline(always)] #[must_use] - pub fn crs_dv(&mut self) -> CRS_DV_W<10> { - CRS_DV_W::new(self) + pub fn crs_dv(&mut self) -> CRS_DV_W { + CRS_DV_W::new(self, 10) } #[doc = "Bits 12:13 - CRS input"] #[inline(always)] #[must_use] - pub fn crs(&mut self) -> CRS_W<12> { - CRS_W::new(self) + pub fn crs(&mut self) -> CRS_W { + CRS_W::new(self, 12) } #[doc = "Bits 14:15 - RXER Input"] #[inline(always)] #[must_use] - pub fn rxer(&mut self) -> RXER_W<14> { - RXER_W::new(self) + pub fn rxer(&mut self) -> RXER_W { + RXER_W::new(self, 14) } #[doc = "Bits 16:17 - COL input"] #[inline(always)] #[must_use] - pub fn col(&mut self) -> COL_W<16> { - COL_W::new(self) + pub fn col(&mut self) -> COL_W { + COL_W::new(self, 16) } #[doc = "Bits 18:19 - CLK_TX input"] #[inline(always)] #[must_use] - pub fn clk_tx(&mut self) -> CLK_TX_W<18> { - CLK_TX_W::new(self) + pub fn clk_tx(&mut self) -> CLK_TX_W { + CLK_TX_W::new(self, 18) } #[doc = "Bits 22:23 - MDIO Input Select"] #[inline(always)] #[must_use] - pub fn mdio(&mut self) -> MDIO_W<22> { - MDIO_W::new(self) + pub fn mdio(&mut self) -> MDIO_W { + MDIO_W::new(self, 22) } #[doc = "Bit 26 - Ethernet MAC Interface Selection"] #[inline(always)] #[must_use] - pub fn infsel(&mut self) -> INFSEL_W<26> { - INFSEL_W::new(self) + pub fn infsel(&mut self) -> INFSEL_W { + INFSEL_W::new(self, 26) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Ethernet 0 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 [eth0_con](index.html) module"] +#[doc = "Ethernet 0 Port Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`eth0_con::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`eth0_con::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct ETH0_CON_SPEC; impl crate::RegisterSpec for ETH0_CON_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [eth0_con::R](R) reader structure"] -impl crate::Readable for ETH0_CON_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [eth0_con::W](W) writer structure"] +#[doc = "`read()` method returns [`eth0_con::R`](R) reader structure"] +impl crate::Readable for ETH0_CON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`eth0_con::W`](W) writer structure"] impl crate::Writable for ETH0_CON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/fce.rs b/src/fce.rs index 7c739802..cf693937 100644 --- a/src/fce.rs +++ b/src/fce.rs @@ -1,17 +1,29 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Clock Control Register"] - pub clc: CLC, + clc: CLC, _reserved1: [u8; 0x04], + id: ID, +} +impl RegisterBlock { + #[doc = "0x00 - Clock Control Register"] + #[inline(always)] + pub const fn clc(&self) -> &CLC { + &self.clc + } #[doc = "0x08 - Module Identification Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } } -#[doc = "CLC (rw) register accessor: an alias for `Reg`"] +#[doc = "CLC (rw) register accessor: Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clc`] +module"] pub type CLC = crate::Reg; #[doc = "Clock Control Register"] pub mod clc; -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] 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 4ab381c0..16516b3e 100644 --- a/src/fce/clc.rs +++ b/src/fce/clc.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DISR` reader - Module Disable Request Bit"] -pub type DISR_R = crate::BitReader; +pub type DISR_R = crate::BitReader; #[doc = "Field `DISR` writer - Module Disable Request Bit"] -pub type DISR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLC_SPEC, bool, O>; +pub type DISR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DISS` reader - Module Disable Status Bit"] -pub type DISS_R = crate::BitReader; +pub type DISS_R = crate::BitReader; impl R { #[doc = "Bit 0 - Module Disable Request Bit"] #[inline(always)] @@ -56,28 +24,29 @@ impl W { #[doc = "Bit 0 - Module Disable Request Bit"] #[inline(always)] #[must_use] - pub fn disr(&mut self) -> DISR_W<0> { - DISR_W::new(self) + pub fn disr(&mut self) -> DISR_W { + DISR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`clc::R`](R) reader structure"] +impl crate::Readable for CLC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`clc::W`](W) writer structure"] impl crate::Writable for CLC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/fce/id.rs b/src/fce/id.rs index f131bbc8..701794d7 100644 --- a/src/fce/id.rs +++ b/src/fce/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision Number"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number Value"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00ca_c001"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00ca_c001; diff --git a/src/fce_ke0.rs b/src/fce_ke0.rs index b5caab77..caa8c089 100644 --- a/src/fce_ke0.rs +++ b/src/fce_ke0.rs @@ -1,52 +1,93 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + ir: IR, + res: RES, + cfg: CFG, + sts: STS, + length: LENGTH, + check: CHECK, + crc: CRC, + ctr: CTR, +} +impl RegisterBlock { #[doc = "0x00 - Input Register"] - pub ir: IR, + #[inline(always)] + pub const fn ir(&self) -> &IR { + &self.ir + } #[doc = "0x04 - CRC Result Register"] - pub res: RES, + #[inline(always)] + pub const fn res(&self) -> &RES { + &self.res + } #[doc = "0x08 - CRC Configuration Register"] - pub cfg: CFG, + #[inline(always)] + pub const fn cfg(&self) -> &CFG { + &self.cfg + } #[doc = "0x0c - CRC Status Register"] - pub sts: STS, + #[inline(always)] + pub const fn sts(&self) -> &STS { + &self.sts + } #[doc = "0x10 - CRC Length Register"] - pub length: LENGTH, + #[inline(always)] + pub const fn length(&self) -> &LENGTH { + &self.length + } #[doc = "0x14 - CRC Check Register"] - pub check: CHECK, + #[inline(always)] + pub const fn check(&self) -> &CHECK { + &self.check + } #[doc = "0x18 - CRC Register"] - pub crc: CRC, + #[inline(always)] + pub const fn crc(&self) -> &CRC { + &self.crc + } #[doc = "0x1c - CRC Test Register"] - pub ctr: CTR, + #[inline(always)] + pub const fn ctr(&self) -> &CTR { + &self.ctr + } } -#[doc = "IR (rw) register accessor: an alias for `Reg`"] +#[doc = "IR (rw) register accessor: Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ir::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ir::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ir`] +module"] pub type IR = crate::Reg; #[doc = "Input Register"] pub mod ir; -#[doc = "RES (r) register accessor: an alias for `Reg`"] +#[doc = "RES (r) register accessor: CRC Result Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`res::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@res`] +module"] pub type RES = crate::Reg; #[doc = "CRC Result Register"] pub mod res; -#[doc = "CFG (rw) register accessor: an alias for `Reg`"] +#[doc = "CFG (rw) register accessor: CRC Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub type CFG = crate::Reg; #[doc = "CRC Configuration Register"] pub mod cfg; -#[doc = "STS (rw) register accessor: an alias for `Reg`"] +#[doc = "STS (rw) register accessor: CRC Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sts::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sts::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sts`] +module"] pub type STS = crate::Reg; #[doc = "CRC Status Register"] pub mod sts; -#[doc = "LENGTH (rw) register accessor: an alias for `Reg`"] +#[doc = "LENGTH (rw) register accessor: CRC Length Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`length::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`length::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@length`] +module"] pub type LENGTH = crate::Reg; #[doc = "CRC Length Register"] pub mod length; -#[doc = "CHECK (rw) register accessor: an alias for `Reg`"] +#[doc = "CHECK (rw) register accessor: CRC Check Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`check::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`check::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@check`] +module"] pub type CHECK = crate::Reg; #[doc = "CRC Check Register"] pub mod check; -#[doc = "CRC (rw) register accessor: an alias for `Reg`"] +#[doc = "CRC (rw) register accessor: CRC Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`crc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`crc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@crc`] +module"] pub type CRC = crate::Reg; #[doc = "CRC Register"] pub mod crc; -#[doc = "CTR (rw) register accessor: an alias for `Reg`"] +#[doc = "CTR (rw) register accessor: CRC Test Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctr`] +module"] 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 dd7a7470..23c46fd7 100644 --- a/src/fce_ke0/cfg.rs +++ b/src/fce_ke0/cfg.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CMI` reader - CRC Mismatch Interrupt"] pub type CMI_R = crate::BitReader; #[doc = "CRC Mismatch Interrupt\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CMI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMI_A { + pub const fn variant(&self) -> CMI_A { match self.bits { false => CMI_A::VALUE1, true => CMI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CRC Mismatch Interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CRC Mismatch Interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMI_A::VALUE2 } } #[doc = "Field `CMI` writer - CRC Mismatch Interrupt"] -pub type CMI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, CMI_A, O>; -impl<'a, const O: u8> CMI_W<'a, O> { +pub type CMI_W<'a, REG> = crate::BitWriter<'a, REG, CMI_A>; +impl<'a, REG> CMI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "CRC Mismatch Interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMI_A::VALUE1) } #[doc = "CRC Mismatch Interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMI_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CEI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEI_A { + pub const fn variant(&self) -> CEI_A { match self.bits { false => CEI_A::VALUE1, true => CEI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Configuration Error Interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Configuration Error Interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEI_A::VALUE2 } } #[doc = "Field `CEI` writer - Configuration Error Interrupt"] -pub type CEI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, CEI_A, O>; -impl<'a, const O: u8> CEI_W<'a, O> { +pub type CEI_W<'a, REG> = crate::BitWriter<'a, REG, CEI_A>; +impl<'a, REG> CEI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Configuration Error Interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEI_A::VALUE1) } #[doc = "Configuration Error Interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEI_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl LEI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LEI_A { + pub const fn variant(&self) -> LEI_A { match self.bits { false => LEI_A::VALUE1, true => LEI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Length Error Interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LEI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Length Error Interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LEI_A::VALUE2 } } #[doc = "Field `LEI` writer - Length Error Interrupt"] -pub type LEI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, LEI_A, O>; -impl<'a, const O: u8> LEI_W<'a, O> { +pub type LEI_W<'a, REG> = crate::BitWriter<'a, REG, LEI_A>; +impl<'a, REG> LEI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Length Error Interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LEI_A::VALUE1) } #[doc = "Length Error Interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LEI_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl BEI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BEI_A { + pub const fn variant(&self) -> BEI_A { match self.bits { false => BEI_A::VALUE1, true => BEI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Bus Error Interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BEI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bus Error Interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BEI_A::VALUE2 } } #[doc = "Field `BEI` writer - Bus Error Interrupt"] -pub type BEI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, BEI_A, O>; -impl<'a, const O: u8> BEI_W<'a, O> { +pub type BEI_W<'a, REG> = crate::BitWriter<'a, REG, BEI_A>; +impl<'a, REG> BEI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Bus Error Interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BEI_A::VALUE1) } #[doc = "Bus Error Interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BEI_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCE_A { + pub const fn variant(&self) -> CCE_A { match self.bits { false => CCE_A::VALUE1, true => CCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CRC check comparison at the end of a message is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CRC check comparison at the end of a message is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCE_A::VALUE2 } } #[doc = "Field `CCE` writer - CRC Check Comparison"] -pub type CCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, CCE_A, O>; -impl<'a, const O: u8> CCE_W<'a, O> { +pub type CCE_W<'a, REG> = crate::BitWriter<'a, REG, CCE_A>; +impl<'a, REG> CCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "CRC check comparison at the end of a message is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCE_A::VALUE1) } #[doc = "CRC check comparison at the end of a message is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCE_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl ALR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ALR_A { + pub const fn variant(&self) -> ALR_A { match self.bits { false => ALR_A::VALUE1, true => ALR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disables automatic reload of the LENGTH field."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ALR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enables automatic reload of the LENGTH field at the end of a message."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ALR_A::VALUE2 } } #[doc = "Field `ALR` writer - Automatic Length Reload"] -pub type ALR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, ALR_A, O>; -impl<'a, const O: u8> ALR_W<'a, O> { +pub type ALR_W<'a, REG> = crate::BitWriter<'a, REG, ALR_A>; +impl<'a, REG> ALR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disables automatic reload of the LENGTH field."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ALR_A::VALUE1) } #[doc = "Enables automatic reload of the LENGTH field at the end of a message."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ALR_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl REFIN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REFIN_A { + pub const fn variant(&self) -> REFIN_A { match self.bits { false => REFIN_A::VALUE1, true => REFIN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "IR Byte Wise Reflection is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REFIN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "IR Byte Wise Reflection is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REFIN_A::VALUE2 } } #[doc = "Field `REFIN` writer - IR Byte Wise Reflection"] -pub type REFIN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, REFIN_A, O>; -impl<'a, const O: u8> REFIN_W<'a, O> { +pub type REFIN_W<'a, REG> = crate::BitWriter<'a, REG, REFIN_A>; +impl<'a, REG> REFIN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "IR Byte Wise Reflection is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REFIN_A::VALUE1) } #[doc = "IR Byte Wise Reflection is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REFIN_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl REFOUT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REFOUT_A { + pub const fn variant(&self) -> REFOUT_A { match self.bits { false => REFOUT_A::VALUE1, true => REFOUT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CRC 32-bit wise is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REFOUT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CRC 32-bit wise is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REFOUT_A::VALUE2 } } #[doc = "Field `REFOUT` writer - CRC 32-Bit Wise Reflection"] -pub type REFOUT_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, REFOUT_A, O>; -impl<'a, const O: u8> REFOUT_W<'a, O> { +pub type REFOUT_W<'a, REG> = crate::BitWriter<'a, REG, REFOUT_A>; +impl<'a, REG> REFOUT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "CRC 32-bit wise is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REFOUT_A::VALUE1) } #[doc = "CRC 32-bit wise is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REFOUT_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl XSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XSEL_A { + pub const fn variant(&self) -> XSEL_A { match self.bits { false => XSEL_A::VALUE1, true => XSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "0x00000000"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "0xFFFFFFFF"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XSEL_A::VALUE2 } } #[doc = "Field `XSEL` writer - Selects the value to be xored with the final CRC"] -pub type XSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, XSEL_A, O>; -impl<'a, const O: u8> XSEL_W<'a, O> { +pub type XSEL_W<'a, REG> = crate::BitWriter<'a, REG, XSEL_A>; +impl<'a, REG> XSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "0x00000000"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XSEL_A::VALUE1) } #[doc = "0xFFFFFFFF"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XSEL_A::VALUE2) } } @@ -535,76 +530,77 @@ impl W { #[doc = "Bit 0 - CRC Mismatch Interrupt"] #[inline(always)] #[must_use] - pub fn cmi(&mut self) -> CMI_W<0> { - CMI_W::new(self) + pub fn cmi(&mut self) -> CMI_W { + CMI_W::new(self, 0) } #[doc = "Bit 1 - Configuration Error Interrupt"] #[inline(always)] #[must_use] - pub fn cei(&mut self) -> CEI_W<1> { - CEI_W::new(self) + pub fn cei(&mut self) -> CEI_W { + CEI_W::new(self, 1) } #[doc = "Bit 2 - Length Error Interrupt"] #[inline(always)] #[must_use] - pub fn lei(&mut self) -> LEI_W<2> { - LEI_W::new(self) + pub fn lei(&mut self) -> LEI_W { + LEI_W::new(self, 2) } #[doc = "Bit 3 - Bus Error Interrupt"] #[inline(always)] #[must_use] - pub fn bei(&mut self) -> BEI_W<3> { - BEI_W::new(self) + pub fn bei(&mut self) -> BEI_W { + BEI_W::new(self, 3) } #[doc = "Bit 4 - CRC Check Comparison"] #[inline(always)] #[must_use] - pub fn cce(&mut self) -> CCE_W<4> { - CCE_W::new(self) + pub fn cce(&mut self) -> CCE_W { + CCE_W::new(self, 4) } #[doc = "Bit 5 - Automatic Length Reload"] #[inline(always)] #[must_use] - pub fn alr(&mut self) -> ALR_W<5> { - ALR_W::new(self) + pub fn alr(&mut self) -> ALR_W { + ALR_W::new(self, 5) } #[doc = "Bit 8 - IR Byte Wise Reflection"] #[inline(always)] #[must_use] - pub fn refin(&mut self) -> REFIN_W<8> { - REFIN_W::new(self) + pub fn refin(&mut self) -> REFIN_W { + REFIN_W::new(self, 8) } #[doc = "Bit 9 - CRC 32-Bit Wise Reflection"] #[inline(always)] #[must_use] - pub fn refout(&mut self) -> REFOUT_W<9> { - REFOUT_W::new(self) + pub fn refout(&mut self) -> REFOUT_W { + REFOUT_W::new(self, 9) } #[doc = "Bit 10 - Selects the value to be xored with the final CRC"] #[inline(always)] #[must_use] - pub fn xsel(&mut self) -> XSEL_W<10> { - XSEL_W::new(self) + pub fn xsel(&mut self) -> XSEL_W { + XSEL_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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)."] +#[doc = "CRC Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. 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"] +#[doc = "`read()` method returns [`cfg::R`](R) reader structure"] +impl crate::Readable for CFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cfg::W`](W) writer structure"] impl crate::Writable for CFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/fce_ke0/check.rs b/src/fce_ke0/check.rs index 30353444..79fa2c84 100644 --- a/src/fce_ke0/check.rs +++ b/src/fce_ke0/check.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CHECK` reader - CHECK Register"] -pub type CHECK_R = crate::FieldReader; +pub type CHECK_R = crate::FieldReader; #[doc = "Field `CHECK` writer - CHECK Register"] -pub type CHECK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CHECK_SPEC, u32, u32, 32, O>; +pub type CHECK_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - CHECK Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - CHECK Register"] #[inline(always)] #[must_use] - pub fn check(&mut self) -> CHECK_W<0> { - CHECK_W::new(self) + pub fn check(&mut self) -> CHECK_W { + CHECK_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CRC Check Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`check::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`check::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`check::R`](R) reader structure"] +impl crate::Readable for CHECK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`check::W`](W) writer structure"] impl crate::Writable for CHECK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/fce_ke0/crc.rs b/src/fce_ke0/crc.rs index f60902e0..45253c01 100644 --- a/src/fce_ke0/crc.rs +++ b/src/fce_ke0/crc.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CRC` reader - CRC Register"] -pub type CRC_R = crate::FieldReader; +pub type CRC_R = crate::FieldReader; #[doc = "Field `CRC` writer - CRC Register"] -pub type CRC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CRC_SPEC, u32, u32, 32, O>; +pub type CRC_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - CRC Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - CRC Register"] #[inline(always)] #[must_use] - pub fn crc(&mut self) -> CRC_W<0> { - CRC_W::new(self) + pub fn crc(&mut self) -> CRC_W { + CRC_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CRC Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`crc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`crc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`crc::R`](R) reader structure"] +impl crate::Readable for CRC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`crc::W`](W) writer structure"] impl crate::Writable for CRC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/fce_ke0/ctr.rs b/src/fce_ke0/ctr.rs index e2d7f3d8..0c4536ee 100644 --- a/src/fce_ke0/ctr.rs +++ b/src/fce_ke0/ctr.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `FCM` reader - Force CRC Mismatch"] -pub type FCM_R = crate::BitReader; +pub type FCM_R = crate::BitReader; #[doc = "Field `FCM` writer - Force CRC Mismatch"] -pub type FCM_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type FCM_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FRM_CFG` reader - Force CFG Register Mismatch"] -pub type FRM_CFG_R = crate::BitReader; +pub type FRM_CFG_R = crate::BitReader; #[doc = "Field `FRM_CFG` writer - Force CFG Register Mismatch"] -pub type FRM_CFG_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type FRM_CFG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FRM_CHECK` reader - Force Check Register Mismatch"] -pub type FRM_CHECK_R = crate::BitReader; +pub type FRM_CHECK_R = crate::BitReader; #[doc = "Field `FRM_CHECK` writer - Force Check Register Mismatch"] -pub type FRM_CHECK_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type FRM_CHECK_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Force CRC Mismatch"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bit 0 - Force CRC Mismatch"] #[inline(always)] #[must_use] - pub fn fcm(&mut self) -> FCM_W<0> { - FCM_W::new(self) + pub fn fcm(&mut self) -> FCM_W { + FCM_W::new(self, 0) } #[doc = "Bit 1 - Force CFG Register Mismatch"] #[inline(always)] #[must_use] - pub fn frm_cfg(&mut self) -> FRM_CFG_W<1> { - FRM_CFG_W::new(self) + pub fn frm_cfg(&mut self) -> FRM_CFG_W { + FRM_CFG_W::new(self, 1) } #[doc = "Bit 2 - Force Check Register Mismatch"] #[inline(always)] #[must_use] - pub fn frm_check(&mut self) -> FRM_CHECK_W<2> { - FRM_CHECK_W::new(self) + pub fn frm_check(&mut self) -> FRM_CHECK_W { + FRM_CHECK_W::new(self, 2) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CRC Test Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ctr::R`](R) reader structure"] +impl crate::Readable for CTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ctr::W`](W) writer structure"] impl crate::Writable for CTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/fce_ke0/ir.rs b/src/fce_ke0/ir.rs index e544ae12..dd0e0ad3 100644 --- a/src/fce_ke0/ir.rs +++ b/src/fce_ke0/ir.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `IR` reader - Input Register"] -pub type IR_R = crate::FieldReader; +pub type IR_R = crate::FieldReader; #[doc = "Field `IR` writer - Input Register"] -pub type IR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IR_SPEC, u32, u32, 32, O>; +pub type IR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Input Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Input Register"] #[inline(always)] #[must_use] - pub fn ir(&mut self) -> IR_W<0> { - IR_W::new(self) + pub fn ir(&mut self) -> IR_W { + IR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ir::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ir::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ir::R`](R) reader structure"] +impl crate::Readable for IR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ir::W`](W) writer structure"] impl crate::Writable for IR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/fce_ke0/length.rs b/src/fce_ke0/length.rs index 7d1c9572..b960dc79 100644 --- a/src/fce_ke0/length.rs +++ b/src/fce_ke0/length.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `LENGTH` reader - Message Length Register"] -pub type LENGTH_R = crate::FieldReader; +pub type LENGTH_R = crate::FieldReader; #[doc = "Field `LENGTH` writer - Message Length Register"] -pub type LENGTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LENGTH_SPEC, u16, u16, 16, O>; +pub type LENGTH_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Message Length Register"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Message Length Register"] #[inline(always)] #[must_use] - pub fn length(&mut self) -> LENGTH_W<0> { - LENGTH_W::new(self) + pub fn length(&mut self) -> LENGTH_W { + LENGTH_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CRC Length Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`length::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`length::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`length::R`](R) reader structure"] +impl crate::Readable for LENGTH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`length::W`](W) writer structure"] impl crate::Writable for LENGTH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/fce_ke0/res.rs b/src/fce_ke0/res.rs index ff71679f..f0138817 100644 --- a/src/fce_ke0/res.rs +++ b/src/fce_ke0/res.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `RES` reader - Result Register"] -pub type RES_R = crate::FieldReader; +pub type RES_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Result Register"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { RES_R::new(self.bits) } } -#[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"] +#[doc = "CRC Result Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`res::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`res::R`](R) reader structure"] +impl crate::Readable for RES_SPEC {} #[doc = "`reset()` method sets RES to value 0xffff_ffff"] impl crate::Resettable for RES_SPEC { const RESET_VALUE: Self::Ux = 0xffff_ffff; diff --git a/src/fce_ke0/sts.rs b/src/fce_ke0/sts.rs index 6c2a3bba..ea2fd671 100644 --- a/src/fce_ke0/sts.rs +++ b/src/fce_ke0/sts.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CMF` reader - CRC Mismatch Flag"] -pub type CMF_R = crate::BitReader; +pub type CMF_R = crate::BitReader; #[doc = "Field `CMF` writer - CRC Mismatch Flag"] -pub type CMF_W<'a, const O: u8> = crate::BitWriter<'a, u32, STS_SPEC, bool, O>; +pub type CMF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CEF` reader - Configuration Error Flag"] -pub type CEF_R = crate::BitReader; +pub type CEF_R = crate::BitReader; #[doc = "Field `CEF` writer - Configuration Error Flag"] -pub type CEF_W<'a, const O: u8> = crate::BitWriter<'a, u32, STS_SPEC, bool, O>; +pub type CEF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LEF` reader - Length Error Flag"] -pub type LEF_R = crate::BitReader; +pub type LEF_R = crate::BitReader; #[doc = "Field `LEF` writer - Length Error Flag"] -pub type LEF_W<'a, const O: u8> = crate::BitWriter<'a, u32, STS_SPEC, bool, O>; +pub type LEF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BEF` reader - Bus Error Flag"] -pub type BEF_R = crate::BitReader; +pub type BEF_R = crate::BitReader; #[doc = "Field `BEF` writer - Bus Error Flag"] -pub type BEF_W<'a, const O: u8> = crate::BitWriter<'a, u32, STS_SPEC, bool, O>; +pub type BEF_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - CRC Mismatch Flag"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bit 0 - CRC Mismatch Flag"] #[inline(always)] #[must_use] - pub fn cmf(&mut self) -> CMF_W<0> { - CMF_W::new(self) + pub fn cmf(&mut self) -> CMF_W { + CMF_W::new(self, 0) } #[doc = "Bit 1 - Configuration Error Flag"] #[inline(always)] #[must_use] - pub fn cef(&mut self) -> CEF_W<1> { - CEF_W::new(self) + pub fn cef(&mut self) -> CEF_W { + CEF_W::new(self, 1) } #[doc = "Bit 2 - Length Error Flag"] #[inline(always)] #[must_use] - pub fn lef(&mut self) -> LEF_W<2> { - LEF_W::new(self) + pub fn lef(&mut self) -> LEF_W { + LEF_W::new(self, 2) } #[doc = "Bit 3 - Bus Error Flag"] #[inline(always)] #[must_use] - pub fn bef(&mut self) -> BEF_W<3> { - BEF_W::new(self) + pub fn bef(&mut self) -> BEF_W { + BEF_W::new(self, 3) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CRC Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sts::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sts::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sts::R`](R) reader structure"] +impl crate::Readable for STS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sts::W`](W) writer structure"] impl crate::Writable for STS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/flash0.rs b/src/flash0.rs index bf0f84ec..040dbe14 100644 --- a/src/flash0.rs +++ b/src/flash0.rs @@ -2,48 +2,85 @@ #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 0x1008], - #[doc = "0x1008 - Flash Module Identification Register"] - pub id: ID, + id: ID, _reserved1: [u8; 0x04], + fsr: FSR, + fcon: FCON, + marp: MARP, + _reserved4: [u8; 0x04], + procon0: PROCON0, + procon1: PROCON1, + procon2: PROCON2, +} +impl RegisterBlock { + #[doc = "0x1008 - Flash Module Identification Register"] + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } #[doc = "0x1010 - Flash Status Register"] - pub fsr: FSR, + #[inline(always)] + pub const fn fsr(&self) -> &FSR { + &self.fsr + } #[doc = "0x1014 - Flash Configuration Register"] - pub fcon: FCON, + #[inline(always)] + pub const fn fcon(&self) -> &FCON { + &self.fcon + } #[doc = "0x1018 - Margin Control Register PFLASH"] - pub marp: MARP, - _reserved4: [u8; 0x04], + #[inline(always)] + pub const fn marp(&self) -> &MARP { + &self.marp + } #[doc = "0x1020 - Flash Protection Configuration Register User 0"] - pub procon0: PROCON0, + #[inline(always)] + pub const fn procon0(&self) -> &PROCON0 { + &self.procon0 + } #[doc = "0x1024 - Flash Protection Configuration Register User 1"] - pub procon1: PROCON1, + #[inline(always)] + pub const fn procon1(&self) -> &PROCON1 { + &self.procon1 + } #[doc = "0x1028 - Flash Protection Configuration Register User 2"] - pub procon2: PROCON2, + #[inline(always)] + pub const fn procon2(&self) -> &PROCON2 { + &self.procon2 + } } -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: Flash Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "Flash Module Identification Register"] pub mod id; -#[doc = "FSR (r) register accessor: an alias for `Reg`"] +#[doc = "FSR (r) register accessor: Flash Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fsr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fsr`] +module"] pub type FSR = crate::Reg; #[doc = "Flash Status Register"] pub mod fsr; -#[doc = "FCON (rw) register accessor: an alias for `Reg`"] +#[doc = "FCON (rw) register accessor: Flash Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fcon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fcon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fcon`] +module"] pub type FCON = crate::Reg; #[doc = "Flash Configuration Register"] pub mod fcon; -#[doc = "MARP (rw) register accessor: an alias for `Reg`"] +#[doc = "MARP (rw) register accessor: Margin Control Register PFLASH\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`marp::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`marp::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@marp`] +module"] pub type MARP = crate::Reg; #[doc = "Margin Control Register PFLASH"] pub mod marp; -#[doc = "PROCON0 (r) register accessor: an alias for `Reg`"] +#[doc = "PROCON0 (r) register accessor: Flash Protection Configuration Register User 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`procon0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@procon0`] +module"] pub type PROCON0 = crate::Reg; #[doc = "Flash Protection Configuration Register User 0"] pub mod procon0; -#[doc = "PROCON1 (r) register accessor: an alias for `Reg`"] +#[doc = "PROCON1 (r) register accessor: Flash Protection Configuration Register User 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`procon1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@procon1`] +module"] pub type PROCON1 = crate::Reg; #[doc = "Flash Protection Configuration Register User 1"] pub mod procon1; -#[doc = "PROCON2 (r) register accessor: an alias for `Reg`"] +#[doc = "PROCON2 (r) register accessor: Flash Protection Configuration Register User 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`procon2::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@procon2`] +module"] 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 b76907ae..337174c1 100644 --- a/src/flash0/fcon.rs +++ b/src/flash0/fcon.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WSPFLASH` reader - Wait States for read access to PFLASH"] -pub type WSPFLASH_R = crate::FieldReader; +pub type WSPFLASH_R = crate::FieldReader; #[doc = "Wait States for read access to PFLASH\n\nValue on reset: 6"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for WSPFLASH_A { + type Ux = u8; +} impl WSPFLASH_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(WSPFLASH_A::VALUE1), 1 => Some(WSPFLASH_A::VALUE2), @@ -70,58 +41,62 @@ impl WSPFLASH_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PFLASH access in one clock cycle"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WSPFLASH_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "PFLASH access in one clock cycle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WSPFLASH_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "PFLASH access in two clock cycles"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == WSPFLASH_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "PFLASH access in three clock cycles"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == WSPFLASH_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "PFLASH access in fifteen clock cycles."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == WSPFLASH_A::VALUE5 } } #[doc = "Field `WSPFLASH` writer - Wait States for read access to PFLASH"] -pub type WSPFLASH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FCON_SPEC, u8, WSPFLASH_A, 4, O>; -impl<'a, const O: u8> WSPFLASH_W<'a, O> { +pub type WSPFLASH_W<'a, REG> = crate::FieldWriter<'a, REG, 4, WSPFLASH_A>; +impl<'a, REG> WSPFLASH_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "PFLASH access in one clock cycle"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WSPFLASH_A::VALUE1) } #[doc = "PFLASH access in one clock cycle"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WSPFLASH_A::VALUE2) } #[doc = "PFLASH access in two clock cycles"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(WSPFLASH_A::VALUE3) } #[doc = "PFLASH access in three clock cycles"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(WSPFLASH_A::VALUE4) } #[doc = "PFLASH access in fifteen clock cycles."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(WSPFLASH_A::VALUE5) } } @@ -144,34 +119,37 @@ impl From for bool { impl WSECPF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WSECPF_A { + pub const fn variant(&self) -> WSECPF_A { match self.bits { false => WSECPF_A::VALUE1, true => WSECPF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No additional wait state for error correction"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WSECPF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "One additional wait state for error correction during read access to Program Flash. If enabled, this wait state is only used for the first transfer of a burst transfer."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WSECPF_A::VALUE2 } } #[doc = "Field `WSECPF` writer - Wait State for Error Correction of PFLASH"] -pub type WSECPF_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, WSECPF_A, O>; -impl<'a, const O: u8> WSECPF_W<'a, O> { +pub type WSECPF_W<'a, REG> = crate::BitWriter<'a, REG, WSECPF_A>; +impl<'a, REG> WSECPF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No additional wait state for error correction"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WSECPF_A::VALUE1) } #[doc = "One additional wait state for error correction during read access to Program Flash. If enabled, this wait state is only used for the first transfer of a burst transfer."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WSECPF_A::VALUE2) } } @@ -194,34 +172,37 @@ impl From for bool { impl IDLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IDLE_A { + pub const fn variant(&self) -> IDLE_A { match self.bits { false => IDLE_A::VALUE1, true => IDLE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal/standard Flash read operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IDLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dynamic idle of Program Flash enabled for power saving; static prefetching disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IDLE_A::VALUE2 } } #[doc = "Field `IDLE` writer - Dynamic Flash Idle"] -pub type IDLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, IDLE_A, O>; -impl<'a, const O: u8> IDLE_W<'a, O> { +pub type IDLE_W<'a, REG> = crate::BitWriter<'a, REG, IDLE_A>; +impl<'a, REG> IDLE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal/standard Flash read operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IDLE_A::VALUE1) } #[doc = "Dynamic idle of Program Flash enabled for power saving; static prefetching disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IDLE_A::VALUE2) } } @@ -244,34 +225,37 @@ impl From for bool { impl ESLDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ESLDIS_A { + pub const fn variant(&self) -> ESLDIS_A { match self.bits { false => ESLDIS_A::VALUE1, true => ESLDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External sleep request signal input is enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ESLDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Externally requested Flash sleep is disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ESLDIS_A::VALUE2 } } #[doc = "Field `ESLDIS` writer - External Sleep Request Disable"] -pub type ESLDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, ESLDIS_A, O>; -impl<'a, const O: u8> ESLDIS_W<'a, O> { +pub type ESLDIS_W<'a, REG> = crate::BitWriter<'a, REG, ESLDIS_A>; +impl<'a, REG> ESLDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External sleep request signal input is enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ESLDIS_A::VALUE1) } #[doc = "Externally requested Flash sleep is disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ESLDIS_A::VALUE2) } } @@ -294,34 +278,37 @@ impl From for bool { impl SLEEP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SLEEP_A { + pub const fn variant(&self) -> SLEEP_A { match self.bits { false => SLEEP_A::VALUE1, true => SLEEP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal state or wake-up"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SLEEP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flash sleep mode is requested"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SLEEP_A::VALUE2 } } #[doc = "Field `SLEEP` writer - Flash SLEEP"] -pub type SLEEP_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, SLEEP_A, O>; -impl<'a, const O: u8> SLEEP_W<'a, O> { +pub type SLEEP_W<'a, REG> = crate::BitWriter<'a, REG, SLEEP_A>; +impl<'a, REG> SLEEP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal state or wake-up"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SLEEP_A::VALUE1) } #[doc = "Flash sleep mode is requested"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SLEEP_A::VALUE2) } } @@ -344,18 +331,18 @@ impl From for bool { impl RPA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RPA_A { + pub const fn variant(&self) -> RPA_A { match self.bits { false => RPA_A::VALUE1, true => RPA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The Flash-internal read protection is not activated. Bits DCF, DDF are not taken into account. Bits DCF, DDFx can be cleared"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RPA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The Flash-internal read protection is activated. Bits DCF, DDF are enabled and evaluated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RPA_A::VALUE2 @@ -380,34 +367,37 @@ impl From for bool { impl DCF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DCF_A { + pub const fn variant(&self) -> DCF_A { match self.bits { false => DCF_A::VALUE1, true => DCF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Code fetching from the Flash memory area is allowed."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DCF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Code fetching from the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DCF_A::VALUE2 } } #[doc = "Field `DCF` writer - Disable Code Fetch from Flash Memory"] -pub type DCF_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, DCF_A, O>; -impl<'a, const O: u8> DCF_W<'a, O> { +pub type DCF_W<'a, REG> = crate::BitWriter<'a, REG, DCF_A>; +impl<'a, REG> DCF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Code fetching from the Flash memory area is allowed."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DCF_A::VALUE1) } #[doc = "Code fetching from the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DCF_A::VALUE2) } } @@ -430,34 +420,37 @@ impl From for bool { impl DDF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DDF_A { + pub const fn variant(&self) -> DDF_A { match self.bits { false => DDF_A::VALUE1, true => DDF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data read access to the Flash memory area is allowed."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DDF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data read access to the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DDF_A::VALUE2 } } #[doc = "Field `DDF` writer - Disable Any Data Fetch from Flash"] -pub type DDF_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, DDF_A, O>; -impl<'a, const O: u8> DDF_W<'a, O> { +pub type DDF_W<'a, REG> = crate::BitWriter<'a, REG, DDF_A>; +impl<'a, REG> DDF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Data read access to the Flash memory area is allowed."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DDF_A::VALUE1) } #[doc = "Data read access to the Flash memory area is not allowed. This bit is not taken into account while RPA='0'."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DDF_A::VALUE2) } } @@ -480,34 +473,37 @@ impl From for bool { impl VOPERM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VOPERM_A { + pub const fn variant(&self) -> VOPERM_A { match self.bits { false => VOPERM_A::VALUE1, true => VOPERM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt not enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VOPERM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flash interrupt because of Verify Error or Operation Error in Flash array (FSI) is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VOPERM_A::VALUE2 } } #[doc = "Field `VOPERM` writer - Verify and Operation Error Interrupt Mask"] -pub type VOPERM_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, VOPERM_A, O>; -impl<'a, const O: u8> VOPERM_W<'a, O> { +pub type VOPERM_W<'a, REG> = crate::BitWriter<'a, REG, VOPERM_A>; +impl<'a, REG> VOPERM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Interrupt not enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VOPERM_A::VALUE1) } #[doc = "Flash interrupt because of Verify Error or Operation Error in Flash array (FSI) is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VOPERM_A::VALUE2) } } @@ -530,34 +526,37 @@ impl From for bool { impl SQERM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SQERM_A { + pub const fn variant(&self) -> SQERM_A { match self.bits { false => SQERM_A::VALUE1, true => SQERM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt not enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SQERM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flash interrupt because of Sequence Error is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SQERM_A::VALUE2 } } #[doc = "Field `SQERM` writer - Command Sequence Error Interrupt Mask"] -pub type SQERM_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, SQERM_A, O>; -impl<'a, const O: u8> SQERM_W<'a, O> { +pub type SQERM_W<'a, REG> = crate::BitWriter<'a, REG, SQERM_A>; +impl<'a, REG> SQERM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Interrupt not enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SQERM_A::VALUE1) } #[doc = "Flash interrupt because of Sequence Error is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SQERM_A::VALUE2) } } @@ -580,34 +579,37 @@ impl From for bool { impl PROERM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PROERM_A { + pub const fn variant(&self) -> PROERM_A { match self.bits { false => PROERM_A::VALUE1, true => PROERM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt not enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PROERM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flash interrupt because of Protection Error is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PROERM_A::VALUE2 } } #[doc = "Field `PROERM` writer - Protection Error Interrupt Mask"] -pub type PROERM_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, PROERM_A, O>; -impl<'a, const O: u8> PROERM_W<'a, O> { +pub type PROERM_W<'a, REG> = crate::BitWriter<'a, REG, PROERM_A>; +impl<'a, REG> PROERM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Interrupt not enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PROERM_A::VALUE1) } #[doc = "Flash interrupt because of Protection Error is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PROERM_A::VALUE2) } } @@ -630,34 +632,37 @@ impl From for bool { impl PFSBERM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PFSBERM_A { + pub const fn variant(&self) -> PFSBERM_A { match self.bits { false => PFSBERM_A::VALUE1, true => PFSBERM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No Single-Bit Error interrupt enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PFSBERM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Single-Bit Error interrupt enabled for PFLASH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PFSBERM_A::VALUE2 } } #[doc = "Field `PFSBERM` writer - PFLASH Single-Bit Error Interrupt Mask"] -pub type PFSBERM_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, PFSBERM_A, O>; -impl<'a, const O: u8> PFSBERM_W<'a, O> { +pub type PFSBERM_W<'a, REG> = crate::BitWriter<'a, REG, PFSBERM_A>; +impl<'a, REG> PFSBERM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No Single-Bit Error interrupt enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PFSBERM_A::VALUE1) } #[doc = "Single-Bit Error interrupt enabled for PFLASH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PFSBERM_A::VALUE2) } } @@ -680,34 +685,37 @@ impl From for bool { impl PFDBERM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PFDBERM_A { + pub const fn variant(&self) -> PFDBERM_A { match self.bits { false => PFDBERM_A::VALUE1, true => PFDBERM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Double-Bit Error interrupt for PFLASH not enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PFDBERM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Double-Bit Error interrupt for PFLASH enabled. Especially intended for margin check"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PFDBERM_A::VALUE2 } } #[doc = "Field `PFDBERM` writer - PFLASH Double-Bit Error Interrupt Mask"] -pub type PFDBERM_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, PFDBERM_A, O>; -impl<'a, const O: u8> PFDBERM_W<'a, O> { +pub type PFDBERM_W<'a, REG> = crate::BitWriter<'a, REG, PFDBERM_A>; +impl<'a, REG> PFDBERM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Double-Bit Error interrupt for PFLASH not enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PFDBERM_A::VALUE1) } #[doc = "Double-Bit Error interrupt for PFLASH enabled. Especially intended for margin check"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PFDBERM_A::VALUE2) } } @@ -730,34 +738,37 @@ impl From for bool { impl EOBM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EOBM_A { + pub const fn variant(&self) -> EOBM_A { match self.bits { false => EOBM_A::VALUE1, true => EOBM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Interrupt not enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EOBM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "EOB interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EOBM_A::VALUE2 } } #[doc = "Field `EOBM` writer - End of Busy Interrupt Mask"] -pub type EOBM_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCON_SPEC, EOBM_A, O>; -impl<'a, const O: u8> EOBM_W<'a, O> { +pub type EOBM_W<'a, REG> = crate::BitWriter<'a, REG, EOBM_A>; +impl<'a, REG> EOBM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Interrupt not enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EOBM_A::VALUE1) } #[doc = "EOB interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EOBM_A::VALUE2) } } @@ -837,100 +848,101 @@ impl W { #[doc = "Bits 0:3 - Wait States for read access to PFLASH"] #[inline(always)] #[must_use] - pub fn wspflash(&mut self) -> WSPFLASH_W<0> { - WSPFLASH_W::new(self) + pub fn wspflash(&mut self) -> WSPFLASH_W { + WSPFLASH_W::new(self, 0) } #[doc = "Bit 4 - Wait State for Error Correction of PFLASH"] #[inline(always)] #[must_use] - pub fn wsecpf(&mut self) -> WSECPF_W<4> { - WSECPF_W::new(self) + pub fn wsecpf(&mut self) -> WSECPF_W { + WSECPF_W::new(self, 4) } #[doc = "Bit 13 - Dynamic Flash Idle"] #[inline(always)] #[must_use] - pub fn idle(&mut self) -> IDLE_W<13> { - IDLE_W::new(self) + pub fn idle(&mut self) -> IDLE_W { + IDLE_W::new(self, 13) } #[doc = "Bit 14 - External Sleep Request Disable"] #[inline(always)] #[must_use] - pub fn esldis(&mut self) -> ESLDIS_W<14> { - ESLDIS_W::new(self) + pub fn esldis(&mut self) -> ESLDIS_W { + ESLDIS_W::new(self, 14) } #[doc = "Bit 15 - Flash SLEEP"] #[inline(always)] #[must_use] - pub fn sleep(&mut self) -> SLEEP_W<15> { - SLEEP_W::new(self) + pub fn sleep(&mut self) -> SLEEP_W { + SLEEP_W::new(self, 15) } #[doc = "Bit 17 - Disable Code Fetch from Flash Memory"] #[inline(always)] #[must_use] - pub fn dcf(&mut self) -> DCF_W<17> { - DCF_W::new(self) + pub fn dcf(&mut self) -> DCF_W { + DCF_W::new(self, 17) } #[doc = "Bit 18 - Disable Any Data Fetch from Flash"] #[inline(always)] #[must_use] - pub fn ddf(&mut self) -> DDF_W<18> { - DDF_W::new(self) + pub fn ddf(&mut self) -> DDF_W { + DDF_W::new(self, 18) } #[doc = "Bit 24 - Verify and Operation Error Interrupt Mask"] #[inline(always)] #[must_use] - pub fn voperm(&mut self) -> VOPERM_W<24> { - VOPERM_W::new(self) + pub fn voperm(&mut self) -> VOPERM_W { + VOPERM_W::new(self, 24) } #[doc = "Bit 25 - Command Sequence Error Interrupt Mask"] #[inline(always)] #[must_use] - pub fn sqerm(&mut self) -> SQERM_W<25> { - SQERM_W::new(self) + pub fn sqerm(&mut self) -> SQERM_W { + SQERM_W::new(self, 25) } #[doc = "Bit 26 - Protection Error Interrupt Mask"] #[inline(always)] #[must_use] - pub fn proerm(&mut self) -> PROERM_W<26> { - PROERM_W::new(self) + pub fn proerm(&mut self) -> PROERM_W { + PROERM_W::new(self, 26) } #[doc = "Bit 27 - PFLASH Single-Bit Error Interrupt Mask"] #[inline(always)] #[must_use] - pub fn pfsberm(&mut self) -> PFSBERM_W<27> { - PFSBERM_W::new(self) + pub fn pfsberm(&mut self) -> PFSBERM_W { + PFSBERM_W::new(self, 27) } #[doc = "Bit 29 - PFLASH Double-Bit Error Interrupt Mask"] #[inline(always)] #[must_use] - pub fn pfdberm(&mut self) -> PFDBERM_W<29> { - PFDBERM_W::new(self) + pub fn pfdberm(&mut self) -> PFDBERM_W { + PFDBERM_W::new(self, 29) } #[doc = "Bit 31 - End of Busy Interrupt Mask"] #[inline(always)] #[must_use] - pub fn eobm(&mut self) -> EOBM_W<31> { - EOBM_W::new(self) + pub fn eobm(&mut self) -> EOBM_W { + EOBM_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Flash Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fcon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fcon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fcon::R`](R) reader structure"] +impl crate::Readable for FCON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fcon::W`](W) writer structure"] impl crate::Writable for FCON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/flash0/fsr.rs b/src/flash0/fsr.rs index e5381c0d..86364508 100644 --- a/src/flash0/fsr.rs +++ b/src/flash0/fsr.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PBUSY` reader - Program Flash Busy"] pub type PBUSY_R = crate::BitReader; #[doc = "Program Flash Busy\n\nValue on reset: 0"] @@ -32,25 +19,25 @@ impl From for bool { impl PBUSY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PBUSY_A { + pub const fn variant(&self) -> PBUSY_A { match self.bits { false => PBUSY_A::VALUE1, true => PBUSY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PFLASH ready, not busy; PFLASH in read mode."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PBUSY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "PFLASH busy; PFLASH not in read mode."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PBUSY_A::VALUE2 } } #[doc = "Field `FABUSY` reader - Flash Array Busy"] -pub type FABUSY_R = crate::BitReader; +pub type FABUSY_R = crate::BitReader; #[doc = "Field `PROG` reader - Programming State"] pub type PROG_R = crate::BitReader; #[doc = "Programming State\n\nValue on reset: 0"] @@ -70,18 +57,18 @@ impl From for bool { impl PROG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PROG_A { + pub const fn variant(&self) -> PROG_A { match self.bits { false => PROG_A::VALUE1, true => PROG_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "There is no program operation requested or in progress or just finished."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PROG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Programming operation (write page) requested (from FIM) or in action or finished."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PROG_A::VALUE2 @@ -106,18 +93,18 @@ impl From for bool { impl ERASE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERASE_A { + pub const fn variant(&self) -> ERASE_A { match self.bits { false => ERASE_A::VALUE1, true => ERASE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "There is no erase operation requested or in progress or just finished"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERASE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Erase operation requested (from FIM) or in action or finished."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERASE_A::VALUE2 @@ -142,18 +129,18 @@ impl From for bool { impl PFPAGE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PFPAGE_A { + pub const fn variant(&self) -> PFPAGE_A { match self.bits { false => PFPAGE_A::VALUE1, true => PFPAGE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Program Flash not in page mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PFPAGE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Program Flash in page mode; assembly buffer of PFLASH (256 byte) is in use (being filled up)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PFPAGE_A::VALUE2 @@ -178,18 +165,18 @@ impl From for bool { impl PFOPER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PFOPER_A { + pub const fn variant(&self) -> PFOPER_A { match self.bits { false => PFOPER_A::VALUE1, true => PFOPER_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No operation error reported by Program Flash"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PFOPER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flash array operation aborted, because of a Flash array failure, e.g. an ECC error in microcode."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PFOPER_A::VALUE2 @@ -214,18 +201,18 @@ impl From for bool { impl SQER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SQER_A { + pub const fn variant(&self) -> SQER_A { match self.bits { false => SQER_A::VALUE1, true => SQER_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No sequence error"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SQER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Command state machine operation unsuccessful because of improper address or command sequence."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SQER_A::VALUE2 @@ -250,18 +237,18 @@ impl From for bool { impl PROER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PROER_A { + pub const fn variant(&self) -> PROER_A { match self.bits { false => PROER_A::VALUE1, true => PROER_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No protection error"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PROER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Protection error."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PROER_A::VALUE2 @@ -286,18 +273,18 @@ impl From for bool { impl PFSBER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PFSBER_A { + pub const fn variant(&self) -> PFSBER_A { match self.bits { false => PFSBER_A::VALUE1, true => PFSBER_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No Single-Bit Error detected during read access to PFLASH"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PFSBER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Single-Bit Error detected and corrected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PFSBER_A::VALUE2 @@ -322,18 +309,18 @@ impl From for bool { impl PFDBER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PFDBER_A { + pub const fn variant(&self) -> PFDBER_A { match self.bits { false => PFDBER_A::VALUE1, true => PFDBER_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No Double-Bit Error detected during read access to PFLASH"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PFDBER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Double-Bit Error detected in PFLASH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PFDBER_A::VALUE2 @@ -358,18 +345,18 @@ impl From for bool { impl PROIN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PROIN_A { + pub const fn variant(&self) -> PROIN_A { match self.bits { false => PROIN_A::VALUE1, true => PROIN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No protection is installed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PROIN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read or/and write protection for one or more users is configured and correctly confirmed in the User Configuration Block(s)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PROIN_A::VALUE2 @@ -394,18 +381,18 @@ impl From for bool { impl RPROIN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RPROIN_A { + pub const fn variant(&self) -> RPROIN_A { match self.bits { false => RPROIN_A::VALUE1, true => RPROIN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No read protection installed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RPROIN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read protection and global write protection is configured and correctly confirmed in the User Configuration Block 0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RPROIN_A::VALUE2 @@ -430,18 +417,18 @@ impl From for bool { impl RPRODIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RPRODIS_A { + pub const fn variant(&self) -> RPRODIS_A { match self.bits { false => RPRODIS_A::VALUE1, true => RPRODIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read protection (if installed) is not disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RPRODIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read and global write protection is temporarily disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RPRODIS_A::VALUE2 @@ -466,18 +453,18 @@ impl From for bool { impl WPROIN0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WPROIN0_A { + pub const fn variant(&self) -> WPROIN0_A { match self.bits { false => WPROIN0_A::VALUE1, true => WPROIN0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection installed for user 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WPROIN0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Sector write protection for user 0 is configured and correctly confirmed in the User Configuration Block 0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WPROIN0_A::VALUE2 @@ -502,18 +489,18 @@ impl From for bool { impl WPROIN1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WPROIN1_A { + pub const fn variant(&self) -> WPROIN1_A { match self.bits { false => WPROIN1_A::VALUE1, true => WPROIN1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection installed for user 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WPROIN1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Sector write protection for user 1 is configured and correctly confirmed in the User Configuration Block 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WPROIN1_A::VALUE2 @@ -538,18 +525,18 @@ impl From for bool { impl WPROIN2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WPROIN2_A { + pub const fn variant(&self) -> WPROIN2_A { match self.bits { false => WPROIN2_A::VALUE1, true => WPROIN2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No OTP write protection installed for user 2"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WPROIN2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Sector OTP write protection with ROM functionality is configured and correctly confirmed in the UCB2. The protection is locked for ever."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WPROIN2_A::VALUE2 @@ -574,18 +561,18 @@ impl From for bool { impl WPRODIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WPRODIS0_A { + pub const fn variant(&self) -> WPRODIS0_A { match self.bits { false => WPRODIS0_A::VALUE1, true => WPRODIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "All protected sectors of user 0 are locked if write protection is installed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WPRODIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "All write-protected sectors of user 0 are temporarily unlocked, if not coincidently locked by user 2 or via read protection."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WPRODIS0_A::VALUE2 @@ -610,18 +597,18 @@ impl From for bool { impl WPRODIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WPRODIS1_A { + pub const fn variant(&self) -> WPRODIS1_A { match self.bits { false => WPRODIS1_A::VALUE1, true => WPRODIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "All protected sectors of user 1 are locked if write protection is installed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WPRODIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "All write-protected sectors of user 1 are temporarily unlocked, if not coincidently locked by user 0 or user 2 or via read protection."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WPRODIS1_A::VALUE2 @@ -646,18 +633,18 @@ impl From for bool { impl SLM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SLM_A { + pub const fn variant(&self) -> SLM_A { match self.bits { false => SLM_A::VALUE1, true => SLM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Flash not in sleep mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SLM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flash is in sleep or shut down mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SLM_A::VALUE2 @@ -682,18 +669,18 @@ impl From for bool { impl VER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VER_A { + pub const fn variant(&self) -> VER_A { match self.bits { false => VER_A::VALUE1, true => VER_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The page is correctly programmed or the sector correctly erased. All programmed or erased bits have full expected quality."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A program verify error or an erase verify error has been detected. Full quality (retention time) of all programmed (\"1\") or erased (\"0\") bits cannot be guaranteed."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VER_A::VALUE2 @@ -801,15 +788,13 @@ impl R { VER_R::new(((self.bits >> 31) & 1) != 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"] +#[doc = "Flash Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fsr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`fsr::R`](R) reader structure"] +impl crate::Readable for FSR_SPEC {} #[doc = "`reset()` method sets FSR to value 0"] impl crate::Resettable for FSR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/flash0/id.rs b/src/flash0/id.rs index a440bfcc..254956ed 100644 --- a/src/flash0/id.rs +++ b/src/flash0/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision Number"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number Value"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Flash Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x009f_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x009f_c000; diff --git a/src/flash0/marp.rs b/src/flash0/marp.rs index dc1271d1..d9496932 100644 --- a/src/flash0/marp.rs +++ b/src/flash0/marp.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MARGIN` reader - PFLASH Margin Selection"] -pub type MARGIN_R = crate::FieldReader; +pub type MARGIN_R = crate::FieldReader; #[doc = "PFLASH Margin Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MARGIN_A { + type Ux = u8; +} impl MARGIN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(MARGIN_A::VALUE1), 1 => Some(MARGIN_A::VALUE2), @@ -64,38 +35,42 @@ impl MARGIN_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard (default) margin."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MARGIN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Tight margin for 0 (low) level. Suboptimal 0-bits are read as 1s."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MARGIN_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Tight margin for 1 (high) level. Suboptimal 1-bits are read as 0s."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MARGIN_A::VALUE3 } } #[doc = "Field `MARGIN` writer - PFLASH Margin Selection"] -pub type MARGIN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MARP_SPEC, u8, MARGIN_A, 4, O>; -impl<'a, const O: u8> MARGIN_W<'a, O> { +pub type MARGIN_W<'a, REG> = crate::FieldWriter<'a, REG, 4, MARGIN_A>; +impl<'a, REG> MARGIN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Standard (default) margin."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MARGIN_A::VALUE1) } #[doc = "Tight margin for 0 (low) level. Suboptimal 0-bits are read as 1s."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MARGIN_A::VALUE2) } #[doc = "Tight margin for 1 (high) level. Suboptimal 1-bits are read as 0s."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MARGIN_A::VALUE3) } } @@ -118,34 +93,37 @@ impl From for bool { impl TRAPDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRAPDIS_A { + pub const fn variant(&self) -> TRAPDIS_A { match self.bits { false => TRAPDIS_A::VALUE1, true => TRAPDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "If a double-bit error occurs in PFLASH, a bus error trap is generated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRAPDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The double-bit error trap is disabled. Shall be used only during margin check"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRAPDIS_A::VALUE2 } } #[doc = "Field `TRAPDIS` writer - PFLASH Double-Bit Error Trap Disable"] -pub type TRAPDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MARP_SPEC, TRAPDIS_A, O>; -impl<'a, const O: u8> TRAPDIS_W<'a, O> { +pub type TRAPDIS_W<'a, REG> = crate::BitWriter<'a, REG, TRAPDIS_A>; +impl<'a, REG> TRAPDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "If a double-bit error occurs in PFLASH, a bus error trap is generated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRAPDIS_A::VALUE1) } #[doc = "The double-bit error trap is disabled. Shall be used only during margin check"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRAPDIS_A::VALUE2) } } @@ -165,34 +143,35 @@ impl W { #[doc = "Bits 0:3 - PFLASH Margin Selection"] #[inline(always)] #[must_use] - pub fn margin(&mut self) -> MARGIN_W<0> { - MARGIN_W::new(self) + pub fn margin(&mut self) -> MARGIN_W { + MARGIN_W::new(self, 0) } #[doc = "Bit 15 - PFLASH Double-Bit Error Trap Disable"] #[inline(always)] #[must_use] - pub fn trapdis(&mut self) -> TRAPDIS_W<15> { - TRAPDIS_W::new(self) + pub fn trapdis(&mut self) -> TRAPDIS_W { + TRAPDIS_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Margin Control Register PFLASH\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`marp::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`marp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`marp::R`](R) reader structure"] +impl crate::Readable for MARP_SPEC {} +#[doc = "`write(|w| ..)` method takes [`marp::W`](W) writer structure"] impl crate::Writable for MARP_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/flash0/procon0.rs b/src/flash0/procon0.rs index 410ba10d..58776b65 100644 --- a/src/flash0/procon0.rs +++ b/src/flash0/procon0.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `S0L` reader - Sector 0 Locked for Write Protection by User 0"] pub type S0L_R = crate::BitReader; #[doc = "Sector 0 Locked for Write Protection by User 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl S0L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0L_A { + pub const fn variant(&self) -> S0L_A { match self.bits { false => S0L_A::VALUE1, true => S0L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0L_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl S1L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1L_A { + pub const fn variant(&self) -> S1L_A { match self.bits { false => S1L_A::VALUE1, true => S1L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1L_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl S2L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2L_A { + pub const fn variant(&self) -> S2L_A { match self.bits { false => S2L_A::VALUE1, true => S2L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2L_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl S3L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3L_A { + pub const fn variant(&self) -> S3L_A { match self.bits { false => S3L_A::VALUE1, true => S3L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3L_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl S4L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S4L_A { + pub const fn variant(&self) -> S4L_A { match self.bits { false => S4L_A::VALUE1, true => S4L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S4L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S4L_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl S5L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S5L_A { + pub const fn variant(&self) -> S5L_A { match self.bits { false => S5L_A::VALUE1, true => S5L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S5L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S5L_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl S6L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S6L_A { + pub const fn variant(&self) -> S6L_A { match self.bits { false => S6L_A::VALUE1, true => S6L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S6L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S6L_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl S7L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S7L_A { + pub const fn variant(&self) -> S7L_A { match self.bits { false => S7L_A::VALUE1, true => S7L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S7L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S7L_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl S8L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S8L_A { + pub const fn variant(&self) -> S8L_A { match self.bits { false => S8L_A::VALUE1, true => S8L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S8L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S8L_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl S9L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S9L_A { + pub const fn variant(&self) -> S9L_A { match self.bits { false => S9L_A::VALUE1, true => S9L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S9L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S9L_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl RPRO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RPRO_A { + pub const fn variant(&self) -> RPRO_A { match self.bits { false => RPRO_A::VALUE1, true => RPRO_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No read protection configured"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RPRO_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read protection and global write protection is configured by user 0 (master user)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RPRO_A::VALUE2 @@ -466,15 +453,13 @@ impl R { RPRO_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Flash Protection Configuration Register User 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`procon0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`procon0::R`](R) reader structure"] +impl crate::Readable for PROCON0_SPEC {} #[doc = "`reset()` method sets PROCON0 to value 0"] impl crate::Resettable for PROCON0_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/flash0/procon1.rs b/src/flash0/procon1.rs index dc89a5e1..fac10537 100644 --- a/src/flash0/procon1.rs +++ b/src/flash0/procon1.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `S0L` reader - Sector 0 Locked for Write Protection by User 1"] pub type S0L_R = crate::BitReader; #[doc = "Sector 0 Locked for Write Protection by User 1\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl S0L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0L_A { + pub const fn variant(&self) -> S0L_A { match self.bits { false => S0L_A::VALUE1, true => S0L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0L_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl S1L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1L_A { + pub const fn variant(&self) -> S1L_A { match self.bits { false => S1L_A::VALUE1, true => S1L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1L_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl S2L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2L_A { + pub const fn variant(&self) -> S2L_A { match self.bits { false => S2L_A::VALUE1, true => S2L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2L_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl S3L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3L_A { + pub const fn variant(&self) -> S3L_A { match self.bits { false => S3L_A::VALUE1, true => S3L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3L_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl S4L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S4L_A { + pub const fn variant(&self) -> S4L_A { match self.bits { false => S4L_A::VALUE1, true => S4L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S4L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S4L_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl S5L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S5L_A { + pub const fn variant(&self) -> S5L_A { match self.bits { false => S5L_A::VALUE1, true => S5L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S5L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S5L_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl S6L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S6L_A { + pub const fn variant(&self) -> S6L_A { match self.bits { false => S6L_A::VALUE1, true => S6L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S6L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S6L_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl S7L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S7L_A { + pub const fn variant(&self) -> S7L_A { match self.bits { false => S7L_A::VALUE1, true => S7L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S7L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S7L_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl S8L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S8L_A { + pub const fn variant(&self) -> S8L_A { match self.bits { false => S8L_A::VALUE1, true => S8L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S8L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S8L_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl S9L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S9L_A { + pub const fn variant(&self) -> S9L_A { match self.bits { false => S9L_A::VALUE1, true => S9L_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No write protection is configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S9L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Write protection is configured for sector n."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S9L_A::VALUE2 @@ -425,15 +412,13 @@ impl R { S9L_R::new(((self.bits >> 9) & 1) != 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"] +#[doc = "Flash Protection Configuration Register User 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`procon1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`procon1::R`](R) reader structure"] +impl crate::Readable for PROCON1_SPEC {} #[doc = "`reset()` method sets PROCON1 to value 0"] impl crate::Resettable for PROCON1_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/flash0/procon2.rs b/src/flash0/procon2.rs index bf0ef6c1..8bafb704 100644 --- a/src/flash0/procon2.rs +++ b/src/flash0/procon2.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `S0ROM` reader - Sector 0 Locked Forever by User 2"] pub type S0ROM_R = crate::BitReader; #[doc = "Sector 0 Locked Forever by User 2\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl S0ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0ROM_A { + pub const fn variant(&self) -> S0ROM_A { match self.bits { false => S0ROM_A::VALUE1, true => S0ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0ROM_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl S1ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1ROM_A { + pub const fn variant(&self) -> S1ROM_A { match self.bits { false => S1ROM_A::VALUE1, true => S1ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1ROM_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl S2ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2ROM_A { + pub const fn variant(&self) -> S2ROM_A { match self.bits { false => S2ROM_A::VALUE1, true => S2ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2ROM_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl S3ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S3ROM_A { + pub const fn variant(&self) -> S3ROM_A { match self.bits { false => S3ROM_A::VALUE1, true => S3ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S3ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S3ROM_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl S4ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S4ROM_A { + pub const fn variant(&self) -> S4ROM_A { match self.bits { false => S4ROM_A::VALUE1, true => S4ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S4ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S4ROM_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl S5ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S5ROM_A { + pub const fn variant(&self) -> S5ROM_A { match self.bits { false => S5ROM_A::VALUE1, true => S5ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S5ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S5ROM_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl S6ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S6ROM_A { + pub const fn variant(&self) -> S6ROM_A { match self.bits { false => S6ROM_A::VALUE1, true => S6ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S6ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S6ROM_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl S7ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S7ROM_A { + pub const fn variant(&self) -> S7ROM_A { match self.bits { false => S7ROM_A::VALUE1, true => S7ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S7ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S7ROM_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl S8ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S8ROM_A { + pub const fn variant(&self) -> S8ROM_A { match self.bits { false => S8ROM_A::VALUE1, true => S8ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S8ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S8ROM_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl S9ROM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S9ROM_A { + pub const fn variant(&self) -> S9ROM_A { match self.bits { false => S9ROM_A::VALUE1, true => S9ROM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ROM functionality configured for sector n."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S9ROM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ROM functionality is configured for sector n. Re-programming of this sector is no longer possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S9ROM_A::VALUE2 @@ -425,15 +412,13 @@ impl R { S9ROM_R::new(((self.bits >> 9) & 1) != 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"] +#[doc = "Flash Protection Configuration Register User 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`procon2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`procon2::R`](R) reader structure"] +impl crate::Readable for PROCON2_SPEC {} #[doc = "`reset()` method sets PROCON2 to value 0"] impl crate::Resettable for PROCON2_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/generic.rs b/src/generic.rs index 5da0ab59..ec96dd7c 100644 --- a/src/generic.rs +++ b/src/generic.rs @@ -21,6 +21,9 @@ macro_rules! raw_reg { const fn $mask() -> $U { <$U>::MAX >> ($size - WI) } + impl FieldSpec for $U { + type Ux = $U; + } }; } raw_reg!(u8, 8, mask_u8); @@ -32,21 +35,21 @@ pub trait RegisterSpec { #[doc = " Raw register type (`u8`, `u16`, `u32`, ...)."] type Ux: RawReg; } +#[doc = " Raw field type"] +pub trait FieldSpec: Sized { + #[doc = " Raw field type (`u8`, `u16`, `u32`, ...)."] + type Ux: Copy + PartialEq + From; +} #[doc = " Trait implemented by readable registers to enable the `read` method."] #[doc = ""] #[doc = " Registers marked with `Writable` can be also be `modify`'ed."] -pub trait Readable: RegisterSpec { - #[doc = " Result from a call to `read` and argument to `modify`."] - type Reader: From> + core::ops::Deref>; -} +pub trait Readable: RegisterSpec {} #[doc = " Trait implemented by writeable registers."] #[doc = ""] #[doc = " This enables the `write`, `write_with_zero` and `reset` methods."] #[doc = ""] #[doc = " Registers marked with `Readable` can be also be `modify`'ed."] pub trait Writable: RegisterSpec { - #[doc = " Writer type argument to `write`, et al."] - type Writer: From> + core::ops::DerefMut>; #[doc = " Specifies the register bits that are not changed if you pass `1` and are changed if you pass `0`"] const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux; #[doc = " Specifies the register bits that are not changed if you pass `0` and are changed if you pass `1`"] @@ -97,8 +100,8 @@ impl Reg { #[doc = " let flag = reader.field2().bit_is_set();"] #[doc = " ```"] #[inline(always)] - pub fn read(&self) -> REG::Reader { - REG::Reader::from(R { bits: self.register.get(), _reg: marker::PhantomData }) + pub fn read(&self) -> R { + R { bits: self.register.get(), _reg: marker::PhantomData } } } impl Reg { @@ -135,9 +138,9 @@ impl Reg { #[inline(always)] pub fn write(&self, f: F) where - F: FnOnce(&mut REG::Writer) -> &mut W, + F: FnOnce(&mut W) -> &mut W, { - self.register.set(f(&mut REG::Writer::from(W { bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, _reg: marker::PhantomData })).bits); + self.register.set(f(&mut W { bits: REG::RESET_VALUE & !REG::ONE_TO_MODIFY_FIELDS_BITMAP | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, _reg: marker::PhantomData }).bits); } } impl Reg { @@ -151,9 +154,9 @@ impl Reg { #[inline(always)] pub unsafe fn write_with_zero(&self, f: F) where - F: FnOnce(&mut REG::Writer) -> &mut W, + F: FnOnce(&mut W) -> &mut W, { - self.register.set(f(&mut REG::Writer::from(W { bits: REG::Ux::default(), _reg: marker::PhantomData })).bits); + self.register.set(f(&mut W { bits: REG::Ux::default(), _reg: marker::PhantomData }).bits); } } impl Reg { @@ -185,24 +188,23 @@ impl Reg { #[inline(always)] pub fn modify(&self, f: F) where - for<'w> F: FnOnce(®::Reader, &'w mut REG::Writer) -> &'w mut W, + for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); - self.register.set(f(®::Reader::from(R { bits, _reg: marker::PhantomData }), &mut REG::Writer::from(W { bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, _reg: marker::PhantomData })).bits); + self.register.set(f(&R { bits, _reg: marker::PhantomData }, &mut W { bits: bits & !REG::ONE_TO_MODIFY_FIELDS_BITMAP | REG::ZERO_TO_MODIFY_FIELDS_BITMAP, _reg: marker::PhantomData }).bits); } } +#[doc(hidden)] +pub mod raw; #[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, -} +pub type R = raw::R; impl R { #[doc = " Reads raw bits from register."] #[inline(always)] - pub fn bits(&self) -> REG::Ux { + pub const fn bits(&self) -> REG::Ux { self.bits } } @@ -220,77 +222,27 @@ where #[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."] - #[doc = ""] - #[doc = " # Safety"] - #[doc = ""] - #[doc = " Read datasheet or reference manual to find what values are allowed to pass."] - #[inline(always)] - pub unsafe fn bits(&mut self, bits: REG::Ux) -> &mut Self { - self.bits = bits; - self - } -} -#[doc(hidden)] -pub struct FieldReaderRaw { - pub(crate) bits: U, - _reg: marker::PhantomData, -} -impl FieldReaderRaw -where - U: Copy, -{ - #[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(hidden)] -pub struct BitReaderRaw { - pub(crate) bits: bool, - _reg: marker::PhantomData, -} -impl BitReaderRaw { - #[doc = " Creates a new instance of the reader."] - #[allow(unused)] - #[inline(always)] - pub(crate) fn new(bits: bool) -> Self { - Self { bits, _reg: marker::PhantomData } - } -} +pub type W = raw::W; #[doc = " Field reader."] #[doc = ""] #[doc = " Result of the `read` methods of fields."] -pub type FieldReader = FieldReaderRaw; +pub type FieldReader = raw::FieldReader; #[doc = " Bit-wise field reader"] -pub type BitReader = BitReaderRaw; -impl FieldReader -where - U: Copy, -{ +pub type BitReader = raw::BitReader; +impl FieldReader { #[doc = " Reads raw bits from field."] #[inline(always)] - pub fn bits(&self) -> U { + pub const fn bits(&self) -> FI::Ux { self.bits } } -impl PartialEq for FieldReader +impl PartialEq for FieldReader where - U: PartialEq, - FI: Copy, - U: From, + FI: FieldSpec + Copy, { #[inline(always)] fn eq(&self, other: &FI) -> bool { - self.bits.eq(&U::from(*other)) + self.bits.eq(&FI::Ux::from(*other)) } } impl PartialEq for BitReader @@ -306,17 +258,17 @@ where impl BitReader { #[doc = " Value of the field as raw bits."] #[inline(always)] - pub fn bit(&self) -> bool { + pub const fn bit(&self) -> bool { self.bits } #[doc = " Returns `true` if the bit is clear (0)."] #[inline(always)] - pub fn bit_is_clear(&self) -> bool { + pub const fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = " Returns `true` if the bit is set (1)."] #[inline(always)] - pub fn bit_is_set(&self) -> bool { + pub const fn bit_is_set(&self) -> bool { self.bit() } } @@ -324,102 +276,109 @@ impl BitReader { pub struct Safe; #[doc(hidden)] pub struct Unsafe; -#[doc(hidden)] -pub struct FieldWriterRaw<'a, U, REG, N, FI, Safety, const WI: u8, const O: u8> -where - REG: Writable + RegisterSpec, - N: From, -{ - pub(crate) w: &'a mut REG::Writer, - _field: marker::PhantomData<(N, FI, Safety)>, -} -impl<'a, U, REG, N, FI, Safety, const WI: u8, const O: u8> FieldWriterRaw<'a, U, REG, N, FI, Safety, WI, O> +#[doc = " Write field Proxy with unsafe `bits`"] +pub type FieldWriter<'a, REG, const WI: u8, FI = u8> = raw::FieldWriter<'a, REG, WI, FI, Unsafe>; +#[doc = " Write field Proxy with safe `bits`"] +pub type FieldWriterSafe<'a, REG, const WI: u8, FI = u8> = raw::FieldWriter<'a, REG, WI, FI, Safe>; +impl<'a, REG, const WI: u8, FI> FieldWriter<'a, REG, WI, FI> where - REG: Writable + RegisterSpec, - N: From, + REG: Writable + RegisterSpec, + FI: FieldSpec, + REG::Ux: From, { - #[doc = " Creates a new instance of the writer"] - #[allow(unused)] + #[doc = " Field width"] + pub const WIDTH: u8 = WI; + #[doc = " Field width"] #[inline(always)] - pub(crate) fn new(w: &'a mut REG::Writer) -> Self { - Self { w, _field: marker::PhantomData } + pub const fn width(&self) -> u8 { + WI } -} -#[doc(hidden)] -pub struct BitWriterRaw<'a, U, REG, FI, M, const O: u8> -where - REG: Writable + RegisterSpec, - bool: From, -{ - pub(crate) w: &'a mut REG::Writer, - _field: marker::PhantomData<(FI, M)>, -} -impl<'a, U, REG, FI, M, const O: u8> BitWriterRaw<'a, U, REG, FI, M, O> -where - REG: Writable + RegisterSpec, - bool: From, -{ - #[doc = " Creates a new instance of the writer"] - #[allow(unused)] + #[doc = " Field offset"] + #[inline(always)] + pub const fn offset(&self) -> u8 { + self.o + } + #[doc = " Writes raw bits to the field"] + #[doc = ""] + #[doc = " # Safety"] + #[doc = ""] + #[doc = " Passing incorrect value can cause undefined behaviour. See reference manual"] + #[inline(always)] + pub unsafe fn bits(self, value: FI::Ux) -> &'a mut W { + self.w.bits &= !(REG::Ux::mask::() << self.o); + self.w.bits |= (REG::Ux::from(value) & REG::Ux::mask::()) << self.o; + self.w + } + #[doc = " Writes `variant` to the field"] #[inline(always)] - pub(crate) fn new(w: &'a mut REG::Writer) -> Self { - Self { w, _field: marker::PhantomData } + pub fn variant(self, variant: FI) -> &'a mut W { + unsafe { self.bits(FI::Ux::from(variant)) } } } -#[doc = " Write field Proxy with unsafe `bits`"] -pub type FieldWriter<'a, U, REG, N, FI, const WI: u8, const O: u8> = FieldWriterRaw<'a, U, REG, N, FI, Unsafe, WI, O>; -#[doc = " Write field Proxy with safe `bits`"] -pub type FieldWriterSafe<'a, U, REG, N, FI, const WI: u8, const O: u8> = FieldWriterRaw<'a, U, REG, N, FI, Safe, WI, O>; -impl<'a, U, REG, N, FI, const WI: u8, const OF: u8> FieldWriter<'a, U, REG, N, FI, WI, OF> +impl<'a, REG, const WI: u8, FI> FieldWriterSafe<'a, REG, WI, FI> where - REG: Writable + RegisterSpec, - N: From, + REG: Writable + RegisterSpec, + FI: FieldSpec, + REG::Ux: From, { #[doc = " Field width"] pub const WIDTH: u8 = WI; -} -impl<'a, U, REG, N, FI, const WI: u8, const OF: u8> FieldWriterSafe<'a, U, REG, N, FI, WI, OF> -where - REG: Writable + RegisterSpec, - N: From, -{ #[doc = " Field width"] - pub const WIDTH: u8 = WI; + #[inline(always)] + pub const fn width(&self) -> u8 { + WI + } + #[doc = " Field offset"] + #[inline(always)] + pub const fn offset(&self) -> u8 { + self.o + } + #[doc = " Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: FI::Ux) -> &'a mut W { + self.w.bits &= !(REG::Ux::mask::() << self.o); + self.w.bits |= (REG::Ux::from(value) & REG::Ux::mask::()) << self.o; + self.w + } + #[doc = " Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FI) -> &'a mut W { + self.bits(FI::Ux::from(variant)) + } } macro_rules! bit_proxy { ($ writer : ident , $ mwv : ident) => { #[doc(hidden)] pub struct $mwv; #[doc = " Bit-wise write field proxy"] - pub type $writer<'a, U, REG, FI, const O: u8> = BitWriterRaw<'a, U, REG, FI, $mwv, O>; - impl<'a, U, REG, FI, const OF: u8> $writer<'a, U, REG, FI, OF> + pub type $writer<'a, REG, FI = bool> = raw::BitWriter<'a, REG, FI, $mwv>; + impl<'a, REG, FI> $writer<'a, REG, FI> where - REG: Writable + RegisterSpec, + REG: Writable + RegisterSpec, bool: From, { #[doc = " Field width"] pub const WIDTH: u8 = 1; - } - }; -} -macro_rules! impl_bit_proxy { - ($ writer : ident) => { - impl<'a, U, REG, FI, const OF: u8> $writer<'a, U, REG, FI, OF> - where - REG: Writable + RegisterSpec, - U: RawReg, - bool: From, - { + #[doc = " Field width"] + #[inline(always)] + pub const fn width(&self) -> u8 { + Self::WIDTH + } + #[doc = " Field offset"] + #[inline(always)] + pub const fn offset(&self) -> u8 { + self.o + } #[doc = " Writes bit to the field"] #[inline(always)] - pub fn bit(self, value: bool) -> &'a mut REG::Writer { - self.w.bits &= !(U::one() << OF); - self.w.bits |= (U::from(value) & U::one()) << OF; + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); + self.w.bits |= (REG::Ux::from(value) & REG::Ux::one()) << self.o; self.w } #[doc = " Writes `variant` to the field"] #[inline(always)] - pub fn variant(self, variant: FI) -> &'a mut REG::Writer { + pub fn variant(self, variant: FI) -> &'a mut W { self.bit(bool::from(variant)) } } @@ -432,149 +391,93 @@ bit_proxy!(BitWriter1C, Bit1C); bit_proxy!(BitWriter0S, Bit0S); bit_proxy!(BitWriter1T, Bit1T); bit_proxy!(BitWriter0T, Bit0T); -impl<'a, U, REG, N, FI, const WI: u8, const OF: u8> FieldWriter<'a, U, REG, N, FI, WI, OF> -where - REG: Writable + RegisterSpec, - U: RawReg + From, - N: From, -{ - #[doc = " Writes raw bits to the field"] - #[doc = ""] - #[doc = " # Safety"] - #[doc = ""] - #[doc = " Passing incorrect value can cause undefined behaviour. See reference manual"] - #[inline(always)] - pub unsafe fn bits(self, value: N) -> &'a mut REG::Writer { - self.w.bits &= !(U::mask::() << OF); - self.w.bits |= (U::from(value) & U::mask::()) << OF; - self.w - } - #[doc = " Writes `variant` to the field"] - #[inline(always)] - pub fn variant(self, variant: FI) -> &'a mut REG::Writer { - unsafe { self.bits(N::from(variant)) } - } -} -impl<'a, U, REG, N, FI, const WI: u8, const OF: u8> FieldWriterSafe<'a, U, REG, N, FI, WI, OF> -where - REG: Writable + RegisterSpec, - U: RawReg + From, - N: From, -{ - #[doc = " Writes raw bits to the field"] - #[inline(always)] - pub fn bits(self, value: N) -> &'a mut REG::Writer { - self.w.bits &= !(U::mask::() << OF); - self.w.bits |= (U::from(value) & U::mask::()) << OF; - self.w - } - #[doc = " Writes `variant` to the field"] - #[inline(always)] - pub fn variant(self, variant: FI) -> &'a mut REG::Writer { - self.bits(N::from(variant)) - } -} -impl_bit_proxy!(BitWriter); -impl_bit_proxy!(BitWriter1S); -impl_bit_proxy!(BitWriter0C); -impl_bit_proxy!(BitWriter1C); -impl_bit_proxy!(BitWriter0S); -impl_bit_proxy!(BitWriter1T); -impl_bit_proxy!(BitWriter0T); -impl<'a, U, REG, FI, const OF: u8> BitWriter<'a, U, REG, FI, OF> +impl<'a, REG, FI> BitWriter<'a, REG, FI> where - REG: Writable + RegisterSpec, - U: RawReg, + REG: Writable + RegisterSpec, bool: From, { #[doc = " Sets the field bit"] #[inline(always)] - pub fn set_bit(self) -> &'a mut REG::Writer { - self.w.bits |= U::one() << OF; + pub fn set_bit(self) -> &'a mut W { + self.w.bits |= REG::Ux::one() << self.o; self.w } #[doc = " Clears the field bit"] #[inline(always)] - pub fn clear_bit(self) -> &'a mut REG::Writer { - self.w.bits &= !(U::one() << OF); + pub fn clear_bit(self) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); self.w } } -impl<'a, U, REG, FI, const OF: u8> BitWriter1S<'a, U, REG, FI, OF> +impl<'a, REG, FI> BitWriter1S<'a, REG, FI> where - REG: Writable + RegisterSpec, - U: RawReg, + REG: Writable + RegisterSpec, bool: From, { #[doc = " Sets the field bit"] #[inline(always)] - pub fn set_bit(self) -> &'a mut REG::Writer { - self.w.bits |= U::one() << OF; + pub fn set_bit(self) -> &'a mut W { + self.w.bits |= REG::Ux::one() << self.o; self.w } } -impl<'a, U, REG, FI, const OF: u8> BitWriter0C<'a, U, REG, FI, OF> +impl<'a, REG, FI> BitWriter0C<'a, REG, FI> where - REG: Writable + RegisterSpec, - U: RawReg, + REG: Writable + RegisterSpec, bool: From, { #[doc = " Clears the field bit"] #[inline(always)] - pub fn clear_bit(self) -> &'a mut REG::Writer { - self.w.bits &= !(U::one() << OF); + pub fn clear_bit(self) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); self.w } } -impl<'a, U, REG, FI, const OF: u8> BitWriter1C<'a, U, REG, FI, OF> +impl<'a, REG, FI> BitWriter1C<'a, REG, FI> where - REG: Writable + RegisterSpec, - U: RawReg, + REG: Writable + RegisterSpec, bool: From, { #[doc = "Clears the field bit by passing one"] #[inline(always)] - pub fn clear_bit_by_one(self) -> &'a mut REG::Writer { - self.w.bits |= U::one() << OF; + pub fn clear_bit_by_one(self) -> &'a mut W { + self.w.bits |= REG::Ux::one() << self.o; self.w } } -impl<'a, U, REG, FI, const OF: u8> BitWriter0S<'a, U, REG, FI, OF> +impl<'a, REG, FI> BitWriter0S<'a, REG, FI> where - REG: Writable + RegisterSpec, - U: RawReg, + REG: Writable + RegisterSpec, bool: From, { #[doc = "Sets the field bit by passing zero"] #[inline(always)] - pub fn set_bit_by_zero(self) -> &'a mut REG::Writer { - self.w.bits &= !(U::one() << OF); + pub fn set_bit_by_zero(self) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); self.w } } -impl<'a, U, REG, FI, const OF: u8> BitWriter1T<'a, U, REG, FI, OF> +impl<'a, REG, FI> BitWriter1T<'a, REG, FI> where - REG: Writable + RegisterSpec, - U: RawReg, + REG: Writable + RegisterSpec, bool: From, { #[doc = "Toggle the field bit by passing one"] #[inline(always)] - pub fn toggle_bit(self) -> &'a mut REG::Writer { - self.w.bits |= U::one() << OF; + pub fn toggle_bit(self) -> &'a mut W { + self.w.bits |= REG::Ux::one() << self.o; self.w } } -impl<'a, U, REG, FI, const OF: u8> BitWriter0T<'a, U, REG, FI, OF> +impl<'a, REG, FI> BitWriter0T<'a, REG, FI> where - REG: Writable + RegisterSpec, - U: RawReg, + REG: Writable + RegisterSpec, bool: From, { #[doc = "Toggle the field bit by passing zero"] #[inline(always)] - pub fn toggle_bit(self) -> &'a mut REG::Writer { - self.w.bits &= !(U::one() << OF); + pub fn toggle_bit(self) -> &'a mut W { + self.w.bits &= !(REG::Ux::one() << self.o); self.w } } diff --git a/src/generic/raw.rs b/src/generic/raw.rs new file mode 100644 index 00000000..a38c3ce2 --- /dev/null +++ b/src/generic/raw.rs @@ -0,0 +1,79 @@ +use super::{marker, BitM, FieldSpec, RegisterSpec, Unsafe, Writable}; +pub struct R { + pub(crate) bits: REG::Ux, + pub(super) _reg: marker::PhantomData, +} +pub struct W { + #[doc = "Writable bits"] + pub(crate) bits: REG::Ux, + pub(super) _reg: marker::PhantomData, +} +pub struct FieldReader +where + FI: FieldSpec, +{ + pub(crate) bits: FI::Ux, + _reg: marker::PhantomData, +} +impl FieldReader { + #[doc = " Creates a new instance of the reader."] + #[allow(unused)] + #[inline(always)] + pub(crate) const fn new(bits: FI::Ux) -> Self { + Self { bits, _reg: marker::PhantomData } + } +} +pub struct BitReader { + pub(crate) bits: bool, + _reg: marker::PhantomData, +} +impl BitReader { + #[doc = " Creates a new instance of the reader."] + #[allow(unused)] + #[inline(always)] + pub(crate) const fn new(bits: bool) -> Self { + Self { bits, _reg: marker::PhantomData } + } +} +pub struct FieldWriter<'a, REG, const WI: u8, FI = u8, Safety = Unsafe> +where + REG: Writable + RegisterSpec, + FI: FieldSpec, +{ + pub(crate) w: &'a mut W, + pub(crate) o: u8, + _field: marker::PhantomData<(FI, Safety)>, +} +impl<'a, REG, const WI: u8, FI, Safety> FieldWriter<'a, REG, WI, FI, Safety> +where + REG: Writable + RegisterSpec, + FI: FieldSpec, +{ + #[doc = " Creates a new instance of the writer"] + #[allow(unused)] + #[inline(always)] + pub(crate) fn new(w: &'a mut W, o: u8) -> Self { + Self { w, o, _field: marker::PhantomData } + } +} +pub struct BitWriter<'a, REG, FI = bool, M = BitM> +where + REG: Writable + RegisterSpec, + bool: From, +{ + pub(crate) w: &'a mut W, + pub(crate) o: u8, + _field: marker::PhantomData<(FI, M)>, +} +impl<'a, REG, FI, M> BitWriter<'a, REG, FI, M> +where + REG: Writable + RegisterSpec, + bool: From, +{ + #[doc = " Creates a new instance of the writer"] + #[allow(unused)] + #[inline(always)] + pub(crate) fn new(w: &'a mut W, o: u8) -> Self { + Self { w, o, _field: marker::PhantomData } + } +} diff --git a/src/gpdma0.rs b/src/gpdma0.rs index 71cb8fdc..32f7f0f5 100644 --- a/src/gpdma0.rs +++ b/src/gpdma0.rs @@ -1,226 +1,388 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Raw IntTfr Status"] - pub rawtfr: RAWTFR, + rawtfr: RAWTFR, _reserved1: [u8; 0x04], - #[doc = "0x08 - Raw IntBlock Status"] - pub rawblock: RAWBLOCK, + rawblock: RAWBLOCK, _reserved2: [u8; 0x04], - #[doc = "0x10 - Raw IntSrcTran Status"] - pub rawsrctran: RAWSRCTRAN, + rawsrctran: RAWSRCTRAN, _reserved3: [u8; 0x04], - #[doc = "0x18 - Raw IntBlock Status"] - pub rawdsttran: RAWDSTTRAN, + rawdsttran: RAWDSTTRAN, _reserved4: [u8; 0x04], - #[doc = "0x20 - Raw IntErr Status"] - pub rawerr: RAWERR, + rawerr: RAWERR, _reserved5: [u8; 0x04], - #[doc = "0x28 - IntTfr Status"] - pub statustfr: STATUSTFR, + statustfr: STATUSTFR, _reserved6: [u8; 0x04], - #[doc = "0x30 - IntBlock Status"] - pub statusblock: STATUSBLOCK, + statusblock: STATUSBLOCK, _reserved7: [u8; 0x04], - #[doc = "0x38 - IntSrcTran Status"] - pub statussrctran: STATUSSRCTRAN, + statussrctran: STATUSSRCTRAN, _reserved8: [u8; 0x04], - #[doc = "0x40 - IntBlock Status"] - pub statusdsttran: STATUSDSTTRAN, + statusdsttran: STATUSDSTTRAN, _reserved9: [u8; 0x04], - #[doc = "0x48 - IntErr Status"] - pub statuserr: STATUSERR, + statuserr: STATUSERR, _reserved10: [u8; 0x04], - #[doc = "0x50 - Mask for Raw IntTfr Status"] - pub masktfr: MASKTFR, + masktfr: MASKTFR, _reserved11: [u8; 0x04], - #[doc = "0x58 - Mask for Raw IntBlock Status"] - pub maskblock: MASKBLOCK, + maskblock: MASKBLOCK, _reserved12: [u8; 0x04], - #[doc = "0x60 - Mask for Raw IntSrcTran Status"] - pub masksrctran: MASKSRCTRAN, + masksrctran: MASKSRCTRAN, _reserved13: [u8; 0x04], - #[doc = "0x68 - Mask for Raw IntBlock Status"] - pub maskdsttran: MASKDSTTRAN, + maskdsttran: MASKDSTTRAN, _reserved14: [u8; 0x04], - #[doc = "0x70 - Mask for Raw IntErr Status"] - pub maskerr: MASKERR, + maskerr: MASKERR, _reserved15: [u8; 0x04], - #[doc = "0x78 - IntTfr Status"] - pub cleartfr: CLEARTFR, + cleartfr: CLEARTFR, _reserved16: [u8; 0x04], - #[doc = "0x80 - IntBlock Status"] - pub clearblock: CLEARBLOCK, + clearblock: CLEARBLOCK, _reserved17: [u8; 0x04], - #[doc = "0x88 - IntSrcTran Status"] - pub clearsrctran: CLEARSRCTRAN, + clearsrctran: CLEARSRCTRAN, _reserved18: [u8; 0x04], - #[doc = "0x90 - IntBlock Status"] - pub cleardsttran: CLEARDSTTRAN, + cleardsttran: CLEARDSTTRAN, _reserved19: [u8; 0x04], - #[doc = "0x98 - IntErr Status"] - pub clearerr: CLEARERR, + clearerr: CLEARERR, _reserved20: [u8; 0x04], - #[doc = "0xa0 - Combined Interrupt Status Register"] - pub statusint: STATUSINT, + statusint: STATUSINT, _reserved21: [u8; 0x04], - #[doc = "0xa8 - Source Software Transaction Request Register"] - pub reqsrcreg: REQSRCREG, + reqsrcreg: REQSRCREG, _reserved22: [u8; 0x04], - #[doc = "0xb0 - Destination Software Transaction Request Register"] - pub reqdstreg: REQDSTREG, + reqdstreg: REQDSTREG, _reserved23: [u8; 0x04], - #[doc = "0xb8 - Single Source Transaction Request Register"] - pub sglreqsrcreg: SGLREQSRCREG, + sglreqsrcreg: SGLREQSRCREG, _reserved24: [u8; 0x04], - #[doc = "0xc0 - Single Destination Transaction Request Register"] - pub sglreqdstreg: SGLREQDSTREG, + sglreqdstreg: SGLREQDSTREG, _reserved25: [u8; 0x04], - #[doc = "0xc8 - Last Source Transaction Request Register"] - pub lstsrcreg: LSTSRCREG, + lstsrcreg: LSTSRCREG, _reserved26: [u8; 0x04], - #[doc = "0xd0 - Last Destination Transaction Request Register"] - pub lstdstreg: LSTDSTREG, + lstdstreg: LSTDSTREG, _reserved27: [u8; 0x04], - #[doc = "0xd8 - GPDMA Configuration Register"] - pub dmacfgreg: DMACFGREG, + dmacfgreg: DMACFGREG, _reserved28: [u8; 0x04], - #[doc = "0xe0 - GPDMA Channel Enable Register"] - pub chenreg: CHENREG, + chenreg: CHENREG, _reserved29: [u8; 0x04], - #[doc = "0xe8 - GPDMA0 ID Register"] - pub id: ID, + id: ID, _reserved30: [u8; 0x4c], + type_: TYPE, + version: VERSION, +} +impl RegisterBlock { + #[doc = "0x00 - Raw IntTfr Status"] + #[inline(always)] + pub const fn rawtfr(&self) -> &RAWTFR { + &self.rawtfr + } + #[doc = "0x08 - Raw IntBlock Status"] + #[inline(always)] + pub const fn rawblock(&self) -> &RAWBLOCK { + &self.rawblock + } + #[doc = "0x10 - Raw IntSrcTran Status"] + #[inline(always)] + pub const fn rawsrctran(&self) -> &RAWSRCTRAN { + &self.rawsrctran + } + #[doc = "0x18 - Raw IntBlock Status"] + #[inline(always)] + pub const fn rawdsttran(&self) -> &RAWDSTTRAN { + &self.rawdsttran + } + #[doc = "0x20 - Raw IntErr Status"] + #[inline(always)] + pub const fn rawerr(&self) -> &RAWERR { + &self.rawerr + } + #[doc = "0x28 - IntTfr Status"] + #[inline(always)] + pub const fn statustfr(&self) -> &STATUSTFR { + &self.statustfr + } + #[doc = "0x30 - IntBlock Status"] + #[inline(always)] + pub const fn statusblock(&self) -> &STATUSBLOCK { + &self.statusblock + } + #[doc = "0x38 - IntSrcTran Status"] + #[inline(always)] + pub const fn statussrctran(&self) -> &STATUSSRCTRAN { + &self.statussrctran + } + #[doc = "0x40 - IntBlock Status"] + #[inline(always)] + pub const fn statusdsttran(&self) -> &STATUSDSTTRAN { + &self.statusdsttran + } + #[doc = "0x48 - IntErr Status"] + #[inline(always)] + pub const fn statuserr(&self) -> &STATUSERR { + &self.statuserr + } + #[doc = "0x50 - Mask for Raw IntTfr Status"] + #[inline(always)] + pub const fn masktfr(&self) -> &MASKTFR { + &self.masktfr + } + #[doc = "0x58 - Mask for Raw IntBlock Status"] + #[inline(always)] + pub const fn maskblock(&self) -> &MASKBLOCK { + &self.maskblock + } + #[doc = "0x60 - Mask for Raw IntSrcTran Status"] + #[inline(always)] + pub const fn masksrctran(&self) -> &MASKSRCTRAN { + &self.masksrctran + } + #[doc = "0x68 - Mask for Raw IntBlock Status"] + #[inline(always)] + pub const fn maskdsttran(&self) -> &MASKDSTTRAN { + &self.maskdsttran + } + #[doc = "0x70 - Mask for Raw IntErr Status"] + #[inline(always)] + pub const fn maskerr(&self) -> &MASKERR { + &self.maskerr + } + #[doc = "0x78 - IntTfr Status"] + #[inline(always)] + pub const fn cleartfr(&self) -> &CLEARTFR { + &self.cleartfr + } + #[doc = "0x80 - IntBlock Status"] + #[inline(always)] + pub const fn clearblock(&self) -> &CLEARBLOCK { + &self.clearblock + } + #[doc = "0x88 - IntSrcTran Status"] + #[inline(always)] + pub const fn clearsrctran(&self) -> &CLEARSRCTRAN { + &self.clearsrctran + } + #[doc = "0x90 - IntBlock Status"] + #[inline(always)] + pub const fn cleardsttran(&self) -> &CLEARDSTTRAN { + &self.cleardsttran + } + #[doc = "0x98 - IntErr Status"] + #[inline(always)] + pub const fn clearerr(&self) -> &CLEARERR { + &self.clearerr + } + #[doc = "0xa0 - Combined Interrupt Status Register"] + #[inline(always)] + pub const fn statusint(&self) -> &STATUSINT { + &self.statusint + } + #[doc = "0xa8 - Source Software Transaction Request Register"] + #[inline(always)] + pub const fn reqsrcreg(&self) -> &REQSRCREG { + &self.reqsrcreg + } + #[doc = "0xb0 - Destination Software Transaction Request Register"] + #[inline(always)] + pub const fn reqdstreg(&self) -> &REQDSTREG { + &self.reqdstreg + } + #[doc = "0xb8 - Single Source Transaction Request Register"] + #[inline(always)] + pub const fn sglreqsrcreg(&self) -> &SGLREQSRCREG { + &self.sglreqsrcreg + } + #[doc = "0xc0 - Single Destination Transaction Request Register"] + #[inline(always)] + pub const fn sglreqdstreg(&self) -> &SGLREQDSTREG { + &self.sglreqdstreg + } + #[doc = "0xc8 - Last Source Transaction Request Register"] + #[inline(always)] + pub const fn lstsrcreg(&self) -> &LSTSRCREG { + &self.lstsrcreg + } + #[doc = "0xd0 - Last Destination Transaction Request Register"] + #[inline(always)] + pub const fn lstdstreg(&self) -> &LSTDSTREG { + &self.lstdstreg + } + #[doc = "0xd8 - GPDMA Configuration Register"] + #[inline(always)] + pub const fn dmacfgreg(&self) -> &DMACFGREG { + &self.dmacfgreg + } + #[doc = "0xe0 - GPDMA Channel Enable Register"] + #[inline(always)] + pub const fn chenreg(&self) -> &CHENREG { + &self.chenreg + } + #[doc = "0xe8 - GPDMA0 ID Register"] + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } #[doc = "0x138 - GPDMA Component Type"] - pub type_: TYPE, + #[inline(always)] + pub const fn type_(&self) -> &TYPE { + &self.type_ + } #[doc = "0x13c - DMA Component Version"] - pub version: VERSION, + #[inline(always)] + pub const fn version(&self) -> &VERSION { + &self.version + } } -#[doc = "RAWTFR (rw) register accessor: an alias for `Reg`"] +#[doc = "RAWTFR (rw) register accessor: Raw IntTfr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawtfr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawtfr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rawtfr`] +module"] pub type RAWTFR = crate::Reg; #[doc = "Raw IntTfr Status"] pub mod rawtfr; -#[doc = "RAWBLOCK (rw) register accessor: an alias for `Reg`"] +#[doc = "RAWBLOCK (rw) register accessor: Raw IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawblock::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawblock::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rawblock`] +module"] pub type RAWBLOCK = crate::Reg; #[doc = "Raw IntBlock Status"] pub mod rawblock; -#[doc = "RAWSRCTRAN (rw) register accessor: an alias for `Reg`"] +#[doc = "RAWSRCTRAN (rw) register accessor: Raw IntSrcTran Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawsrctran::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawsrctran::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rawsrctran`] +module"] pub type RAWSRCTRAN = crate::Reg; #[doc = "Raw IntSrcTran Status"] pub mod rawsrctran; -#[doc = "RAWDSTTRAN (rw) register accessor: an alias for `Reg`"] +#[doc = "RAWDSTTRAN (rw) register accessor: Raw IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawdsttran::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawdsttran::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rawdsttran`] +module"] pub type RAWDSTTRAN = crate::Reg; #[doc = "Raw IntBlock Status"] pub mod rawdsttran; -#[doc = "RAWERR (rw) register accessor: an alias for `Reg`"] +#[doc = "RAWERR (rw) register accessor: Raw IntErr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawerr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawerr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rawerr`] +module"] pub type RAWERR = crate::Reg; #[doc = "Raw IntErr Status"] pub mod rawerr; -#[doc = "STATUSTFR (r) register accessor: an alias for `Reg`"] +#[doc = "STATUSTFR (r) register accessor: IntTfr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statustfr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@statustfr`] +module"] pub type STATUSTFR = crate::Reg; #[doc = "IntTfr Status"] pub mod statustfr; -#[doc = "STATUSBLOCK (r) register accessor: an alias for `Reg`"] +#[doc = "STATUSBLOCK (r) register accessor: IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statusblock::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@statusblock`] +module"] pub type STATUSBLOCK = crate::Reg; #[doc = "IntBlock Status"] pub mod statusblock; -#[doc = "STATUSSRCTRAN (r) register accessor: an alias for `Reg`"] +#[doc = "STATUSSRCTRAN (r) register accessor: IntSrcTran Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statussrctran::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@statussrctran`] +module"] pub type STATUSSRCTRAN = crate::Reg; #[doc = "IntSrcTran Status"] pub mod statussrctran; -#[doc = "STATUSDSTTRAN (r) register accessor: an alias for `Reg`"] +#[doc = "STATUSDSTTRAN (r) register accessor: IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statusdsttran::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@statusdsttran`] +module"] pub type STATUSDSTTRAN = crate::Reg; #[doc = "IntBlock Status"] pub mod statusdsttran; -#[doc = "STATUSERR (r) register accessor: an alias for `Reg`"] +#[doc = "STATUSERR (r) register accessor: IntErr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statuserr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@statuserr`] +module"] pub type STATUSERR = crate::Reg; #[doc = "IntErr Status"] pub mod statuserr; -#[doc = "MASKTFR (rw) register accessor: an alias for `Reg`"] +#[doc = "MASKTFR (rw) register accessor: Mask for Raw IntTfr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`masktfr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`masktfr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@masktfr`] +module"] pub type MASKTFR = crate::Reg; #[doc = "Mask for Raw IntTfr Status"] pub mod masktfr; -#[doc = "MASKBLOCK (rw) register accessor: an alias for `Reg`"] +#[doc = "MASKBLOCK (rw) register accessor: Mask for Raw IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`maskblock::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`maskblock::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@maskblock`] +module"] pub type MASKBLOCK = crate::Reg; #[doc = "Mask for Raw IntBlock Status"] pub mod maskblock; -#[doc = "MASKSRCTRAN (rw) register accessor: an alias for `Reg`"] +#[doc = "MASKSRCTRAN (rw) register accessor: Mask for Raw IntSrcTran Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`masksrctran::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`masksrctran::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@masksrctran`] +module"] pub type MASKSRCTRAN = crate::Reg; #[doc = "Mask for Raw IntSrcTran Status"] pub mod masksrctran; -#[doc = "MASKDSTTRAN (rw) register accessor: an alias for `Reg`"] +#[doc = "MASKDSTTRAN (rw) register accessor: Mask for Raw IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`maskdsttran::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`maskdsttran::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@maskdsttran`] +module"] pub type MASKDSTTRAN = crate::Reg; #[doc = "Mask for Raw IntBlock Status"] pub mod maskdsttran; -#[doc = "MASKERR (rw) register accessor: an alias for `Reg`"] +#[doc = "MASKERR (rw) register accessor: Mask for Raw IntErr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`maskerr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`maskerr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@maskerr`] +module"] pub type MASKERR = crate::Reg; #[doc = "Mask for Raw IntErr Status"] pub mod maskerr; -#[doc = "CLEARTFR (w) register accessor: an alias for `Reg`"] +#[doc = "CLEARTFR (w) register accessor: IntTfr Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cleartfr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cleartfr`] +module"] pub type CLEARTFR = crate::Reg; #[doc = "IntTfr Status"] pub mod cleartfr; -#[doc = "CLEARBLOCK (w) register accessor: an alias for `Reg`"] +#[doc = "CLEARBLOCK (w) register accessor: IntBlock Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clearblock::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clearblock`] +module"] pub type CLEARBLOCK = crate::Reg; #[doc = "IntBlock Status"] pub mod clearblock; -#[doc = "CLEARSRCTRAN (w) register accessor: an alias for `Reg`"] +#[doc = "CLEARSRCTRAN (w) register accessor: IntSrcTran Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clearsrctran::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clearsrctran`] +module"] pub type CLEARSRCTRAN = crate::Reg; #[doc = "IntSrcTran Status"] pub mod clearsrctran; -#[doc = "CLEARDSTTRAN (w) register accessor: an alias for `Reg`"] +#[doc = "CLEARDSTTRAN (w) register accessor: IntBlock Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cleardsttran::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cleardsttran`] +module"] pub type CLEARDSTTRAN = crate::Reg; #[doc = "IntBlock Status"] pub mod cleardsttran; -#[doc = "CLEARERR (w) register accessor: an alias for `Reg`"] +#[doc = "CLEARERR (w) register accessor: IntErr Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clearerr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clearerr`] +module"] pub type CLEARERR = crate::Reg; #[doc = "IntErr Status"] pub mod clearerr; -#[doc = "STATUSINT (r) register accessor: an alias for `Reg`"] +#[doc = "STATUSINT (r) register accessor: Combined Interrupt Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statusint::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@statusint`] +module"] pub type STATUSINT = crate::Reg; #[doc = "Combined Interrupt Status Register"] pub mod statusint; -#[doc = "REQSRCREG (rw) register accessor: an alias for `Reg`"] +#[doc = "REQSRCREG (rw) register accessor: Source Software Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`reqsrcreg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`reqsrcreg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@reqsrcreg`] +module"] pub type REQSRCREG = crate::Reg; #[doc = "Source Software Transaction Request Register"] pub mod reqsrcreg; -#[doc = "REQDSTREG (rw) register accessor: an alias for `Reg`"] +#[doc = "REQDSTREG (rw) register accessor: Destination Software Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`reqdstreg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`reqdstreg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@reqdstreg`] +module"] pub type REQDSTREG = crate::Reg; #[doc = "Destination Software Transaction Request Register"] pub mod reqdstreg; -#[doc = "SGLREQSRCREG (rw) register accessor: an alias for `Reg`"] +#[doc = "SGLREQSRCREG (rw) register accessor: Single Source Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sglreqsrcreg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sglreqsrcreg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sglreqsrcreg`] +module"] pub type SGLREQSRCREG = crate::Reg; #[doc = "Single Source Transaction Request Register"] pub mod sglreqsrcreg; -#[doc = "SGLREQDSTREG (rw) register accessor: an alias for `Reg`"] +#[doc = "SGLREQDSTREG (rw) register accessor: Single Destination Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sglreqdstreg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sglreqdstreg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sglreqdstreg`] +module"] pub type SGLREQDSTREG = crate::Reg; #[doc = "Single Destination Transaction Request Register"] pub mod sglreqdstreg; -#[doc = "LSTSRCREG (rw) register accessor: an alias for `Reg`"] +#[doc = "LSTSRCREG (rw) register accessor: Last Source Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lstsrcreg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lstsrcreg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lstsrcreg`] +module"] pub type LSTSRCREG = crate::Reg; #[doc = "Last Source Transaction Request Register"] pub mod lstsrcreg; -#[doc = "LSTDSTREG (rw) register accessor: an alias for `Reg`"] +#[doc = "LSTDSTREG (rw) register accessor: Last Destination Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lstdstreg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lstdstreg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lstdstreg`] +module"] pub type LSTDSTREG = crate::Reg; #[doc = "Last Destination Transaction Request Register"] pub mod lstdstreg; -#[doc = "DMACFGREG (rw) register accessor: an alias for `Reg`"] +#[doc = "DMACFGREG (rw) register accessor: GPDMA Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dmacfgreg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dmacfgreg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dmacfgreg`] +module"] pub type DMACFGREG = crate::Reg; #[doc = "GPDMA Configuration Register"] pub mod dmacfgreg; -#[doc = "CHENREG (rw) register accessor: an alias for `Reg`"] +#[doc = "CHENREG (rw) register accessor: GPDMA Channel Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chenreg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chenreg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@chenreg`] +module"] pub type CHENREG = crate::Reg; #[doc = "GPDMA Channel Enable Register"] pub mod chenreg; -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: GPDMA0 ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "GPDMA0 ID Register"] pub mod id; -#[doc = "TYPE (r) register accessor: an alias for `Reg`"] +#[doc = "TYPE (r) register accessor: GPDMA Component Type\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`type_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@type_`] +module"] pub type TYPE = crate::Reg; #[doc = "GPDMA Component Type"] pub mod type_; -#[doc = "VERSION (r) register accessor: an alias for `Reg`"] +#[doc = "VERSION (r) register accessor: DMA Component Version\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`version::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@version`] +module"] 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 b7726945..20a5267a 100644 --- a/src/gpdma0/chenreg.rs +++ b/src/gpdma0/chenreg.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH` reader - Enables/Disables the channel"] -pub type CH_R = crate::FieldReader; +pub type CH_R = crate::FieldReader; #[doc = "Enables/Disables the channel\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -51,43 +19,50 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CH_A { + type Ux = u8; +} impl CH_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CH_A::VALUE1), 1 => Some(CH_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable the Channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable the Channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH_A::VALUE2 } } #[doc = "Field `CH` writer - Enables/Disables the channel"] -pub type CH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CHENREG_SPEC, u8, CH_A, 8, O>; -impl<'a, const O: u8> CH_W<'a, O> { +pub type CH_W<'a, REG> = crate::FieldWriter<'a, REG, 8, CH_A>; +impl<'a, REG> CH_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Disable the Channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH_A::VALUE1) } #[doc = "Enable the Channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH_A::VALUE2) } } #[doc = "Field `WE_CH` writer - Channel enable write enable"] -pub type WE_CH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CHENREG_SPEC, u8, u8, 8, O>; +pub type WE_CH_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Enables/Disables the channel"] #[inline(always)] @@ -99,34 +74,35 @@ impl W { #[doc = "Bits 0:7 - Enables/Disables the channel"] #[inline(always)] #[must_use] - pub fn ch(&mut self) -> CH_W<0> { - CH_W::new(self) + pub fn ch(&mut self) -> CH_W { + CH_W::new(self, 0) } #[doc = "Bits 8:15 - Channel enable write enable"] #[inline(always)] #[must_use] - pub fn we_ch(&mut self) -> WE_CH_W<8> { - WE_CH_W::new(self) + pub fn we_ch(&mut self) -> WE_CH_W { + WE_CH_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "GPDMA Channel Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chenreg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chenreg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`chenreg::R`](R) reader structure"] +impl crate::Readable for CHENREG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`chenreg::W`](W) writer structure"] impl crate::Writable for CHENREG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/clearblock.rs b/src/gpdma0/clearblock.rs index e4a88d95..248e4174 100644 --- a/src/gpdma0/clearblock.rs +++ b/src/gpdma0/clearblock.rs @@ -1,24 +1,5 @@ #[doc = "Register `CLEARBLOCK` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CH0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARBLOCK_SPEC, CH0_AW, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_AW>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARBLOCK_SPEC, CH1_AW, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_AW>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARBLOCK_SPEC, CH2_AW, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_AW>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARBLOCK_SPEC, CH3_AW, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_AW>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARBLOCK_SPEC, CH4_AW, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_AW>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARBLOCK_SPEC, CH5_AW, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_AW>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARBLOCK_SPEC, CH6_AW, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_AW>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARBLOCK_SPEC, CH7_AW, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_AW>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Clear Interrupt Status and Raw Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Clear Interrupt Status and Raw Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Clear Interrupt Status and Raw Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Clear Interrupt Status and Raw Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Clear Interrupt Status and Raw Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Clear Interrupt Status and Raw Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Clear Interrupt Status and Raw Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Clear Interrupt Status and Raw Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "IntBlock Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clearblock::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CLEARBLOCK_SPEC; impl crate::RegisterSpec for CLEARBLOCK_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [clearblock::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`clearblock::W`](W) writer structure"] impl crate::Writable for CLEARBLOCK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/cleardsttran.rs b/src/gpdma0/cleardsttran.rs index a9ea304b..088b4c72 100644 --- a/src/gpdma0/cleardsttran.rs +++ b/src/gpdma0/cleardsttran.rs @@ -1,24 +1,5 @@ #[doc = "Register `CLEARDSTTRAN` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CH0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARDSTTRAN_SPEC, CH0_AW, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_AW>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARDSTTRAN_SPEC, CH1_AW, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_AW>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARDSTTRAN_SPEC, CH2_AW, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_AW>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARDSTTRAN_SPEC, CH3_AW, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_AW>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARDSTTRAN_SPEC, CH4_AW, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_AW>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARDSTTRAN_SPEC, CH5_AW, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_AW>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARDSTTRAN_SPEC, CH6_AW, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_AW>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARDSTTRAN_SPEC, CH7_AW, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_AW>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Clear Interrupt Status and Raw Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Clear Interrupt Status and Raw Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Clear Interrupt Status and Raw Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Clear Interrupt Status and Raw Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Clear Interrupt Status and Raw Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Clear Interrupt Status and Raw Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Clear Interrupt Status and Raw Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Clear Interrupt Status and Raw Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "IntBlock Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cleardsttran::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CLEARDSTTRAN_SPEC; impl crate::RegisterSpec for CLEARDSTTRAN_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cleardsttran::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cleardsttran::W`](W) writer structure"] impl crate::Writable for CLEARDSTTRAN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/clearerr.rs b/src/gpdma0/clearerr.rs index 8223c7eb..b673d851 100644 --- a/src/gpdma0/clearerr.rs +++ b/src/gpdma0/clearerr.rs @@ -1,24 +1,5 @@ #[doc = "Register `CLEARERR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CH0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARERR_SPEC, CH0_AW, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_AW>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARERR_SPEC, CH1_AW, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_AW>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARERR_SPEC, CH2_AW, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_AW>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARERR_SPEC, CH3_AW, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_AW>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARERR_SPEC, CH4_AW, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_AW>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARERR_SPEC, CH5_AW, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_AW>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARERR_SPEC, CH6_AW, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_AW>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARERR_SPEC, CH7_AW, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_AW>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Clear Interrupt Status and Raw Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Clear Interrupt Status and Raw Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Clear Interrupt Status and Raw Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Clear Interrupt Status and Raw Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Clear Interrupt Status and Raw Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Clear Interrupt Status and Raw Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Clear Interrupt Status and Raw Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Clear Interrupt Status and Raw Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "IntErr Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clearerr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CLEARERR_SPEC; impl crate::RegisterSpec for CLEARERR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [clearerr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`clearerr::W`](W) writer structure"] impl crate::Writable for CLEARERR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/clearsrctran.rs b/src/gpdma0/clearsrctran.rs index d8ae7b81..7e09ab48 100644 --- a/src/gpdma0/clearsrctran.rs +++ b/src/gpdma0/clearsrctran.rs @@ -1,24 +1,5 @@ #[doc = "Register `CLEARSRCTRAN` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CH0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARSRCTRAN_SPEC, CH0_AW, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_AW>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARSRCTRAN_SPEC, CH1_AW, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_AW>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARSRCTRAN_SPEC, CH2_AW, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_AW>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARSRCTRAN_SPEC, CH3_AW, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_AW>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARSRCTRAN_SPEC, CH4_AW, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_AW>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARSRCTRAN_SPEC, CH5_AW, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_AW>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARSRCTRAN_SPEC, CH6_AW, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_AW>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARSRCTRAN_SPEC, CH7_AW, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_AW>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Clear Interrupt Status and Raw Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Clear Interrupt Status and Raw Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Clear Interrupt Status and Raw Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Clear Interrupt Status and Raw Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Clear Interrupt Status and Raw Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Clear Interrupt Status and Raw Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Clear Interrupt Status and Raw Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Clear Interrupt Status and Raw Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "IntSrcTran Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clearsrctran::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CLEARSRCTRAN_SPEC; impl crate::RegisterSpec for CLEARSRCTRAN_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [clearsrctran::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`clearsrctran::W`](W) writer structure"] impl crate::Writable for CLEARSRCTRAN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/cleartfr.rs b/src/gpdma0/cleartfr.rs index 7931b460..5cd8bfbb 100644 --- a/src/gpdma0/cleartfr.rs +++ b/src/gpdma0/cleartfr.rs @@ -1,24 +1,5 @@ #[doc = "Register `CLEARTFR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Interrupt Status and Raw Status for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CH0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CH0` writer - Clear Interrupt Status and Raw Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARTFR_SPEC, CH0_AW, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_AW>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `CH1` writer - Clear Interrupt Status and Raw Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARTFR_SPEC, CH1_AW, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_AW>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CH2` writer - Clear Interrupt Status and Raw Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARTFR_SPEC, CH2_AW, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_AW>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CH3` writer - Clear Interrupt Status and Raw Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARTFR_SPEC, CH3_AW, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_AW>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CH4` writer - Clear Interrupt Status and Raw Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARTFR_SPEC, CH4_AW, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_AW>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CH5` writer - Clear Interrupt Status and Raw Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARTFR_SPEC, CH5_AW, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_AW>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CH6` writer - Clear Interrupt Status and Raw Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARTFR_SPEC, CH6_AW, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_AW>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `CH7` writer - Clear Interrupt Status and Raw Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLEARTFR_SPEC, CH7_AW, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_AW>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE1) } #[doc = "clear status"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Clear Interrupt Status and Raw Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Clear Interrupt Status and Raw Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Clear Interrupt Status and Raw Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Clear Interrupt Status and Raw Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Clear Interrupt Status and Raw Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Clear Interrupt Status and Raw Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Clear Interrupt Status and Raw Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Clear Interrupt Status and Raw Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "IntTfr Status\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cleartfr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CLEARTFR_SPEC; impl crate::RegisterSpec for CLEARTFR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cleartfr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cleartfr::W`](W) writer structure"] impl crate::Writable for CLEARTFR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/dmacfgreg.rs b/src/gpdma0/dmacfgreg.rs index 545e2934..7db2af01 100644 --- a/src/gpdma0/dmacfgreg.rs +++ b/src/gpdma0/dmacfgreg.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DMA_EN` reader - GPDMA Enable bit."] pub type DMA_EN_R = crate::BitReader; #[doc = "GPDMA Enable bit.\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl DMA_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DMA_EN_A { + pub const fn variant(&self) -> DMA_EN_A { match self.bits { false => DMA_EN_A::VALUE1, true => DMA_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "GPDMA Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DMA_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "GPDMA Enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DMA_EN_A::VALUE2 } } #[doc = "Field `DMA_EN` writer - GPDMA Enable bit."] -pub type DMA_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DMACFGREG_SPEC, DMA_EN_A, O>; -impl<'a, const O: u8> DMA_EN_W<'a, O> { +pub type DMA_EN_W<'a, REG> = crate::BitWriter<'a, REG, DMA_EN_A>; +impl<'a, REG> DMA_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "GPDMA Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DMA_EN_A::VALUE1) } #[doc = "GPDMA Enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DMA_EN_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - GPDMA Enable bit."] #[inline(always)] #[must_use] - pub fn dma_en(&mut self) -> DMA_EN_W<0> { - DMA_EN_W::new(self) + pub fn dma_en(&mut self) -> DMA_EN_W { + DMA_EN_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "GPDMA Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dmacfgreg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dmacfgreg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dmacfgreg::R`](R) reader structure"] +impl crate::Readable for DMACFGREG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dmacfgreg::W`](W) writer structure"] impl crate::Writable for DMACFGREG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/id.rs b/src/gpdma0/id.rs index 95476061..f901eebb 100644 --- a/src/gpdma0/id.rs +++ b/src/gpdma0/id.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VALUE` reader - Hardcoded GPDMA Peripheral ID"] -pub type VALUE_R = crate::FieldReader; +pub type VALUE_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Hardcoded GPDMA Peripheral ID"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { VALUE_R::new(self.bits) } } -#[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"] +#[doc = "GPDMA0 ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00af_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00af_c000; diff --git a/src/gpdma0/lstdstreg.rs b/src/gpdma0/lstdstreg.rs index 952259db..dc9350af 100644 --- a/src/gpdma0/lstdstreg.rs +++ b/src/gpdma0/lstdstreg.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Destination last request for channel 0"] pub type CH0_R = crate::BitReader; #[doc = "Destination last request for channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH0_A { + pub const fn variant(&self) -> CH0_A { match self.bits { false => CH0_A::VALUE1, true => CH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH0_A::VALUE2 } } #[doc = "Field `CH0` writer - Destination last request for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, CH0_A, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_A>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH1_A { + pub const fn variant(&self) -> CH1_A { match self.bits { false => CH1_A::VALUE1, true => CH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH1_A::VALUE2 } } #[doc = "Field `CH1` writer - Destination last request for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, CH1_A, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_A>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CH2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH2_A { + pub const fn variant(&self) -> CH2_A { match self.bits { false => CH2_A::VALUE1, true => CH2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH2_A::VALUE2 } } #[doc = "Field `CH2` writer - Destination last request for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, CH2_A, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_A>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CH3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH3_A { + pub const fn variant(&self) -> CH3_A { match self.bits { false => CH3_A::VALUE1, true => CH3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH3_A::VALUE2 } } #[doc = "Field `CH3` writer - Destination last request for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, CH3_A, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_A>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CH4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH4_A { + pub const fn variant(&self) -> CH4_A { match self.bits { false => CH4_A::VALUE1, true => CH4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH4_A::VALUE2 } } #[doc = "Field `CH4` writer - Destination last request for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, CH4_A, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_A>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CH5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH5_A { + pub const fn variant(&self) -> CH5_A { match self.bits { false => CH5_A::VALUE1, true => CH5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH5_A::VALUE2 } } #[doc = "Field `CH5` writer - Destination last request for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, CH5_A, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_A>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CH6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH6_A { + pub const fn variant(&self) -> CH6_A { match self.bits { false => CH6_A::VALUE1, true => CH6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH6_A::VALUE2 } } #[doc = "Field `CH6` writer - Destination last request for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, CH6_A, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_A>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CH7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH7_A { + pub const fn variant(&self) -> CH7_A { match self.bits { false => CH7_A::VALUE1, true => CH7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH7_A::VALUE2 } } #[doc = "Field `CH7` writer - Destination last request for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, CH7_A, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_A>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE2) } } @@ -449,16 +441,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Destination last transaction request write enable for channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -477,16 +472,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Destination last transaction request write enable for channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -505,16 +503,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Destination last transaction request write enable for channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -533,16 +534,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Destination last transaction request write enable for channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -561,16 +565,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Destination last transaction request write enable for channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -589,16 +596,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Destination last transaction request write enable for channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -617,16 +627,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Destination last transaction request write enable for channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -645,16 +658,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Destination last transaction request write enable for channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTDSTREG_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -704,118 +720,119 @@ impl W { #[doc = "Bit 0 - Destination last request for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Destination last request for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Destination last request for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Destination last request for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Destination last request for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Destination last request for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Destination last request for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Destination last request for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Destination last transaction request write enable for channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Destination last transaction request write enable for channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Destination last transaction request write enable for channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Destination last transaction request write enable for channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Destination last transaction request write enable for channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Destination last transaction request write enable for channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Destination last transaction request write enable for channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Destination last transaction request write enable for channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Last Destination Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lstdstreg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lstdstreg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`lstdstreg::R`](R) reader structure"] +impl crate::Readable for LSTDSTREG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`lstdstreg::W`](W) writer structure"] impl crate::Writable for LSTDSTREG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/lstsrcreg.rs b/src/gpdma0/lstsrcreg.rs index 6a0d30a7..7803a63e 100644 --- a/src/gpdma0/lstsrcreg.rs +++ b/src/gpdma0/lstsrcreg.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Source last request for channel 0"] pub type CH0_R = crate::BitReader; #[doc = "Source last request for channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH0_A { + pub const fn variant(&self) -> CH0_A { match self.bits { false => CH0_A::VALUE1, true => CH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH0_A::VALUE2 } } #[doc = "Field `CH0` writer - Source last request for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, CH0_A, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_A>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH1_A { + pub const fn variant(&self) -> CH1_A { match self.bits { false => CH1_A::VALUE1, true => CH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH1_A::VALUE2 } } #[doc = "Field `CH1` writer - Source last request for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, CH1_A, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_A>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CH2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH2_A { + pub const fn variant(&self) -> CH2_A { match self.bits { false => CH2_A::VALUE1, true => CH2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH2_A::VALUE2 } } #[doc = "Field `CH2` writer - Source last request for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, CH2_A, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_A>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CH3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH3_A { + pub const fn variant(&self) -> CH3_A { match self.bits { false => CH3_A::VALUE1, true => CH3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH3_A::VALUE2 } } #[doc = "Field `CH3` writer - Source last request for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, CH3_A, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_A>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CH4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH4_A { + pub const fn variant(&self) -> CH4_A { match self.bits { false => CH4_A::VALUE1, true => CH4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH4_A::VALUE2 } } #[doc = "Field `CH4` writer - Source last request for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, CH4_A, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_A>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CH5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH5_A { + pub const fn variant(&self) -> CH5_A { match self.bits { false => CH5_A::VALUE1, true => CH5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH5_A::VALUE2 } } #[doc = "Field `CH5` writer - Source last request for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, CH5_A, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_A>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CH6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH6_A { + pub const fn variant(&self) -> CH6_A { match self.bits { false => CH6_A::VALUE1, true => CH6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH6_A::VALUE2 } } #[doc = "Field `CH6` writer - Source last request for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, CH6_A, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_A>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CH7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH7_A { + pub const fn variant(&self) -> CH7_A { match self.bits { false => CH7_A::VALUE1, true => CH7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not last transaction in current block"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Last transaction in current block"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH7_A::VALUE2 } } #[doc = "Field `CH7` writer - Source last request for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, CH7_A, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_A>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not last transaction in current block"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE1) } #[doc = "Last transaction in current block"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE2) } } @@ -449,16 +441,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Source last transaction request write enable for channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -477,16 +472,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Source last transaction request write enable for channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -505,16 +503,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Source last transaction request write enable for channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -533,16 +534,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Source last transaction request write enable for channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -561,16 +565,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Source last transaction request write enable for channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -589,16 +596,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Source last transaction request write enable for channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -617,16 +627,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Source last transaction request write enable for channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -645,16 +658,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Source last transaction request write enable for channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, LSTSRCREG_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -704,118 +720,119 @@ impl W { #[doc = "Bit 0 - Source last request for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Source last request for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Source last request for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Source last request for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Source last request for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Source last request for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Source last request for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Source last request for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Source last transaction request write enable for channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Source last transaction request write enable for channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Source last transaction request write enable for channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Source last transaction request write enable for channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Source last transaction request write enable for channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Source last transaction request write enable for channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Source last transaction request write enable for channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Source last transaction request write enable for channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Last Source Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lstsrcreg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lstsrcreg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`lstsrcreg::R`](R) reader structure"] +impl crate::Readable for LSTSRCREG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`lstsrcreg::W`](W) writer structure"] impl crate::Writable for LSTSRCREG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/maskblock.rs b/src/gpdma0/maskblock.rs index 8f7bf536..4761e02e 100644 --- a/src/gpdma0/maskblock.rs +++ b/src/gpdma0/maskblock.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Mask bit for channel 0"] pub type CH0_R = crate::BitReader; #[doc = "Mask bit for channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH0_A { + pub const fn variant(&self) -> CH0_A { match self.bits { false => CH0_A::VALUE1, true => CH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH0_A::VALUE2 } } #[doc = "Field `CH0` writer - Mask bit for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, CH0_A, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_A>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH1_A { + pub const fn variant(&self) -> CH1_A { match self.bits { false => CH1_A::VALUE1, true => CH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH1_A::VALUE2 } } #[doc = "Field `CH1` writer - Mask bit for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, CH1_A, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_A>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CH2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH2_A { + pub const fn variant(&self) -> CH2_A { match self.bits { false => CH2_A::VALUE1, true => CH2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH2_A::VALUE2 } } #[doc = "Field `CH2` writer - Mask bit for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, CH2_A, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_A>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CH3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH3_A { + pub const fn variant(&self) -> CH3_A { match self.bits { false => CH3_A::VALUE1, true => CH3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH3_A::VALUE2 } } #[doc = "Field `CH3` writer - Mask bit for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, CH3_A, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_A>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CH4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH4_A { + pub const fn variant(&self) -> CH4_A { match self.bits { false => CH4_A::VALUE1, true => CH4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH4_A::VALUE2 } } #[doc = "Field `CH4` writer - Mask bit for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, CH4_A, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_A>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CH5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH5_A { + pub const fn variant(&self) -> CH5_A { match self.bits { false => CH5_A::VALUE1, true => CH5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH5_A::VALUE2 } } #[doc = "Field `CH5` writer - Mask bit for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, CH5_A, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_A>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CH6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH6_A { + pub const fn variant(&self) -> CH6_A { match self.bits { false => CH6_A::VALUE1, true => CH6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH6_A::VALUE2 } } #[doc = "Field `CH6` writer - Mask bit for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, CH6_A, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_A>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CH7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH7_A { + pub const fn variant(&self) -> CH7_A { match self.bits { false => CH7_A::VALUE1, true => CH7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH7_A::VALUE2 } } #[doc = "Field `CH7` writer - Mask bit for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, CH7_A, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_A>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE2) } } @@ -449,16 +441,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -477,16 +472,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -505,16 +503,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -533,16 +534,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -561,16 +565,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -589,16 +596,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -617,16 +627,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -645,16 +658,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKBLOCK_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -704,118 +720,119 @@ impl W { #[doc = "Bit 0 - Mask bit for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Mask bit for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Mask bit for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Mask bit for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Mask bit for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Mask bit for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Mask bit for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Mask bit for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Write enable for mask bit of channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Write enable for mask bit of channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Write enable for mask bit of channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Write enable for mask bit of channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Write enable for mask bit of channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Write enable for mask bit of channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Write enable for mask bit of channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Write enable for mask bit of channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Mask for Raw IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`maskblock::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`maskblock::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`maskblock::R`](R) reader structure"] +impl crate::Readable for MASKBLOCK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`maskblock::W`](W) writer structure"] impl crate::Writable for MASKBLOCK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/maskdsttran.rs b/src/gpdma0/maskdsttran.rs index 2b013ad0..dea58b05 100644 --- a/src/gpdma0/maskdsttran.rs +++ b/src/gpdma0/maskdsttran.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Mask bit for channel 0"] pub type CH0_R = crate::BitReader; #[doc = "Mask bit for channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH0_A { + pub const fn variant(&self) -> CH0_A { match self.bits { false => CH0_A::VALUE1, true => CH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH0_A::VALUE2 } } #[doc = "Field `CH0` writer - Mask bit for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, CH0_A, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_A>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH1_A { + pub const fn variant(&self) -> CH1_A { match self.bits { false => CH1_A::VALUE1, true => CH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH1_A::VALUE2 } } #[doc = "Field `CH1` writer - Mask bit for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, CH1_A, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_A>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CH2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH2_A { + pub const fn variant(&self) -> CH2_A { match self.bits { false => CH2_A::VALUE1, true => CH2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH2_A::VALUE2 } } #[doc = "Field `CH2` writer - Mask bit for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, CH2_A, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_A>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CH3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH3_A { + pub const fn variant(&self) -> CH3_A { match self.bits { false => CH3_A::VALUE1, true => CH3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH3_A::VALUE2 } } #[doc = "Field `CH3` writer - Mask bit for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, CH3_A, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_A>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CH4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH4_A { + pub const fn variant(&self) -> CH4_A { match self.bits { false => CH4_A::VALUE1, true => CH4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH4_A::VALUE2 } } #[doc = "Field `CH4` writer - Mask bit for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, CH4_A, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_A>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CH5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH5_A { + pub const fn variant(&self) -> CH5_A { match self.bits { false => CH5_A::VALUE1, true => CH5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH5_A::VALUE2 } } #[doc = "Field `CH5` writer - Mask bit for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, CH5_A, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_A>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CH6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH6_A { + pub const fn variant(&self) -> CH6_A { match self.bits { false => CH6_A::VALUE1, true => CH6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH6_A::VALUE2 } } #[doc = "Field `CH6` writer - Mask bit for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, CH6_A, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_A>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CH7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH7_A { + pub const fn variant(&self) -> CH7_A { match self.bits { false => CH7_A::VALUE1, true => CH7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH7_A::VALUE2 } } #[doc = "Field `CH7` writer - Mask bit for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, CH7_A, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_A>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE2) } } @@ -449,16 +441,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -477,16 +472,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -505,16 +503,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -533,16 +534,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -561,16 +565,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -589,16 +596,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -617,16 +627,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -645,16 +658,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKDSTTRAN_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -704,118 +720,119 @@ impl W { #[doc = "Bit 0 - Mask bit for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Mask bit for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Mask bit for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Mask bit for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Mask bit for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Mask bit for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Mask bit for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Mask bit for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Write enable for mask bit of channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Write enable for mask bit of channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Write enable for mask bit of channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Write enable for mask bit of channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Write enable for mask bit of channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Write enable for mask bit of channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Write enable for mask bit of channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Write enable for mask bit of channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Mask for Raw IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`maskdsttran::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`maskdsttran::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`maskdsttran::R`](R) reader structure"] +impl crate::Readable for MASKDSTTRAN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`maskdsttran::W`](W) writer structure"] impl crate::Writable for MASKDSTTRAN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/maskerr.rs b/src/gpdma0/maskerr.rs index 3c670bbf..5282bfe0 100644 --- a/src/gpdma0/maskerr.rs +++ b/src/gpdma0/maskerr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Mask bit for channel 0"] pub type CH0_R = crate::BitReader; #[doc = "Mask bit for channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH0_A { + pub const fn variant(&self) -> CH0_A { match self.bits { false => CH0_A::VALUE1, true => CH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH0_A::VALUE2 } } #[doc = "Field `CH0` writer - Mask bit for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, CH0_A, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_A>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH1_A { + pub const fn variant(&self) -> CH1_A { match self.bits { false => CH1_A::VALUE1, true => CH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH1_A::VALUE2 } } #[doc = "Field `CH1` writer - Mask bit for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, CH1_A, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_A>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CH2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH2_A { + pub const fn variant(&self) -> CH2_A { match self.bits { false => CH2_A::VALUE1, true => CH2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH2_A::VALUE2 } } #[doc = "Field `CH2` writer - Mask bit for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, CH2_A, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_A>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CH3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH3_A { + pub const fn variant(&self) -> CH3_A { match self.bits { false => CH3_A::VALUE1, true => CH3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH3_A::VALUE2 } } #[doc = "Field `CH3` writer - Mask bit for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, CH3_A, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_A>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CH4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH4_A { + pub const fn variant(&self) -> CH4_A { match self.bits { false => CH4_A::VALUE1, true => CH4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH4_A::VALUE2 } } #[doc = "Field `CH4` writer - Mask bit for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, CH4_A, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_A>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CH5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH5_A { + pub const fn variant(&self) -> CH5_A { match self.bits { false => CH5_A::VALUE1, true => CH5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH5_A::VALUE2 } } #[doc = "Field `CH5` writer - Mask bit for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, CH5_A, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_A>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CH6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH6_A { + pub const fn variant(&self) -> CH6_A { match self.bits { false => CH6_A::VALUE1, true => CH6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH6_A::VALUE2 } } #[doc = "Field `CH6` writer - Mask bit for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, CH6_A, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_A>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CH7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH7_A { + pub const fn variant(&self) -> CH7_A { match self.bits { false => CH7_A::VALUE1, true => CH7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH7_A::VALUE2 } } #[doc = "Field `CH7` writer - Mask bit for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, CH7_A, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_A>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE2) } } @@ -449,16 +441,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -477,16 +472,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -505,16 +503,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -533,16 +534,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -561,16 +565,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -589,16 +596,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -617,16 +627,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -645,16 +658,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKERR_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -704,118 +720,119 @@ impl W { #[doc = "Bit 0 - Mask bit for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Mask bit for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Mask bit for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Mask bit for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Mask bit for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Mask bit for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Mask bit for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Mask bit for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Write enable for mask bit of channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Write enable for mask bit of channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Write enable for mask bit of channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Write enable for mask bit of channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Write enable for mask bit of channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Write enable for mask bit of channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Write enable for mask bit of channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Write enable for mask bit of channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Mask for Raw IntErr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`maskerr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`maskerr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`maskerr::R`](R) reader structure"] +impl crate::Readable for MASKERR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`maskerr::W`](W) writer structure"] impl crate::Writable for MASKERR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/masksrctran.rs b/src/gpdma0/masksrctran.rs index 61b06ddf..d9984b6b 100644 --- a/src/gpdma0/masksrctran.rs +++ b/src/gpdma0/masksrctran.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Mask bit for channel 0"] pub type CH0_R = crate::BitReader; #[doc = "Mask bit for channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH0_A { + pub const fn variant(&self) -> CH0_A { match self.bits { false => CH0_A::VALUE1, true => CH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH0_A::VALUE2 } } #[doc = "Field `CH0` writer - Mask bit for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, CH0_A, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_A>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH1_A { + pub const fn variant(&self) -> CH1_A { match self.bits { false => CH1_A::VALUE1, true => CH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH1_A::VALUE2 } } #[doc = "Field `CH1` writer - Mask bit for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, CH1_A, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_A>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CH2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH2_A { + pub const fn variant(&self) -> CH2_A { match self.bits { false => CH2_A::VALUE1, true => CH2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH2_A::VALUE2 } } #[doc = "Field `CH2` writer - Mask bit for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, CH2_A, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_A>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CH3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH3_A { + pub const fn variant(&self) -> CH3_A { match self.bits { false => CH3_A::VALUE1, true => CH3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH3_A::VALUE2 } } #[doc = "Field `CH3` writer - Mask bit for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, CH3_A, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_A>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CH4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH4_A { + pub const fn variant(&self) -> CH4_A { match self.bits { false => CH4_A::VALUE1, true => CH4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH4_A::VALUE2 } } #[doc = "Field `CH4` writer - Mask bit for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, CH4_A, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_A>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CH5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH5_A { + pub const fn variant(&self) -> CH5_A { match self.bits { false => CH5_A::VALUE1, true => CH5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH5_A::VALUE2 } } #[doc = "Field `CH5` writer - Mask bit for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, CH5_A, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_A>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CH6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH6_A { + pub const fn variant(&self) -> CH6_A { match self.bits { false => CH6_A::VALUE1, true => CH6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH6_A::VALUE2 } } #[doc = "Field `CH6` writer - Mask bit for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, CH6_A, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_A>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CH7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH7_A { + pub const fn variant(&self) -> CH7_A { match self.bits { false => CH7_A::VALUE1, true => CH7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH7_A::VALUE2 } } #[doc = "Field `CH7` writer - Mask bit for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, CH7_A, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_A>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE2) } } @@ -449,16 +441,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -477,16 +472,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -505,16 +503,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -533,16 +534,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -561,16 +565,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -589,16 +596,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -617,16 +627,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -645,16 +658,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKSRCTRAN_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -704,118 +720,119 @@ impl W { #[doc = "Bit 0 - Mask bit for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Mask bit for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Mask bit for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Mask bit for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Mask bit for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Mask bit for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Mask bit for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Mask bit for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Write enable for mask bit of channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Write enable for mask bit of channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Write enable for mask bit of channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Write enable for mask bit of channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Write enable for mask bit of channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Write enable for mask bit of channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Write enable for mask bit of channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Write enable for mask bit of channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Mask for Raw IntSrcTran Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`masksrctran::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`masksrctran::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`masksrctran::R`](R) reader structure"] +impl crate::Readable for MASKSRCTRAN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`masksrctran::W`](W) writer structure"] impl crate::Writable for MASKSRCTRAN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/masktfr.rs b/src/gpdma0/masktfr.rs index 57c21fd2..4109e4e4 100644 --- a/src/gpdma0/masktfr.rs +++ b/src/gpdma0/masktfr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Mask bit for channel 0"] pub type CH0_R = crate::BitReader; #[doc = "Mask bit for channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH0_A { + pub const fn variant(&self) -> CH0_A { match self.bits { false => CH0_A::VALUE1, true => CH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH0_A::VALUE2 } } #[doc = "Field `CH0` writer - Mask bit for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, CH0_A, O>; -impl<'a, const O: u8> CH0_W<'a, O> { +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG, CH0_A>; +impl<'a, REG> CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH1_A { + pub const fn variant(&self) -> CH1_A { match self.bits { false => CH1_A::VALUE1, true => CH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH1_A::VALUE2 } } #[doc = "Field `CH1` writer - Mask bit for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, CH1_A, O>; -impl<'a, const O: u8> CH1_W<'a, O> { +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG, CH1_A>; +impl<'a, REG> CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CH2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH2_A { + pub const fn variant(&self) -> CH2_A { match self.bits { false => CH2_A::VALUE1, true => CH2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH2_A::VALUE2 } } #[doc = "Field `CH2` writer - Mask bit for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, CH2_A, O>; -impl<'a, const O: u8> CH2_W<'a, O> { +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG, CH2_A>; +impl<'a, REG> CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CH3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH3_A { + pub const fn variant(&self) -> CH3_A { match self.bits { false => CH3_A::VALUE1, true => CH3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH3_A::VALUE2 } } #[doc = "Field `CH3` writer - Mask bit for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, CH3_A, O>; -impl<'a, const O: u8> CH3_W<'a, O> { +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG, CH3_A>; +impl<'a, REG> CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CH4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH4_A { + pub const fn variant(&self) -> CH4_A { match self.bits { false => CH4_A::VALUE1, true => CH4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH4_A::VALUE2 } } #[doc = "Field `CH4` writer - Mask bit for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, CH4_A, O>; -impl<'a, const O: u8> CH4_W<'a, O> { +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG, CH4_A>; +impl<'a, REG> CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CH5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH5_A { + pub const fn variant(&self) -> CH5_A { match self.bits { false => CH5_A::VALUE1, true => CH5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH5_A::VALUE2 } } #[doc = "Field `CH5` writer - Mask bit for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, CH5_A, O>; -impl<'a, const O: u8> CH5_W<'a, O> { +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG, CH5_A>; +impl<'a, REG> CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CH6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH6_A { + pub const fn variant(&self) -> CH6_A { match self.bits { false => CH6_A::VALUE1, true => CH6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH6_A::VALUE2 } } #[doc = "Field `CH6` writer - Mask bit for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, CH6_A, O>; -impl<'a, const O: u8> CH6_W<'a, O> { +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG, CH6_A>; +impl<'a, REG> CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CH7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH7_A { + pub const fn variant(&self) -> CH7_A { match self.bits { false => CH7_A::VALUE1, true => CH7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "masked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unmasked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH7_A::VALUE2 } } #[doc = "Field `CH7` writer - Mask bit for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, CH7_A, O>; -impl<'a, const O: u8> CH7_W<'a, O> { +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG, CH7_A>; +impl<'a, REG> CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "masked"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE1) } #[doc = "unmasked"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH7_A::VALUE2) } } @@ -449,16 +441,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Write enable for mask bit of channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -477,16 +472,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Write enable for mask bit of channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -505,16 +503,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Write enable for mask bit of channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -533,16 +534,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Write enable for mask bit of channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -561,16 +565,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Write enable for mask bit of channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -589,16 +596,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Write enable for mask bit of channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -617,16 +627,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Write enable for mask bit of channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -645,16 +658,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Write enable for mask bit of channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, MASKTFR_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -704,118 +720,119 @@ impl W { #[doc = "Bit 0 - Mask bit for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Mask bit for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Mask bit for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Mask bit for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Mask bit for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Mask bit for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Mask bit for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Mask bit for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Write enable for mask bit of channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Write enable for mask bit of channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Write enable for mask bit of channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Write enable for mask bit of channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Write enable for mask bit of channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Write enable for mask bit of channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Write enable for mask bit of channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Write enable for mask bit of channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Mask for Raw IntTfr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`masktfr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`masktfr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`masktfr::R`](R) reader structure"] +impl crate::Readable for MASKTFR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`masktfr::W`](W) writer structure"] impl crate::Writable for MASKTFR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/rawblock.rs b/src/gpdma0/rawblock.rs index d1f4efd5..12bbfa6a 100644 --- a/src/gpdma0/rawblock.rs +++ b/src/gpdma0/rawblock.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWBLOCK_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWBLOCK_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWBLOCK_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWBLOCK_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWBLOCK_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWBLOCK_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWBLOCK_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWBLOCK_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Raw Interrupt Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Raw Interrupt Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Raw Interrupt Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Raw Interrupt Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Raw Interrupt Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Raw Interrupt Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Raw Interrupt Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Raw IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawblock::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawblock::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rawblock::R`](R) reader structure"] +impl crate::Readable for RAWBLOCK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rawblock::W`](W) writer structure"] impl crate::Writable for RAWBLOCK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/rawdsttran.rs b/src/gpdma0/rawdsttran.rs index 058b9189..29067731 100644 --- a/src/gpdma0/rawdsttran.rs +++ b/src/gpdma0/rawdsttran.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWDSTTRAN_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWDSTTRAN_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWDSTTRAN_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWDSTTRAN_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWDSTTRAN_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWDSTTRAN_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWDSTTRAN_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWDSTTRAN_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Raw Interrupt Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Raw Interrupt Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Raw Interrupt Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Raw Interrupt Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Raw Interrupt Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Raw Interrupt Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Raw Interrupt Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Raw IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawdsttran::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawdsttran::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rawdsttran::R`](R) reader structure"] +impl crate::Readable for RAWDSTTRAN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rawdsttran::W`](W) writer structure"] impl crate::Writable for RAWDSTTRAN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/rawerr.rs b/src/gpdma0/rawerr.rs index 7f2a4749..70cb8542 100644 --- a/src/gpdma0/rawerr.rs +++ b/src/gpdma0/rawerr.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWERR_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWERR_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWERR_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWERR_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWERR_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWERR_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWERR_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWERR_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Raw Interrupt Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Raw Interrupt Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Raw Interrupt Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Raw Interrupt Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Raw Interrupt Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Raw Interrupt Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Raw Interrupt Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Raw IntErr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawerr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawerr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rawerr::R`](R) reader structure"] +impl crate::Readable for RAWERR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rawerr::W`](W) writer structure"] impl crate::Writable for RAWERR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/rawsrctran.rs b/src/gpdma0/rawsrctran.rs index ac683e19..b8337548 100644 --- a/src/gpdma0/rawsrctran.rs +++ b/src/gpdma0/rawsrctran.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWSRCTRAN_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWSRCTRAN_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWSRCTRAN_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWSRCTRAN_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWSRCTRAN_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWSRCTRAN_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWSRCTRAN_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWSRCTRAN_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Raw Interrupt Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Raw Interrupt Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Raw Interrupt Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Raw Interrupt Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Raw Interrupt Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Raw Interrupt Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Raw Interrupt Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Raw IntSrcTran Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawsrctran::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawsrctran::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rawsrctran::R`](R) reader structure"] +impl crate::Readable for RAWSRCTRAN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rawsrctran::W`](W) writer structure"] impl crate::Writable for RAWSRCTRAN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/rawtfr.rs b/src/gpdma0/rawtfr.rs index 69e07bde..ddc68491 100644 --- a/src/gpdma0/rawtfr.rs +++ b/src/gpdma0/rawtfr.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Raw Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Raw Interrupt Status for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWTFR_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Raw Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Raw Interrupt Status for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWTFR_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Raw Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWTFR_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Raw Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Raw Interrupt Status for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWTFR_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Raw Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Raw Interrupt Status for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWTFR_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Raw Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Raw Interrupt Status for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWTFR_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Raw Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Raw Interrupt Status for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWTFR_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Raw Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Raw Interrupt Status for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAWTFR_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bit 0 - Raw Interrupt Status for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Raw Interrupt Status for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Raw Interrupt Status for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Raw Interrupt Status for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Raw Interrupt Status for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Raw Interrupt Status for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Raw Interrupt Status for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Raw Interrupt Status for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Raw IntTfr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawtfr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rawtfr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rawtfr::R`](R) reader structure"] +impl crate::Readable for RAWTFR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rawtfr::W`](W) writer structure"] impl crate::Writable for RAWTFR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/reqdstreg.rs b/src/gpdma0/reqdstreg.rs index 340e4a15..e7a78440 100644 --- a/src/gpdma0/reqdstreg.rs +++ b/src/gpdma0/reqdstreg.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Source request for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Source request for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Source request for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Source request for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Source request for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Source request for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Source request for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Source request for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Source request for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Source request for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Source request for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Source request for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Source request for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Source request for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Source request for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Source request for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Source request write enable for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum WE_CH0_AW { @@ -81,16 +49,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Source request write enable for channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -109,16 +80,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Source request write enable for channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -137,16 +111,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Source request write enable for channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -165,16 +142,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Source request write enable for channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -193,16 +173,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Source request write enable for channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -221,16 +204,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Source request write enable for channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -249,16 +235,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Source request write enable for channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -277,16 +266,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Source request write enable for channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQDSTREG_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -336,118 +328,119 @@ impl W { #[doc = "Bit 0 - Source request for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Source request for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Source request for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Source request for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Source request for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Source request for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Source request for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Source request for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Source request write enable for channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Source request write enable for channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Source request write enable for channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Source request write enable for channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Source request write enable for channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Source request write enable for channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Source request write enable for channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Source request write enable for channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Destination Software Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`reqdstreg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`reqdstreg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`reqdstreg::R`](R) reader structure"] +impl crate::Readable for REQDSTREG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`reqdstreg::W`](W) writer structure"] impl crate::Writable for REQDSTREG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/reqsrcreg.rs b/src/gpdma0/reqsrcreg.rs index 7eee9757..cc489a1c 100644 --- a/src/gpdma0/reqsrcreg.rs +++ b/src/gpdma0/reqsrcreg.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Source request for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Source request for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Source request for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Source request for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Source request for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Source request for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Source request for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Source request for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Source request for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Source request for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Source request for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Source request for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Source request for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Source request for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Source request for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Source request for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Source request write enable for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum WE_CH0_AW { @@ -81,16 +49,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Source request write enable for channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -109,16 +80,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Source request write enable for channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -137,16 +111,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Source request write enable for channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -165,16 +142,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Source request write enable for channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -193,16 +173,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Source request write enable for channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -221,16 +204,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Source request write enable for channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -249,16 +235,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Source request write enable for channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -277,16 +266,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Source request write enable for channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, REQSRCREG_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -336,118 +328,119 @@ impl W { #[doc = "Bit 0 - Source request for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Source request for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Source request for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Source request for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Source request for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Source request for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Source request for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Source request for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Source request write enable for channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Source request write enable for channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Source request write enable for channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Source request write enable for channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Source request write enable for channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Source request write enable for channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Source request write enable for channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Source request write enable for channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Software Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`reqsrcreg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`reqsrcreg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`reqsrcreg::R`](R) reader structure"] +impl crate::Readable for REQSRCREG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`reqsrcreg::W`](W) writer structure"] impl crate::Writable for REQSRCREG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/sglreqdstreg.rs b/src/gpdma0/sglreqdstreg.rs index 4c5ff0f9..1c812f37 100644 --- a/src/gpdma0/sglreqdstreg.rs +++ b/src/gpdma0/sglreqdstreg.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Source request for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Source request for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Source request for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Source request for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Source request for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Source request for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Source request for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Source request for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Source request for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Source request for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Source request for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Source request for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Source request for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Source request for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Source request for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Source request for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Source request write enable for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum WE_CH0_AW { @@ -81,16 +49,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Source request write enable for channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -109,16 +80,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Source request write enable for channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -137,16 +111,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Source request write enable for channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -165,16 +142,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Source request write enable for channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -193,16 +173,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Source request write enable for channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -221,16 +204,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Source request write enable for channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -249,16 +235,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Source request write enable for channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -277,16 +266,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Source request write enable for channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQDSTREG_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -336,118 +328,119 @@ impl W { #[doc = "Bit 0 - Source request for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Source request for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Source request for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Source request for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Source request for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Source request for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Source request for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Source request for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Source request write enable for channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Source request write enable for channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Source request write enable for channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Source request write enable for channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Source request write enable for channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Source request write enable for channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Source request write enable for channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Source request write enable for channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Single Destination Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sglreqdstreg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sglreqdstreg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sglreqdstreg::R`](R) reader structure"] +impl crate::Readable for SGLREQDSTREG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sglreqdstreg::W`](W) writer structure"] impl crate::Writable for SGLREQDSTREG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/sglreqsrcreg.rs b/src/gpdma0/sglreqsrcreg.rs index 7a6d670c..614908aa 100644 --- a/src/gpdma0/sglreqsrcreg.rs +++ b/src/gpdma0/sglreqsrcreg.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH0` reader - Source request for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH0` writer - Source request for channel 0"] -pub type CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, bool, O>; +pub type CH0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH1` reader - Source request for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH1` writer - Source request for channel 1"] -pub type CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, bool, O>; +pub type CH1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH2` reader - Source request for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH2` writer - Source request for channel 2"] -pub type CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, bool, O>; +pub type CH2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH3` reader - Source request for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH3` writer - Source request for channel 3"] -pub type CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, bool, O>; +pub type CH3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH4` reader - Source request for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH4` writer - Source request for channel 4"] -pub type CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, bool, O>; +pub type CH4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH5` reader - Source request for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH5` writer - Source request for channel 5"] -pub type CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, bool, O>; +pub type CH5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH6` reader - Source request for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH6` writer - Source request for channel 6"] -pub type CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, bool, O>; +pub type CH6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CH7` reader - Source request for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; #[doc = "Field `CH7` writer - Source request for channel 7"] -pub type CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, bool, O>; +pub type CH7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Source request write enable for channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum WE_CH0_AW { @@ -81,16 +49,19 @@ impl From for bool { } } #[doc = "Field `WE_CH0` writer - Source request write enable for channel 0"] -pub type WE_CH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, WE_CH0_AW, O>; -impl<'a, const O: u8> WE_CH0_W<'a, O> { +pub type WE_CH0_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH0_AW>; +impl<'a, REG> WE_CH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH0_AW::VALUE2) } } @@ -109,16 +80,19 @@ impl From for bool { } } #[doc = "Field `WE_CH1` writer - Source request write enable for channel 1"] -pub type WE_CH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, WE_CH1_AW, O>; -impl<'a, const O: u8> WE_CH1_W<'a, O> { +pub type WE_CH1_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH1_AW>; +impl<'a, REG> WE_CH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH1_AW::VALUE2) } } @@ -137,16 +111,19 @@ impl From for bool { } } #[doc = "Field `WE_CH2` writer - Source request write enable for channel 2"] -pub type WE_CH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, WE_CH2_AW, O>; -impl<'a, const O: u8> WE_CH2_W<'a, O> { +pub type WE_CH2_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH2_AW>; +impl<'a, REG> WE_CH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH2_AW::VALUE2) } } @@ -165,16 +142,19 @@ impl From for bool { } } #[doc = "Field `WE_CH3` writer - Source request write enable for channel 3"] -pub type WE_CH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, WE_CH3_AW, O>; -impl<'a, const O: u8> WE_CH3_W<'a, O> { +pub type WE_CH3_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH3_AW>; +impl<'a, REG> WE_CH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH3_AW::VALUE2) } } @@ -193,16 +173,19 @@ impl From for bool { } } #[doc = "Field `WE_CH4` writer - Source request write enable for channel 4"] -pub type WE_CH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, WE_CH4_AW, O>; -impl<'a, const O: u8> WE_CH4_W<'a, O> { +pub type WE_CH4_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH4_AW>; +impl<'a, REG> WE_CH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH4_AW::VALUE2) } } @@ -221,16 +204,19 @@ impl From for bool { } } #[doc = "Field `WE_CH5` writer - Source request write enable for channel 5"] -pub type WE_CH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, WE_CH5_AW, O>; -impl<'a, const O: u8> WE_CH5_W<'a, O> { +pub type WE_CH5_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH5_AW>; +impl<'a, REG> WE_CH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH5_AW::VALUE2) } } @@ -249,16 +235,19 @@ impl From for bool { } } #[doc = "Field `WE_CH6` writer - Source request write enable for channel 6"] -pub type WE_CH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, WE_CH6_AW, O>; -impl<'a, const O: u8> WE_CH6_W<'a, O> { +pub type WE_CH6_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH6_AW>; +impl<'a, REG> WE_CH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH6_AW::VALUE2) } } @@ -277,16 +266,19 @@ impl From for bool { } } #[doc = "Field `WE_CH7` writer - Source request write enable for channel 7"] -pub type WE_CH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, SGLREQSRCREG_SPEC, WE_CH7_AW, O>; -impl<'a, const O: u8> WE_CH7_W<'a, O> { +pub type WE_CH7_W<'a, REG> = crate::BitWriter<'a, REG, WE_CH7_AW>; +impl<'a, REG> WE_CH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "write disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE1) } #[doc = "write enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WE_CH7_AW::VALUE2) } } @@ -336,118 +328,119 @@ impl W { #[doc = "Bit 0 - Source request for channel 0"] #[inline(always)] #[must_use] - pub fn ch0(&mut self) -> CH0_W<0> { - CH0_W::new(self) + pub fn ch0(&mut self) -> CH0_W { + CH0_W::new(self, 0) } #[doc = "Bit 1 - Source request for channel 1"] #[inline(always)] #[must_use] - pub fn ch1(&mut self) -> CH1_W<1> { - CH1_W::new(self) + pub fn ch1(&mut self) -> CH1_W { + CH1_W::new(self, 1) } #[doc = "Bit 2 - Source request for channel 2"] #[inline(always)] #[must_use] - pub fn ch2(&mut self) -> CH2_W<2> { - CH2_W::new(self) + pub fn ch2(&mut self) -> CH2_W { + CH2_W::new(self, 2) } #[doc = "Bit 3 - Source request for channel 3"] #[inline(always)] #[must_use] - pub fn ch3(&mut self) -> CH3_W<3> { - CH3_W::new(self) + pub fn ch3(&mut self) -> CH3_W { + CH3_W::new(self, 3) } #[doc = "Bit 4 - Source request for channel 4"] #[inline(always)] #[must_use] - pub fn ch4(&mut self) -> CH4_W<4> { - CH4_W::new(self) + pub fn ch4(&mut self) -> CH4_W { + CH4_W::new(self, 4) } #[doc = "Bit 5 - Source request for channel 5"] #[inline(always)] #[must_use] - pub fn ch5(&mut self) -> CH5_W<5> { - CH5_W::new(self) + pub fn ch5(&mut self) -> CH5_W { + CH5_W::new(self, 5) } #[doc = "Bit 6 - Source request for channel 6"] #[inline(always)] #[must_use] - pub fn ch6(&mut self) -> CH6_W<6> { - CH6_W::new(self) + pub fn ch6(&mut self) -> CH6_W { + CH6_W::new(self, 6) } #[doc = "Bit 7 - Source request for channel 7"] #[inline(always)] #[must_use] - pub fn ch7(&mut self) -> CH7_W<7> { - CH7_W::new(self) + pub fn ch7(&mut self) -> CH7_W { + CH7_W::new(self, 7) } #[doc = "Bit 8 - Source request write enable for channel 0"] #[inline(always)] #[must_use] - pub fn we_ch0(&mut self) -> WE_CH0_W<8> { - WE_CH0_W::new(self) + pub fn we_ch0(&mut self) -> WE_CH0_W { + WE_CH0_W::new(self, 8) } #[doc = "Bit 9 - Source request write enable for channel 1"] #[inline(always)] #[must_use] - pub fn we_ch1(&mut self) -> WE_CH1_W<9> { - WE_CH1_W::new(self) + pub fn we_ch1(&mut self) -> WE_CH1_W { + WE_CH1_W::new(self, 9) } #[doc = "Bit 10 - Source request write enable for channel 2"] #[inline(always)] #[must_use] - pub fn we_ch2(&mut self) -> WE_CH2_W<10> { - WE_CH2_W::new(self) + pub fn we_ch2(&mut self) -> WE_CH2_W { + WE_CH2_W::new(self, 10) } #[doc = "Bit 11 - Source request write enable for channel 3"] #[inline(always)] #[must_use] - pub fn we_ch3(&mut self) -> WE_CH3_W<11> { - WE_CH3_W::new(self) + pub fn we_ch3(&mut self) -> WE_CH3_W { + WE_CH3_W::new(self, 11) } #[doc = "Bit 12 - Source request write enable for channel 4"] #[inline(always)] #[must_use] - pub fn we_ch4(&mut self) -> WE_CH4_W<12> { - WE_CH4_W::new(self) + pub fn we_ch4(&mut self) -> WE_CH4_W { + WE_CH4_W::new(self, 12) } #[doc = "Bit 13 - Source request write enable for channel 5"] #[inline(always)] #[must_use] - pub fn we_ch5(&mut self) -> WE_CH5_W<13> { - WE_CH5_W::new(self) + pub fn we_ch5(&mut self) -> WE_CH5_W { + WE_CH5_W::new(self, 13) } #[doc = "Bit 14 - Source request write enable for channel 6"] #[inline(always)] #[must_use] - pub fn we_ch6(&mut self) -> WE_CH6_W<14> { - WE_CH6_W::new(self) + pub fn we_ch6(&mut self) -> WE_CH6_W { + WE_CH6_W::new(self, 14) } #[doc = "Bit 15 - Source request write enable for channel 7"] #[inline(always)] #[must_use] - pub fn we_ch7(&mut self) -> WE_CH7_W<15> { - WE_CH7_W::new(self) + pub fn we_ch7(&mut self) -> WE_CH7_W { + WE_CH7_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Single Source Transaction Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sglreqsrcreg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sglreqsrcreg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sglreqsrcreg::R`](R) reader structure"] +impl crate::Readable for SGLREQSRCREG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sglreqsrcreg::W`](W) writer structure"] impl crate::Writable for SGLREQSRCREG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0/statusblock.rs b/src/gpdma0/statusblock.rs index 21a9d139..52e1e422 100644 --- a/src/gpdma0/statusblock.rs +++ b/src/gpdma0/statusblock.rs @@ -1,34 +1,21 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CH0` reader - Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH1` reader - Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH2` reader - Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH3` reader - Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH4` reader - Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH5` reader - Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH6` reader - Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH7` reader - Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -71,15 +58,13 @@ impl R { CH7_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statusblock::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`statusblock::R`](R) reader structure"] +impl crate::Readable for STATUSBLOCK_SPEC {} #[doc = "`reset()` method sets STATUSBLOCK to value 0"] impl crate::Resettable for STATUSBLOCK_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/gpdma0/statusdsttran.rs b/src/gpdma0/statusdsttran.rs index c3735689..f091066e 100644 --- a/src/gpdma0/statusdsttran.rs +++ b/src/gpdma0/statusdsttran.rs @@ -1,34 +1,21 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CH0` reader - Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH1` reader - Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH2` reader - Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH3` reader - Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH4` reader - Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH5` reader - Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH6` reader - Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH7` reader - Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -71,15 +58,13 @@ impl R { CH7_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "IntBlock Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statusdsttran::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`statusdsttran::R`](R) reader structure"] +impl crate::Readable for STATUSDSTTRAN_SPEC {} #[doc = "`reset()` method sets STATUSDSTTRAN to value 0"] impl crate::Resettable for STATUSDSTTRAN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/gpdma0/statuserr.rs b/src/gpdma0/statuserr.rs index 76f5a8e4..81ab4fd6 100644 --- a/src/gpdma0/statuserr.rs +++ b/src/gpdma0/statuserr.rs @@ -1,34 +1,21 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CH0` reader - Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH1` reader - Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH2` reader - Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH3` reader - Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH4` reader - Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH5` reader - Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH6` reader - Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH7` reader - Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -71,15 +58,13 @@ impl R { CH7_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "IntErr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statuserr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`statuserr::R`](R) reader structure"] +impl crate::Readable for STATUSERR_SPEC {} #[doc = "`reset()` method sets STATUSERR to value 0"] impl crate::Resettable for STATUSERR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/gpdma0/statusint.rs b/src/gpdma0/statusint.rs index a7618638..5b3a7ca3 100644 --- a/src/gpdma0/statusint.rs +++ b/src/gpdma0/statusint.rs @@ -1,28 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `TFR` reader - OR of the contents of STATUSTFR register"] -pub type TFR_R = crate::BitReader; +pub type TFR_R = crate::BitReader; #[doc = "Field `BLOCK` reader - OR of the contents of STATUSBLOCK register"] -pub type BLOCK_R = crate::BitReader; +pub type BLOCK_R = crate::BitReader; #[doc = "Field `SRCT` reader - OR of the contents of STATUSSRCTRAN register"] -pub type SRCT_R = crate::BitReader; +pub type SRCT_R = crate::BitReader; #[doc = "Field `DSTT` reader - OR of the contents of STATUSDSTTRAN register"] -pub type DSTT_R = crate::BitReader; +pub type DSTT_R = crate::BitReader; #[doc = "Field `ERR` reader - OR of the contents of STATUSERR register"] -pub type ERR_R = crate::BitReader; +pub type ERR_R = crate::BitReader; impl R { #[doc = "Bit 0 - OR of the contents of STATUSTFR register"] #[inline(always)] @@ -50,15 +37,13 @@ impl R { ERR_R::new(((self.bits >> 4) & 1) != 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"] +#[doc = "Combined Interrupt Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statusint::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`statusint::R`](R) reader structure"] +impl crate::Readable for STATUSINT_SPEC {} #[doc = "`reset()` method sets STATUSINT to value 0"] impl crate::Resettable for STATUSINT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/gpdma0/statussrctran.rs b/src/gpdma0/statussrctran.rs index 10102328..d099b7d1 100644 --- a/src/gpdma0/statussrctran.rs +++ b/src/gpdma0/statussrctran.rs @@ -1,34 +1,21 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CH0` reader - Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH1` reader - Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH2` reader - Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH3` reader - Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH4` reader - Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH5` reader - Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH6` reader - Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH7` reader - Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -71,15 +58,13 @@ impl R { CH7_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "IntSrcTran Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statussrctran::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`statussrctran::R`](R) reader structure"] +impl crate::Readable for STATUSSRCTRAN_SPEC {} #[doc = "`reset()` method sets STATUSSRCTRAN to value 0"] impl crate::Resettable for STATUSSRCTRAN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/gpdma0/statustfr.rs b/src/gpdma0/statustfr.rs index 9f65969d..70a4a94f 100644 --- a/src/gpdma0/statustfr.rs +++ b/src/gpdma0/statustfr.rs @@ -1,34 +1,21 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CH0` reader - Interrupt Status for channel 0"] -pub type CH0_R = crate::BitReader; +pub type CH0_R = crate::BitReader; #[doc = "Field `CH1` reader - Interrupt Status for channel 1"] -pub type CH1_R = crate::BitReader; +pub type CH1_R = crate::BitReader; #[doc = "Field `CH2` reader - Interrupt Status for channel 2"] -pub type CH2_R = crate::BitReader; +pub type CH2_R = crate::BitReader; #[doc = "Field `CH3` reader - Interrupt Status for channel 3"] -pub type CH3_R = crate::BitReader; +pub type CH3_R = crate::BitReader; #[doc = "Field `CH4` reader - Interrupt Status for channel 4"] -pub type CH4_R = crate::BitReader; +pub type CH4_R = crate::BitReader; #[doc = "Field `CH5` reader - Interrupt Status for channel 5"] -pub type CH5_R = crate::BitReader; +pub type CH5_R = crate::BitReader; #[doc = "Field `CH6` reader - Interrupt Status for channel 6"] -pub type CH6_R = crate::BitReader; +pub type CH6_R = crate::BitReader; #[doc = "Field `CH7` reader - Interrupt Status for channel 7"] -pub type CH7_R = crate::BitReader; +pub type CH7_R = crate::BitReader; impl R { #[doc = "Bit 0 - Interrupt Status for channel 0"] #[inline(always)] @@ -71,15 +58,13 @@ impl R { CH7_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "IntTfr Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`statustfr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`statustfr::R`](R) reader structure"] +impl crate::Readable for STATUSTFR_SPEC {} #[doc = "`reset()` method sets STATUSTFR to value 0"] impl crate::Resettable for STATUSTFR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/gpdma0/type_.rs b/src/gpdma0/type_.rs index 192d9721..16eb364f 100644 --- a/src/gpdma0/type_.rs +++ b/src/gpdma0/type_.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VALUE` reader - Component Type"] -pub type VALUE_R = crate::FieldReader; +pub type VALUE_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Component Type"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { VALUE_R::new(self.bits) } } -#[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"] +#[doc = "GPDMA Component Type\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`type_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`type_::R`](R) reader structure"] +impl crate::Readable for TYPE_SPEC {} #[doc = "`reset()` method sets TYPE to value 0x4457_1110"] impl crate::Resettable for TYPE_SPEC { const RESET_VALUE: Self::Ux = 0x4457_1110; diff --git a/src/gpdma0/version.rs b/src/gpdma0/version.rs index 6d7ed7ba..f8b9bb86 100644 --- a/src/gpdma0/version.rs +++ b/src/gpdma0/version.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VALUE` reader - Version number of the component"] -pub type VALUE_R = crate::FieldReader; +pub type VALUE_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Version number of the component"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { VALUE_R::new(self.bits) } } -#[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"] +#[doc = "DMA Component Version\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`version::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`version::R`](R) reader structure"] +impl crate::Readable for VERSION_SPEC {} #[doc = "`reset()` method sets VERSION to value 0x3231_342a"] impl crate::Resettable for VERSION_SPEC { const RESET_VALUE: Self::Ux = 0x3231_342a; diff --git a/src/gpdma0_ch0.rs b/src/gpdma0_ch0.rs index 67d9983d..2601babd 100644 --- a/src/gpdma0_ch0.rs +++ b/src/gpdma0_ch0.rs @@ -1,90 +1,157 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Source Address Register"] - pub sar: SAR, + sar: SAR, _reserved1: [u8; 0x04], - #[doc = "0x08 - Destination Address Register"] - pub dar: DAR, + dar: DAR, _reserved2: [u8; 0x04], - #[doc = "0x10 - Linked List Pointer Register"] - pub llp: LLP, + llp: LLP, _reserved3: [u8; 0x04], + ctll: CTLL, + ctlh: CTLH, + sstat: SSTAT, + _reserved6: [u8; 0x04], + dstat: DSTAT, + _reserved7: [u8; 0x04], + sstatar: SSTATAR, + _reserved8: [u8; 0x04], + dstatar: DSTATAR, + _reserved9: [u8; 0x04], + cfgl: CFGL, + cfgh: CFGH, + sgr: SGR, + _reserved12: [u8; 0x04], + dsr: DSR, +} +impl RegisterBlock { + #[doc = "0x00 - Source Address Register"] + #[inline(always)] + pub const fn sar(&self) -> &SAR { + &self.sar + } + #[doc = "0x08 - Destination Address Register"] + #[inline(always)] + pub const fn dar(&self) -> &DAR { + &self.dar + } + #[doc = "0x10 - Linked List Pointer Register"] + #[inline(always)] + pub const fn llp(&self) -> &LLP { + &self.llp + } #[doc = "0x18 - Control Register Low"] - pub ctll: CTLL, + #[inline(always)] + pub const fn ctll(&self) -> &CTLL { + &self.ctll + } #[doc = "0x1c - Control Register High"] - pub ctlh: CTLH, + #[inline(always)] + pub const fn ctlh(&self) -> &CTLH { + &self.ctlh + } #[doc = "0x20 - Source Status Register"] - pub sstat: SSTAT, - _reserved6: [u8; 0x04], + #[inline(always)] + pub const fn sstat(&self) -> &SSTAT { + &self.sstat + } #[doc = "0x28 - Destination Status Register"] - pub dstat: DSTAT, - _reserved7: [u8; 0x04], + #[inline(always)] + pub const fn dstat(&self) -> &DSTAT { + &self.dstat + } #[doc = "0x30 - Source Status Address Register"] - pub sstatar: SSTATAR, - _reserved8: [u8; 0x04], + #[inline(always)] + pub const fn sstatar(&self) -> &SSTATAR { + &self.sstatar + } #[doc = "0x38 - Destination Status Address Register"] - pub dstatar: DSTATAR, - _reserved9: [u8; 0x04], + #[inline(always)] + pub const fn dstatar(&self) -> &DSTATAR { + &self.dstatar + } #[doc = "0x40 - Configuration Register Low"] - pub cfgl: CFGL, + #[inline(always)] + pub const fn cfgl(&self) -> &CFGL { + &self.cfgl + } #[doc = "0x44 - Configuration Register High"] - pub cfgh: CFGH, + #[inline(always)] + pub const fn cfgh(&self) -> &CFGH { + &self.cfgh + } #[doc = "0x48 - Source Gather Register"] - pub sgr: SGR, - _reserved12: [u8; 0x04], + #[inline(always)] + pub const fn sgr(&self) -> &SGR { + &self.sgr + } #[doc = "0x50 - Destination Scatter Register"] - pub dsr: DSR, + #[inline(always)] + pub const fn dsr(&self) -> &DSR { + &self.dsr + } } -#[doc = "SAR (rw) register accessor: an alias for `Reg`"] +#[doc = "SAR (rw) register accessor: Source Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sar`] +module"] pub type SAR = crate::Reg; #[doc = "Source Address Register"] pub mod sar; -#[doc = "DAR (rw) register accessor: an alias for `Reg`"] +#[doc = "DAR (rw) register accessor: Destination Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dar`] +module"] pub type DAR = crate::Reg; #[doc = "Destination Address Register"] pub mod dar; -#[doc = "LLP (rw) register accessor: an alias for `Reg`"] +#[doc = "LLP (rw) register accessor: Linked List Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`llp::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`llp::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@llp`] +module"] pub type LLP = crate::Reg; #[doc = "Linked List Pointer Register"] pub mod llp; -#[doc = "CTLL (rw) register accessor: an alias for `Reg`"] +#[doc = "CTLL (rw) register accessor: Control Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctll::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctll::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctll`] +module"] pub type CTLL = crate::Reg; #[doc = "Control Register Low"] pub mod ctll; -#[doc = "CTLH (rw) register accessor: an alias for `Reg`"] +#[doc = "CTLH (rw) register accessor: Control Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctlh::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctlh::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctlh`] +module"] pub type CTLH = crate::Reg; #[doc = "Control Register High"] pub mod ctlh; -#[doc = "SSTAT (rw) register accessor: an alias for `Reg`"] +#[doc = "SSTAT (rw) register accessor: Source Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sstat::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sstat::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sstat`] +module"] pub type SSTAT = crate::Reg; #[doc = "Source Status Register"] pub mod sstat; -#[doc = "DSTAT (rw) register accessor: an alias for `Reg`"] +#[doc = "DSTAT (rw) register accessor: Destination Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dstat::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dstat::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dstat`] +module"] pub type DSTAT = crate::Reg; #[doc = "Destination Status Register"] pub mod dstat; -#[doc = "SSTATAR (rw) register accessor: an alias for `Reg`"] +#[doc = "SSTATAR (rw) register accessor: Source Status Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sstatar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sstatar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sstatar`] +module"] pub type SSTATAR = crate::Reg; #[doc = "Source Status Address Register"] pub mod sstatar; -#[doc = "DSTATAR (rw) register accessor: an alias for `Reg`"] +#[doc = "DSTATAR (rw) register accessor: Destination Status Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dstatar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dstatar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dstatar`] +module"] pub type DSTATAR = crate::Reg; #[doc = "Destination Status Address Register"] pub mod dstatar; -#[doc = "CFGL (rw) register accessor: an alias for `Reg`"] +#[doc = "CFGL (rw) register accessor: Configuration Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfgl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cfgl`] +module"] pub type CFGL = crate::Reg; #[doc = "Configuration Register Low"] pub mod cfgl; -#[doc = "CFGH (rw) register accessor: an alias for `Reg`"] +#[doc = "CFGH (rw) register accessor: Configuration Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgh::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfgh::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cfgh`] +module"] pub type CFGH = crate::Reg; #[doc = "Configuration Register High"] pub mod cfgh; -#[doc = "SGR (rw) register accessor: an alias for `Reg`"] +#[doc = "SGR (rw) register accessor: Source Gather Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sgr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sgr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sgr`] +module"] pub type SGR = crate::Reg; #[doc = "Source Gather Register"] pub mod sgr; -#[doc = "DSR (rw) register accessor: an alias for `Reg`"] +#[doc = "DSR (rw) register accessor: Destination Scatter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dsr`] +module"] 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 a8895a64..5415fbc6 100644 --- a/src/gpdma0_ch0/cfgh.rs +++ b/src/gpdma0_ch0/cfgh.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `FCMODE` reader - Flow Control Mode"] pub type FCMODE_R = crate::BitReader; #[doc = "Flow Control Mode\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl FCMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FCMODE_A { + pub const fn variant(&self) -> FCMODE_A { match self.bits { false => FCMODE_A::VALUE1, true => FCMODE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Source transaction requests are serviced when they occur. Data pre-fetching is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FCMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Source transaction requests are not serviced until a destination transaction request occurs. In this mode, the amount of data transferred from the source is limited so that it is guaranteed to be transferred to the destination prior to block termination by the destination. Data pre-fetching is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FCMODE_A::VALUE2 } } #[doc = "Field `FCMODE` writer - Flow Control Mode"] -pub type FCMODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGH_SPEC, FCMODE_A, O>; -impl<'a, const O: u8> FCMODE_W<'a, O> { +pub type FCMODE_W<'a, REG> = crate::BitWriter<'a, REG, FCMODE_A>; +impl<'a, REG> FCMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Source transaction requests are serviced when they occur. Data pre-fetching is enabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FCMODE_A::VALUE1) } #[doc = "Source transaction requests are not serviced until a destination transaction request occurs. In this mode, the amount of data transferred from the source is limited so that it is guaranteed to be transferred to the destination prior to block termination by the destination. Data pre-fetching is disabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FCMODE_A::VALUE2) } } @@ -103,57 +74,60 @@ impl From for bool { impl FIFO_MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FIFO_MODE_A { + pub const fn variant(&self) -> FIFO_MODE_A { match self.bits { false => FIFO_MODE_A::VALUE1, true => FIFO_MODE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Space/data available for single AHB transfer of the specified transfer width."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FIFO_MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data available is greater than or equal to half the FIFO depth for destination transfers and space available is greater than half the fifo depth for source transfers. The exceptions are at the end of a burst transaction request or at the end of a block transfer."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FIFO_MODE_A::VALUE2 } } #[doc = "Field `FIFO_MODE` writer - FIFO Mode Select"] -pub type FIFO_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGH_SPEC, FIFO_MODE_A, O>; -impl<'a, const O: u8> FIFO_MODE_W<'a, O> { +pub type FIFO_MODE_W<'a, REG> = crate::BitWriter<'a, REG, FIFO_MODE_A>; +impl<'a, REG> FIFO_MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Space/data available for single AHB transfer of the specified transfer width."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FIFO_MODE_A::VALUE1) } #[doc = "Data available is greater than or equal to half the FIFO depth for destination transfers and space available is greater than half the fifo depth for source transfers. The exceptions are at the end of a burst transaction request or at the end of a block transfer."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FIFO_MODE_A::VALUE2) } } #[doc = "Field `PROTCTL` reader - Protection Control"] -pub type PROTCTL_R = crate::FieldReader; +pub type PROTCTL_R = crate::FieldReader; #[doc = "Field `PROTCTL` writer - Protection Control"] -pub type PROTCTL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGH_SPEC, u8, u8, 3, O>; +pub type PROTCTL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `DS_UPD_EN` reader - Destination Status Update Enable"] -pub type DS_UPD_EN_R = crate::BitReader; +pub type DS_UPD_EN_R = crate::BitReader; #[doc = "Field `DS_UPD_EN` writer - Destination Status Update Enable"] -pub type DS_UPD_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGH_SPEC, bool, O>; +pub type DS_UPD_EN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SS_UPD_EN` reader - Source Status Update Enable"] -pub type SS_UPD_EN_R = crate::BitReader; +pub type SS_UPD_EN_R = crate::BitReader; #[doc = "Field `SS_UPD_EN` writer - Source Status Update Enable"] -pub type SS_UPD_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGH_SPEC, bool, O>; +pub type SS_UPD_EN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SRC_PER` reader - Source Peripheral"] -pub type SRC_PER_R = crate::FieldReader; +pub type SRC_PER_R = crate::FieldReader; #[doc = "Field `SRC_PER` writer - Source Peripheral"] -pub type SRC_PER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGH_SPEC, u8, u8, 4, O>; +pub type SRC_PER_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `DEST_PER` reader - Destination Peripheral"] -pub type DEST_PER_R = crate::FieldReader; +pub type DEST_PER_R = crate::FieldReader; #[doc = "Field `DEST_PER` writer - Destination Peripheral"] -pub type DEST_PER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGH_SPEC, u8, u8, 4, O>; +pub type DEST_PER_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bit 0 - Flow Control Mode"] #[inline(always)] @@ -195,64 +169,65 @@ impl W { #[doc = "Bit 0 - Flow Control Mode"] #[inline(always)] #[must_use] - pub fn fcmode(&mut self) -> FCMODE_W<0> { - FCMODE_W::new(self) + pub fn fcmode(&mut self) -> FCMODE_W { + FCMODE_W::new(self, 0) } #[doc = "Bit 1 - FIFO Mode Select"] #[inline(always)] #[must_use] - pub fn fifo_mode(&mut self) -> FIFO_MODE_W<1> { - FIFO_MODE_W::new(self) + pub fn fifo_mode(&mut self) -> FIFO_MODE_W { + FIFO_MODE_W::new(self, 1) } #[doc = "Bits 2:4 - Protection Control"] #[inline(always)] #[must_use] - pub fn protctl(&mut self) -> PROTCTL_W<2> { - PROTCTL_W::new(self) + pub fn protctl(&mut self) -> PROTCTL_W { + PROTCTL_W::new(self, 2) } #[doc = "Bit 5 - Destination Status Update Enable"] #[inline(always)] #[must_use] - pub fn ds_upd_en(&mut self) -> DS_UPD_EN_W<5> { - DS_UPD_EN_W::new(self) + pub fn ds_upd_en(&mut self) -> DS_UPD_EN_W { + DS_UPD_EN_W::new(self, 5) } #[doc = "Bit 6 - Source Status Update Enable"] #[inline(always)] #[must_use] - pub fn ss_upd_en(&mut self) -> SS_UPD_EN_W<6> { - SS_UPD_EN_W::new(self) + pub fn ss_upd_en(&mut self) -> SS_UPD_EN_W { + SS_UPD_EN_W::new(self, 6) } #[doc = "Bits 7:10 - Source Peripheral"] #[inline(always)] #[must_use] - pub fn src_per(&mut self) -> SRC_PER_W<7> { - SRC_PER_W::new(self) + pub fn src_per(&mut self) -> SRC_PER_W { + SRC_PER_W::new(self, 7) } #[doc = "Bits 11:14 - Destination Peripheral"] #[inline(always)] #[must_use] - pub fn dest_per(&mut self) -> DEST_PER_W<11> { - DEST_PER_W::new(self) + pub fn dest_per(&mut self) -> DEST_PER_W { + DEST_PER_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Configuration Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgh::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfgh::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cfgh::R`](R) reader structure"] +impl crate::Readable for CFGH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cfgh::W`](W) writer structure"] impl crate::Writable for CFGH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/cfgl.rs b/src/gpdma0_ch0/cfgl.rs index cfdfa8e4..f956e1a8 100644 --- a/src/gpdma0_ch0/cfgl.rs +++ b/src/gpdma0_ch0/cfgl.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH_PRIOR` reader - Channel priority"] -pub type CH_PRIOR_R = crate::FieldReader; +pub type CH_PRIOR_R = crate::FieldReader; #[doc = "Field `CH_PRIOR` writer - Channel priority"] -pub type CH_PRIOR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGL_SPEC, u8, u8, 3, O>; +pub type CH_PRIOR_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `CH_SUSP` reader - Channel Suspend"] pub type CH_SUSP_R = crate::BitReader; #[doc = "Channel Suspend\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl CH_SUSP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH_SUSP_A { + pub const fn variant(&self) -> CH_SUSP_A { match self.bits { false => CH_SUSP_A::VALUE1, true => CH_SUSP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not suspended."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH_SUSP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Suspend DMA transfer from the source."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH_SUSP_A::VALUE2 } } #[doc = "Field `CH_SUSP` writer - Channel Suspend"] -pub type CH_SUSP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, CH_SUSP_A, O>; -impl<'a, const O: u8> CH_SUSP_W<'a, O> { +pub type CH_SUSP_W<'a, REG> = crate::BitWriter<'a, REG, CH_SUSP_A>; +impl<'a, REG> CH_SUSP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not suspended."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH_SUSP_A::VALUE1) } #[doc = "Suspend DMA transfer from the source."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH_SUSP_A::VALUE2) } } @@ -107,18 +78,18 @@ impl From for bool { impl FIFO_EMPTY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FIFO_EMPTY_A { + pub const fn variant(&self) -> FIFO_EMPTY_A { match self.bits { true => FIFO_EMPTY_A::VALUE1, false => FIFO_EMPTY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel FIFO empty"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FIFO_EMPTY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel FIFO not empty"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FIFO_EMPTY_A::VALUE2 @@ -143,34 +114,37 @@ impl From for bool { impl HS_SEL_DST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HS_SEL_DST_A { + pub const fn variant(&self) -> HS_SEL_DST_A { match self.bits { false => HS_SEL_DST_A::VALUE1, true => HS_SEL_DST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HS_SEL_DST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Software handshaking interface. Hardware- initiated transaction requests are ignored."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HS_SEL_DST_A::VALUE2 } } #[doc = "Field `HS_SEL_DST` writer - Destination Software or Hardware Handshaking Select"] -pub type HS_SEL_DST_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, HS_SEL_DST_A, O>; -impl<'a, const O: u8> HS_SEL_DST_W<'a, O> { +pub type HS_SEL_DST_W<'a, REG> = crate::BitWriter<'a, REG, HS_SEL_DST_A>; +impl<'a, REG> HS_SEL_DST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HS_SEL_DST_A::VALUE1) } #[doc = "Software handshaking interface. Hardware- initiated transaction requests are ignored."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HS_SEL_DST_A::VALUE2) } } @@ -193,39 +167,42 @@ impl From for bool { impl HS_SEL_SRC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HS_SEL_SRC_A { + pub const fn variant(&self) -> HS_SEL_SRC_A { match self.bits { false => HS_SEL_SRC_A::VALUE1, true => HS_SEL_SRC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HS_SEL_SRC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Software handshaking interface. Hardware-initiated transaction requests are ignored."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HS_SEL_SRC_A::VALUE2 } } #[doc = "Field `HS_SEL_SRC` writer - Source Software or Hardware Handshaking Select"] -pub type HS_SEL_SRC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, HS_SEL_SRC_A, O>; -impl<'a, const O: u8> HS_SEL_SRC_W<'a, O> { +pub type HS_SEL_SRC_W<'a, REG> = crate::BitWriter<'a, REG, HS_SEL_SRC_A>; +impl<'a, REG> HS_SEL_SRC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HS_SEL_SRC_A::VALUE1) } #[doc = "Software handshaking interface. Hardware-initiated transaction requests are ignored."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HS_SEL_SRC_A::VALUE2) } } #[doc = "Field `LOCK_CH_L` reader - Channel Lock Level"] -pub type LOCK_CH_L_R = crate::FieldReader; +pub type LOCK_CH_L_R = crate::FieldReader; #[doc = "Channel Lock Level\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -243,10 +220,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LOCK_CH_L_A { + type Ux = u8; +} impl LOCK_CH_L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(LOCK_CH_L_A::VALUE1), 1 => Some(LOCK_CH_L_A::VALUE2), @@ -254,43 +234,47 @@ impl LOCK_CH_L_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Over complete DMA transfer"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LOCK_CH_L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Over complete DMA block transfer"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LOCK_CH_L_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Over complete DMA transaction"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LOCK_CH_L_A::VALUE3 } } #[doc = "Field `LOCK_CH_L` writer - Channel Lock Level"] -pub type LOCK_CH_L_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGL_SPEC, u8, LOCK_CH_L_A, 2, O>; -impl<'a, const O: u8> LOCK_CH_L_W<'a, O> { +pub type LOCK_CH_L_W<'a, REG> = crate::FieldWriter<'a, REG, 2, LOCK_CH_L_A>; +impl<'a, REG> LOCK_CH_L_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Over complete DMA transfer"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LOCK_CH_L_A::VALUE1) } #[doc = "Over complete DMA block transfer"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LOCK_CH_L_A::VALUE2) } #[doc = "Over complete DMA transaction"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LOCK_CH_L_A::VALUE3) } } #[doc = "Field `LOCK_B_L` reader - Bus Lock Level"] -pub type LOCK_B_L_R = crate::FieldReader; +pub type LOCK_B_L_R = crate::FieldReader; #[doc = "Bus Lock Level\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -308,10 +292,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LOCK_B_L_A { + type Ux = u8; +} impl LOCK_B_L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(LOCK_B_L_A::VALUE1), 1 => Some(LOCK_B_L_A::VALUE2), @@ -319,49 +306,53 @@ impl LOCK_B_L_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Over complete DMA transfer"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LOCK_B_L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Over complete DMA block transfer"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LOCK_B_L_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Over complete DMA transaction"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LOCK_B_L_A::VALUE3 } } #[doc = "Field `LOCK_B_L` writer - Bus Lock Level"] -pub type LOCK_B_L_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGL_SPEC, u8, LOCK_B_L_A, 2, O>; -impl<'a, const O: u8> LOCK_B_L_W<'a, O> { +pub type LOCK_B_L_W<'a, REG> = crate::FieldWriter<'a, REG, 2, LOCK_B_L_A>; +impl<'a, REG> LOCK_B_L_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Over complete DMA transfer"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LOCK_B_L_A::VALUE1) } #[doc = "Over complete DMA block transfer"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LOCK_B_L_A::VALUE2) } #[doc = "Over complete DMA transaction"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LOCK_B_L_A::VALUE3) } } #[doc = "Field `LOCK_CH` reader - Channel Lock Bit"] -pub type LOCK_CH_R = crate::BitReader; +pub type LOCK_CH_R = crate::BitReader; #[doc = "Field `LOCK_CH` writer - Channel Lock Bit"] -pub type LOCK_CH_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, bool, O>; +pub type LOCK_CH_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LOCK_B` reader - Bus Lock Bit"] -pub type LOCK_B_R = crate::BitReader; +pub type LOCK_B_R = crate::BitReader; #[doc = "Field `LOCK_B` writer - Bus Lock Bit"] -pub type LOCK_B_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, bool, O>; +pub type LOCK_B_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DST_HS_POL` reader - Destination Handshaking Interface Polarity"] pub type DST_HS_POL_R = crate::BitReader; #[doc = "Destination Handshaking Interface Polarity\n\nValue on reset: 0"] @@ -381,34 +372,37 @@ impl From for bool { impl DST_HS_POL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DST_HS_POL_A { + pub const fn variant(&self) -> DST_HS_POL_A { match self.bits { false => DST_HS_POL_A::VALUE1, true => DST_HS_POL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active high"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DST_HS_POL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active low"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DST_HS_POL_A::VALUE2 } } #[doc = "Field `DST_HS_POL` writer - Destination Handshaking Interface Polarity"] -pub type DST_HS_POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, DST_HS_POL_A, O>; -impl<'a, const O: u8> DST_HS_POL_W<'a, O> { +pub type DST_HS_POL_W<'a, REG> = crate::BitWriter<'a, REG, DST_HS_POL_A>; +impl<'a, REG> DST_HS_POL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active high"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DST_HS_POL_A::VALUE1) } #[doc = "Active low"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DST_HS_POL_A::VALUE2) } } @@ -431,49 +425,52 @@ impl From for bool { impl SRC_HS_POL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRC_HS_POL_A { + pub const fn variant(&self) -> SRC_HS_POL_A { match self.bits { false => SRC_HS_POL_A::VALUE1, true => SRC_HS_POL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active high"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRC_HS_POL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active low"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRC_HS_POL_A::VALUE2 } } #[doc = "Field `SRC_HS_POL` writer - Source Handshaking Interface Polarity"] -pub type SRC_HS_POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, SRC_HS_POL_A, O>; -impl<'a, const O: u8> SRC_HS_POL_W<'a, O> { +pub type SRC_HS_POL_W<'a, REG> = crate::BitWriter<'a, REG, SRC_HS_POL_A>; +impl<'a, REG> SRC_HS_POL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active high"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRC_HS_POL_A::VALUE1) } #[doc = "Active low"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRC_HS_POL_A::VALUE2) } } #[doc = "Field `MAX_ABRST` reader - Maximum AMBA Burst Length"] -pub type MAX_ABRST_R = crate::FieldReader; +pub type MAX_ABRST_R = crate::FieldReader; #[doc = "Field `MAX_ABRST` writer - Maximum AMBA Burst Length"] -pub type MAX_ABRST_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGL_SPEC, u16, u16, 10, O>; +pub type MAX_ABRST_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `RELOAD_SRC` reader - Automatic Source Reload"] -pub type RELOAD_SRC_R = crate::BitReader; +pub type RELOAD_SRC_R = crate::BitReader; #[doc = "Field `RELOAD_SRC` writer - Automatic Source Reload"] -pub type RELOAD_SRC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, bool, O>; +pub type RELOAD_SRC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RELOAD_DST` reader - Automatic Destination Reload"] -pub type RELOAD_DST_R = crate::BitReader; +pub type RELOAD_DST_R = crate::BitReader; #[doc = "Field `RELOAD_DST` writer - Automatic Destination Reload"] -pub type RELOAD_DST_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, bool, O>; +pub type RELOAD_DST_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 5:7 - Channel priority"] #[inline(always)] @@ -550,100 +547,101 @@ impl W { #[doc = "Bits 5:7 - Channel priority"] #[inline(always)] #[must_use] - pub fn ch_prior(&mut self) -> CH_PRIOR_W<5> { - CH_PRIOR_W::new(self) + pub fn ch_prior(&mut self) -> CH_PRIOR_W { + CH_PRIOR_W::new(self, 5) } #[doc = "Bit 8 - Channel Suspend"] #[inline(always)] #[must_use] - pub fn ch_susp(&mut self) -> CH_SUSP_W<8> { - CH_SUSP_W::new(self) + pub fn ch_susp(&mut self) -> CH_SUSP_W { + CH_SUSP_W::new(self, 8) } #[doc = "Bit 10 - Destination Software or Hardware Handshaking Select"] #[inline(always)] #[must_use] - pub fn hs_sel_dst(&mut self) -> HS_SEL_DST_W<10> { - HS_SEL_DST_W::new(self) + pub fn hs_sel_dst(&mut self) -> HS_SEL_DST_W { + HS_SEL_DST_W::new(self, 10) } #[doc = "Bit 11 - Source Software or Hardware Handshaking Select"] #[inline(always)] #[must_use] - pub fn hs_sel_src(&mut self) -> HS_SEL_SRC_W<11> { - HS_SEL_SRC_W::new(self) + pub fn hs_sel_src(&mut self) -> HS_SEL_SRC_W { + HS_SEL_SRC_W::new(self, 11) } #[doc = "Bits 12:13 - Channel Lock Level"] #[inline(always)] #[must_use] - pub fn lock_ch_l(&mut self) -> LOCK_CH_L_W<12> { - LOCK_CH_L_W::new(self) + pub fn lock_ch_l(&mut self) -> LOCK_CH_L_W { + LOCK_CH_L_W::new(self, 12) } #[doc = "Bits 14:15 - Bus Lock Level"] #[inline(always)] #[must_use] - pub fn lock_b_l(&mut self) -> LOCK_B_L_W<14> { - LOCK_B_L_W::new(self) + pub fn lock_b_l(&mut self) -> LOCK_B_L_W { + LOCK_B_L_W::new(self, 14) } #[doc = "Bit 16 - Channel Lock Bit"] #[inline(always)] #[must_use] - pub fn lock_ch(&mut self) -> LOCK_CH_W<16> { - LOCK_CH_W::new(self) + pub fn lock_ch(&mut self) -> LOCK_CH_W { + LOCK_CH_W::new(self, 16) } #[doc = "Bit 17 - Bus Lock Bit"] #[inline(always)] #[must_use] - pub fn lock_b(&mut self) -> LOCK_B_W<17> { - LOCK_B_W::new(self) + pub fn lock_b(&mut self) -> LOCK_B_W { + LOCK_B_W::new(self, 17) } #[doc = "Bit 18 - Destination Handshaking Interface Polarity"] #[inline(always)] #[must_use] - pub fn dst_hs_pol(&mut self) -> DST_HS_POL_W<18> { - DST_HS_POL_W::new(self) + pub fn dst_hs_pol(&mut self) -> DST_HS_POL_W { + DST_HS_POL_W::new(self, 18) } #[doc = "Bit 19 - Source Handshaking Interface Polarity"] #[inline(always)] #[must_use] - pub fn src_hs_pol(&mut self) -> SRC_HS_POL_W<19> { - SRC_HS_POL_W::new(self) + pub fn src_hs_pol(&mut self) -> SRC_HS_POL_W { + SRC_HS_POL_W::new(self, 19) } #[doc = "Bits 20:29 - Maximum AMBA Burst Length"] #[inline(always)] #[must_use] - pub fn max_abrst(&mut self) -> MAX_ABRST_W<20> { - MAX_ABRST_W::new(self) + pub fn max_abrst(&mut self) -> MAX_ABRST_W { + MAX_ABRST_W::new(self, 20) } #[doc = "Bit 30 - Automatic Source Reload"] #[inline(always)] #[must_use] - pub fn reload_src(&mut self) -> RELOAD_SRC_W<30> { - RELOAD_SRC_W::new(self) + pub fn reload_src(&mut self) -> RELOAD_SRC_W { + RELOAD_SRC_W::new(self, 30) } #[doc = "Bit 31 - Automatic Destination Reload"] #[inline(always)] #[must_use] - pub fn reload_dst(&mut self) -> RELOAD_DST_W<31> { - RELOAD_DST_W::new(self) + pub fn reload_dst(&mut self) -> RELOAD_DST_W { + RELOAD_DST_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Configuration Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfgl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cfgl::R`](R) reader structure"] +impl crate::Readable for CFGL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cfgl::W`](W) writer structure"] impl crate::Writable for CFGL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/ctlh.rs b/src/gpdma0_ch0/ctlh.rs index 385c624e..d6c59051 100644 --- a/src/gpdma0_ch0/ctlh.rs +++ b/src/gpdma0_ch0/ctlh.rs @@ -1,47 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BLOCK_TS` reader - Block Transfer Size"] -pub type BLOCK_TS_R = crate::FieldReader; +pub type BLOCK_TS_R = crate::FieldReader; #[doc = "Field `BLOCK_TS` writer - Block Transfer Size"] -pub type BLOCK_TS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLH_SPEC, u16, u16, 12, O>; +pub type BLOCK_TS_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; #[doc = "Field `DONE` reader - Done bit"] -pub type DONE_R = crate::BitReader; +pub type DONE_R = crate::BitReader; #[doc = "Field `DONE` writer - Done bit"] -pub type DONE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTLH_SPEC, bool, O>; +pub type DONE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:11 - Block Transfer Size"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:11 - Block Transfer Size"] #[inline(always)] #[must_use] - pub fn block_ts(&mut self) -> BLOCK_TS_W<0> { - BLOCK_TS_W::new(self) + pub fn block_ts(&mut self) -> BLOCK_TS_W { + BLOCK_TS_W::new(self, 0) } #[doc = "Bit 12 - Done bit"] #[inline(always)] #[must_use] - pub fn done(&mut self) -> DONE_W<12> { - DONE_W::new(self) + pub fn done(&mut self) -> DONE_W { + DONE_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Control Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctlh::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctlh::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ctlh::R`](R) reader structure"] +impl crate::Readable for CTLH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ctlh::W`](W) writer structure"] impl crate::Writable for CTLH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/ctll.rs b/src/gpdma0_ch0/ctll.rs index 8e639aba..275cb096 100644 --- a/src/gpdma0_ch0/ctll.rs +++ b/src/gpdma0_ch0/ctll.rs @@ -1,53 +1,21 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INT_EN` reader - Interrupt Enable Bit"] -pub type INT_EN_R = crate::BitReader; +pub type INT_EN_R = crate::BitReader; #[doc = "Field `INT_EN` writer - Interrupt Enable Bit"] -pub type INT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTLL_SPEC, bool, O>; +pub type INT_EN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DST_TR_WIDTH` reader - Destination Transfer Width"] -pub type DST_TR_WIDTH_R = crate::FieldReader; +pub type DST_TR_WIDTH_R = crate::FieldReader; #[doc = "Field `DST_TR_WIDTH` writer - Destination Transfer Width"] -pub type DST_TR_WIDTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type DST_TR_WIDTH_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `SRC_TR_WIDTH` reader - Source Transfer Width"] -pub type SRC_TR_WIDTH_R = crate::FieldReader; +pub type SRC_TR_WIDTH_R = crate::FieldReader; #[doc = "Field `SRC_TR_WIDTH` writer - Source Transfer Width"] -pub type SRC_TR_WIDTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type SRC_TR_WIDTH_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `DINC` reader - Destination Address Increment"] -pub type DINC_R = crate::FieldReader; +pub type DINC_R = crate::FieldReader; #[doc = "Destination Address Increment\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -65,10 +33,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DINC_A { + type Ux = u8; +} impl DINC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DINC_A::VALUE1), 1 => Some(DINC_A::VALUE2), @@ -76,43 +47,47 @@ impl DINC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Increment"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DINC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Decrement"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DINC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "No change"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DINC_A::VALUE3 } } #[doc = "Field `DINC` writer - Destination Address Increment"] -pub type DINC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, DINC_A, 2, O>; -impl<'a, const O: u8> DINC_W<'a, O> { +pub type DINC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DINC_A>; +impl<'a, REG> DINC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Increment"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DINC_A::VALUE1) } #[doc = "Decrement"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DINC_A::VALUE2) } #[doc = "No change"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DINC_A::VALUE3) } } #[doc = "Field `SINC` reader - Source Address Increment"] -pub type SINC_R = crate::FieldReader; +pub type SINC_R = crate::FieldReader; #[doc = "Source Address Increment\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -130,10 +105,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SINC_A { + type Ux = u8; +} impl SINC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SINC_A::VALUE1), 1 => Some(SINC_A::VALUE2), @@ -141,49 +119,53 @@ impl SINC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Increment"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SINC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Decrement"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SINC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "No change"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SINC_A::VALUE3 } } #[doc = "Field `SINC` writer - Source Address Increment"] -pub type SINC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, SINC_A, 2, O>; -impl<'a, const O: u8> SINC_W<'a, O> { +pub type SINC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SINC_A>; +impl<'a, REG> SINC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Increment"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SINC_A::VALUE1) } #[doc = "Decrement"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SINC_A::VALUE2) } #[doc = "No change"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SINC_A::VALUE3) } } #[doc = "Field `DEST_MSIZE` reader - Destination Burst Transaction Length"] -pub type DEST_MSIZE_R = crate::FieldReader; +pub type DEST_MSIZE_R = crate::FieldReader; #[doc = "Field `DEST_MSIZE` writer - Destination Burst Transaction Length"] -pub type DEST_MSIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type DEST_MSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `SRC_MSIZE` reader - Source Burst Transaction Length"] -pub type SRC_MSIZE_R = crate::FieldReader; +pub type SRC_MSIZE_R = crate::FieldReader; #[doc = "Field `SRC_MSIZE` writer - Source Burst Transaction Length"] -pub type SRC_MSIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type SRC_MSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `SRC_GATHER_EN` reader - Source gather enable"] pub type SRC_GATHER_EN_R = crate::BitReader; #[doc = "Source gather enable\n\nValue on reset: 0"] @@ -203,34 +185,37 @@ impl From for bool { impl SRC_GATHER_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRC_GATHER_EN_A { + pub const fn variant(&self) -> SRC_GATHER_EN_A { match self.bits { false => SRC_GATHER_EN_A::VALUE1, true => SRC_GATHER_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gather disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRC_GATHER_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gather enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRC_GATHER_EN_A::VALUE2 } } #[doc = "Field `SRC_GATHER_EN` writer - Source gather enable"] -pub type SRC_GATHER_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTLL_SPEC, SRC_GATHER_EN_A, O>; -impl<'a, const O: u8> SRC_GATHER_EN_W<'a, O> { +pub type SRC_GATHER_EN_W<'a, REG> = crate::BitWriter<'a, REG, SRC_GATHER_EN_A>; +impl<'a, REG> SRC_GATHER_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Gather disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRC_GATHER_EN_A::VALUE1) } #[doc = "Gather enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRC_GATHER_EN_A::VALUE2) } } @@ -253,49 +238,52 @@ impl From for bool { impl DST_SCATTER_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DST_SCATTER_EN_A { + pub const fn variant(&self) -> DST_SCATTER_EN_A { match self.bits { false => DST_SCATTER_EN_A::VALUE1, true => DST_SCATTER_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Scatter disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DST_SCATTER_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Scatter enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DST_SCATTER_EN_A::VALUE2 } } #[doc = "Field `DST_SCATTER_EN` writer - Destination scatter enable"] -pub type DST_SCATTER_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTLL_SPEC, DST_SCATTER_EN_A, O>; -impl<'a, const O: u8> DST_SCATTER_EN_W<'a, O> { +pub type DST_SCATTER_EN_W<'a, REG> = crate::BitWriter<'a, REG, DST_SCATTER_EN_A>; +impl<'a, REG> DST_SCATTER_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Scatter disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DST_SCATTER_EN_A::VALUE1) } #[doc = "Scatter enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DST_SCATTER_EN_A::VALUE2) } } #[doc = "Field `TT_FC` reader - Transfer Type and Flow Control"] -pub type TT_FC_R = crate::FieldReader; +pub type TT_FC_R = crate::FieldReader; #[doc = "Field `TT_FC` writer - Transfer Type and Flow Control"] -pub type TT_FC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type TT_FC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `LLP_DST_EN` reader - Linked List Pointer for Destination Enable"] -pub type LLP_DST_EN_R = crate::BitReader; +pub type LLP_DST_EN_R = crate::BitReader; #[doc = "Field `LLP_DST_EN` writer - Linked List Pointer for Destination Enable"] -pub type LLP_DST_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTLL_SPEC, bool, O>; +pub type LLP_DST_EN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LLP_SRC_EN` reader - Linked List Pointer for Source Enable"] -pub type LLP_SRC_EN_R = crate::BitReader; +pub type LLP_SRC_EN_R = crate::BitReader; #[doc = "Field `LLP_SRC_EN` writer - Linked List Pointer for Source Enable"] -pub type LLP_SRC_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTLL_SPEC, bool, O>; +pub type LLP_SRC_EN_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Interrupt Enable Bit"] #[inline(always)] @@ -362,94 +350,95 @@ impl W { #[doc = "Bit 0 - Interrupt Enable Bit"] #[inline(always)] #[must_use] - pub fn int_en(&mut self) -> INT_EN_W<0> { - INT_EN_W::new(self) + pub fn int_en(&mut self) -> INT_EN_W { + INT_EN_W::new(self, 0) } #[doc = "Bits 1:3 - Destination Transfer Width"] #[inline(always)] #[must_use] - pub fn dst_tr_width(&mut self) -> DST_TR_WIDTH_W<1> { - DST_TR_WIDTH_W::new(self) + pub fn dst_tr_width(&mut self) -> DST_TR_WIDTH_W { + DST_TR_WIDTH_W::new(self, 1) } #[doc = "Bits 4:6 - Source Transfer Width"] #[inline(always)] #[must_use] - pub fn src_tr_width(&mut self) -> SRC_TR_WIDTH_W<4> { - SRC_TR_WIDTH_W::new(self) + pub fn src_tr_width(&mut self) -> SRC_TR_WIDTH_W { + SRC_TR_WIDTH_W::new(self, 4) } #[doc = "Bits 7:8 - Destination Address Increment"] #[inline(always)] #[must_use] - pub fn dinc(&mut self) -> DINC_W<7> { - DINC_W::new(self) + pub fn dinc(&mut self) -> DINC_W { + DINC_W::new(self, 7) } #[doc = "Bits 9:10 - Source Address Increment"] #[inline(always)] #[must_use] - pub fn sinc(&mut self) -> SINC_W<9> { - SINC_W::new(self) + pub fn sinc(&mut self) -> SINC_W { + SINC_W::new(self, 9) } #[doc = "Bits 11:13 - Destination Burst Transaction Length"] #[inline(always)] #[must_use] - pub fn dest_msize(&mut self) -> DEST_MSIZE_W<11> { - DEST_MSIZE_W::new(self) + pub fn dest_msize(&mut self) -> DEST_MSIZE_W { + DEST_MSIZE_W::new(self, 11) } #[doc = "Bits 14:16 - Source Burst Transaction Length"] #[inline(always)] #[must_use] - pub fn src_msize(&mut self) -> SRC_MSIZE_W<14> { - SRC_MSIZE_W::new(self) + pub fn src_msize(&mut self) -> SRC_MSIZE_W { + SRC_MSIZE_W::new(self, 14) } #[doc = "Bit 17 - Source gather enable"] #[inline(always)] #[must_use] - pub fn src_gather_en(&mut self) -> SRC_GATHER_EN_W<17> { - SRC_GATHER_EN_W::new(self) + pub fn src_gather_en(&mut self) -> SRC_GATHER_EN_W { + SRC_GATHER_EN_W::new(self, 17) } #[doc = "Bit 18 - Destination scatter enable"] #[inline(always)] #[must_use] - pub fn dst_scatter_en(&mut self) -> DST_SCATTER_EN_W<18> { - DST_SCATTER_EN_W::new(self) + pub fn dst_scatter_en(&mut self) -> DST_SCATTER_EN_W { + DST_SCATTER_EN_W::new(self, 18) } #[doc = "Bits 20:22 - Transfer Type and Flow Control"] #[inline(always)] #[must_use] - pub fn tt_fc(&mut self) -> TT_FC_W<20> { - TT_FC_W::new(self) + pub fn tt_fc(&mut self) -> TT_FC_W { + TT_FC_W::new(self, 20) } #[doc = "Bit 27 - Linked List Pointer for Destination Enable"] #[inline(always)] #[must_use] - pub fn llp_dst_en(&mut self) -> LLP_DST_EN_W<27> { - LLP_DST_EN_W::new(self) + pub fn llp_dst_en(&mut self) -> LLP_DST_EN_W { + LLP_DST_EN_W::new(self, 27) } #[doc = "Bit 28 - Linked List Pointer for Source Enable"] #[inline(always)] #[must_use] - pub fn llp_src_en(&mut self) -> LLP_SRC_EN_W<28> { - LLP_SRC_EN_W::new(self) + pub fn llp_src_en(&mut self) -> LLP_SRC_EN_W { + LLP_SRC_EN_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Control Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctll::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctll::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ctll::R`](R) reader structure"] +impl crate::Readable for CTLL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ctll::W`](W) writer structure"] impl crate::Writable for CTLL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/dar.rs b/src/gpdma0_ch0/dar.rs index 9e02f373..ce3f2d68 100644 --- a/src/gpdma0_ch0/dar.rs +++ b/src/gpdma0_ch0/dar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DAR` reader - Current Destination address of DMA transfer"] -pub type DAR_R = crate::FieldReader; +pub type DAR_R = crate::FieldReader; #[doc = "Field `DAR` writer - Current Destination address of DMA transfer"] -pub type DAR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAR_SPEC, u32, u32, 32, O>; +pub type DAR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Current Destination address of DMA transfer"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Current Destination address of DMA transfer"] #[inline(always)] #[must_use] - pub fn dar(&mut self) -> DAR_W<0> { - DAR_W::new(self) + pub fn dar(&mut self) -> DAR_W { + DAR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Destination Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dar::R`](R) reader structure"] +impl crate::Readable for DAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dar::W`](W) writer structure"] impl crate::Writable for DAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/dsr.rs b/src/gpdma0_ch0/dsr.rs index 3caa86cf..97361f0e 100644 --- a/src/gpdma0_ch0/dsr.rs +++ b/src/gpdma0_ch0/dsr.rs @@ -1,47 +1,15 @@ #[doc = "Register `DSR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSI` reader - Destination scatter interval"] -pub type DSI_R = crate::FieldReader; +pub type DSI_R = crate::FieldReader; #[doc = "Field `DSI` writer - Destination scatter interval"] -pub type DSI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DSR_SPEC, u32, u32, 20, O>; +pub type DSI_W<'a, REG> = crate::FieldWriter<'a, REG, 20, u32>; #[doc = "Field `DSC` reader - Destination scatter count"] -pub type DSC_R = crate::FieldReader; +pub type DSC_R = crate::FieldReader; #[doc = "Field `DSC` writer - Destination scatter count"] -pub type DSC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DSR_SPEC, u16, u16, 12, O>; +pub type DSC_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:19 - Destination scatter interval"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:19 - Destination scatter interval"] #[inline(always)] #[must_use] - pub fn dsi(&mut self) -> DSI_W<0> { - DSI_W::new(self) + pub fn dsi(&mut self) -> DSI_W { + DSI_W::new(self, 0) } #[doc = "Bits 20:31 - Destination scatter count"] #[inline(always)] #[must_use] - pub fn dsc(&mut self) -> DSC_W<20> { - DSC_W::new(self) + pub fn dsc(&mut self) -> DSC_W { + DSC_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Destination Scatter Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dsr::R`](R) reader structure"] +impl crate::Readable for DSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dsr::W`](W) writer structure"] impl crate::Writable for DSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/dstat.rs b/src/gpdma0_ch0/dstat.rs index c6c7134e..28d2e69c 100644 --- a/src/gpdma0_ch0/dstat.rs +++ b/src/gpdma0_ch0/dstat.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSTAT` reader - Destination Status"] -pub type DSTAT_R = crate::FieldReader; +pub type DSTAT_R = crate::FieldReader; #[doc = "Field `DSTAT` writer - Destination Status"] -pub type DSTAT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DSTAT_SPEC, u32, u32, 32, O>; +pub type DSTAT_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Destination Status"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Destination Status"] #[inline(always)] #[must_use] - pub fn dstat(&mut self) -> DSTAT_W<0> { - DSTAT_W::new(self) + pub fn dstat(&mut self) -> DSTAT_W { + DSTAT_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Destination Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dstat::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dstat::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dstat::R`](R) reader structure"] +impl crate::Readable for DSTAT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dstat::W`](W) writer structure"] impl crate::Writable for DSTAT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/dstatar.rs b/src/gpdma0_ch0/dstatar.rs index 59ed3311..b18ee391 100644 --- a/src/gpdma0_ch0/dstatar.rs +++ b/src/gpdma0_ch0/dstatar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSTATAR` reader - Destination Status Address"] -pub type DSTATAR_R = crate::FieldReader; +pub type DSTATAR_R = crate::FieldReader; #[doc = "Field `DSTATAR` writer - Destination Status Address"] -pub type DSTATAR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DSTATAR_SPEC, u32, u32, 32, O>; +pub type DSTATAR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Destination Status Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Destination Status Address"] #[inline(always)] #[must_use] - pub fn dstatar(&mut self) -> DSTATAR_W<0> { - DSTATAR_W::new(self) + pub fn dstatar(&mut self) -> DSTATAR_W { + DSTATAR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Destination Status Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dstatar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dstatar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dstatar::R`](R) reader structure"] +impl crate::Readable for DSTATAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dstatar::W`](W) writer structure"] impl crate::Writable for DSTATAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/llp.rs b/src/gpdma0_ch0/llp.rs index 2a7048dc..325eafc5 100644 --- a/src/gpdma0_ch0/llp.rs +++ b/src/gpdma0_ch0/llp.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `LOC` reader - Starting Address In Memory"] -pub type LOC_R = crate::FieldReader; +pub type LOC_R = crate::FieldReader; #[doc = "Field `LOC` writer - Starting Address In Memory"] -pub type LOC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LLP_SPEC, u32, u32, 30, O>; +pub type LOC_W<'a, REG> = crate::FieldWriter<'a, REG, 30, u32>; impl R { #[doc = "Bits 2:31 - Starting Address In Memory"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 2:31 - Starting Address In Memory"] #[inline(always)] #[must_use] - pub fn loc(&mut self) -> LOC_W<2> { - LOC_W::new(self) + pub fn loc(&mut self) -> LOC_W { + LOC_W::new(self, 2) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Linked List Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`llp::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`llp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`llp::R`](R) reader structure"] +impl crate::Readable for LLP_SPEC {} +#[doc = "`write(|w| ..)` method takes [`llp::W`](W) writer structure"] impl crate::Writable for LLP_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/sar.rs b/src/gpdma0_ch0/sar.rs index b6da0d98..23de4dd2 100644 --- a/src/gpdma0_ch0/sar.rs +++ b/src/gpdma0_ch0/sar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SAR` reader - Current Source Address of DMA transfer"] -pub type SAR_R = crate::FieldReader; +pub type SAR_R = crate::FieldReader; #[doc = "Field `SAR` writer - Current Source Address of DMA transfer"] -pub type SAR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SAR_SPEC, u32, u32, 32, O>; +pub type SAR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Current Source Address of DMA transfer"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Current Source Address of DMA transfer"] #[inline(always)] #[must_use] - pub fn sar(&mut self) -> SAR_W<0> { - SAR_W::new(self) + pub fn sar(&mut self) -> SAR_W { + SAR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sar::R`](R) reader structure"] +impl crate::Readable for SAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sar::W`](W) writer structure"] impl crate::Writable for SAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/sgr.rs b/src/gpdma0_ch0/sgr.rs index e420bd30..74e81c95 100644 --- a/src/gpdma0_ch0/sgr.rs +++ b/src/gpdma0_ch0/sgr.rs @@ -1,47 +1,15 @@ #[doc = "Register `SGR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SGI` reader - Source gather interval"] -pub type SGI_R = crate::FieldReader; +pub type SGI_R = crate::FieldReader; #[doc = "Field `SGI` writer - Source gather interval"] -pub type SGI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SGR_SPEC, u32, u32, 20, O>; +pub type SGI_W<'a, REG> = crate::FieldWriter<'a, REG, 20, u32>; #[doc = "Field `SGC` reader - Source gather count"] -pub type SGC_R = crate::FieldReader; +pub type SGC_R = crate::FieldReader; #[doc = "Field `SGC` writer - Source gather count"] -pub type SGC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SGR_SPEC, u16, u16, 12, O>; +pub type SGC_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:19 - Source gather interval"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:19 - Source gather interval"] #[inline(always)] #[must_use] - pub fn sgi(&mut self) -> SGI_W<0> { - SGI_W::new(self) + pub fn sgi(&mut self) -> SGI_W { + SGI_W::new(self, 0) } #[doc = "Bits 20:31 - Source gather count"] #[inline(always)] #[must_use] - pub fn sgc(&mut self) -> SGC_W<20> { - SGC_W::new(self) + pub fn sgc(&mut self) -> SGC_W { + SGC_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Gather Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sgr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sgr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sgr::R`](R) reader structure"] +impl crate::Readable for SGR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sgr::W`](W) writer structure"] impl crate::Writable for SGR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/sstat.rs b/src/gpdma0_ch0/sstat.rs index a9983e4a..94ed1a7a 100644 --- a/src/gpdma0_ch0/sstat.rs +++ b/src/gpdma0_ch0/sstat.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SSTAT` reader - Source Status"] -pub type SSTAT_R = crate::FieldReader; +pub type SSTAT_R = crate::FieldReader; #[doc = "Field `SSTAT` writer - Source Status"] -pub type SSTAT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SSTAT_SPEC, u32, u32, 32, O>; +pub type SSTAT_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Source Status"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Source Status"] #[inline(always)] #[must_use] - pub fn sstat(&mut self) -> SSTAT_W<0> { - SSTAT_W::new(self) + pub fn sstat(&mut self) -> SSTAT_W { + SSTAT_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sstat::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sstat::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sstat::R`](R) reader structure"] +impl crate::Readable for SSTAT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sstat::W`](W) writer structure"] impl crate::Writable for SSTAT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch0/sstatar.rs b/src/gpdma0_ch0/sstatar.rs index 2428dda0..859b8672 100644 --- a/src/gpdma0_ch0/sstatar.rs +++ b/src/gpdma0_ch0/sstatar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SSTATAR` reader - Source Status Address"] -pub type SSTATAR_R = crate::FieldReader; +pub type SSTATAR_R = crate::FieldReader; #[doc = "Field `SSTATAR` writer - Source Status Address"] -pub type SSTATAR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SSTATAR_SPEC, u32, u32, 32, O>; +pub type SSTATAR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Source Status Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Source Status Address"] #[inline(always)] #[must_use] - pub fn sstatar(&mut self) -> SSTATAR_W<0> { - SSTATAR_W::new(self) + pub fn sstatar(&mut self) -> SSTATAR_W { + SSTATAR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Status Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sstatar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sstatar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sstatar::R`](R) reader structure"] +impl crate::Readable for SSTATAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sstatar::W`](W) writer structure"] impl crate::Writable for SSTATAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch2.rs b/src/gpdma0_ch2.rs index a8cdc5a0..92db00c3 100644 --- a/src/gpdma0_ch2.rs +++ b/src/gpdma0_ch2.rs @@ -1,43 +1,75 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Source Address Register"] - pub sar: SAR, + sar: SAR, _reserved1: [u8; 0x04], - #[doc = "0x08 - Destination Address Register"] - pub dar: DAR, + dar: DAR, _reserved2: [u8; 0x0c], + ctll: CTLL, + ctlh: CTLH, + _reserved4: [u8; 0x20], + cfgl: CFGL, + cfgh: CFGH, +} +impl RegisterBlock { + #[doc = "0x00 - Source Address Register"] + #[inline(always)] + pub const fn sar(&self) -> &SAR { + &self.sar + } + #[doc = "0x08 - Destination Address Register"] + #[inline(always)] + pub const fn dar(&self) -> &DAR { + &self.dar + } #[doc = "0x18 - Control Register Low"] - pub ctll: CTLL, + #[inline(always)] + pub const fn ctll(&self) -> &CTLL { + &self.ctll + } #[doc = "0x1c - Control Register High"] - pub ctlh: CTLH, - _reserved4: [u8; 0x20], + #[inline(always)] + pub const fn ctlh(&self) -> &CTLH { + &self.ctlh + } #[doc = "0x40 - Configuration Register Low"] - pub cfgl: CFGL, + #[inline(always)] + pub const fn cfgl(&self) -> &CFGL { + &self.cfgl + } #[doc = "0x44 - Configuration Register High"] - pub cfgh: CFGH, + #[inline(always)] + pub const fn cfgh(&self) -> &CFGH { + &self.cfgh + } } -#[doc = "SAR (rw) register accessor: an alias for `Reg`"] +#[doc = "SAR (rw) register accessor: Source Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sar`] +module"] pub type SAR = crate::Reg; #[doc = "Source Address Register"] pub mod sar; -#[doc = "DAR (rw) register accessor: an alias for `Reg`"] +#[doc = "DAR (rw) register accessor: Destination Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dar`] +module"] pub type DAR = crate::Reg; #[doc = "Destination Address Register"] pub mod dar; -#[doc = "CTLL (rw) register accessor: an alias for `Reg`"] +#[doc = "CTLL (rw) register accessor: Control Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctll::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctll::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctll`] +module"] pub type CTLL = crate::Reg; #[doc = "Control Register Low"] pub mod ctll; -#[doc = "CTLH (rw) register accessor: an alias for `Reg`"] +#[doc = "CTLH (rw) register accessor: Control Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctlh::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctlh::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctlh`] +module"] pub type CTLH = crate::Reg; #[doc = "Control Register High"] pub mod ctlh; -#[doc = "CFGL (rw) register accessor: an alias for `Reg`"] +#[doc = "CFGL (rw) register accessor: Configuration Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfgl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cfgl`] +module"] pub type CFGL = crate::Reg; #[doc = "Configuration Register Low"] pub mod cfgl; -#[doc = "CFGH (rw) register accessor: an alias for `Reg`"] +#[doc = "CFGH (rw) register accessor: Configuration Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgh::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfgh::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cfgh`] +module"] 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 70cb7b4e..ebc36121 100644 --- a/src/gpdma0_ch2/cfgh.rs +++ b/src/gpdma0_ch2/cfgh.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `FCMODE` reader - Flow Control Mode"] pub type FCMODE_R = crate::BitReader; #[doc = "Flow Control Mode\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl FCMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FCMODE_A { + pub const fn variant(&self) -> FCMODE_A { match self.bits { false => FCMODE_A::VALUE1, true => FCMODE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Source transaction requests are serviced when they occur. Data pre-fetching is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FCMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Source transaction requests are not serviced until a destination transaction request occurs. In this mode, the amount of data transferred from the source is limited so that it is guaranteed to be transferred to the destination prior to block termination by the destination. Data pre-fetching is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FCMODE_A::VALUE2 } } #[doc = "Field `FCMODE` writer - Flow Control Mode"] -pub type FCMODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGH_SPEC, FCMODE_A, O>; -impl<'a, const O: u8> FCMODE_W<'a, O> { +pub type FCMODE_W<'a, REG> = crate::BitWriter<'a, REG, FCMODE_A>; +impl<'a, REG> FCMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Source transaction requests are serviced when they occur. Data pre-fetching is enabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FCMODE_A::VALUE1) } #[doc = "Source transaction requests are not serviced until a destination transaction request occurs. In this mode, the amount of data transferred from the source is limited so that it is guaranteed to be transferred to the destination prior to block termination by the destination. Data pre-fetching is disabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FCMODE_A::VALUE2) } } @@ -103,49 +74,52 @@ impl From for bool { impl FIFO_MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FIFO_MODE_A { + pub const fn variant(&self) -> FIFO_MODE_A { match self.bits { false => FIFO_MODE_A::VALUE1, true => FIFO_MODE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Space/data available for single AHB transfer of the specified transfer width."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FIFO_MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data available is greater than or equal to half the FIFO depth for destination transfers and space available is greater than half the fifo depth for source transfers. The exceptions are at the end of a burst transaction request or at the end of a block transfer."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FIFO_MODE_A::VALUE2 } } #[doc = "Field `FIFO_MODE` writer - FIFO Mode Select"] -pub type FIFO_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGH_SPEC, FIFO_MODE_A, O>; -impl<'a, const O: u8> FIFO_MODE_W<'a, O> { +pub type FIFO_MODE_W<'a, REG> = crate::BitWriter<'a, REG, FIFO_MODE_A>; +impl<'a, REG> FIFO_MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Space/data available for single AHB transfer of the specified transfer width."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FIFO_MODE_A::VALUE1) } #[doc = "Data available is greater than or equal to half the FIFO depth for destination transfers and space available is greater than half the fifo depth for source transfers. The exceptions are at the end of a burst transaction request or at the end of a block transfer."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FIFO_MODE_A::VALUE2) } } #[doc = "Field `PROTCTL` reader - Protection Control"] -pub type PROTCTL_R = crate::FieldReader; +pub type PROTCTL_R = crate::FieldReader; #[doc = "Field `PROTCTL` writer - Protection Control"] -pub type PROTCTL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGH_SPEC, u8, u8, 3, O>; +pub type PROTCTL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `SRC_PER` reader - Source Peripheral"] -pub type SRC_PER_R = crate::FieldReader; +pub type SRC_PER_R = crate::FieldReader; #[doc = "Field `SRC_PER` writer - Source Peripheral"] -pub type SRC_PER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGH_SPEC, u8, u8, 4, O>; +pub type SRC_PER_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `DEST_PER` reader - Destination Peripheral"] -pub type DEST_PER_R = crate::FieldReader; +pub type DEST_PER_R = crate::FieldReader; #[doc = "Field `DEST_PER` writer - Destination Peripheral"] -pub type DEST_PER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGH_SPEC, u8, u8, 4, O>; +pub type DEST_PER_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bit 0 - Flow Control Mode"] #[inline(always)] @@ -177,52 +151,53 @@ impl W { #[doc = "Bit 0 - Flow Control Mode"] #[inline(always)] #[must_use] - pub fn fcmode(&mut self) -> FCMODE_W<0> { - FCMODE_W::new(self) + pub fn fcmode(&mut self) -> FCMODE_W { + FCMODE_W::new(self, 0) } #[doc = "Bit 1 - FIFO Mode Select"] #[inline(always)] #[must_use] - pub fn fifo_mode(&mut self) -> FIFO_MODE_W<1> { - FIFO_MODE_W::new(self) + pub fn fifo_mode(&mut self) -> FIFO_MODE_W { + FIFO_MODE_W::new(self, 1) } #[doc = "Bits 2:4 - Protection Control"] #[inline(always)] #[must_use] - pub fn protctl(&mut self) -> PROTCTL_W<2> { - PROTCTL_W::new(self) + pub fn protctl(&mut self) -> PROTCTL_W { + PROTCTL_W::new(self, 2) } #[doc = "Bits 7:10 - Source Peripheral"] #[inline(always)] #[must_use] - pub fn src_per(&mut self) -> SRC_PER_W<7> { - SRC_PER_W::new(self) + pub fn src_per(&mut self) -> SRC_PER_W { + SRC_PER_W::new(self, 7) } #[doc = "Bits 11:14 - Destination Peripheral"] #[inline(always)] #[must_use] - pub fn dest_per(&mut self) -> DEST_PER_W<11> { - DEST_PER_W::new(self) + pub fn dest_per(&mut self) -> DEST_PER_W { + DEST_PER_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Configuration Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgh::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfgh::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cfgh::R`](R) reader structure"] +impl crate::Readable for CFGH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cfgh::W`](W) writer structure"] impl crate::Writable for CFGH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch2/cfgl.rs b/src/gpdma0_ch2/cfgl.rs index 95d243a7..69a56bba 100644 --- a/src/gpdma0_ch2/cfgl.rs +++ b/src/gpdma0_ch2/cfgl.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CH_PRIOR` reader - Channel priority"] -pub type CH_PRIOR_R = crate::FieldReader; +pub type CH_PRIOR_R = crate::FieldReader; #[doc = "Field `CH_PRIOR` writer - Channel priority"] -pub type CH_PRIOR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGL_SPEC, u8, u8, 3, O>; +pub type CH_PRIOR_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `CH_SUSP` reader - Channel Suspend"] pub type CH_SUSP_R = crate::BitReader; #[doc = "Channel Suspend\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl CH_SUSP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH_SUSP_A { + pub const fn variant(&self) -> CH_SUSP_A { match self.bits { false => CH_SUSP_A::VALUE1, true => CH_SUSP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not suspended."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH_SUSP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Suspend DMA transfer from the source."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH_SUSP_A::VALUE2 } } #[doc = "Field `CH_SUSP` writer - Channel Suspend"] -pub type CH_SUSP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, CH_SUSP_A, O>; -impl<'a, const O: u8> CH_SUSP_W<'a, O> { +pub type CH_SUSP_W<'a, REG> = crate::BitWriter<'a, REG, CH_SUSP_A>; +impl<'a, REG> CH_SUSP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not suspended."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH_SUSP_A::VALUE1) } #[doc = "Suspend DMA transfer from the source."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH_SUSP_A::VALUE2) } } @@ -107,18 +78,18 @@ impl From for bool { impl FIFO_EMPTY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FIFO_EMPTY_A { + pub const fn variant(&self) -> FIFO_EMPTY_A { match self.bits { true => FIFO_EMPTY_A::VALUE1, false => FIFO_EMPTY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel FIFO empty"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FIFO_EMPTY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel FIFO not empty"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FIFO_EMPTY_A::VALUE2 @@ -143,34 +114,37 @@ impl From for bool { impl HS_SEL_DST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HS_SEL_DST_A { + pub const fn variant(&self) -> HS_SEL_DST_A { match self.bits { false => HS_SEL_DST_A::VALUE1, true => HS_SEL_DST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HS_SEL_DST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Software handshaking interface. Hardware- initiated transaction requests are ignored."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HS_SEL_DST_A::VALUE2 } } #[doc = "Field `HS_SEL_DST` writer - Destination Software or Hardware Handshaking Select"] -pub type HS_SEL_DST_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, HS_SEL_DST_A, O>; -impl<'a, const O: u8> HS_SEL_DST_W<'a, O> { +pub type HS_SEL_DST_W<'a, REG> = crate::BitWriter<'a, REG, HS_SEL_DST_A>; +impl<'a, REG> HS_SEL_DST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HS_SEL_DST_A::VALUE1) } #[doc = "Software handshaking interface. Hardware- initiated transaction requests are ignored."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HS_SEL_DST_A::VALUE2) } } @@ -193,39 +167,42 @@ impl From for bool { impl HS_SEL_SRC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HS_SEL_SRC_A { + pub const fn variant(&self) -> HS_SEL_SRC_A { match self.bits { false => HS_SEL_SRC_A::VALUE1, true => HS_SEL_SRC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HS_SEL_SRC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Software handshaking interface. Hardware-initiated transaction requests are ignored."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HS_SEL_SRC_A::VALUE2 } } #[doc = "Field `HS_SEL_SRC` writer - Source Software or Hardware Handshaking Select"] -pub type HS_SEL_SRC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, HS_SEL_SRC_A, O>; -impl<'a, const O: u8> HS_SEL_SRC_W<'a, O> { +pub type HS_SEL_SRC_W<'a, REG> = crate::BitWriter<'a, REG, HS_SEL_SRC_A>; +impl<'a, REG> HS_SEL_SRC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Hardware handshaking interface. Software-initiated transaction requests are ignored."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HS_SEL_SRC_A::VALUE1) } #[doc = "Software handshaking interface. Hardware-initiated transaction requests are ignored."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HS_SEL_SRC_A::VALUE2) } } #[doc = "Field `LOCK_CH_L` reader - Channel Lock Level"] -pub type LOCK_CH_L_R = crate::FieldReader; +pub type LOCK_CH_L_R = crate::FieldReader; #[doc = "Channel Lock Level\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -243,10 +220,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LOCK_CH_L_A { + type Ux = u8; +} impl LOCK_CH_L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(LOCK_CH_L_A::VALUE1), 1 => Some(LOCK_CH_L_A::VALUE2), @@ -254,43 +234,47 @@ impl LOCK_CH_L_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Over complete DMA transfer"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LOCK_CH_L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Over complete DMA block transfer"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LOCK_CH_L_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Over complete DMA transaction"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LOCK_CH_L_A::VALUE3 } } #[doc = "Field `LOCK_CH_L` writer - Channel Lock Level"] -pub type LOCK_CH_L_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGL_SPEC, u8, LOCK_CH_L_A, 2, O>; -impl<'a, const O: u8> LOCK_CH_L_W<'a, O> { +pub type LOCK_CH_L_W<'a, REG> = crate::FieldWriter<'a, REG, 2, LOCK_CH_L_A>; +impl<'a, REG> LOCK_CH_L_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Over complete DMA transfer"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LOCK_CH_L_A::VALUE1) } #[doc = "Over complete DMA block transfer"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LOCK_CH_L_A::VALUE2) } #[doc = "Over complete DMA transaction"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LOCK_CH_L_A::VALUE3) } } #[doc = "Field `LOCK_B_L` reader - Bus Lock Level"] -pub type LOCK_B_L_R = crate::FieldReader; +pub type LOCK_B_L_R = crate::FieldReader; #[doc = "Bus Lock Level\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -308,10 +292,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LOCK_B_L_A { + type Ux = u8; +} impl LOCK_B_L_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(LOCK_B_L_A::VALUE1), 1 => Some(LOCK_B_L_A::VALUE2), @@ -319,49 +306,53 @@ impl LOCK_B_L_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Over complete DMA transfer"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LOCK_B_L_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Over complete DMA block transfer"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LOCK_B_L_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Over complete DMA transaction"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LOCK_B_L_A::VALUE3 } } #[doc = "Field `LOCK_B_L` writer - Bus Lock Level"] -pub type LOCK_B_L_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGL_SPEC, u8, LOCK_B_L_A, 2, O>; -impl<'a, const O: u8> LOCK_B_L_W<'a, O> { +pub type LOCK_B_L_W<'a, REG> = crate::FieldWriter<'a, REG, 2, LOCK_B_L_A>; +impl<'a, REG> LOCK_B_L_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Over complete DMA transfer"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LOCK_B_L_A::VALUE1) } #[doc = "Over complete DMA block transfer"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LOCK_B_L_A::VALUE2) } #[doc = "Over complete DMA transaction"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LOCK_B_L_A::VALUE3) } } #[doc = "Field `LOCK_CH` reader - Channel Lock Bit"] -pub type LOCK_CH_R = crate::BitReader; +pub type LOCK_CH_R = crate::BitReader; #[doc = "Field `LOCK_CH` writer - Channel Lock Bit"] -pub type LOCK_CH_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, bool, O>; +pub type LOCK_CH_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LOCK_B` reader - Bus Lock Bit"] -pub type LOCK_B_R = crate::BitReader; +pub type LOCK_B_R = crate::BitReader; #[doc = "Field `LOCK_B` writer - Bus Lock Bit"] -pub type LOCK_B_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, bool, O>; +pub type LOCK_B_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DST_HS_POL` reader - Destination Handshaking Interface Polarity"] pub type DST_HS_POL_R = crate::BitReader; #[doc = "Destination Handshaking Interface Polarity\n\nValue on reset: 0"] @@ -381,34 +372,37 @@ impl From for bool { impl DST_HS_POL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DST_HS_POL_A { + pub const fn variant(&self) -> DST_HS_POL_A { match self.bits { false => DST_HS_POL_A::VALUE1, true => DST_HS_POL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active high"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DST_HS_POL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active low"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DST_HS_POL_A::VALUE2 } } #[doc = "Field `DST_HS_POL` writer - Destination Handshaking Interface Polarity"] -pub type DST_HS_POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, DST_HS_POL_A, O>; -impl<'a, const O: u8> DST_HS_POL_W<'a, O> { +pub type DST_HS_POL_W<'a, REG> = crate::BitWriter<'a, REG, DST_HS_POL_A>; +impl<'a, REG> DST_HS_POL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active high"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DST_HS_POL_A::VALUE1) } #[doc = "Active low"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DST_HS_POL_A::VALUE2) } } @@ -431,41 +425,44 @@ impl From for bool { impl SRC_HS_POL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRC_HS_POL_A { + pub const fn variant(&self) -> SRC_HS_POL_A { match self.bits { false => SRC_HS_POL_A::VALUE1, true => SRC_HS_POL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active high"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRC_HS_POL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active low"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRC_HS_POL_A::VALUE2 } } #[doc = "Field `SRC_HS_POL` writer - Source Handshaking Interface Polarity"] -pub type SRC_HS_POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFGL_SPEC, SRC_HS_POL_A, O>; -impl<'a, const O: u8> SRC_HS_POL_W<'a, O> { +pub type SRC_HS_POL_W<'a, REG> = crate::BitWriter<'a, REG, SRC_HS_POL_A>; +impl<'a, REG> SRC_HS_POL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active high"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRC_HS_POL_A::VALUE1) } #[doc = "Active low"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRC_HS_POL_A::VALUE2) } } #[doc = "Field `MAX_ABRST` reader - Maximum AMBA Burst Length"] -pub type MAX_ABRST_R = crate::FieldReader; +pub type MAX_ABRST_R = crate::FieldReader; #[doc = "Field `MAX_ABRST` writer - Maximum AMBA Burst Length"] -pub type MAX_ABRST_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFGL_SPEC, u16, u16, 10, O>; +pub type MAX_ABRST_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; impl R { #[doc = "Bits 5:7 - Channel priority"] #[inline(always)] @@ -532,88 +529,89 @@ impl W { #[doc = "Bits 5:7 - Channel priority"] #[inline(always)] #[must_use] - pub fn ch_prior(&mut self) -> CH_PRIOR_W<5> { - CH_PRIOR_W::new(self) + pub fn ch_prior(&mut self) -> CH_PRIOR_W { + CH_PRIOR_W::new(self, 5) } #[doc = "Bit 8 - Channel Suspend"] #[inline(always)] #[must_use] - pub fn ch_susp(&mut self) -> CH_SUSP_W<8> { - CH_SUSP_W::new(self) + pub fn ch_susp(&mut self) -> CH_SUSP_W { + CH_SUSP_W::new(self, 8) } #[doc = "Bit 10 - Destination Software or Hardware Handshaking Select"] #[inline(always)] #[must_use] - pub fn hs_sel_dst(&mut self) -> HS_SEL_DST_W<10> { - HS_SEL_DST_W::new(self) + pub fn hs_sel_dst(&mut self) -> HS_SEL_DST_W { + HS_SEL_DST_W::new(self, 10) } #[doc = "Bit 11 - Source Software or Hardware Handshaking Select"] #[inline(always)] #[must_use] - pub fn hs_sel_src(&mut self) -> HS_SEL_SRC_W<11> { - HS_SEL_SRC_W::new(self) + pub fn hs_sel_src(&mut self) -> HS_SEL_SRC_W { + HS_SEL_SRC_W::new(self, 11) } #[doc = "Bits 12:13 - Channel Lock Level"] #[inline(always)] #[must_use] - pub fn lock_ch_l(&mut self) -> LOCK_CH_L_W<12> { - LOCK_CH_L_W::new(self) + pub fn lock_ch_l(&mut self) -> LOCK_CH_L_W { + LOCK_CH_L_W::new(self, 12) } #[doc = "Bits 14:15 - Bus Lock Level"] #[inline(always)] #[must_use] - pub fn lock_b_l(&mut self) -> LOCK_B_L_W<14> { - LOCK_B_L_W::new(self) + pub fn lock_b_l(&mut self) -> LOCK_B_L_W { + LOCK_B_L_W::new(self, 14) } #[doc = "Bit 16 - Channel Lock Bit"] #[inline(always)] #[must_use] - pub fn lock_ch(&mut self) -> LOCK_CH_W<16> { - LOCK_CH_W::new(self) + pub fn lock_ch(&mut self) -> LOCK_CH_W { + LOCK_CH_W::new(self, 16) } #[doc = "Bit 17 - Bus Lock Bit"] #[inline(always)] #[must_use] - pub fn lock_b(&mut self) -> LOCK_B_W<17> { - LOCK_B_W::new(self) + pub fn lock_b(&mut self) -> LOCK_B_W { + LOCK_B_W::new(self, 17) } #[doc = "Bit 18 - Destination Handshaking Interface Polarity"] #[inline(always)] #[must_use] - pub fn dst_hs_pol(&mut self) -> DST_HS_POL_W<18> { - DST_HS_POL_W::new(self) + pub fn dst_hs_pol(&mut self) -> DST_HS_POL_W { + DST_HS_POL_W::new(self, 18) } #[doc = "Bit 19 - Source Handshaking Interface Polarity"] #[inline(always)] #[must_use] - pub fn src_hs_pol(&mut self) -> SRC_HS_POL_W<19> { - SRC_HS_POL_W::new(self) + pub fn src_hs_pol(&mut self) -> SRC_HS_POL_W { + SRC_HS_POL_W::new(self, 19) } #[doc = "Bits 20:29 - Maximum AMBA Burst Length"] #[inline(always)] #[must_use] - pub fn max_abrst(&mut self) -> MAX_ABRST_W<20> { - MAX_ABRST_W::new(self) + pub fn max_abrst(&mut self) -> MAX_ABRST_W { + MAX_ABRST_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Configuration Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfgl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cfgl::R`](R) reader structure"] +impl crate::Readable for CFGL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cfgl::W`](W) writer structure"] impl crate::Writable for CFGL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch2/ctlh.rs b/src/gpdma0_ch2/ctlh.rs index 385c624e..d6c59051 100644 --- a/src/gpdma0_ch2/ctlh.rs +++ b/src/gpdma0_ch2/ctlh.rs @@ -1,47 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BLOCK_TS` reader - Block Transfer Size"] -pub type BLOCK_TS_R = crate::FieldReader; +pub type BLOCK_TS_R = crate::FieldReader; #[doc = "Field `BLOCK_TS` writer - Block Transfer Size"] -pub type BLOCK_TS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLH_SPEC, u16, u16, 12, O>; +pub type BLOCK_TS_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; #[doc = "Field `DONE` reader - Done bit"] -pub type DONE_R = crate::BitReader; +pub type DONE_R = crate::BitReader; #[doc = "Field `DONE` writer - Done bit"] -pub type DONE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTLH_SPEC, bool, O>; +pub type DONE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:11 - Block Transfer Size"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:11 - Block Transfer Size"] #[inline(always)] #[must_use] - pub fn block_ts(&mut self) -> BLOCK_TS_W<0> { - BLOCK_TS_W::new(self) + pub fn block_ts(&mut self) -> BLOCK_TS_W { + BLOCK_TS_W::new(self, 0) } #[doc = "Bit 12 - Done bit"] #[inline(always)] #[must_use] - pub fn done(&mut self) -> DONE_W<12> { - DONE_W::new(self) + pub fn done(&mut self) -> DONE_W { + DONE_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Control Register High\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctlh::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctlh::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ctlh::R`](R) reader structure"] +impl crate::Readable for CTLH_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ctlh::W`](W) writer structure"] impl crate::Writable for CTLH_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch2/ctll.rs b/src/gpdma0_ch2/ctll.rs index 69157c00..29af3789 100644 --- a/src/gpdma0_ch2/ctll.rs +++ b/src/gpdma0_ch2/ctll.rs @@ -1,53 +1,21 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INT_EN` reader - Interrupt Enable Bit"] -pub type INT_EN_R = crate::BitReader; +pub type INT_EN_R = crate::BitReader; #[doc = "Field `INT_EN` writer - Interrupt Enable Bit"] -pub type INT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTLL_SPEC, bool, O>; +pub type INT_EN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DST_TR_WIDTH` reader - Destination Transfer Width"] -pub type DST_TR_WIDTH_R = crate::FieldReader; +pub type DST_TR_WIDTH_R = crate::FieldReader; #[doc = "Field `DST_TR_WIDTH` writer - Destination Transfer Width"] -pub type DST_TR_WIDTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type DST_TR_WIDTH_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `SRC_TR_WIDTH` reader - Source Transfer Width"] -pub type SRC_TR_WIDTH_R = crate::FieldReader; +pub type SRC_TR_WIDTH_R = crate::FieldReader; #[doc = "Field `SRC_TR_WIDTH` writer - Source Transfer Width"] -pub type SRC_TR_WIDTH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type SRC_TR_WIDTH_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `DINC` reader - Destination Address Increment"] -pub type DINC_R = crate::FieldReader; +pub type DINC_R = crate::FieldReader; #[doc = "Destination Address Increment\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -65,10 +33,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DINC_A { + type Ux = u8; +} impl DINC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DINC_A::VALUE1), 1 => Some(DINC_A::VALUE2), @@ -76,43 +47,47 @@ impl DINC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Increment"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DINC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Decrement"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DINC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "No change"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DINC_A::VALUE3 } } #[doc = "Field `DINC` writer - Destination Address Increment"] -pub type DINC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, DINC_A, 2, O>; -impl<'a, const O: u8> DINC_W<'a, O> { +pub type DINC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DINC_A>; +impl<'a, REG> DINC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Increment"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DINC_A::VALUE1) } #[doc = "Decrement"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DINC_A::VALUE2) } #[doc = "No change"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DINC_A::VALUE3) } } #[doc = "Field `SINC` reader - Source Address Increment"] -pub type SINC_R = crate::FieldReader; +pub type SINC_R = crate::FieldReader; #[doc = "Source Address Increment\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -130,10 +105,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SINC_A { + type Ux = u8; +} impl SINC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SINC_A::VALUE1), 1 => Some(SINC_A::VALUE2), @@ -141,53 +119,57 @@ impl SINC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Increment"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SINC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Decrement"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SINC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "No change"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SINC_A::VALUE3 } } #[doc = "Field `SINC` writer - Source Address Increment"] -pub type SINC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, SINC_A, 2, O>; -impl<'a, const O: u8> SINC_W<'a, O> { +pub type SINC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SINC_A>; +impl<'a, REG> SINC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Increment"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SINC_A::VALUE1) } #[doc = "Decrement"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SINC_A::VALUE2) } #[doc = "No change"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SINC_A::VALUE3) } } #[doc = "Field `DEST_MSIZE` reader - Destination Burst Transaction Length"] -pub type DEST_MSIZE_R = crate::FieldReader; +pub type DEST_MSIZE_R = crate::FieldReader; #[doc = "Field `DEST_MSIZE` writer - Destination Burst Transaction Length"] -pub type DEST_MSIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type DEST_MSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `SRC_MSIZE` reader - Source Burst Transaction Length"] -pub type SRC_MSIZE_R = crate::FieldReader; +pub type SRC_MSIZE_R = crate::FieldReader; #[doc = "Field `SRC_MSIZE` writer - Source Burst Transaction Length"] -pub type SRC_MSIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type SRC_MSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `TT_FC` reader - Transfer Type and Flow Control"] -pub type TT_FC_R = crate::FieldReader; +pub type TT_FC_R = crate::FieldReader; #[doc = "Field `TT_FC` writer - Transfer Type and Flow Control"] -pub type TT_FC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTLL_SPEC, u8, u8, 3, O>; +pub type TT_FC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bit 0 - Interrupt Enable Bit"] #[inline(always)] @@ -234,70 +216,71 @@ impl W { #[doc = "Bit 0 - Interrupt Enable Bit"] #[inline(always)] #[must_use] - pub fn int_en(&mut self) -> INT_EN_W<0> { - INT_EN_W::new(self) + pub fn int_en(&mut self) -> INT_EN_W { + INT_EN_W::new(self, 0) } #[doc = "Bits 1:3 - Destination Transfer Width"] #[inline(always)] #[must_use] - pub fn dst_tr_width(&mut self) -> DST_TR_WIDTH_W<1> { - DST_TR_WIDTH_W::new(self) + pub fn dst_tr_width(&mut self) -> DST_TR_WIDTH_W { + DST_TR_WIDTH_W::new(self, 1) } #[doc = "Bits 4:6 - Source Transfer Width"] #[inline(always)] #[must_use] - pub fn src_tr_width(&mut self) -> SRC_TR_WIDTH_W<4> { - SRC_TR_WIDTH_W::new(self) + pub fn src_tr_width(&mut self) -> SRC_TR_WIDTH_W { + SRC_TR_WIDTH_W::new(self, 4) } #[doc = "Bits 7:8 - Destination Address Increment"] #[inline(always)] #[must_use] - pub fn dinc(&mut self) -> DINC_W<7> { - DINC_W::new(self) + pub fn dinc(&mut self) -> DINC_W { + DINC_W::new(self, 7) } #[doc = "Bits 9:10 - Source Address Increment"] #[inline(always)] #[must_use] - pub fn sinc(&mut self) -> SINC_W<9> { - SINC_W::new(self) + pub fn sinc(&mut self) -> SINC_W { + SINC_W::new(self, 9) } #[doc = "Bits 11:13 - Destination Burst Transaction Length"] #[inline(always)] #[must_use] - pub fn dest_msize(&mut self) -> DEST_MSIZE_W<11> { - DEST_MSIZE_W::new(self) + pub fn dest_msize(&mut self) -> DEST_MSIZE_W { + DEST_MSIZE_W::new(self, 11) } #[doc = "Bits 14:16 - Source Burst Transaction Length"] #[inline(always)] #[must_use] - pub fn src_msize(&mut self) -> SRC_MSIZE_W<14> { - SRC_MSIZE_W::new(self) + pub fn src_msize(&mut self) -> SRC_MSIZE_W { + SRC_MSIZE_W::new(self, 14) } #[doc = "Bits 20:22 - Transfer Type and Flow Control"] #[inline(always)] #[must_use] - pub fn tt_fc(&mut self) -> TT_FC_W<20> { - TT_FC_W::new(self) + pub fn tt_fc(&mut self) -> TT_FC_W { + TT_FC_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Control Register Low\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctll::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctll::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ctll::R`](R) reader structure"] +impl crate::Readable for CTLL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ctll::W`](W) writer structure"] impl crate::Writable for CTLL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch2/dar.rs b/src/gpdma0_ch2/dar.rs index 9e02f373..ce3f2d68 100644 --- a/src/gpdma0_ch2/dar.rs +++ b/src/gpdma0_ch2/dar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DAR` reader - Current Destination address of DMA transfer"] -pub type DAR_R = crate::FieldReader; +pub type DAR_R = crate::FieldReader; #[doc = "Field `DAR` writer - Current Destination address of DMA transfer"] -pub type DAR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAR_SPEC, u32, u32, 32, O>; +pub type DAR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Current Destination address of DMA transfer"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Current Destination address of DMA transfer"] #[inline(always)] #[must_use] - pub fn dar(&mut self) -> DAR_W<0> { - DAR_W::new(self) + pub fn dar(&mut self) -> DAR_W { + DAR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Destination Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dar::R`](R) reader structure"] +impl crate::Readable for DAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dar::W`](W) writer structure"] impl crate::Writable for DAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/gpdma0_ch2/sar.rs b/src/gpdma0_ch2/sar.rs index b6da0d98..23de4dd2 100644 --- a/src/gpdma0_ch2/sar.rs +++ b/src/gpdma0_ch2/sar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SAR` reader - Current Source Address of DMA transfer"] -pub type SAR_R = crate::FieldReader; +pub type SAR_R = crate::FieldReader; #[doc = "Field `SAR` writer - Current Source Address of DMA transfer"] -pub type SAR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SAR_SPEC, u32, u32, 32, O>; +pub type SAR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Current Source Address of DMA transfer"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Current Source Address of DMA transfer"] #[inline(always)] #[must_use] - pub fn sar(&mut self) -> SAR_W<0> { - SAR_W::new(self) + pub fn sar(&mut self) -> SAR_W { + SAR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sar::R`](R) reader structure"] +impl crate::Readable for SAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sar::W`](W) writer structure"] impl crate::Writable for SAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0.rs b/src/hrpwm0.rs index d634e32a..42256e12 100644 --- a/src/hrpwm0.rs +++ b/src/hrpwm0.rs @@ -1,110 +1,197 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Bias and suspend configuration"] - pub hrbsc: HRBSC, + hrbsc: HRBSC, _reserved1: [u8; 0x04], - #[doc = "0x08 - Module identification register"] - pub midr: MIDR, + midr: MIDR, _reserved2: [u8; 0x08], - #[doc = "0x14 - Global Analog Configuration"] - pub glbana: GLBANA, + glbana: GLBANA, _reserved3: [u8; 0x08], + csgcfg: CSGCFG, + csgsetg: CSGSETG, + csgclrg: CSGCLRG, + csgstatg: CSGSTATG, + csgfcg: CSGFCG, + csgfsg: CSGFSG, + csgtrg: CSGTRG, + csgtrc: CSGTRC, + csgtrsg: CSGTRSG, + _reserved12: [u8; 0x1c], + hrccfg: HRCCFG, + hrcstrg: HRCSTRG, + hrcctrg: HRCCTRG, + hrcstsg: HRCSTSG, + hrghrs: HRGHRS, +} +impl RegisterBlock { + #[doc = "0x00 - Bias and suspend configuration"] + #[inline(always)] + pub const fn hrbsc(&self) -> &HRBSC { + &self.hrbsc + } + #[doc = "0x08 - Module identification register"] + #[inline(always)] + pub const fn midr(&self) -> &MIDR { + &self.midr + } + #[doc = "0x14 - Global Analog Configuration"] + #[inline(always)] + pub const fn glbana(&self) -> &GLBANA { + &self.glbana + } #[doc = "0x20 - Global CSG configuration"] - pub csgcfg: CSGCFG, + #[inline(always)] + pub const fn csgcfg(&self) -> &CSGCFG { + &self.csgcfg + } #[doc = "0x24 - Global CSG run bit set"] - pub csgsetg: CSGSETG, + #[inline(always)] + pub const fn csgsetg(&self) -> &CSGSETG { + &self.csgsetg + } #[doc = "0x28 - Global CSG run bit clear"] - pub csgclrg: CSGCLRG, + #[inline(always)] + pub const fn csgclrg(&self) -> &CSGCLRG { + &self.csgclrg + } #[doc = "0x2c - Global CSG run bit status"] - pub csgstatg: CSGSTATG, + #[inline(always)] + pub const fn csgstatg(&self) -> &CSGSTATG { + &self.csgstatg + } #[doc = "0x30 - Global CSG slope/prescaler control"] - pub csgfcg: CSGFCG, + #[inline(always)] + pub const fn csgfcg(&self) -> &CSGFCG { + &self.csgfcg + } #[doc = "0x34 - Global CSG slope/prescaler status"] - pub csgfsg: CSGFSG, + #[inline(always)] + pub const fn csgfsg(&self) -> &CSGFSG { + &self.csgfsg + } #[doc = "0x38 - Global CSG shadow/switch trigger"] - pub csgtrg: CSGTRG, + #[inline(always)] + pub const fn csgtrg(&self) -> &CSGTRG { + &self.csgtrg + } #[doc = "0x3c - Global CSG shadow trigger clear"] - pub csgtrc: CSGTRC, + #[inline(always)] + pub const fn csgtrc(&self) -> &CSGTRC { + &self.csgtrc + } #[doc = "0x40 - Global CSG shadow/switch status"] - pub csgtrsg: CSGTRSG, - _reserved12: [u8; 0x1c], + #[inline(always)] + pub const fn csgtrsg(&self) -> &CSGTRSG { + &self.csgtrsg + } #[doc = "0x60 - Global HRC configuration"] - pub hrccfg: HRCCFG, + #[inline(always)] + pub const fn hrccfg(&self) -> &HRCCFG { + &self.hrccfg + } #[doc = "0x64 - Global HRC shadow trigger set"] - pub hrcstrg: HRCSTRG, + #[inline(always)] + pub const fn hrcstrg(&self) -> &HRCSTRG { + &self.hrcstrg + } #[doc = "0x68 - Global HRC shadow trigger clear"] - pub hrcctrg: HRCCTRG, + #[inline(always)] + pub const fn hrcctrg(&self) -> &HRCCTRG { + &self.hrcctrg + } #[doc = "0x6c - Global HRC shadow transfer status"] - pub hrcstsg: HRCSTSG, + #[inline(always)] + pub const fn hrcstsg(&self) -> &HRCSTSG { + &self.hrcstsg + } #[doc = "0x70 - High Resolution Generation Status"] - pub hrghrs: HRGHRS, + #[inline(always)] + pub const fn hrghrs(&self) -> &HRGHRS { + &self.hrghrs + } } -#[doc = "HRBSC (rw) register accessor: an alias for `Reg`"] +#[doc = "HRBSC (rw) register accessor: Bias and suspend configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hrbsc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hrbsc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hrbsc`] +module"] pub type HRBSC = crate::Reg; #[doc = "Bias and suspend configuration"] pub mod hrbsc; -#[doc = "MIDR (r) register accessor: an alias for `Reg`"] +#[doc = "MIDR (r) register accessor: Module identification register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`midr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@midr`] +module"] pub type MIDR = crate::Reg; #[doc = "Module identification register"] pub mod midr; -#[doc = "GLBANA (rw) register accessor: an alias for `Reg`"] +#[doc = "GLBANA (rw) register accessor: Global Analog Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`glbana::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`glbana::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@glbana`] +module"] pub type GLBANA = crate::Reg; #[doc = "Global Analog Configuration"] pub mod glbana; -#[doc = "CSGCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "CSGCFG (rw) register accessor: Global CSG configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csgcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgcfg`] +module"] pub type CSGCFG = crate::Reg; #[doc = "Global CSG configuration"] pub mod csgcfg; -#[doc = "CSGSETG (w) register accessor: an alias for `Reg`"] +#[doc = "CSGSETG (w) register accessor: Global CSG run bit set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgsetg::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgsetg`] +module"] pub type CSGSETG = crate::Reg; #[doc = "Global CSG run bit set"] pub mod csgsetg; -#[doc = "CSGCLRG (w) register accessor: an alias for `Reg`"] +#[doc = "CSGCLRG (w) register accessor: Global CSG run bit clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgclrg::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgclrg`] +module"] pub type CSGCLRG = crate::Reg; #[doc = "Global CSG run bit clear"] pub mod csgclrg; -#[doc = "CSGSTATG (r) register accessor: an alias for `Reg`"] +#[doc = "CSGSTATG (r) register accessor: Global CSG run bit status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csgstatg::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgstatg`] +module"] pub type CSGSTATG = crate::Reg; #[doc = "Global CSG run bit status"] pub mod csgstatg; -#[doc = "CSGFCG (w) register accessor: an alias for `Reg`"] +#[doc = "CSGFCG (w) register accessor: Global CSG slope/prescaler control\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgfcg::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgfcg`] +module"] pub type CSGFCG = crate::Reg; #[doc = "Global CSG slope/prescaler control"] pub mod csgfcg; -#[doc = "CSGFSG (r) register accessor: an alias for `Reg`"] +#[doc = "CSGFSG (r) register accessor: Global CSG slope/prescaler status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csgfsg::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgfsg`] +module"] pub type CSGFSG = crate::Reg; #[doc = "Global CSG slope/prescaler status"] pub mod csgfsg; -#[doc = "CSGTRG (w) register accessor: an alias for `Reg`"] +#[doc = "CSGTRG (w) register accessor: Global CSG shadow/switch trigger\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgtrg::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgtrg`] +module"] pub type CSGTRG = crate::Reg; #[doc = "Global CSG shadow/switch trigger"] pub mod csgtrg; -#[doc = "CSGTRC (w) register accessor: an alias for `Reg`"] +#[doc = "CSGTRC (w) register accessor: Global CSG shadow trigger clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgtrc::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgtrc`] +module"] pub type CSGTRC = crate::Reg; #[doc = "Global CSG shadow trigger clear"] pub mod csgtrc; -#[doc = "CSGTRSG (r) register accessor: an alias for `Reg`"] +#[doc = "CSGTRSG (r) register accessor: Global CSG shadow/switch status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csgtrsg::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@csgtrsg`] +module"] pub type CSGTRSG = crate::Reg; #[doc = "Global CSG shadow/switch status"] pub mod csgtrsg; -#[doc = "HRCCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "HRCCFG (rw) register accessor: Global HRC configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hrccfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hrccfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hrccfg`] +module"] pub type HRCCFG = crate::Reg; #[doc = "Global HRC configuration"] pub mod hrccfg; -#[doc = "HRCSTRG (w) register accessor: an alias for `Reg`"] +#[doc = "HRCSTRG (w) register accessor: Global HRC shadow trigger set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hrcstrg::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hrcstrg`] +module"] pub type HRCSTRG = crate::Reg; #[doc = "Global HRC shadow trigger set"] pub mod hrcstrg; -#[doc = "HRCCTRG (w) register accessor: an alias for `Reg`"] +#[doc = "HRCCTRG (w) register accessor: Global HRC shadow trigger clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hrcctrg::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hrcctrg`] +module"] pub type HRCCTRG = crate::Reg; #[doc = "Global HRC shadow trigger clear"] pub mod hrcctrg; -#[doc = "HRCSTSG (r) register accessor: an alias for `Reg`"] +#[doc = "HRCSTSG (r) register accessor: Global HRC shadow transfer status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hrcstsg::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hrcstsg`] +module"] pub type HRCSTSG = crate::Reg; #[doc = "Global HRC shadow transfer status"] pub mod hrcstsg; -#[doc = "HRGHRS (r) register accessor: an alias for `Reg`"] +#[doc = "HRGHRS (r) register accessor: High Resolution Generation Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hrghrs::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hrghrs`] +module"] 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 c54cc087..c51a2ffe 100644 --- a/src/hrpwm0/csgcfg.rs +++ b/src/hrpwm0/csgcfg.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `C0PM` reader - CSG0 Power Mode"] -pub type C0PM_R = crate::FieldReader; +pub type C0PM_R = crate::FieldReader; #[doc = "CSG0 Power Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C0PM_A { + type Ux = u8; +} impl C0PM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C0PM_A::VALUE1), 1 => Some(C0PM_A::VALUE2), @@ -64,43 +35,47 @@ impl C0PM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSG0 unit is powered OFF"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C0PM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSG0 unit is set in Low Speed Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C0PM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSG0 unit is set in High Speed Mode"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == C0PM_A::VALUE4 } } #[doc = "Field `C0PM` writer - CSG0 Power Mode"] -pub type C0PM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CSGCFG_SPEC, u8, C0PM_A, 2, O>; -impl<'a, const O: u8> C0PM_W<'a, O> { +pub type C0PM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, C0PM_A>; +impl<'a, REG> C0PM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSG0 unit is powered OFF"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C0PM_A::VALUE1) } #[doc = "CSG0 unit is set in Low Speed Mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C0PM_A::VALUE2) } #[doc = "CSG0 unit is set in High Speed Mode"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(C0PM_A::VALUE4) } } #[doc = "Field `C1PM` reader - CSG1 Power Mode"] -pub type C1PM_R = crate::FieldReader; +pub type C1PM_R = crate::FieldReader; #[doc = "CSG1 Power Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C1PM_A { + type Ux = u8; +} impl C1PM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C1PM_A::VALUE1), 1 => Some(C1PM_A::VALUE2), @@ -129,43 +107,47 @@ impl C1PM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSG1 unit is powered OFF"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C1PM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSG1 unit is set in Low Speed Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C1PM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSG1 unit is set in High Speed Mode"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == C1PM_A::VALUE4 } } #[doc = "Field `C1PM` writer - CSG1 Power Mode"] -pub type C1PM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CSGCFG_SPEC, u8, C1PM_A, 2, O>; -impl<'a, const O: u8> C1PM_W<'a, O> { +pub type C1PM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, C1PM_A>; +impl<'a, REG> C1PM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSG1 unit is powered OFF"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C1PM_A::VALUE1) } #[doc = "CSG1 unit is set in Low Speed Mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C1PM_A::VALUE2) } #[doc = "CSG1 unit is set in High Speed Mode"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(C1PM_A::VALUE4) } } #[doc = "Field `C2PM` reader - CSG2 Power Mode"] -pub type C2PM_R = crate::FieldReader; +pub type C2PM_R = crate::FieldReader; #[doc = "CSG2 Power Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C2PM_A { + type Ux = u8; +} impl C2PM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C2PM_A::VALUE1), 1 => Some(C2PM_A::VALUE2), @@ -194,53 +179,57 @@ impl C2PM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSG2 unit is powered OFF"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C2PM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSG2 unit is set in Low Speed Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C2PM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSG2 unit is set in High Speed Mode"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == C2PM_A::VALUE4 } } #[doc = "Field `C2PM` writer - CSG2 Power Mode"] -pub type C2PM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CSGCFG_SPEC, u8, C2PM_A, 2, O>; -impl<'a, const O: u8> C2PM_W<'a, O> { +pub type C2PM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, C2PM_A>; +impl<'a, REG> C2PM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSG2 unit is powered OFF"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C2PM_A::VALUE1) } #[doc = "CSG2 unit is set in Low Speed Mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C2PM_A::VALUE2) } #[doc = "CSG2 unit is set in High Speed Mode"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(C2PM_A::VALUE4) } } #[doc = "Field `C0CD` reader - CSG0 Clock disable"] -pub type C0CD_R = crate::BitReader; +pub type C0CD_R = crate::BitReader; #[doc = "Field `C0CD` writer - CSG0 Clock disable"] -pub type C0CD_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCFG_SPEC, bool, O>; +pub type C0CD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `C1CD` reader - CSG1 Clock disable"] -pub type C1CD_R = crate::BitReader; +pub type C1CD_R = crate::BitReader; #[doc = "Field `C1CD` writer - CSG1 Clock disable"] -pub type C1CD_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCFG_SPEC, bool, O>; +pub type C1CD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `C2CD` reader - CSG2 Clock disable"] -pub type C2CD_R = crate::BitReader; +pub type C2CD_R = crate::BitReader; #[doc = "Field `C2CD` writer - CSG2 Clock disable"] -pub type C2CD_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCFG_SPEC, bool, O>; +pub type C2CD_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:1 - CSG0 Power Mode"] #[inline(always)] @@ -277,58 +266,59 @@ impl W { #[doc = "Bits 0:1 - CSG0 Power Mode"] #[inline(always)] #[must_use] - pub fn c0pm(&mut self) -> C0PM_W<0> { - C0PM_W::new(self) + pub fn c0pm(&mut self) -> C0PM_W { + C0PM_W::new(self, 0) } #[doc = "Bits 2:3 - CSG1 Power Mode"] #[inline(always)] #[must_use] - pub fn c1pm(&mut self) -> C1PM_W<2> { - C1PM_W::new(self) + pub fn c1pm(&mut self) -> C1PM_W { + C1PM_W::new(self, 2) } #[doc = "Bits 4:5 - CSG2 Power Mode"] #[inline(always)] #[must_use] - pub fn c2pm(&mut self) -> C2PM_W<4> { - C2PM_W::new(self) + pub fn c2pm(&mut self) -> C2PM_W { + C2PM_W::new(self, 4) } #[doc = "Bit 16 - CSG0 Clock disable"] #[inline(always)] #[must_use] - pub fn c0cd(&mut self) -> C0CD_W<16> { - C0CD_W::new(self) + pub fn c0cd(&mut self) -> C0CD_W { + C0CD_W::new(self, 16) } #[doc = "Bit 17 - CSG1 Clock disable"] #[inline(always)] #[must_use] - pub fn c1cd(&mut self) -> C1CD_W<17> { - C1CD_W::new(self) + pub fn c1cd(&mut self) -> C1CD_W { + C1CD_W::new(self, 17) } #[doc = "Bit 18 - CSG2 Clock disable"] #[inline(always)] #[must_use] - pub fn c2cd(&mut self) -> C2CD_W<18> { - C2CD_W::new(self) + pub fn c2cd(&mut self) -> C2CD_W { + C2CD_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global CSG configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csgcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`csgcfg::R`](R) reader structure"] +impl crate::Readable for CSGCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`csgcfg::W`](W) writer structure"] impl crate::Writable for CSGCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/csgclrg.rs b/src/hrpwm0/csgclrg.rs index 4cd41a14..46a89f8d 100644 --- a/src/hrpwm0/csgclrg.rs +++ b/src/hrpwm0/csgclrg.rs @@ -1,112 +1,96 @@ #[doc = "Register `CSGCLRG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CD0R` writer - DAC0 run bit clear"] -pub type CD0R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CD0R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CC0R` writer - CMP0 run bit clear"] -pub type CC0R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CC0R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CC0P` writer - CMP0 passive level clear"] -pub type CC0P_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CC0P_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CD1R` writer - DAC1 run bit clear"] -pub type CD1R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CD1R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CC1R` writer - CMP1 run bit clear"] -pub type CC1R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CC1R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CC1P` writer - CMP1 passive level clear"] -pub type CC1P_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CC1P_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CD2R` writer - DAC2 run bit clear"] -pub type CD2R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CD2R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CC2R` writer - CMP2 run bit clear"] -pub type CC2R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CC2R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CC2P` writer - CMP2 passive level clear"] -pub type CC2P_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGCLRG_SPEC, bool, O>; +pub type CC2P_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - DAC0 run bit clear"] #[inline(always)] #[must_use] - pub fn cd0r(&mut self) -> CD0R_W<0> { - CD0R_W::new(self) + pub fn cd0r(&mut self) -> CD0R_W { + CD0R_W::new(self, 0) } #[doc = "Bit 1 - CMP0 run bit clear"] #[inline(always)] #[must_use] - pub fn cc0r(&mut self) -> CC0R_W<1> { - CC0R_W::new(self) + pub fn cc0r(&mut self) -> CC0R_W { + CC0R_W::new(self, 1) } #[doc = "Bit 2 - CMP0 passive level clear"] #[inline(always)] #[must_use] - pub fn cc0p(&mut self) -> CC0P_W<2> { - CC0P_W::new(self) + pub fn cc0p(&mut self) -> CC0P_W { + CC0P_W::new(self, 2) } #[doc = "Bit 4 - DAC1 run bit clear"] #[inline(always)] #[must_use] - pub fn cd1r(&mut self) -> CD1R_W<4> { - CD1R_W::new(self) + pub fn cd1r(&mut self) -> CD1R_W { + CD1R_W::new(self, 4) } #[doc = "Bit 5 - CMP1 run bit clear"] #[inline(always)] #[must_use] - pub fn cc1r(&mut self) -> CC1R_W<5> { - CC1R_W::new(self) + pub fn cc1r(&mut self) -> CC1R_W { + CC1R_W::new(self, 5) } #[doc = "Bit 6 - CMP1 passive level clear"] #[inline(always)] #[must_use] - pub fn cc1p(&mut self) -> CC1P_W<6> { - CC1P_W::new(self) + pub fn cc1p(&mut self) -> CC1P_W { + CC1P_W::new(self, 6) } #[doc = "Bit 8 - DAC2 run bit clear"] #[inline(always)] #[must_use] - pub fn cd2r(&mut self) -> CD2R_W<8> { - CD2R_W::new(self) + pub fn cd2r(&mut self) -> CD2R_W { + CD2R_W::new(self, 8) } #[doc = "Bit 9 - CMP2 run bit clear"] #[inline(always)] #[must_use] - pub fn cc2r(&mut self) -> CC2R_W<9> { - CC2R_W::new(self) + pub fn cc2r(&mut self) -> CC2R_W { + CC2R_W::new(self, 9) } #[doc = "Bit 10 - CMP2 passive level clear"] #[inline(always)] #[must_use] - pub fn cc2p(&mut self) -> CC2P_W<10> { - CC2P_W::new(self) + pub fn cc2p(&mut self) -> CC2P_W { + CC2P_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global CSG run bit clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgclrg::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CSGCLRG_SPEC; impl crate::RegisterSpec for CSGCLRG_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [csgclrg::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`csgclrg::W`](W) writer structure"] impl crate::Writable for CSGCLRG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/csgfcg.rs b/src/hrpwm0/csgfcg.rs index b30ae0b7..ef5779a5 100644 --- a/src/hrpwm0/csgfcg.rs +++ b/src/hrpwm0/csgfcg.rs @@ -1,160 +1,144 @@ #[doc = "Register `CSGFCG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `S0STR` writer - Slope 0 start"] -pub type S0STR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type S0STR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S0STP` writer - Slope 0 stop"] -pub type S0STP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type S0STP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS0STR` writer - Prescaler 0 start"] -pub type PS0STR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS0STR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS0STP` writer - Prescaler 0 stop"] -pub type PS0STP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS0STP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS0CLR` writer - Prescaler 0 clear"] -pub type PS0CLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS0CLR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1STR` writer - Slope 1 start"] -pub type S1STR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type S1STR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S1STP` writer - Slope 1 stop"] -pub type S1STP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type S1STP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1STR` writer - Prescaler 1 start"] -pub type PS1STR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS1STR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1STP` writer - Prescaler 1 stop"] -pub type PS1STP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS1STP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1CLR` writer - Prescaler 1 clear"] -pub type PS1CLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS1CLR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2STR` writer - Slope 2 start"] -pub type S2STR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type S2STR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S2STP` writer - Slope 2 stop"] -pub type S2STP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type S2STP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2STR` writer - Prescaler 2 start"] -pub type PS2STR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS2STR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2STP` writer - Prescaler 2 stop"] -pub type PS2STP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS2STP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2CLR` writer - Prescaler 2 clear"] -pub type PS2CLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGFCG_SPEC, bool, O>; +pub type PS2CLR_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Slope 0 start"] #[inline(always)] #[must_use] - pub fn s0str(&mut self) -> S0STR_W<0> { - S0STR_W::new(self) + pub fn s0str(&mut self) -> S0STR_W { + S0STR_W::new(self, 0) } #[doc = "Bit 1 - Slope 0 stop"] #[inline(always)] #[must_use] - pub fn s0stp(&mut self) -> S0STP_W<1> { - S0STP_W::new(self) + pub fn s0stp(&mut self) -> S0STP_W { + S0STP_W::new(self, 1) } #[doc = "Bit 2 - Prescaler 0 start"] #[inline(always)] #[must_use] - pub fn ps0str(&mut self) -> PS0STR_W<2> { - PS0STR_W::new(self) + pub fn ps0str(&mut self) -> PS0STR_W { + PS0STR_W::new(self, 2) } #[doc = "Bit 3 - Prescaler 0 stop"] #[inline(always)] #[must_use] - pub fn ps0stp(&mut self) -> PS0STP_W<3> { - PS0STP_W::new(self) + pub fn ps0stp(&mut self) -> PS0STP_W { + PS0STP_W::new(self, 3) } #[doc = "Bit 4 - Prescaler 0 clear"] #[inline(always)] #[must_use] - pub fn ps0clr(&mut self) -> PS0CLR_W<4> { - PS0CLR_W::new(self) + pub fn ps0clr(&mut self) -> PS0CLR_W { + PS0CLR_W::new(self, 4) } #[doc = "Bit 8 - Slope 1 start"] #[inline(always)] #[must_use] - pub fn s1str(&mut self) -> S1STR_W<8> { - S1STR_W::new(self) + pub fn s1str(&mut self) -> S1STR_W { + S1STR_W::new(self, 8) } #[doc = "Bit 9 - Slope 1 stop"] #[inline(always)] #[must_use] - pub fn s1stp(&mut self) -> S1STP_W<9> { - S1STP_W::new(self) + pub fn s1stp(&mut self) -> S1STP_W { + S1STP_W::new(self, 9) } #[doc = "Bit 10 - Prescaler 1 start"] #[inline(always)] #[must_use] - pub fn ps1str(&mut self) -> PS1STR_W<10> { - PS1STR_W::new(self) + pub fn ps1str(&mut self) -> PS1STR_W { + PS1STR_W::new(self, 10) } #[doc = "Bit 11 - Prescaler 1 stop"] #[inline(always)] #[must_use] - pub fn ps1stp(&mut self) -> PS1STP_W<11> { - PS1STP_W::new(self) + pub fn ps1stp(&mut self) -> PS1STP_W { + PS1STP_W::new(self, 11) } #[doc = "Bit 12 - Prescaler 1 clear"] #[inline(always)] #[must_use] - pub fn ps1clr(&mut self) -> PS1CLR_W<12> { - PS1CLR_W::new(self) + pub fn ps1clr(&mut self) -> PS1CLR_W { + PS1CLR_W::new(self, 12) } #[doc = "Bit 16 - Slope 2 start"] #[inline(always)] #[must_use] - pub fn s2str(&mut self) -> S2STR_W<16> { - S2STR_W::new(self) + pub fn s2str(&mut self) -> S2STR_W { + S2STR_W::new(self, 16) } #[doc = "Bit 17 - Slope 2 stop"] #[inline(always)] #[must_use] - pub fn s2stp(&mut self) -> S2STP_W<17> { - S2STP_W::new(self) + pub fn s2stp(&mut self) -> S2STP_W { + S2STP_W::new(self, 17) } #[doc = "Bit 18 - Prescaler 2 start"] #[inline(always)] #[must_use] - pub fn ps2str(&mut self) -> PS2STR_W<18> { - PS2STR_W::new(self) + pub fn ps2str(&mut self) -> PS2STR_W { + PS2STR_W::new(self, 18) } #[doc = "Bit 19 - Prescaler 2 stop"] #[inline(always)] #[must_use] - pub fn ps2stp(&mut self) -> PS2STP_W<19> { - PS2STP_W::new(self) + pub fn ps2stp(&mut self) -> PS2STP_W { + PS2STP_W::new(self, 19) } #[doc = "Bit 20 - Prescaler 2 clear"] #[inline(always)] #[must_use] - pub fn ps2clr(&mut self) -> PS2CLR_W<20> { - PS2CLR_W::new(self) + pub fn ps2clr(&mut self) -> PS2CLR_W { + PS2CLR_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global CSG slope/prescaler control\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgfcg::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CSGFCG_SPEC; impl crate::RegisterSpec for CSGFCG_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [csgfcg::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`csgfcg::W`](W) writer structure"] impl crate::Writable for CSGFCG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/csgfsg.rs b/src/hrpwm0/csgfsg.rs index 7aadf682..3f11d683 100644 --- a/src/hrpwm0/csgfsg.rs +++ b/src/hrpwm0/csgfsg.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `S0RB` reader - DAC0 slope generation status"] pub type S0RB_R = crate::BitReader; #[doc = "DAC0 slope generation status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl S0RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0RB_A { + pub const fn variant(&self) -> S0RB_A { match self.bits { false => S0RB_A::VALUE1, true => S0RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Slope generation is stopped."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Slope generation is running."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0RB_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P0RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0RB_A { + pub const fn variant(&self) -> P0RB_A { match self.bits { false => P0RB_A::VALUE1, true => P0RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler is stopped. The clock used for the slope generation is halted and therefore the slope is frozen."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler is running."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0RB_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl S1RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1RB_A { + pub const fn variant(&self) -> S1RB_A { match self.bits { false => S1RB_A::VALUE1, true => S1RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Slope generation is stopped."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Slope generation is running."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1RB_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P1RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1RB_A { + pub const fn variant(&self) -> P1RB_A { match self.bits { false => P1RB_A::VALUE1, true => P1RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler is stopped. The clock used for the slope generation is halted and therefore the slope is frozen."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler is running."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1RB_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl S2RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S2RB_A { + pub const fn variant(&self) -> S2RB_A { match self.bits { false => S2RB_A::VALUE1, true => S2RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Slope generation is stopped."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S2RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Slope generation is running."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S2RB_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P2RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2RB_A { + pub const fn variant(&self) -> P2RB_A { match self.bits { false => P2RB_A::VALUE1, true => P2RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Prescaler is stopped. The clock used for the slope generation is halted and therefore the slope is frozen."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler is running."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2RB_A::VALUE2 @@ -261,15 +248,13 @@ impl R { P2RB_R::new(((self.bits >> 17) & 1) != 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"] +#[doc = "Global CSG slope/prescaler status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csgfsg::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`csgfsg::R`](R) reader structure"] +impl crate::Readable for CSGFSG_SPEC {} #[doc = "`reset()` method sets CSGFSG to value 0"] impl crate::Resettable for CSGFSG_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0/csgsetg.rs b/src/hrpwm0/csgsetg.rs index 0ca4a2d4..d726d9bd 100644 --- a/src/hrpwm0/csgsetg.rs +++ b/src/hrpwm0/csgsetg.rs @@ -1,112 +1,96 @@ #[doc = "Register `CSGSETG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SD0R` writer - DAC0 run bit set"] -pub type SD0R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SD0R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SC0R` writer - CMP0 run bit set"] -pub type SC0R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SC0R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SC0P` writer - CMP0 passive level set"] -pub type SC0P_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SC0P_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SD1R` writer - DAC1 run bit set"] -pub type SD1R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SD1R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SC1R` writer - CMP1 run bit set"] -pub type SC1R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SC1R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SC1P` writer - CMP1 passive level set"] -pub type SC1P_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SC1P_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SD2R` writer - DAC2 run bit set"] -pub type SD2R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SD2R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SC2R` writer - CMP2 run bit set"] -pub type SC2R_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SC2R_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SC2P` writer - CMP2 passive level set"] -pub type SC2P_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGSETG_SPEC, bool, O>; +pub type SC2P_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - DAC0 run bit set"] #[inline(always)] #[must_use] - pub fn sd0r(&mut self) -> SD0R_W<0> { - SD0R_W::new(self) + pub fn sd0r(&mut self) -> SD0R_W { + SD0R_W::new(self, 0) } #[doc = "Bit 1 - CMP0 run bit set"] #[inline(always)] #[must_use] - pub fn sc0r(&mut self) -> SC0R_W<1> { - SC0R_W::new(self) + pub fn sc0r(&mut self) -> SC0R_W { + SC0R_W::new(self, 1) } #[doc = "Bit 2 - CMP0 passive level set"] #[inline(always)] #[must_use] - pub fn sc0p(&mut self) -> SC0P_W<2> { - SC0P_W::new(self) + pub fn sc0p(&mut self) -> SC0P_W { + SC0P_W::new(self, 2) } #[doc = "Bit 4 - DAC1 run bit set"] #[inline(always)] #[must_use] - pub fn sd1r(&mut self) -> SD1R_W<4> { - SD1R_W::new(self) + pub fn sd1r(&mut self) -> SD1R_W { + SD1R_W::new(self, 4) } #[doc = "Bit 5 - CMP1 run bit set"] #[inline(always)] #[must_use] - pub fn sc1r(&mut self) -> SC1R_W<5> { - SC1R_W::new(self) + pub fn sc1r(&mut self) -> SC1R_W { + SC1R_W::new(self, 5) } #[doc = "Bit 6 - CMP1 passive level set"] #[inline(always)] #[must_use] - pub fn sc1p(&mut self) -> SC1P_W<6> { - SC1P_W::new(self) + pub fn sc1p(&mut self) -> SC1P_W { + SC1P_W::new(self, 6) } #[doc = "Bit 8 - DAC2 run bit set"] #[inline(always)] #[must_use] - pub fn sd2r(&mut self) -> SD2R_W<8> { - SD2R_W::new(self) + pub fn sd2r(&mut self) -> SD2R_W { + SD2R_W::new(self, 8) } #[doc = "Bit 9 - CMP2 run bit set"] #[inline(always)] #[must_use] - pub fn sc2r(&mut self) -> SC2R_W<9> { - SC2R_W::new(self) + pub fn sc2r(&mut self) -> SC2R_W { + SC2R_W::new(self, 9) } #[doc = "Bit 10 - CMP2 passive level set"] #[inline(always)] #[must_use] - pub fn sc2p(&mut self) -> SC2P_W<10> { - SC2P_W::new(self) + pub fn sc2p(&mut self) -> SC2P_W { + SC2P_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global CSG run bit set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgsetg::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CSGSETG_SPEC; impl crate::RegisterSpec for CSGSETG_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [csgsetg::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`csgsetg::W`](W) writer structure"] impl crate::Writable for CSGSETG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/csgstatg.rs b/src/hrpwm0/csgstatg.rs index 7a41832d..0aa51c01 100644 --- a/src/hrpwm0/csgstatg.rs +++ b/src/hrpwm0/csgstatg.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `D0RB` reader - DAC0 run bit status"] pub type D0RB_R = crate::BitReader; #[doc = "DAC0 run bit status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl D0RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> D0RB_A { + pub const fn variant(&self) -> D0RB_A { match self.bits { false => D0RB_A::VALUE1, true => D0RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC0 is not running (control logic is disabled)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == D0RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC0 is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == D0RB_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl C0RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> C0RB_A { + pub const fn variant(&self) -> C0RB_A { match self.bits { false => C0RB_A::VALUE1, true => C0RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP0 functionality is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C0RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP0 functionality is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C0RB_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl PSLS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSLS0_A { + pub const fn variant(&self) -> PSLS0_A { match self.bits { false => PSLS0_A::VALUE1, true => PSLS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP0 output is not clamped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSLS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP0 output is clamped"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSLS0_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl D1RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> D1RB_A { + pub const fn variant(&self) -> D1RB_A { match self.bits { false => D1RB_A::VALUE1, true => D1RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC1 is not running (control logic is disabled)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == D1RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC1 is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == D1RB_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl C1RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> C1RB_A { + pub const fn variant(&self) -> C1RB_A { match self.bits { false => C1RB_A::VALUE1, true => C1RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP1 functionality is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C1RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP1 functionality is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C1RB_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PSLS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSLS1_A { + pub const fn variant(&self) -> PSLS1_A { match self.bits { false => PSLS1_A::VALUE1, true => PSLS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP1 output is not clamped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSLS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP1 output is clamped"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSLS1_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl D2RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> D2RB_A { + pub const fn variant(&self) -> D2RB_A { match self.bits { false => D2RB_A::VALUE1, true => D2RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DAC2 is not running (control logic is disabled)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == D2RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DAC1 is running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == D2RB_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl C2RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> C2RB_A { + pub const fn variant(&self) -> C2RB_A { match self.bits { false => C2RB_A::VALUE1, true => C2RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP2 functionality is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C2RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP2 functionality is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C2RB_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PSLS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSLS2_A { + pub const fn variant(&self) -> PSLS2_A { match self.bits { false => PSLS2_A::VALUE1, true => PSLS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP2 output is not clamped"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSLS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP2 output is clamped"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSLS2_A::VALUE2 @@ -384,15 +371,13 @@ impl R { PSLS2_R::new(((self.bits >> 10) & 1) != 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"] +#[doc = "Global CSG run bit status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csgstatg::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`csgstatg::R`](R) reader structure"] +impl crate::Readable for CSGSTATG_SPEC {} #[doc = "`reset()` method sets CSGSTATG to value 0"] impl crate::Resettable for CSGSTATG_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0/csgtrc.rs b/src/hrpwm0/csgtrc.rs index 53f1d9d9..18c4e1fc 100644 --- a/src/hrpwm0/csgtrc.rs +++ b/src/hrpwm0/csgtrc.rs @@ -1,64 +1,48 @@ #[doc = "Register `CSGTRC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `D0SEC` writer - DAC0 shadow transfer enable clear"] -pub type D0SEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRC_SPEC, bool, O>; +pub type D0SEC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `D1SEC` writer - DAC1 shadow transfer enable clear"] -pub type D1SEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRC_SPEC, bool, O>; +pub type D1SEC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `D2SEC` writer - DAC2 shadow transfer enable clear"] -pub type D2SEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRC_SPEC, bool, O>; +pub type D2SEC_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - DAC0 shadow transfer enable clear"] #[inline(always)] #[must_use] - pub fn d0sec(&mut self) -> D0SEC_W<0> { - D0SEC_W::new(self) + pub fn d0sec(&mut self) -> D0SEC_W { + D0SEC_W::new(self, 0) } #[doc = "Bit 4 - DAC1 shadow transfer enable clear"] #[inline(always)] #[must_use] - pub fn d1sec(&mut self) -> D1SEC_W<4> { - D1SEC_W::new(self) + pub fn d1sec(&mut self) -> D1SEC_W { + D1SEC_W::new(self, 4) } #[doc = "Bit 8 - DAC2 shadow transfer enable clear"] #[inline(always)] #[must_use] - pub fn d2sec(&mut self) -> D2SEC_W<8> { - D2SEC_W::new(self) + pub fn d2sec(&mut self) -> D2SEC_W { + D2SEC_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global CSG shadow trigger clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgtrc::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CSGTRC_SPEC; impl crate::RegisterSpec for CSGTRC_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [csgtrc::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`csgtrc::W`](W) writer structure"] impl crate::Writable for CSGTRC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/csgtrg.rs b/src/hrpwm0/csgtrg.rs index 3151a2d9..4e94a531 100644 --- a/src/hrpwm0/csgtrg.rs +++ b/src/hrpwm0/csgtrg.rs @@ -1,88 +1,72 @@ #[doc = "Register `CSGTRG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `D0SES` writer - DAC0 shadow transfer enable set"] -pub type D0SES_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRG_SPEC, bool, O>; +pub type D0SES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `D0SVS` writer - CMP0 inverting input switch request"] -pub type D0SVS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRG_SPEC, bool, O>; +pub type D0SVS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `D1SES` writer - DAC1 shadow transfer enable set"] -pub type D1SES_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRG_SPEC, bool, O>; +pub type D1SES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `D1SVS` writer - CMP1 inverting input switch request"] -pub type D1SVS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRG_SPEC, bool, O>; +pub type D1SVS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `D2SES` writer - DAC2 shadow transfer enable set"] -pub type D2SES_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRG_SPEC, bool, O>; +pub type D2SES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `D2SVS` writer - CMP2 inverting input switch request"] -pub type D2SVS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CSGTRG_SPEC, bool, O>; +pub type D2SVS_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - DAC0 shadow transfer enable set"] #[inline(always)] #[must_use] - pub fn d0ses(&mut self) -> D0SES_W<0> { - D0SES_W::new(self) + pub fn d0ses(&mut self) -> D0SES_W { + D0SES_W::new(self, 0) } #[doc = "Bit 1 - CMP0 inverting input switch request"] #[inline(always)] #[must_use] - pub fn d0svs(&mut self) -> D0SVS_W<1> { - D0SVS_W::new(self) + pub fn d0svs(&mut self) -> D0SVS_W { + D0SVS_W::new(self, 1) } #[doc = "Bit 4 - DAC1 shadow transfer enable set"] #[inline(always)] #[must_use] - pub fn d1ses(&mut self) -> D1SES_W<4> { - D1SES_W::new(self) + pub fn d1ses(&mut self) -> D1SES_W { + D1SES_W::new(self, 4) } #[doc = "Bit 5 - CMP1 inverting input switch request"] #[inline(always)] #[must_use] - pub fn d1svs(&mut self) -> D1SVS_W<5> { - D1SVS_W::new(self) + pub fn d1svs(&mut self) -> D1SVS_W { + D1SVS_W::new(self, 5) } #[doc = "Bit 8 - DAC2 shadow transfer enable set"] #[inline(always)] #[must_use] - pub fn d2ses(&mut self) -> D2SES_W<8> { - D2SES_W::new(self) + pub fn d2ses(&mut self) -> D2SES_W { + D2SES_W::new(self, 8) } #[doc = "Bit 9 - CMP2 inverting input switch request"] #[inline(always)] #[must_use] - pub fn d2svs(&mut self) -> D2SVS_W<9> { - D2SVS_W::new(self) + pub fn d2svs(&mut self) -> D2SVS_W { + D2SVS_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global CSG shadow/switch trigger\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`csgtrg::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CSGTRG_SPEC; impl crate::RegisterSpec for CSGTRG_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [csgtrg::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`csgtrg::W`](W) writer structure"] impl crate::Writable for CSGTRG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/csgtrsg.rs b/src/hrpwm0/csgtrsg.rs index 715f4242..806e5b4f 100644 --- a/src/hrpwm0/csgtrsg.rs +++ b/src/hrpwm0/csgtrsg.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `D0STE` reader - DAC0 shadow transfer enable"] pub type D0STE_R = crate::BitReader; #[doc = "DAC0 shadow transfer enable\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl D0STE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> D0STE_A { + pub const fn variant(&self) -> D0STE_A { match self.bits { false => D0STE_A::VALUE1, true => D0STE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has been performed."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == D0STE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested but is still pending completion."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == D0STE_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl SW0ST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SW0ST_A { + pub const fn variant(&self) -> SW0ST_A { match self.bits { false => SW0ST_A::VALUE1, true => SW0ST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Inverting input connected to HRPWMx.C0I\\[A\\]"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SW0ST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Inverting input connected to HRPWMx.C0I\\[B\\]"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SW0ST_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl D1STE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> D1STE_A { + pub const fn variant(&self) -> D1STE_A { match self.bits { false => D1STE_A::VALUE1, true => D1STE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has been performed."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == D1STE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested but is still pending completion."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == D1STE_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl SW1ST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SW1ST_A { + pub const fn variant(&self) -> SW1ST_A { match self.bits { false => SW1ST_A::VALUE1, true => SW1ST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Inverting input connected to HRPWMx.C1I\\[A\\]"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SW1ST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Inverting input connected to HRPWMx.C1I\\[B\\]"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SW1ST_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl D2STE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> D2STE_A { + pub const fn variant(&self) -> D2STE_A { match self.bits { false => D2STE_A::VALUE1, true => D2STE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer has been performed."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == D2STE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer has been requested but is still pending completion."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == D2STE_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl SW2ST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SW2ST_A { + pub const fn variant(&self) -> SW2ST_A { match self.bits { false => SW2ST_A::VALUE1, true => SW2ST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Inverting input connected to HRPWMx.C2I\\[A\\]"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SW2ST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Inverting input connected to HRPWMx.C2I\\[B\\]"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SW2ST_A::VALUE2 @@ -261,15 +248,13 @@ impl R { SW2ST_R::new(((self.bits >> 9) & 1) != 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"] +#[doc = "Global CSG shadow/switch status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csgtrsg::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`csgtrsg::R`](R) reader structure"] +impl crate::Readable for CSGTRSG_SPEC {} #[doc = "`reset()` method sets CSGTRSG to value 0"] impl crate::Resettable for CSGTRSG_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0/glbana.rs b/src/hrpwm0/glbana.rs index e39d791f..ffe6b8ea 100644 --- a/src/hrpwm0/glbana.rs +++ b/src/hrpwm0/glbana.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SLDLY` reader - Delay of lock detection"] -pub type SLDLY_R = crate::FieldReader; +pub type SLDLY_R = crate::FieldReader; #[doc = "Field `SLDLY` writer - Delay of lock detection"] -pub type SLDLY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLBANA_SPEC, u8, u8, 2, O>; +pub type SLDLY_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `FUP` reader - Force chargepump up"] -pub type FUP_R = crate::BitReader; +pub type FUP_R = crate::BitReader; #[doc = "Field `FUP` writer - Force chargepump up"] -pub type FUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLBANA_SPEC, bool, O>; +pub type FUP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FDN` reader - Force chargepump down"] -pub type FDN_R = crate::BitReader; +pub type FDN_R = crate::BitReader; #[doc = "Field `FDN` writer - Force chargepump down"] -pub type FDN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLBANA_SPEC, bool, O>; +pub type FDN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SLCP` reader - HRCs chargepump current selection"] -pub type SLCP_R = crate::FieldReader; +pub type SLCP_R = crate::FieldReader; #[doc = "Field `SLCP` writer - HRCs chargepump current selection"] -pub type SLCP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLBANA_SPEC, u8, u8, 3, O>; +pub type SLCP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `SLIBLDO` reader - HRCs LDO bias current"] -pub type SLIBLDO_R = crate::FieldReader; +pub type SLIBLDO_R = crate::FieldReader; #[doc = "Field `SLIBLDO` writer - HRCs LDO bias current"] -pub type SLIBLDO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLBANA_SPEC, u8, u8, 2, O>; +pub type SLIBLDO_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `SLIBLF` reader - HRCs loop filter bias current"] -pub type SLIBLF_R = crate::FieldReader; +pub type SLIBLF_R = crate::FieldReader; #[doc = "Field `SLIBLF` writer - HRCs loop filter bias current"] -pub type SLIBLF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLBANA_SPEC, u8, u8, 2, O>; +pub type SLIBLF_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `SLVREF` reader - Reference voltage for chargepump and loop filter"] -pub type SLVREF_R = crate::FieldReader; +pub type SLVREF_R = crate::FieldReader; #[doc = "Field `SLVREF` writer - Reference voltage for chargepump and loop filter"] -pub type SLVREF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLBANA_SPEC, u8, u8, 3, O>; +pub type SLVREF_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `TRIBIAS` reader - Bias trimming"] -pub type TRIBIAS_R = crate::FieldReader; +pub type TRIBIAS_R = crate::FieldReader; #[doc = "Field `TRIBIAS` writer - Bias trimming"] -pub type TRIBIAS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLBANA_SPEC, u8, u8, 2, O>; +pub type TRIBIAS_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `GHREN` reader - Force chargepump down"] pub type GHREN_R = crate::BitReader; #[doc = "Force chargepump down\n\nValue on reset: 0"] @@ -85,34 +53,37 @@ impl From for bool { impl GHREN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GHREN_A { + pub const fn variant(&self) -> GHREN_A { match self.bits { false => GHREN_A::VALUE1, true => GHREN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Global high resolution generation is enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GHREN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Global high resolution generation is disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GHREN_A::VALUE2 } } #[doc = "Field `GHREN` writer - Force chargepump down"] -pub type GHREN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLBANA_SPEC, GHREN_A, O>; -impl<'a, const O: u8> GHREN_W<'a, O> { +pub type GHREN_W<'a, REG> = crate::BitWriter<'a, REG, GHREN_A>; +impl<'a, REG> GHREN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Global high resolution generation is enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GHREN_A::VALUE1) } #[doc = "Global high resolution generation is disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GHREN_A::VALUE2) } } @@ -167,76 +138,77 @@ impl W { #[doc = "Bits 0:1 - Delay of lock detection"] #[inline(always)] #[must_use] - pub fn sldly(&mut self) -> SLDLY_W<0> { - SLDLY_W::new(self) + pub fn sldly(&mut self) -> SLDLY_W { + SLDLY_W::new(self, 0) } #[doc = "Bit 2 - Force chargepump up"] #[inline(always)] #[must_use] - pub fn fup(&mut self) -> FUP_W<2> { - FUP_W::new(self) + pub fn fup(&mut self) -> FUP_W { + FUP_W::new(self, 2) } #[doc = "Bit 3 - Force chargepump down"] #[inline(always)] #[must_use] - pub fn fdn(&mut self) -> FDN_W<3> { - FDN_W::new(self) + pub fn fdn(&mut self) -> FDN_W { + FDN_W::new(self, 3) } #[doc = "Bits 6:8 - HRCs chargepump current selection"] #[inline(always)] #[must_use] - pub fn slcp(&mut self) -> SLCP_W<6> { - SLCP_W::new(self) + pub fn slcp(&mut self) -> SLCP_W { + SLCP_W::new(self, 6) } #[doc = "Bits 9:10 - HRCs LDO bias current"] #[inline(always)] #[must_use] - pub fn slibldo(&mut self) -> SLIBLDO_W<9> { - SLIBLDO_W::new(self) + pub fn slibldo(&mut self) -> SLIBLDO_W { + SLIBLDO_W::new(self, 9) } #[doc = "Bits 11:12 - HRCs loop filter bias current"] #[inline(always)] #[must_use] - pub fn sliblf(&mut self) -> SLIBLF_W<11> { - SLIBLF_W::new(self) + pub fn sliblf(&mut self) -> SLIBLF_W { + SLIBLF_W::new(self, 11) } #[doc = "Bits 13:15 - Reference voltage for chargepump and loop filter"] #[inline(always)] #[must_use] - pub fn slvref(&mut self) -> SLVREF_W<13> { - SLVREF_W::new(self) + pub fn slvref(&mut self) -> SLVREF_W { + SLVREF_W::new(self, 13) } #[doc = "Bits 16:17 - Bias trimming"] #[inline(always)] #[must_use] - pub fn tribias(&mut self) -> TRIBIAS_W<16> { - TRIBIAS_W::new(self) + pub fn tribias(&mut self) -> TRIBIAS_W { + TRIBIAS_W::new(self, 16) } #[doc = "Bit 18 - Force chargepump down"] #[inline(always)] #[must_use] - pub fn ghren(&mut self) -> GHREN_W<18> { - GHREN_W::new(self) + pub fn ghren(&mut self) -> GHREN_W { + GHREN_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Analog Configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`glbana::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`glbana::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`glbana::R`](R) reader structure"] +impl crate::Readable for GLBANA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`glbana::W`](W) writer structure"] impl crate::Writable for GLBANA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/hrbsc.rs b/src/hrpwm0/hrbsc.rs index fb9a5ed4..b719f359 100644 --- a/src/hrpwm0/hrbsc.rs +++ b/src/hrpwm0/hrbsc.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SUSCFG` reader - Suspend configuration"] -pub type SUSCFG_R = crate::FieldReader; +pub type SUSCFG_R = crate::FieldReader; #[doc = "Suspend configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SUSCFG_A { + type Ux = u8; +} impl SUSCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SUSCFG_A::VALUE1), 1 => Some(SUSCFG_A::VALUE2), @@ -67,55 +38,59 @@ impl SUSCFG_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Suspend is ignored."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUSCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGy and HRCy units are halted."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUSCFG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Comparator outputs, HRPWMx.CyO are clamped to passive level and the CSGy units are halted. High resolution channel outputs, HRPWMx.HROUTy0 and HRPWMx.HROUTy1, are clamped to passive state and the HRCy units are halted."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SUSCFG_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGy units are halted. High resolution channel outputs, HRPWMx.HROUTy0 and HRPWMx.HROUTy1, are clamped to passive state and the HRCy units are halted."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SUSCFG_A::VALUE4 } } #[doc = "Field `SUSCFG` writer - Suspend configuration"] -pub type SUSCFG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HRBSC_SPEC, u8, SUSCFG_A, 3, O>; -impl<'a, const O: u8> SUSCFG_W<'a, O> { +pub type SUSCFG_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SUSCFG_A>; +impl<'a, REG> SUSCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Suspend is ignored."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE1) } #[doc = "CSGy and HRCy units are halted."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE2) } #[doc = "Comparator outputs, HRPWMx.CyO are clamped to passive level and the CSGy units are halted. High resolution channel outputs, HRPWMx.HROUTy0 and HRPWMx.HROUTy1, are clamped to passive state and the HRCy units are halted."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE3) } #[doc = "CSGy units are halted. High resolution channel outputs, HRPWMx.HROUTy0 and HRPWMx.HROUTy1, are clamped to passive state and the HRCy units are halted."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE4) } } #[doc = "Field `HRBE` reader - HRPWM bias enable"] -pub type HRBE_R = crate::BitReader; +pub type HRBE_R = crate::BitReader; #[doc = "Field `HRBE` writer - HRPWM bias enable"] -pub type HRBE_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRBSC_SPEC, bool, O>; +pub type HRBE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:2 - Suspend configuration"] #[inline(always)] @@ -132,34 +107,35 @@ impl W { #[doc = "Bits 0:2 - Suspend configuration"] #[inline(always)] #[must_use] - pub fn suscfg(&mut self) -> SUSCFG_W<0> { - SUSCFG_W::new(self) + pub fn suscfg(&mut self) -> SUSCFG_W { + SUSCFG_W::new(self, 0) } #[doc = "Bit 8 - HRPWM bias enable"] #[inline(always)] #[must_use] - pub fn hrbe(&mut self) -> HRBE_W<8> { - HRBE_W::new(self) + pub fn hrbe(&mut self) -> HRBE_W { + HRBE_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Bias and suspend configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hrbsc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hrbsc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hrbsc::R`](R) reader structure"] +impl crate::Readable for HRBSC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hrbsc::W`](W) writer structure"] impl crate::Writable for HRBSC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/hrccfg.rs b/src/hrpwm0/hrccfg.rs index 743b692e..e9107f25 100644 --- a/src/hrpwm0/hrccfg.rs +++ b/src/hrpwm0/hrccfg.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HRCPM` reader - High resolution channels power mode"] pub type HRCPM_R = crate::BitReader; #[doc = "High resolution channels power mode\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl HRCPM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRCPM_A { + pub const fn variant(&self) -> HRCPM_A { match self.bits { false => HRCPM_A::VALUE1, true => HRCPM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == HRCPM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "High resolution generation logic is ON. In this mode it is possible to generate a high resolution signal placement with the HRCy subunits."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRCPM_A::VALUE2 } } #[doc = "Field `HRCPM` writer - High resolution channels power mode"] -pub type HRCPM_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, HRCPM_A, O>; -impl<'a, const O: u8> HRCPM_W<'a, O> { +pub type HRCPM_W<'a, REG> = crate::BitWriter<'a, REG, HRCPM_A>; +impl<'a, REG> HRCPM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRCPM_A::VALUE1) } #[doc = "High resolution generation logic is ON. In this mode it is possible to generate a high resolution signal placement with the HRCy subunits."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRCPM_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl HRC0E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRC0E_A { + pub const fn variant(&self) -> HRC0E_A { match self.bits { false => HRC0E_A::VALUE1, true => HRC0E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == HRC0E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRC0 High Resolution Path is enabled. In this mode it is possible to generate a high resolution PWM signal if HRCPM = 1#."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRC0E_A::VALUE2 } } #[doc = "Field `HRC0E` writer - HRC0 high resolution enable"] -pub type HRC0E_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, HRC0E_A, O>; -impl<'a, const O: u8> HRC0E_W<'a, O> { +pub type HRC0E_W<'a, REG> = crate::BitWriter<'a, REG, HRC0E_A>; +impl<'a, REG> HRC0E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRC0E_A::VALUE1) } #[doc = "HRC0 High Resolution Path is enabled. In this mode it is possible to generate a high resolution PWM signal if HRCPM = 1#."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRC0E_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl HRC1E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRC1E_A { + pub const fn variant(&self) -> HRC1E_A { match self.bits { false => HRC1E_A::VALUE1, true => HRC1E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == HRC1E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRC1 High Resolution Path is enabled. In this mode it is possible to generate a high resolution PWM signal if HRCPM = 1#."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRC1E_A::VALUE2 } } #[doc = "Field `HRC1E` writer - HRC1 high resolution channel enable"] -pub type HRC1E_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, HRC1E_A, O>; -impl<'a, const O: u8> HRC1E_W<'a, O> { +pub type HRC1E_W<'a, REG> = crate::BitWriter<'a, REG, HRC1E_A>; +impl<'a, REG> HRC1E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRC1E_A::VALUE1) } #[doc = "HRC1 High Resolution Path is enabled. In this mode it is possible to generate a high resolution PWM signal if HRCPM = 1#."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRC1E_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl HRC2E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRC2E_A { + pub const fn variant(&self) -> HRC2E_A { match self.bits { false => HRC2E_A::VALUE1, true => HRC2E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == HRC2E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRC2 High Resolution Path is enabled. In this mode it is possible to generate a high resolution PWM signal if HRCPM = 1#."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRC2E_A::VALUE2 } } #[doc = "Field `HRC2E` writer - HRC2 high resolution channel enable"] -pub type HRC2E_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, HRC2E_A, O>; -impl<'a, const O: u8> HRC2E_W<'a, O> { +pub type HRC2E_W<'a, REG> = crate::BitWriter<'a, REG, HRC2E_A>; +impl<'a, REG> HRC2E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRC2E_A::VALUE1) } #[doc = "HRC2 High Resolution Path is enabled. In this mode it is possible to generate a high resolution PWM signal if HRCPM = 1#."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRC2E_A::VALUE2) } } @@ -253,39 +233,42 @@ impl From for bool { impl HRC3E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRC3E_A { + pub const fn variant(&self) -> HRC3E_A { match self.bits { false => HRC3E_A::VALUE1, true => HRC3E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == HRC3E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRC3 High Resolution Path is enabled. In this mode it is possible to generate a high resolution PWM signal if HRCPM = 1#."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRC3E_A::VALUE2 } } #[doc = "Field `HRC3E` writer - HRC3 high resolution channel enable"] -pub type HRC3E_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, HRC3E_A, O>; -impl<'a, const O: u8> HRC3E_W<'a, O> { +pub type HRC3E_W<'a, REG> = crate::BitWriter<'a, REG, HRC3E_A>; +impl<'a, REG> HRC3E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRC3E_A::VALUE1) } #[doc = "HRC3 High Resolution Path is enabled. In this mode it is possible to generate a high resolution PWM signal if HRCPM = 1#."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRC3E_A::VALUE2) } } #[doc = "Field `CLKC` reader - Clock information control"] -pub type CLKC_R = crate::FieldReader; +pub type CLKC_R = crate::FieldReader; #[doc = "Clock information control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -305,10 +288,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CLKC_A { + type Ux = u8; +} impl CLKC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLKC_A::VALUE1), 1 => Some(CLKC_A::VALUE2), @@ -317,48 +303,52 @@ impl CLKC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No clock frequency is selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CLKC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Module clock frequency is 180 MHz"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CLKC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Module clock frequency is 120 MHz"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLKC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Module clock frequency is 80 MHz"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLKC_A::VALUE4 } } #[doc = "Field `CLKC` writer - Clock information control"] -pub type CLKC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HRCCFG_SPEC, u8, CLKC_A, 3, O>; -impl<'a, const O: u8> CLKC_W<'a, O> { +pub type CLKC_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CLKC_A>; +impl<'a, REG> CLKC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No clock frequency is selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CLKC_A::VALUE1) } #[doc = "Module clock frequency is 180 MHz"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CLKC_A::VALUE2) } #[doc = "Module clock frequency is 120 MHz"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLKC_A::VALUE3) } #[doc = "Module clock frequency is 80 MHz"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLKC_A::VALUE4) } } @@ -381,34 +371,37 @@ impl From for bool { impl LRC0E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LRC0E_A { + pub const fn variant(&self) -> LRC0E_A { match self.bits { false => LRC0E_A::VALUE1, true => LRC0E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == LRC0E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRC0 Low Resolution Path is enabled. In this mode it is possible to generate a an output PWM signal via the Low Resolution Path."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LRC0E_A::VALUE2 } } #[doc = "Field `LRC0E` writer - HRC0 low resolution channel enable"] -pub type LRC0E_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, LRC0E_A, O>; -impl<'a, const O: u8> LRC0E_W<'a, O> { +pub type LRC0E_W<'a, REG> = crate::BitWriter<'a, REG, LRC0E_A>; +impl<'a, REG> LRC0E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LRC0E_A::VALUE1) } #[doc = "HRC0 Low Resolution Path is enabled. In this mode it is possible to generate a an output PWM signal via the Low Resolution Path."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LRC0E_A::VALUE2) } } @@ -431,34 +424,37 @@ impl From for bool { impl LRC1E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LRC1E_A { + pub const fn variant(&self) -> LRC1E_A { match self.bits { false => LRC1E_A::VALUE1, true => LRC1E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == LRC1E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRC1 Low Resolution Path is enabled. In this mode it is possible to generate a an output PWM signal via the Low Resolution Path."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LRC1E_A::VALUE2 } } #[doc = "Field `LRC1E` writer - HRC1 low resolution channel enable"] -pub type LRC1E_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, LRC1E_A, O>; -impl<'a, const O: u8> LRC1E_W<'a, O> { +pub type LRC1E_W<'a, REG> = crate::BitWriter<'a, REG, LRC1E_A>; +impl<'a, REG> LRC1E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LRC1E_A::VALUE1) } #[doc = "HRC1 Low Resolution Path is enabled. In this mode it is possible to generate a an output PWM signal via the Low Resolution Path."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LRC1E_A::VALUE2) } } @@ -481,34 +477,37 @@ impl From for bool { impl LRC2E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LRC2E_A { + pub const fn variant(&self) -> LRC2E_A { match self.bits { false => LRC2E_A::VALUE1, true => LRC2E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == LRC2E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRC2 Low Resolution Path is enabled. In this mode it is possible to generate a an output PWM signal via the Low Resolution Path."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LRC2E_A::VALUE2 } } #[doc = "Field `LRC2E` writer - HRC2 low resolution channel enable"] -pub type LRC2E_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, LRC2E_A, O>; -impl<'a, const O: u8> LRC2E_W<'a, O> { +pub type LRC2E_W<'a, REG> = crate::BitWriter<'a, REG, LRC2E_A>; +impl<'a, REG> LRC2E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LRC2E_A::VALUE1) } #[doc = "HRC2 Low Resolution Path is enabled. In this mode it is possible to generate a an output PWM signal via the Low Resolution Path."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LRC2E_A::VALUE2) } } @@ -531,34 +530,37 @@ impl From for bool { impl LRC3E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LRC3E_A { + pub const fn variant(&self) -> LRC3E_A { match self.bits { false => LRC3E_A::VALUE1, true => LRC3E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == LRC3E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRC3 Low Resolution Path is enabled. In this mode it is possible to generate a an output PWM signal via the Low Resolution Path."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LRC3E_A::VALUE2 } } #[doc = "Field `LRC3E` writer - HRC3 low resolution channel enable"] -pub type LRC3E_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCFG_SPEC, LRC3E_A, O>; -impl<'a, const O: u8> LRC3E_W<'a, O> { +pub type LRC3E_W<'a, REG> = crate::BitWriter<'a, REG, LRC3E_A>; +impl<'a, REG> LRC3E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LRC3E_A::VALUE1) } #[doc = "HRC3 Low Resolution Path is enabled. In this mode it is possible to generate a an output PWM signal via the Low Resolution Path."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LRC3E_A::VALUE2) } } @@ -618,82 +620,83 @@ impl W { #[doc = "Bit 0 - High resolution channels power mode"] #[inline(always)] #[must_use] - pub fn hrcpm(&mut self) -> HRCPM_W<0> { - HRCPM_W::new(self) + pub fn hrcpm(&mut self) -> HRCPM_W { + HRCPM_W::new(self, 0) } #[doc = "Bit 4 - HRC0 high resolution enable"] #[inline(always)] #[must_use] - pub fn hrc0e(&mut self) -> HRC0E_W<4> { - HRC0E_W::new(self) + pub fn hrc0e(&mut self) -> HRC0E_W { + HRC0E_W::new(self, 4) } #[doc = "Bit 5 - HRC1 high resolution channel enable"] #[inline(always)] #[must_use] - pub fn hrc1e(&mut self) -> HRC1E_W<5> { - HRC1E_W::new(self) + pub fn hrc1e(&mut self) -> HRC1E_W { + HRC1E_W::new(self, 5) } #[doc = "Bit 6 - HRC2 high resolution channel enable"] #[inline(always)] #[must_use] - pub fn hrc2e(&mut self) -> HRC2E_W<6> { - HRC2E_W::new(self) + pub fn hrc2e(&mut self) -> HRC2E_W { + HRC2E_W::new(self, 6) } #[doc = "Bit 7 - HRC3 high resolution channel enable"] #[inline(always)] #[must_use] - pub fn hrc3e(&mut self) -> HRC3E_W<7> { - HRC3E_W::new(self) + pub fn hrc3e(&mut self) -> HRC3E_W { + HRC3E_W::new(self, 7) } #[doc = "Bits 16:18 - Clock information control"] #[inline(always)] #[must_use] - pub fn clkc(&mut self) -> CLKC_W<16> { - CLKC_W::new(self) + pub fn clkc(&mut self) -> CLKC_W { + CLKC_W::new(self, 16) } #[doc = "Bit 20 - HRC0 low resolution channel enable"] #[inline(always)] #[must_use] - pub fn lrc0e(&mut self) -> LRC0E_W<20> { - LRC0E_W::new(self) + pub fn lrc0e(&mut self) -> LRC0E_W { + LRC0E_W::new(self, 20) } #[doc = "Bit 21 - HRC1 low resolution channel enable"] #[inline(always)] #[must_use] - pub fn lrc1e(&mut self) -> LRC1E_W<21> { - LRC1E_W::new(self) + pub fn lrc1e(&mut self) -> LRC1E_W { + LRC1E_W::new(self, 21) } #[doc = "Bit 22 - HRC2 low resolution channel enable"] #[inline(always)] #[must_use] - pub fn lrc2e(&mut self) -> LRC2E_W<22> { - LRC2E_W::new(self) + pub fn lrc2e(&mut self) -> LRC2E_W { + LRC2E_W::new(self, 22) } #[doc = "Bit 23 - HRC3 low resolution channel enable"] #[inline(always)] #[must_use] - pub fn lrc3e(&mut self) -> LRC3E_W<23> { - LRC3E_W::new(self) + pub fn lrc3e(&mut self) -> LRC3E_W { + LRC3E_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global HRC configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hrccfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hrccfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hrccfg::R`](R) reader structure"] +impl crate::Readable for HRCCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hrccfg::W`](W) writer structure"] impl crate::Writable for HRCCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/hrcctrg.rs b/src/hrpwm0/hrcctrg.rs index f860051d..2d2d1674 100644 --- a/src/hrpwm0/hrcctrg.rs +++ b/src/hrpwm0/hrcctrg.rs @@ -1,104 +1,88 @@ #[doc = "Register `HRCCTRG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `H0EC` writer - HRC0 high resolution values shadow transfer Enable Clear"] -pub type H0EC_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCTRG_SPEC, bool, O>; +pub type H0EC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H0DEC` writer - HRC0 dead time value shadow transfer Enable Clear"] -pub type H0DEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCTRG_SPEC, bool, O>; +pub type H0DEC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H1EC` writer - HRC1 high resolution values shadow transfer Enable Clear"] -pub type H1EC_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCTRG_SPEC, bool, O>; +pub type H1EC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H1DEC` writer - HRC1 dead time value shadow transfer Enable Clear"] -pub type H1DEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCTRG_SPEC, bool, O>; +pub type H1DEC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H2CEC` writer - HRC2 high resolution values shadow transfer Enable Clear"] -pub type H2CEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCTRG_SPEC, bool, O>; +pub type H2CEC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H2DEC` writer - HRC2 dead time value shadow transfer Enable Clear"] -pub type H2DEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCTRG_SPEC, bool, O>; +pub type H2DEC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H3EC` writer - HRC3 high resolution values shadow transfer Enable Clear"] -pub type H3EC_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCTRG_SPEC, bool, O>; +pub type H3EC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H3DEC` writer - HRC3 dead time value shadow transfer Enable Clear"] -pub type H3DEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCCTRG_SPEC, bool, O>; +pub type H3DEC_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - HRC0 high resolution values shadow transfer Enable Clear"] #[inline(always)] #[must_use] - pub fn h0ec(&mut self) -> H0EC_W<0> { - H0EC_W::new(self) + pub fn h0ec(&mut self) -> H0EC_W { + H0EC_W::new(self, 0) } #[doc = "Bit 1 - HRC0 dead time value shadow transfer Enable Clear"] #[inline(always)] #[must_use] - pub fn h0dec(&mut self) -> H0DEC_W<1> { - H0DEC_W::new(self) + pub fn h0dec(&mut self) -> H0DEC_W { + H0DEC_W::new(self, 1) } #[doc = "Bit 4 - HRC1 high resolution values shadow transfer Enable Clear"] #[inline(always)] #[must_use] - pub fn h1ec(&mut self) -> H1EC_W<4> { - H1EC_W::new(self) + pub fn h1ec(&mut self) -> H1EC_W { + H1EC_W::new(self, 4) } #[doc = "Bit 5 - HRC1 dead time value shadow transfer Enable Clear"] #[inline(always)] #[must_use] - pub fn h1dec(&mut self) -> H1DEC_W<5> { - H1DEC_W::new(self) + pub fn h1dec(&mut self) -> H1DEC_W { + H1DEC_W::new(self, 5) } #[doc = "Bit 8 - HRC2 high resolution values shadow transfer Enable Clear"] #[inline(always)] #[must_use] - pub fn h2cec(&mut self) -> H2CEC_W<8> { - H2CEC_W::new(self) + pub fn h2cec(&mut self) -> H2CEC_W { + H2CEC_W::new(self, 8) } #[doc = "Bit 9 - HRC2 dead time value shadow transfer Enable Clear"] #[inline(always)] #[must_use] - pub fn h2dec(&mut self) -> H2DEC_W<9> { - H2DEC_W::new(self) + pub fn h2dec(&mut self) -> H2DEC_W { + H2DEC_W::new(self, 9) } #[doc = "Bit 12 - HRC3 high resolution values shadow transfer Enable Clear"] #[inline(always)] #[must_use] - pub fn h3ec(&mut self) -> H3EC_W<12> { - H3EC_W::new(self) + pub fn h3ec(&mut self) -> H3EC_W { + H3EC_W::new(self, 12) } #[doc = "Bit 13 - HRC3 dead time value shadow transfer Enable Clear"] #[inline(always)] #[must_use] - pub fn h3dec(&mut self) -> H3DEC_W<13> { - H3DEC_W::new(self) + pub fn h3dec(&mut self) -> H3DEC_W { + H3DEC_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global HRC shadow trigger clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hrcctrg::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HRCCTRG_SPEC; impl crate::RegisterSpec for HRCCTRG_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [hrcctrg::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`hrcctrg::W`](W) writer structure"] impl crate::Writable for HRCCTRG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/hrcstrg.rs b/src/hrpwm0/hrcstrg.rs index 262a2f68..5aca9b1a 100644 --- a/src/hrpwm0/hrcstrg.rs +++ b/src/hrpwm0/hrcstrg.rs @@ -1,104 +1,88 @@ #[doc = "Register `HRCSTRG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `H0ES` writer - HRC0 high resolution values shadow transfer Enable Set"] -pub type H0ES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCSTRG_SPEC, bool, O>; +pub type H0ES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H0DES` writer - HRC0 dead time value shadow transfer enable set"] -pub type H0DES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCSTRG_SPEC, bool, O>; +pub type H0DES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H1ES` writer - HRC1 high resolution values shadow transfer Enable Set"] -pub type H1ES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCSTRG_SPEC, bool, O>; +pub type H1ES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H1DES` writer - HRC0 dead time value shadow transfer enable set"] -pub type H1DES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCSTRG_SPEC, bool, O>; +pub type H1DES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H2ES` writer - HRC2 high resolution values shadow transfer Enable Set"] -pub type H2ES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCSTRG_SPEC, bool, O>; +pub type H2ES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H2DES` writer - HRC0 dead time value shadow transfer enable set"] -pub type H2DES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCSTRG_SPEC, bool, O>; +pub type H2DES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H3ES` writer - HRC3 high resolution values shadow transfer Enable Set"] -pub type H3ES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCSTRG_SPEC, bool, O>; +pub type H3ES_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `H3DES` writer - HRC0 dead time value shadow transfer enable set"] -pub type H3DES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HRCSTRG_SPEC, bool, O>; +pub type H3DES_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - HRC0 high resolution values shadow transfer Enable Set"] #[inline(always)] #[must_use] - pub fn h0es(&mut self) -> H0ES_W<0> { - H0ES_W::new(self) + pub fn h0es(&mut self) -> H0ES_W { + H0ES_W::new(self, 0) } #[doc = "Bit 1 - HRC0 dead time value shadow transfer enable set"] #[inline(always)] #[must_use] - pub fn h0des(&mut self) -> H0DES_W<1> { - H0DES_W::new(self) + pub fn h0des(&mut self) -> H0DES_W { + H0DES_W::new(self, 1) } #[doc = "Bit 4 - HRC1 high resolution values shadow transfer Enable Set"] #[inline(always)] #[must_use] - pub fn h1es(&mut self) -> H1ES_W<4> { - H1ES_W::new(self) + pub fn h1es(&mut self) -> H1ES_W { + H1ES_W::new(self, 4) } #[doc = "Bit 5 - HRC0 dead time value shadow transfer enable set"] #[inline(always)] #[must_use] - pub fn h1des(&mut self) -> H1DES_W<5> { - H1DES_W::new(self) + pub fn h1des(&mut self) -> H1DES_W { + H1DES_W::new(self, 5) } #[doc = "Bit 8 - HRC2 high resolution values shadow transfer Enable Set"] #[inline(always)] #[must_use] - pub fn h2es(&mut self) -> H2ES_W<8> { - H2ES_W::new(self) + pub fn h2es(&mut self) -> H2ES_W { + H2ES_W::new(self, 8) } #[doc = "Bit 9 - HRC0 dead time value shadow transfer enable set"] #[inline(always)] #[must_use] - pub fn h2des(&mut self) -> H2DES_W<9> { - H2DES_W::new(self) + pub fn h2des(&mut self) -> H2DES_W { + H2DES_W::new(self, 9) } #[doc = "Bit 12 - HRC3 high resolution values shadow transfer Enable Set"] #[inline(always)] #[must_use] - pub fn h3es(&mut self) -> H3ES_W<12> { - H3ES_W::new(self) + pub fn h3es(&mut self) -> H3ES_W { + H3ES_W::new(self, 12) } #[doc = "Bit 13 - HRC0 dead time value shadow transfer enable set"] #[inline(always)] #[must_use] - pub fn h3des(&mut self) -> H3DES_W<13> { - H3DES_W::new(self) + pub fn h3des(&mut self) -> H3DES_W { + H3DES_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global HRC shadow trigger set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hrcstrg::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HRCSTRG_SPEC; impl crate::RegisterSpec for HRCSTRG_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [hrcstrg::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`hrcstrg::W`](W) writer structure"] impl crate::Writable for HRCSTRG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0/hrcstsg.rs b/src/hrpwm0/hrcstsg.rs index 309bba25..26742d50 100644 --- a/src/hrpwm0/hrcstsg.rs +++ b/src/hrpwm0/hrcstsg.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `H0STE` reader - HRC0 high resolution values shadow transfer status"] pub type H0STE_R = crate::BitReader; #[doc = "HRC0 high resolution values shadow transfer status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl H0STE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> H0STE_A { + pub const fn variant(&self) -> H0STE_A { match self.bits { false => H0STE_A::VALUE1, true => H0STE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No shadow transfer pending 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"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == H0STE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer pending 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"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == H0STE_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl H0DSTE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> H0DSTE_A { + pub const fn variant(&self) -> H0DSTE_A { match self.bits { false => H0DSTE_A::VALUE1, true => H0DSTE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No shadow transfer pending 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"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == H0DSTE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer pending 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"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == H0DSTE_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl H1STE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> H1STE_A { + pub const fn variant(&self) -> H1STE_A { match self.bits { false => H1STE_A::VALUE1, true => H1STE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No shadow transfer pending 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"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == H1STE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer pending 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"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == H1STE_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl H1DSTE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> H1DSTE_A { + pub const fn variant(&self) -> H1DSTE_A { match self.bits { false => H1DSTE_A::VALUE1, true => H1DSTE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No shadow transfer pending 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"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == H1DSTE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer pending 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"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == H1DSTE_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl H2STE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> H2STE_A { + pub const fn variant(&self) -> H2STE_A { match self.bits { false => H2STE_A::VALUE1, true => H2STE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No shadow transfer pending 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"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == H2STE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer pending 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"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == H2STE_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl H2DSTE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> H2DSTE_A { + pub const fn variant(&self) -> H2DSTE_A { match self.bits { false => H2DSTE_A::VALUE1, true => H2DSTE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No shadow transfer pending 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"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == H2DSTE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer pending 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"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == H2DSTE_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl H3STE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> H3STE_A { + pub const fn variant(&self) -> H3STE_A { match self.bits { false => H3STE_A::VALUE1, true => H3STE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No shadow transfer pending 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"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == H3STE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer pending 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"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == H3STE_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl H3DSTE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> H3DSTE_A { + pub const fn variant(&self) -> H3DSTE_A { match self.bits { false => H3DSTE_A::VALUE1, true => H3DSTE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No shadow transfer pending 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"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == H3DSTE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer pending 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"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == H3DSTE_A::VALUE2 @@ -343,15 +330,13 @@ impl R { H3DSTE_R::new(((self.bits >> 13) & 1) != 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"] +#[doc = "Global HRC shadow transfer status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hrcstsg::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`hrcstsg::R`](R) reader structure"] +impl crate::Readable for HRCSTSG_SPEC {} #[doc = "`reset()` method sets HRCSTSG to value 0"] impl crate::Resettable for HRCSTSG_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0/hrghrs.rs b/src/hrpwm0/hrghrs.rs index d5d3c338..f9e5ad23 100644 --- a/src/hrpwm0/hrghrs.rs +++ b/src/hrpwm0/hrghrs.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `HRGR` reader - High Resolution Generation Ready"] pub type HRGR_R = crate::BitReader; #[doc = "High Resolution Generation Ready\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl HRGR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRGR_A { + pub const fn variant(&self) -> HRGR_A { match self.bits { false => HRGR_A::VALUE1, true => HRGR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "High resolution logic is not working"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HRGR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "High resolution logic is working"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRGR_A::VALUE2 @@ -56,15 +43,13 @@ impl R { HRGR_R::new((self.bits & 1) != 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"] +#[doc = "High Resolution Generation Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hrghrs::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`hrghrs::R`](R) reader structure"] +impl crate::Readable for HRGHRS_SPEC {} #[doc = "`reset()` method sets HRGHRS to value 0"] impl crate::Resettable for HRGHRS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0/midr.rs b/src/hrpwm0/midr.rs index c8e9cbe5..4409d43a 100644 --- a/src/hrpwm0/midr.rs +++ b/src/hrpwm0/midr.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MODR` reader - Module Revision"] -pub type MODR_R = crate::FieldReader; +pub type MODR_R = crate::FieldReader; #[doc = "Field `MODT` reader - Module Type"] -pub type MODT_R = crate::FieldReader; +pub type MODT_R = crate::FieldReader; #[doc = "Field `MODN` reader - Module Number"] -pub type MODN_R = crate::FieldReader; +pub type MODN_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module identification register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`midr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`midr::R`](R) reader structure"] +impl crate::Readable for MIDR_SPEC {} #[doc = "`reset()` method sets MIDR to value 0x00a9_c000"] impl crate::Resettable for MIDR_SPEC { const RESET_VALUE: Self::Ux = 0x00a9_c000; diff --git a/src/hrpwm0_csg0.rs b/src/hrpwm0_csg0.rs index 0246ab7e..ef8dbadb 100644 --- a/src/hrpwm0_csg0.rs +++ b/src/hrpwm0_csg0.rs @@ -1,100 +1,182 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + dci: DCI, + ies: IES, + sc: SC, + pc: PC, + dsv1: DSV1, + dsv2: DSV2, + sdsv1: SDSV1, + spc: SPC, + cc: CC, + plc: PLC, + blv: BLV, + sre: SRE, + srs: SRS, + sws: SWS, + swc: SWC, + istat: ISTAT, +} +impl RegisterBlock { #[doc = "0x00 - External input selection"] - pub dci: DCI, + #[inline(always)] + pub const fn dci(&self) -> &DCI { + &self.dci + } #[doc = "0x04 - External input selection"] - pub ies: IES, + #[inline(always)] + pub const fn ies(&self) -> &IES { + &self.ies + } #[doc = "0x08 - Slope generation control"] - pub sc: SC, + #[inline(always)] + pub const fn sc(&self) -> &SC { + &self.sc + } #[doc = "0x0c - Pulse swallow configuration"] - pub pc: PC, + #[inline(always)] + pub const fn pc(&self) -> &PC { + &self.pc + } #[doc = "0x10 - DAC reference value 1"] - pub dsv1: DSV1, + #[inline(always)] + pub const fn dsv1(&self) -> &DSV1 { + &self.dsv1 + } #[doc = "0x14 - DAC reference value 1"] - pub dsv2: DSV2, + #[inline(always)] + pub const fn dsv2(&self) -> &DSV2 { + &self.dsv2 + } #[doc = "0x18 - Shadow reference value 1"] - pub sdsv1: SDSV1, + #[inline(always)] + pub const fn sdsv1(&self) -> &SDSV1 { + &self.sdsv1 + } #[doc = "0x1c - Shadow Pulse swallow value"] - pub spc: SPC, + #[inline(always)] + pub const fn spc(&self) -> &SPC { + &self.spc + } #[doc = "0x20 - Comparator configuration"] - pub cc: CC, + #[inline(always)] + pub const fn cc(&self) -> &CC { + &self.cc + } #[doc = "0x24 - Passive level configuration"] - pub plc: PLC, + #[inline(always)] + pub const fn plc(&self) -> &PLC { + &self.plc + } #[doc = "0x28 - Comparator blanking value"] - pub blv: BLV, + #[inline(always)] + pub const fn blv(&self) -> &BLV { + &self.blv + } #[doc = "0x2c - Service request enable"] - pub sre: SRE, + #[inline(always)] + pub const fn sre(&self) -> &SRE { + &self.sre + } #[doc = "0x30 - Service request line selector"] - pub srs: SRS, + #[inline(always)] + pub const fn srs(&self) -> &SRS { + &self.srs + } #[doc = "0x34 - Service request SW set"] - pub sws: SWS, + #[inline(always)] + pub const fn sws(&self) -> &SWS { + &self.sws + } #[doc = "0x38 - Service request SW clear"] - pub swc: SWC, + #[inline(always)] + pub const fn swc(&self) -> &SWC { + &self.swc + } #[doc = "0x3c - Service request status"] - pub istat: ISTAT, + #[inline(always)] + pub const fn istat(&self) -> &ISTAT { + &self.istat + } } -#[doc = "DCI (rw) register accessor: an alias for `Reg`"] +#[doc = "DCI (rw) register accessor: External input selection\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dci::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dci::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dci`] +module"] pub type DCI = crate::Reg; #[doc = "External input selection"] pub mod dci; -#[doc = "IES (rw) register accessor: an alias for `Reg`"] +#[doc = "IES (rw) register accessor: External input selection\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ies::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ies::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ies`] +module"] pub type IES = crate::Reg; #[doc = "External input selection"] pub mod ies; -#[doc = "SC (rw) register accessor: an alias for `Reg`"] +#[doc = "SC (rw) register accessor: Slope generation control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sc`] +module"] pub type SC = crate::Reg; #[doc = "Slope generation control"] pub mod sc; -#[doc = "PC (r) register accessor: an alias for `Reg`"] +#[doc = "PC (r) register accessor: Pulse swallow configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pc::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pc`] +module"] pub type PC = crate::Reg; #[doc = "Pulse swallow configuration"] pub mod pc; -#[doc = "DSV1 (r) register accessor: an alias for `Reg`"] +#[doc = "DSV1 (r) register accessor: DAC reference value 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsv1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dsv1`] +module"] pub type DSV1 = crate::Reg; #[doc = "DAC reference value 1"] pub mod dsv1; -#[doc = "DSV2 (rw) register accessor: an alias for `Reg`"] +#[doc = "DSV2 (rw) register accessor: DAC reference value 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsv2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dsv2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dsv2`] +module"] pub type DSV2 = crate::Reg; #[doc = "DAC reference value 1"] pub mod dsv2; -#[doc = "SDSV1 (rw) register accessor: an alias for `Reg`"] +#[doc = "SDSV1 (rw) register accessor: Shadow reference value 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sdsv1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sdsv1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sdsv1`] +module"] pub type SDSV1 = crate::Reg; #[doc = "Shadow reference value 1"] pub mod sdsv1; -#[doc = "SPC (rw) register accessor: an alias for `Reg`"] +#[doc = "SPC (rw) register accessor: Shadow Pulse swallow value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`spc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`spc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@spc`] +module"] pub type SPC = crate::Reg; #[doc = "Shadow Pulse swallow value"] pub mod spc; -#[doc = "CC (rw) register accessor: an alias for `Reg`"] +#[doc = "CC (rw) register accessor: Comparator configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cc`] +module"] pub type CC = crate::Reg; #[doc = "Comparator configuration"] pub mod cc; -#[doc = "PLC (rw) register accessor: an alias for `Reg`"] +#[doc = "PLC (rw) register accessor: Passive level configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`plc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`plc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@plc`] +module"] pub type PLC = crate::Reg; #[doc = "Passive level configuration"] pub mod plc; -#[doc = "BLV (rw) register accessor: an alias for `Reg`"] +#[doc = "BLV (rw) register accessor: Comparator blanking value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`blv::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`blv::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@blv`] +module"] pub type BLV = crate::Reg; #[doc = "Comparator blanking value"] pub mod blv; -#[doc = "SRE (rw) register accessor: an alias for `Reg`"] +#[doc = "SRE (rw) register accessor: Service request enable\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sre::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sre::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sre`] +module"] pub type SRE = crate::Reg; #[doc = "Service request enable"] pub mod sre; -#[doc = "SRS (rw) register accessor: an alias for `Reg`"] +#[doc = "SRS (rw) register accessor: Service request line selector\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srs`] +module"] pub type SRS = crate::Reg; #[doc = "Service request line selector"] pub mod srs; -#[doc = "SWS (w) register accessor: an alias for `Reg`"] +#[doc = "SWS (w) register accessor: Service request SW set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sws::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sws`] +module"] pub type SWS = crate::Reg; #[doc = "Service request SW set"] pub mod sws; -#[doc = "SWC (w) register accessor: an alias for `Reg`"] +#[doc = "SWC (w) register accessor: Service request SW clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`swc::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@swc`] +module"] pub type SWC = crate::Reg; #[doc = "Service request SW clear"] pub mod swc; -#[doc = "ISTAT (r) register accessor: an alias for `Reg`"] +#[doc = "ISTAT (r) register accessor: Service request status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`istat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@istat`] +module"] 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 134f39f9..bb70812c 100644 --- a/src/hrpwm0_csg0/blv.rs +++ b/src/hrpwm0_csg0/blv.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BLV` reader - Blanking value"] -pub type BLV_R = crate::FieldReader; +pub type BLV_R = crate::FieldReader; #[doc = "Field `BLV` writer - Blanking value"] -pub type BLV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BLV_SPEC, u8, u8, 8, O>; +pub type BLV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Blanking value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:7 - Blanking value"] #[inline(always)] #[must_use] - pub fn blv(&mut self) -> BLV_W<0> { - BLV_W::new(self) + pub fn blv(&mut self) -> BLV_W { + BLV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Comparator blanking value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`blv::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`blv::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`blv::R`](R) reader structure"] +impl crate::Readable for BLV_SPEC {} +#[doc = "`write(|w| ..)` method takes [`blv::W`](W) writer structure"] impl crate::Writable for BLV_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/cc.rs b/src/hrpwm0_csg0/cc.rs index 1da185a4..e0dc1d51 100644 --- a/src/hrpwm0_csg0/cc.rs +++ b/src/hrpwm0_csg0/cc.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `IBS` reader - External blanking trigger selector"] -pub type IBS_R = crate::FieldReader; +pub type IBS_R = crate::FieldReader; #[doc = "External blanking trigger selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -79,10 +47,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for IBS_A { + type Ux = u8; +} impl IBS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IBS_A { + pub const fn variant(&self) -> IBS_A { match self.bits { 0 => IBS_A::VALUE1, 1 => IBS_A::VALUE2, @@ -103,168 +74,172 @@ impl IBS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.BLyA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IBS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.BLyB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IBS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HRPWMx.BLyC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == IBS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "HRPWMx.BLyD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == IBS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "HRPWMx.BLyE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == IBS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "HRPWMx.BLyF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == IBS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "HRPWMx.BLyG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == IBS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "HRPWMx.BLyH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == IBS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "HRPWMx.BLyI"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == IBS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "HRPWMx.BLyJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == IBS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "HRPWMx.BLyK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == IBS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "HRPWMx.BLyL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == IBS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "HRPWMx.BLyM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == IBS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "HRPWMx.BLyN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == IBS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "HRPWMx.BLyO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == IBS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "HRPWMx.BLyP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == IBS_A::VALUE16 } } #[doc = "Field `IBS` writer - External blanking trigger selector"] -pub type IBS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CC_SPEC, u8, IBS_A, 4, O>; -impl<'a, const O: u8> IBS_W<'a, O> { +pub type IBS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, IBS_A>; +impl<'a, REG> IBS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "HRPWMx.BLyA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE1) } #[doc = "HRPWMx.BLyB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE2) } #[doc = "HRPWMx.BLyC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE3) } #[doc = "HRPWMx.BLyD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE4) } #[doc = "HRPWMx.BLyE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE5) } #[doc = "HRPWMx.BLyF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE6) } #[doc = "HRPWMx.BLyG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE7) } #[doc = "HRPWMx.BLyH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE8) } #[doc = "HRPWMx.BLyI"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE9) } #[doc = "HRPWMx.BLyJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE10) } #[doc = "HRPWMx.BLyK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE11) } #[doc = "HRPWMx.BLyL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE12) } #[doc = "HRPWMx.BLyM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE13) } #[doc = "HRPWMx.BLyN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE14) } #[doc = "HRPWMx.BLyO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE15) } #[doc = "HRPWMx.BLyP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(IBS_A::VALUE16) } } @@ -287,39 +262,42 @@ impl From for bool { impl IMCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IMCS_A { + pub const fn variant(&self) -> IMCS_A { match self.bits { false => IMCS_A::VALUE1, true => IMCS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.CyINA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IMCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.CyINB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IMCS_A::VALUE2 } } #[doc = "Field `IMCS` writer - Inverting comparator input selector"] -pub type IMCS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CC_SPEC, IMCS_A, O>; -impl<'a, const O: u8> IMCS_W<'a, O> { +pub type IMCS_W<'a, REG> = crate::BitWriter<'a, REG, IMCS_A>; +impl<'a, REG> IMCS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HRPWMx.CyINA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IMCS_A::VALUE1) } #[doc = "HRPWMx.CyINB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IMCS_A::VALUE2) } } #[doc = "Field `IMCC` reader - Comparator input switching configuration"] -pub type IMCC_R = crate::FieldReader; +pub type IMCC_R = crate::FieldReader; #[doc = "Comparator input switching configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -337,10 +315,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for IMCC_A { + type Ux = u8; +} impl IMCC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(IMCC_A::VALUE1), 1 => Some(IMCC_A::VALUE2), @@ -348,55 +329,59 @@ impl IMCC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dynamic switch disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IMCC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Comparator input is connected to HRPWMx.CyINB when the control signal is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IMCC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Comparator input is connected to HRPWMx.CyINA when the control signal is HIGH"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == IMCC_A::VALUE3 } } #[doc = "Field `IMCC` writer - Comparator input switching configuration"] -pub type IMCC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CC_SPEC, u8, IMCC_A, 2, O>; -impl<'a, const O: u8> IMCC_W<'a, O> { +pub type IMCC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, IMCC_A>; +impl<'a, REG> IMCC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Dynamic switch disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IMCC_A::VALUE1) } #[doc = "Comparator input is connected to HRPWMx.CyINB when the control signal is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IMCC_A::VALUE2) } #[doc = "Comparator input is connected to HRPWMx.CyINA when the control signal is HIGH"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(IMCC_A::VALUE3) } } #[doc = "Field `ESE` reader - External triggered switch enable"] -pub type ESE_R = crate::BitReader; +pub type ESE_R = crate::BitReader; #[doc = "Field `ESE` writer - External triggered switch enable"] -pub type ESE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CC_SPEC, bool, O>; +pub type ESE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OIE` reader - Comparator output inversion enable"] -pub type OIE_R = crate::BitReader; +pub type OIE_R = crate::BitReader; #[doc = "Field `OIE` writer - Comparator output inversion enable"] -pub type OIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CC_SPEC, bool, O>; +pub type OIE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OSE` reader - Comparator output synchronization enable"] -pub type OSE_R = crate::BitReader; +pub type OSE_R = crate::BitReader; #[doc = "Field `OSE` writer - Comparator output synchronization enable"] -pub type OSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CC_SPEC, bool, O>; +pub type OSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BLMC` reader - Blanking mode"] -pub type BLMC_R = crate::FieldReader; +pub type BLMC_R = crate::FieldReader; #[doc = "Blanking mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -416,10 +401,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BLMC_A { + type Ux = u8; +} impl BLMC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BLMC_A { + pub const fn variant(&self) -> BLMC_A { match self.bits { 0 => BLMC_A::VALUE1, 1 => BLMC_A::VALUE2, @@ -428,55 +416,59 @@ impl BLMC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Blanking disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BLMC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Blanking on a LOW to HIGH transition"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BLMC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Blanking on a HIGH to LOW transition"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BLMC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Blanking on both transitions"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BLMC_A::VALUE4 } } #[doc = "Field `BLMC` writer - Blanking mode"] -pub type BLMC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CC_SPEC, u8, BLMC_A, 2, O>; -impl<'a, const O: u8> BLMC_W<'a, O> { +pub type BLMC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, BLMC_A>; +impl<'a, REG> BLMC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Blanking disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BLMC_A::VALUE1) } #[doc = "Blanking on a LOW to HIGH transition"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BLMC_A::VALUE2) } #[doc = "Blanking on a HIGH to LOW transition"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BLMC_A::VALUE3) } #[doc = "Blanking on both transitions"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BLMC_A::VALUE4) } } #[doc = "Field `EBE` reader - External blanking trigger enabled"] -pub type EBE_R = crate::BitReader; +pub type EBE_R = crate::BitReader; #[doc = "Field `EBE` writer - External blanking trigger enabled"] -pub type EBE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CC_SPEC, bool, O>; +pub type EBE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `COFE` reader - Comparator output filter enable"] pub type COFE_R = crate::BitReader; #[doc = "Comparator output filter enable\n\nValue on reset: 0"] @@ -496,39 +488,42 @@ impl From for bool { impl COFE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> COFE_A { + pub const fn variant(&self) -> COFE_A { match self.bits { false => COFE_A::VALUE1, true => COFE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Filtering stage disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == COFE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Filtering stage enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == COFE_A::VALUE2 } } #[doc = "Field `COFE` writer - Comparator output filter enable"] -pub type COFE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CC_SPEC, COFE_A, O>; -impl<'a, const O: u8> COFE_W<'a, O> { +pub type COFE_W<'a, REG> = crate::BitWriter<'a, REG, COFE_A>; +impl<'a, REG> COFE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Filtering stage disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(COFE_A::VALUE1) } #[doc = "Filtering stage enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(COFE_A::VALUE2) } } #[doc = "Field `COFM` reader - Comparator output filter window"] -pub type COFM_R = crate::FieldReader; +pub type COFM_R = crate::FieldReader; #[doc = "Comparator output filter window\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -556,10 +551,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for COFM_A { + type Ux = u8; +} impl COFM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(COFM_A::VALUE1), 1 => Some(COFM_A::VALUE2), @@ -572,93 +570,97 @@ impl COFM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Comparator Output needs to be stable for 2 clock cycles"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == COFM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Comparator Output needs to be stable for 3 clock cycles"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == COFM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Comparator Output needs to be stable for 4 clock cycles"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == COFM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Comparator Output needs to be stable for 5 clock cycles"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == COFM_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Comparator Output needs to be stable for 14 clock cycles"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == COFM_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Comparator Output needs to be stable for 15 clock cycles"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == COFM_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Comparator Output needs to be stable for 16 clock cycles"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == COFM_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Comparator Output needs to be stable for 32 clock cycles"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == COFM_A::VALUE8 } } #[doc = "Field `COFM` writer - Comparator output filter window"] -pub type COFM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CC_SPEC, u8, COFM_A, 4, O>; -impl<'a, const O: u8> COFM_W<'a, O> { +pub type COFM_W<'a, REG> = crate::FieldWriter<'a, REG, 4, COFM_A>; +impl<'a, REG> COFM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Comparator Output needs to be stable for 2 clock cycles"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(COFM_A::VALUE1) } #[doc = "Comparator Output needs to be stable for 3 clock cycles"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(COFM_A::VALUE2) } #[doc = "Comparator Output needs to be stable for 4 clock cycles"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(COFM_A::VALUE3) } #[doc = "Comparator Output needs to be stable for 5 clock cycles"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(COFM_A::VALUE4) } #[doc = "Comparator Output needs to be stable for 14 clock cycles"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(COFM_A::VALUE5) } #[doc = "Comparator Output needs to be stable for 15 clock cycles"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(COFM_A::VALUE6) } #[doc = "Comparator Output needs to be stable for 16 clock cycles"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(COFM_A::VALUE7) } #[doc = "Comparator Output needs to be stable for 32 clock cycles"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(COFM_A::VALUE8) } } #[doc = "Field `COFC` reader - Comparator output filter control"] -pub type COFC_R = crate::FieldReader; +pub type COFC_R = crate::FieldReader; #[doc = "Comparator output filter control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -676,10 +678,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for COFC_A { + type Ux = u8; +} impl COFC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(COFC_A::VALUE1), 1 => Some(COFC_A::VALUE2), @@ -687,38 +692,42 @@ impl COFC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Filtering is always done if enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == COFC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Filtering is only done when CSGyDSV1 value is currently fed to the DAC"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == COFC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Filtering is only done when the CSGyDSV2 value is currently fed to the DAC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == COFC_A::VALUE3 } } #[doc = "Field `COFC` writer - Comparator output filter control"] -pub type COFC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CC_SPEC, u8, COFC_A, 2, O>; -impl<'a, const O: u8> COFC_W<'a, O> { +pub type COFC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, COFC_A>; +impl<'a, REG> COFC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Filtering is always done if enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(COFC_A::VALUE1) } #[doc = "Filtering is only done when CSGyDSV1 value is currently fed to the DAC"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(COFC_A::VALUE2) } #[doc = "Filtering is only done when the CSGyDSV2 value is currently fed to the DAC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(COFC_A::VALUE3) } } @@ -783,88 +792,89 @@ impl W { #[doc = "Bits 0:3 - External blanking trigger selector"] #[inline(always)] #[must_use] - pub fn ibs(&mut self) -> IBS_W<0> { - IBS_W::new(self) + pub fn ibs(&mut self) -> IBS_W { + IBS_W::new(self, 0) } #[doc = "Bit 8 - Inverting comparator input selector"] #[inline(always)] #[must_use] - pub fn imcs(&mut self) -> IMCS_W<8> { - IMCS_W::new(self) + pub fn imcs(&mut self) -> IMCS_W { + IMCS_W::new(self, 8) } #[doc = "Bits 9:10 - Comparator input switching configuration"] #[inline(always)] #[must_use] - pub fn imcc(&mut self) -> IMCC_W<9> { - IMCC_W::new(self) + pub fn imcc(&mut self) -> IMCC_W { + IMCC_W::new(self, 9) } #[doc = "Bit 11 - External triggered switch enable"] #[inline(always)] #[must_use] - pub fn ese(&mut self) -> ESE_W<11> { - ESE_W::new(self) + pub fn ese(&mut self) -> ESE_W { + ESE_W::new(self, 11) } #[doc = "Bit 12 - Comparator output inversion enable"] #[inline(always)] #[must_use] - pub fn oie(&mut self) -> OIE_W<12> { - OIE_W::new(self) + pub fn oie(&mut self) -> OIE_W { + OIE_W::new(self, 12) } #[doc = "Bit 13 - Comparator output synchronization enable"] #[inline(always)] #[must_use] - pub fn ose(&mut self) -> OSE_W<13> { - OSE_W::new(self) + pub fn ose(&mut self) -> OSE_W { + OSE_W::new(self, 13) } #[doc = "Bits 14:15 - Blanking mode"] #[inline(always)] #[must_use] - pub fn blmc(&mut self) -> BLMC_W<14> { - BLMC_W::new(self) + pub fn blmc(&mut self) -> BLMC_W { + BLMC_W::new(self, 14) } #[doc = "Bit 16 - External blanking trigger enabled"] #[inline(always)] #[must_use] - pub fn ebe(&mut self) -> EBE_W<16> { - EBE_W::new(self) + pub fn ebe(&mut self) -> EBE_W { + EBE_W::new(self, 16) } #[doc = "Bit 17 - Comparator output filter enable"] #[inline(always)] #[must_use] - pub fn cofe(&mut self) -> COFE_W<17> { - COFE_W::new(self) + pub fn cofe(&mut self) -> COFE_W { + COFE_W::new(self, 17) } #[doc = "Bits 18:21 - Comparator output filter window"] #[inline(always)] #[must_use] - pub fn cofm(&mut self) -> COFM_W<18> { - COFM_W::new(self) + pub fn cofm(&mut self) -> COFM_W { + COFM_W::new(self, 18) } #[doc = "Bits 24:25 - Comparator output filter control"] #[inline(always)] #[must_use] - pub fn cofc(&mut self) -> COFC_W<24> { - COFC_W::new(self) + pub fn cofc(&mut self) -> COFC_W { + COFC_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Comparator configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cc::R`](R) reader structure"] +impl crate::Readable for CC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cc::W`](W) writer structure"] impl crate::Writable for CC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/dci.rs b/src/hrpwm0_csg0/dci.rs index 187232c2..ae3264d1 100644 --- a/src/hrpwm0_csg0/dci.rs +++ b/src/hrpwm0_csg0/dci.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SVIS` reader - Value Selector input selection"] -pub type SVIS_R = crate::FieldReader; +pub type SVIS_R = crate::FieldReader; #[doc = "Value Selector input selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -79,10 +47,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SVIS_A { + type Ux = u8; +} impl SVIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SVIS_A { + pub const fn variant(&self) -> SVIS_A { match self.bits { 0 => SVIS_A::VALUE1, 1 => SVIS_A::VALUE2, @@ -103,189 +74,193 @@ impl SVIS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.SyIA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SVIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.SyIB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SVIS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HRPWMx.SyIC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SVIS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "HRPWMx.SyID"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SVIS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "HRPWMx.SyIE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == SVIS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "HRPWMx.SyIF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == SVIS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "HRPWMx.SyIG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == SVIS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "HRPWMx.SyIH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == SVIS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "HRPWMx.SyII"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == SVIS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "HRPWMx.SyIJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == SVIS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "HRPWMx.SyIK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == SVIS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "HRPWMx.SyIL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == SVIS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "HRPWMx.SyIM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == SVIS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "HRPWMx.SyIN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == SVIS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "HRPWMx.SyIO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == SVIS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "HRPWMx.SyIP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == SVIS_A::VALUE16 } } #[doc = "Field `SVIS` writer - Value Selector input selection"] -pub type SVIS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DCI_SPEC, u8, SVIS_A, 4, O>; -impl<'a, const O: u8> SVIS_W<'a, O> { +pub type SVIS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, SVIS_A>; +impl<'a, REG> SVIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "HRPWMx.SyIA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE1) } #[doc = "HRPWMx.SyIB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE2) } #[doc = "HRPWMx.SyIC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE3) } #[doc = "HRPWMx.SyID"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE4) } #[doc = "HRPWMx.SyIE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE5) } #[doc = "HRPWMx.SyIF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE6) } #[doc = "HRPWMx.SyIG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE7) } #[doc = "HRPWMx.SyIH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE8) } #[doc = "HRPWMx.SyII"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE9) } #[doc = "HRPWMx.SyIJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE10) } #[doc = "HRPWMx.SyIK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE11) } #[doc = "HRPWMx.SyIL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE12) } #[doc = "HRPWMx.SyIM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE13) } #[doc = "HRPWMx.SyIN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE14) } #[doc = "HRPWMx.SyIO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE15) } #[doc = "HRPWMx.SyIP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(SVIS_A::VALUE16) } } #[doc = "Field `STRIS` reader - Slope generation start control input selection"] -pub type STRIS_R = crate::FieldReader; +pub type STRIS_R = crate::FieldReader; #[doc = "Field `STRIS` writer - Slope generation start control input selection"] -pub type STRIS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DCI_SPEC, u8, u8, 4, O>; +pub type STRIS_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `STPIS` reader - Slope generation stop control input selection"] -pub type STPIS_R = crate::FieldReader; +pub type STPIS_R = crate::FieldReader; #[doc = "Field `STPIS` writer - Slope generation stop control input selection"] -pub type STPIS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DCI_SPEC, u8, u8, 4, O>; +pub type STPIS_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `TRGIS` reader - External conversion trigger input selection"] -pub type TRGIS_R = crate::FieldReader; +pub type TRGIS_R = crate::FieldReader; #[doc = "Field `TRGIS` writer - External conversion trigger input selection"] -pub type TRGIS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DCI_SPEC, u8, u8, 4, O>; +pub type TRGIS_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `STIS` reader - External shadow request enable input selection"] -pub type STIS_R = crate::FieldReader; +pub type STIS_R = crate::FieldReader; #[doc = "Field `STIS` writer - External shadow request enable input selection"] -pub type STIS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DCI_SPEC, u8, u8, 4, O>; +pub type STIS_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `SCS` reader - Slope generation clock selection"] -pub type SCS_R = crate::FieldReader; +pub type SCS_R = crate::FieldReader; #[doc = "Slope generation clock selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -305,10 +280,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SCS_A { + type Ux = u8; +} impl SCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCS_A { + pub const fn variant(&self) -> SCS_A { match self.bits { 0 => SCS_A::VALUE1, 1 => SCS_A::VALUE2, @@ -317,48 +295,52 @@ impl SCS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.MCLK (Module clock is used)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.ECLKA (External clock is used)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HRPWMx.ECLKB (External clock is used)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SCS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "HRPWMx.ECLKC (External clock is used)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SCS_A::VALUE4 } } #[doc = "Field `SCS` writer - Slope generation clock selection"] -pub type SCS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DCI_SPEC, u8, SCS_A, 2, O>; -impl<'a, const O: u8> SCS_W<'a, O> { +pub type SCS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SCS_A>; +impl<'a, REG> SCS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "HRPWMx.MCLK (Module clock is used)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCS_A::VALUE1) } #[doc = "HRPWMx.ECLKA (External clock is used)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCS_A::VALUE2) } #[doc = "HRPWMx.ECLKB (External clock is used)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SCS_A::VALUE3) } #[doc = "HRPWMx.ECLKC (External clock is used)"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SCS_A::VALUE4) } } @@ -398,58 +380,59 @@ impl W { #[doc = "Bits 0:3 - Value Selector input selection"] #[inline(always)] #[must_use] - pub fn svis(&mut self) -> SVIS_W<0> { - SVIS_W::new(self) + pub fn svis(&mut self) -> SVIS_W { + SVIS_W::new(self, 0) } #[doc = "Bits 4:7 - Slope generation start control input selection"] #[inline(always)] #[must_use] - pub fn stris(&mut self) -> STRIS_W<4> { - STRIS_W::new(self) + pub fn stris(&mut self) -> STRIS_W { + STRIS_W::new(self, 4) } #[doc = "Bits 8:11 - Slope generation stop control input selection"] #[inline(always)] #[must_use] - pub fn stpis(&mut self) -> STPIS_W<8> { - STPIS_W::new(self) + pub fn stpis(&mut self) -> STPIS_W { + STPIS_W::new(self, 8) } #[doc = "Bits 12:15 - External conversion trigger input selection"] #[inline(always)] #[must_use] - pub fn trgis(&mut self) -> TRGIS_W<12> { - TRGIS_W::new(self) + pub fn trgis(&mut self) -> TRGIS_W { + TRGIS_W::new(self, 12) } #[doc = "Bits 16:19 - External shadow request enable input selection"] #[inline(always)] #[must_use] - pub fn stis(&mut self) -> STIS_W<16> { - STIS_W::new(self) + pub fn stis(&mut self) -> STIS_W { + STIS_W::new(self, 16) } #[doc = "Bits 20:21 - Slope generation clock selection"] #[inline(always)] #[must_use] - pub fn scs(&mut self) -> SCS_W<20> { - SCS_W::new(self) + pub fn scs(&mut self) -> SCS_W { + SCS_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "External input selection\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dci::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dci::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dci::R`](R) reader structure"] +impl crate::Readable for DCI_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dci::W`](W) writer structure"] impl crate::Writable for DCI_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/dsv1.rs b/src/hrpwm0_csg0/dsv1.rs index e72d7a29..7d57fead 100644 --- a/src/hrpwm0_csg0/dsv1.rs +++ b/src/hrpwm0_csg0/dsv1.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DSV1` reader - DAC reference value 1"] -pub type DSV1_R = crate::FieldReader; +pub type DSV1_R = crate::FieldReader; impl R { #[doc = "Bits 0:9 - DAC reference value 1"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "DAC reference value 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsv1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dsv1::R`](R) reader structure"] +impl crate::Readable for DSV1_SPEC {} #[doc = "`reset()` method sets DSV1 to value 0"] impl crate::Resettable for DSV1_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0_csg0/dsv2.rs b/src/hrpwm0_csg0/dsv2.rs index 71bcad74..2eb9e0ab 100644 --- a/src/hrpwm0_csg0/dsv2.rs +++ b/src/hrpwm0_csg0/dsv2.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSV2` reader - DAC reference value 2"] -pub type DSV2_R = crate::FieldReader; +pub type DSV2_R = crate::FieldReader; #[doc = "Field `DSV2` writer - DAC reference value 2"] -pub type DSV2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DSV2_SPEC, u16, u16, 10, O>; +pub type DSV2_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; impl R { #[doc = "Bits 0:9 - DAC reference value 2"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:9 - DAC reference value 2"] #[inline(always)] #[must_use] - pub fn dsv2(&mut self) -> DSV2_W<0> { - DSV2_W::new(self) + pub fn dsv2(&mut self) -> DSV2_W { + DSV2_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "DAC reference value 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsv2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dsv2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dsv2::R`](R) reader structure"] +impl crate::Readable for DSV2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dsv2::W`](W) writer structure"] impl crate::Writable for DSV2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/ies.rs b/src/hrpwm0_csg0/ies.rs index 0e5a9e59..efa465d9 100644 --- a/src/hrpwm0_csg0/ies.rs +++ b/src/hrpwm0_csg0/ies.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SVLS` reader - External value switch function level selection"] -pub type SVLS_R = crate::FieldReader; +pub type SVLS_R = crate::FieldReader; #[doc = "External value switch function level selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SVLS_A { + type Ux = u8; +} impl SVLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SVLS_A::VALUE1), 1 => Some(SVLS_A::VALUE2), @@ -64,43 +35,47 @@ impl SVLS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Function disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SVLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active when input is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SVLS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Active when input is LOW"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SVLS_A::VALUE3 } } #[doc = "Field `SVLS` writer - External value switch function level selection"] -pub type SVLS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IES_SPEC, u8, SVLS_A, 2, O>; -impl<'a, const O: u8> SVLS_W<'a, O> { +pub type SVLS_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SVLS_A>; +impl<'a, REG> SVLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Function disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SVLS_A::VALUE1) } #[doc = "Active when input is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SVLS_A::VALUE2) } #[doc = "Active when input is LOW"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SVLS_A::VALUE3) } } #[doc = "Field `STRES` reader - External start function edge selection"] -pub type STRES_R = crate::FieldReader; +pub type STRES_R = crate::FieldReader; #[doc = "External start function edge selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -120,10 +95,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STRES_A { + type Ux = u8; +} impl STRES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STRES_A { + pub const fn variant(&self) -> STRES_A { match self.bits { 0 => STRES_A::VALUE1, 1 => STRES_A::VALUE2, @@ -132,53 +110,57 @@ impl STRES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Function disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STRES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STRES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STRES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STRES_A::VALUE4 } } #[doc = "Field `STRES` writer - External start function edge selection"] -pub type STRES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, IES_SPEC, u8, STRES_A, 2, O>; -impl<'a, const O: u8> STRES_W<'a, O> { +pub type STRES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, STRES_A>; +impl<'a, REG> STRES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Function disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STRES_A::VALUE1) } #[doc = "Active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STRES_A::VALUE2) } #[doc = "Active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STRES_A::VALUE3) } #[doc = "Active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STRES_A::VALUE4) } } #[doc = "Field `STPES` reader - External stop function edge selection"] -pub type STPES_R = crate::FieldReader; +pub type STPES_R = crate::FieldReader; #[doc = "External stop function edge selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -198,10 +180,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STPES_A { + type Ux = u8; +} impl STPES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STPES_A { + pub const fn variant(&self) -> STPES_A { match self.bits { 0 => STPES_A::VALUE1, 1 => STPES_A::VALUE2, @@ -210,53 +195,57 @@ impl STPES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Function disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STPES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STPES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STPES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STPES_A::VALUE4 } } #[doc = "Field `STPES` writer - External stop function edge selection"] -pub type STPES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, IES_SPEC, u8, STPES_A, 2, O>; -impl<'a, const O: u8> STPES_W<'a, O> { +pub type STPES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, STPES_A>; +impl<'a, REG> STPES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Function disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STPES_A::VALUE1) } #[doc = "Active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STPES_A::VALUE2) } #[doc = "Active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STPES_A::VALUE3) } #[doc = "Active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STPES_A::VALUE4) } } #[doc = "Field `TRGES` reader - External trigger function edge selection"] -pub type TRGES_R = crate::FieldReader; +pub type TRGES_R = crate::FieldReader; #[doc = "External trigger function edge selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -276,10 +265,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TRGES_A { + type Ux = u8; +} impl TRGES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRGES_A { + pub const fn variant(&self) -> TRGES_A { match self.bits { 0 => TRGES_A::VALUE1, 1 => TRGES_A::VALUE2, @@ -288,53 +280,57 @@ impl TRGES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Function disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRGES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRGES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TRGES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TRGES_A::VALUE4 } } #[doc = "Field `TRGES` writer - External trigger function edge selection"] -pub type TRGES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, IES_SPEC, u8, TRGES_A, 2, O>; -impl<'a, const O: u8> TRGES_W<'a, O> { +pub type TRGES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, TRGES_A>; +impl<'a, REG> TRGES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Function disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRGES_A::VALUE1) } #[doc = "Active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRGES_A::VALUE2) } #[doc = "Active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TRGES_A::VALUE3) } #[doc = "Active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TRGES_A::VALUE4) } } #[doc = "Field `STES` reader - External shadow transfer enable edge selection"] -pub type STES_R = crate::FieldReader; +pub type STES_R = crate::FieldReader; #[doc = "External shadow transfer enable edge selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -354,10 +350,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STES_A { + type Ux = u8; +} impl STES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STES_A { + pub const fn variant(&self) -> STES_A { match self.bits { 0 => STES_A::VALUE1, 1 => STES_A::VALUE2, @@ -366,48 +365,52 @@ impl STES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Function disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active on rising edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Active on falling edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Active on both edges"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STES_A::VALUE4 } } #[doc = "Field `STES` writer - External shadow transfer enable edge selection"] -pub type STES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, IES_SPEC, u8, STES_A, 2, O>; -impl<'a, const O: u8> STES_W<'a, O> { +pub type STES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, STES_A>; +impl<'a, REG> STES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Function disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STES_A::VALUE1) } #[doc = "Active on rising edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STES_A::VALUE2) } #[doc = "Active on falling edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STES_A::VALUE3) } #[doc = "Active on both edges"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STES_A::VALUE4) } } @@ -442,52 +445,53 @@ impl W { #[doc = "Bits 0:1 - External value switch function level selection"] #[inline(always)] #[must_use] - pub fn svls(&mut self) -> SVLS_W<0> { - SVLS_W::new(self) + pub fn svls(&mut self) -> SVLS_W { + SVLS_W::new(self, 0) } #[doc = "Bits 2:3 - External start function edge selection"] #[inline(always)] #[must_use] - pub fn stres(&mut self) -> STRES_W<2> { - STRES_W::new(self) + pub fn stres(&mut self) -> STRES_W { + STRES_W::new(self, 2) } #[doc = "Bits 4:5 - External stop function edge selection"] #[inline(always)] #[must_use] - pub fn stpes(&mut self) -> STPES_W<4> { - STPES_W::new(self) + pub fn stpes(&mut self) -> STPES_W { + STPES_W::new(self, 4) } #[doc = "Bits 6:7 - External trigger function edge selection"] #[inline(always)] #[must_use] - pub fn trges(&mut self) -> TRGES_W<6> { - TRGES_W::new(self) + pub fn trges(&mut self) -> TRGES_W { + TRGES_W::new(self, 6) } #[doc = "Bits 8:9 - External shadow transfer enable edge selection"] #[inline(always)] #[must_use] - pub fn stes(&mut self) -> STES_W<8> { - STES_W::new(self) + pub fn stes(&mut self) -> STES_W { + STES_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "External input selection\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ies::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ies::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ies::R`](R) reader structure"] +impl crate::Readable for IES_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ies::W`](W) writer structure"] impl crate::Writable for IES_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/istat.rs b/src/hrpwm0_csg0/istat.rs index 004256bb..a951f6fa 100644 --- a/src/hrpwm0_csg0/istat.rs +++ b/src/hrpwm0_csg0/istat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VLS1S` reader - Value switch from CSGyDSV1 to CSGyDSV2 interrupt status"] pub type VLS1S_R = crate::BitReader; #[doc = "Value switch from CSGyDSV1 to CSGyDSV2 interrupt status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl VLS1S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VLS1S_A { + pub const fn variant(&self) -> VLS1S_A { match self.bits { false => VLS1S_A::VALUE1, true => VLS1S_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Value switch not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VLS1S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Value switch detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VLS1S_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl VLS2S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VLS2S_A { + pub const fn variant(&self) -> VLS2S_A { match self.bits { false => VLS2S_A::VALUE1, true => VLS2S_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Value switch not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VLS2S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Value switch detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VLS2S_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl TRGSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRGSS_A { + pub const fn variant(&self) -> TRGSS_A { match self.bits { false => TRGSS_A::VALUE1, true => TRGSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Conversion trigger was not generated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRGSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Conversion trigger was generated"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRGSS_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl STRSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STRSS_A { + pub const fn variant(&self) -> STRSS_A { match self.bits { false => STRSS_A::VALUE1, true => STRSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Start trigger not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STRSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Start trigger detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STRSS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl STPSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STPSS_A { + pub const fn variant(&self) -> STPSS_A { match self.bits { false => STPSS_A::VALUE1, true => STPSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Stop trigger not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STPSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Stop trigger detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STPSS_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl STDS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STDS_A { + pub const fn variant(&self) -> STDS_A { match self.bits { false => STDS_A::VALUE1, true => STDS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer was not performed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STDS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer was performed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STDS_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl CRSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CRSS_A { + pub const fn variant(&self) -> CRSS_A { match self.bits { false => CRSS_A::VALUE1, true => CRSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Comparator output LOW to HIGH transition not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CRSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Comparator output LOW to HIGH transition detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CRSS_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl CFSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CFSS_A { + pub const fn variant(&self) -> CFSS_A { match self.bits { false => CFSS_A::VALUE1, true => CFSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Comparator output HIGH to LOW transition not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CFSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Comparator output HIGH to LOW transition detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CFSS_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl CSES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CSES_A { + pub const fn variant(&self) -> CSES_A { match self.bits { false => CSES_A::VALUE1, true => CSES_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Comparator output has been set to the clamped state"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CSES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Comparator output has not been set to the clamped state"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CSES_A::VALUE2 @@ -384,15 +371,13 @@ impl R { CSES_R::new(((self.bits >> 8) & 1) != 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"] +#[doc = "Service request status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`istat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`istat::R`](R) reader structure"] +impl crate::Readable for ISTAT_SPEC {} #[doc = "`reset()` method sets ISTAT to value 0"] impl crate::Resettable for ISTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0_csg0/pc.rs b/src/hrpwm0_csg0/pc.rs index 0cea4a4d..03a227f0 100644 --- a/src/hrpwm0_csg0/pc.rs +++ b/src/hrpwm0_csg0/pc.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PSWV` reader - Pulse swallow configuration"] -pub type PSWV_R = crate::FieldReader; +pub type PSWV_R = crate::FieldReader; impl R { #[doc = "Bits 0:5 - Pulse swallow configuration"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Pulse swallow configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pc::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pc::R`](R) reader structure"] +impl crate::Readable for PC_SPEC {} #[doc = "`reset()` method sets PC to value 0"] impl crate::Resettable for PC_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0_csg0/plc.rs b/src/hrpwm0_csg0/plc.rs index b7ee0512..3926336e 100644 --- a/src/hrpwm0_csg0/plc.rs +++ b/src/hrpwm0_csg0/plc.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `IPLS` reader - Clamping control signal selector"] -pub type IPLS_R = crate::FieldReader; +pub type IPLS_R = crate::FieldReader; #[doc = "Clamping control signal selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -79,10 +47,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for IPLS_A { + type Ux = u8; +} impl IPLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IPLS_A { + pub const fn variant(&self) -> IPLS_A { match self.bits { 0 => IPLS_A::VALUE1, 1 => IPLS_A::VALUE2, @@ -103,173 +74,177 @@ impl IPLS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.BLyA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IPLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.BLyB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IPLS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HRPWMx.BLyC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == IPLS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "HRPWMx.BLyD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == IPLS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "HRPWMx.BLyE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == IPLS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "HRPWMx.BLyF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == IPLS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "HRPWMx.BLyG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == IPLS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "HRPWMx.BLyH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == IPLS_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "HRPWMx.BLyI"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == IPLS_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "HRPWMx.BLyJ"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == IPLS_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "HRPWMx.BLyK"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == IPLS_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "HRPWMx.BLyL"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == IPLS_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "HRPWMx.BLyM"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == IPLS_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "HRPWMx.BLyN"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == IPLS_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "HRPWMx.BLyO"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == IPLS_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "HRPWMx.BLyP"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == IPLS_A::VALUE16 } } #[doc = "Field `IPLS` writer - Clamping control signal selector"] -pub type IPLS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PLC_SPEC, u8, IPLS_A, 4, O>; -impl<'a, const O: u8> IPLS_W<'a, O> { +pub type IPLS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 4, IPLS_A>; +impl<'a, REG> IPLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "HRPWMx.BLyA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE1) } #[doc = "HRPWMx.BLyB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE2) } #[doc = "HRPWMx.BLyC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE3) } #[doc = "HRPWMx.BLyD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE4) } #[doc = "HRPWMx.BLyE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE5) } #[doc = "HRPWMx.BLyF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE6) } #[doc = "HRPWMx.BLyG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE7) } #[doc = "HRPWMx.BLyH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE8) } #[doc = "HRPWMx.BLyI"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE9) } #[doc = "HRPWMx.BLyJ"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE10) } #[doc = "HRPWMx.BLyK"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE11) } #[doc = "HRPWMx.BLyL"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE12) } #[doc = "HRPWMx.BLyM"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE13) } #[doc = "HRPWMx.BLyN"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE14) } #[doc = "HRPWMx.BLyO"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE15) } #[doc = "HRPWMx.BLyP"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(IPLS_A::VALUE16) } } #[doc = "Field `PLCL` reader - Clamping control signal level selection"] -pub type PLCL_R = crate::FieldReader; +pub type PLCL_R = crate::FieldReader; #[doc = "Clamping control signal level selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -287,10 +262,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PLCL_A { + type Ux = u8; +} impl PLCL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PLCL_A::VALUE1), 1 => Some(PLCL_A::VALUE2), @@ -298,38 +276,42 @@ impl PLCL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clamping control disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLCL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Output is set to clamped level when the control signal is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLCL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Output is set to clamped level when the control signal is LOW"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PLCL_A::VALUE3 } } #[doc = "Field `PLCL` writer - Clamping control signal level selection"] -pub type PLCL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLC_SPEC, u8, PLCL_A, 2, O>; -impl<'a, const O: u8> PLCL_W<'a, O> { +pub type PLCL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PLCL_A>; +impl<'a, REG> PLCL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Clamping control disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PLCL_A::VALUE1) } #[doc = "Output is set to clamped level when the control signal is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PLCL_A::VALUE2) } #[doc = "Output is set to clamped level when the control signal is LOW"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PLCL_A::VALUE3) } } @@ -352,34 +334,37 @@ impl From for bool { impl PSL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSL_A { + pub const fn variant(&self) -> PSL_A { match self.bits { false => PSL_A::VALUE1, true => PSL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Output clamped level is LOW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Output clamped level is HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSL_A::VALUE2 } } #[doc = "Field `PSL` writer - Output passive level value"] -pub type PSL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLC_SPEC, PSL_A, O>; -impl<'a, const O: u8> PSL_W<'a, O> { +pub type PSL_W<'a, REG> = crate::BitWriter<'a, REG, PSL_A>; +impl<'a, REG> PSL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Output clamped level is LOW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSL_A::VALUE1) } #[doc = "Output clamped level is HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSL_A::VALUE2) } } @@ -402,39 +387,42 @@ impl From for bool { impl PLSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PLSW_A { + pub const fn variant(&self) -> PLSW_A { match self.bits { false => PLSW_A::VALUE1, true => PLSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External signal and SW can remove the output from the clamped state"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Only SW can remove the output from the clamped state"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLSW_A::VALUE2 } } #[doc = "Field `PLSW` writer - Clamped state exit SW configuration"] -pub type PLSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLC_SPEC, PLSW_A, O>; -impl<'a, const O: u8> PLSW_W<'a, O> { +pub type PLSW_W<'a, REG> = crate::BitWriter<'a, REG, PLSW_A>; +impl<'a, REG> PLSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External signal and SW can remove the output from the clamped state"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PLSW_A::VALUE1) } #[doc = "Only SW can remove the output from the clamped state"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PLSW_A::VALUE2) } } #[doc = "Field `PLEC` reader - Passive level enter configuration"] -pub type PLEC_R = crate::FieldReader; +pub type PLEC_R = crate::FieldReader; #[doc = "Passive level enter configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -452,10 +440,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PLEC_A { + type Ux = u8; +} impl PLEC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PLEC_A::VALUE1), 1 => Some(PLEC_A::VALUE2), @@ -463,43 +454,47 @@ impl PLEC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive level is entered immediately"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLEC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Passive level is entered only after the comparator output passes to LOW (output from the blanking stage)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLEC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Passive level is entered only after the comparator output passes to HIGH (output from the blanking stage)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PLEC_A::VALUE3 } } #[doc = "Field `PLEC` writer - Passive level enter configuration"] -pub type PLEC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLC_SPEC, u8, PLEC_A, 2, O>; -impl<'a, const O: u8> PLEC_W<'a, O> { +pub type PLEC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PLEC_A>; +impl<'a, REG> PLEC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Passive level is entered immediately"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PLEC_A::VALUE1) } #[doc = "Passive level is entered only after the comparator output passes to LOW (output from the blanking stage)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PLEC_A::VALUE2) } #[doc = "Passive level is entered only after the comparator output passes to HIGH (output from the blanking stage)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PLEC_A::VALUE3) } } #[doc = "Field `PLXC` reader - Passive level exit configuration"] -pub type PLXC_R = crate::FieldReader; +pub type PLXC_R = crate::FieldReader; #[doc = "Passive level exit configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -517,10 +512,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PLXC_A { + type Ux = u8; +} impl PLXC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PLXC_A::VALUE1), 1 => Some(PLXC_A::VALUE2), @@ -528,38 +526,42 @@ impl PLXC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive level is exit immediately"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLXC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Passive level is exit only after the comparator output passes to LOW (output from the blanking stage)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLXC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Passive level is exit only after the comparator output passes to HIGH (output from the blanking stage)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PLXC_A::VALUE3 } } #[doc = "Field `PLXC` writer - Passive level exit configuration"] -pub type PLXC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLC_SPEC, u8, PLXC_A, 2, O>; -impl<'a, const O: u8> PLXC_W<'a, O> { +pub type PLXC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PLXC_A>; +impl<'a, REG> PLXC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Passive level is exit immediately"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PLXC_A::VALUE1) } #[doc = "Passive level is exit only after the comparator output passes to LOW (output from the blanking stage)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PLXC_A::VALUE2) } #[doc = "Passive level is exit only after the comparator output passes to HIGH (output from the blanking stage)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PLXC_A::VALUE3) } } @@ -599,58 +601,59 @@ impl W { #[doc = "Bits 0:3 - Clamping control signal selector"] #[inline(always)] #[must_use] - pub fn ipls(&mut self) -> IPLS_W<0> { - IPLS_W::new(self) + pub fn ipls(&mut self) -> IPLS_W { + IPLS_W::new(self, 0) } #[doc = "Bits 8:9 - Clamping control signal level selection"] #[inline(always)] #[must_use] - pub fn plcl(&mut self) -> PLCL_W<8> { - PLCL_W::new(self) + pub fn plcl(&mut self) -> PLCL_W { + PLCL_W::new(self, 8) } #[doc = "Bit 10 - Output passive level value"] #[inline(always)] #[must_use] - pub fn psl(&mut self) -> PSL_W<10> { - PSL_W::new(self) + pub fn psl(&mut self) -> PSL_W { + PSL_W::new(self, 10) } #[doc = "Bit 11 - Clamped state exit SW configuration"] #[inline(always)] #[must_use] - pub fn plsw(&mut self) -> PLSW_W<11> { - PLSW_W::new(self) + pub fn plsw(&mut self) -> PLSW_W { + PLSW_W::new(self, 11) } #[doc = "Bits 12:13 - Passive level enter configuration"] #[inline(always)] #[must_use] - pub fn plec(&mut self) -> PLEC_W<12> { - PLEC_W::new(self) + pub fn plec(&mut self) -> PLEC_W { + PLEC_W::new(self, 12) } #[doc = "Bits 14:15 - Passive level exit configuration"] #[inline(always)] #[must_use] - pub fn plxc(&mut self) -> PLXC_W<14> { - PLXC_W::new(self) + pub fn plxc(&mut self) -> PLXC_W { + PLXC_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Passive level configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`plc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`plc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`plc::R`](R) reader structure"] +impl crate::Readable for PLC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`plc::W`](W) writer structure"] impl crate::Writable for PLC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/sc.rs b/src/hrpwm0_csg0/sc.rs index 3fc959db..c9743a86 100644 --- a/src/hrpwm0_csg0/sc.rs +++ b/src/hrpwm0_csg0/sc.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PSRM` reader - Prescaler external start configuration"] -pub type PSRM_R = crate::FieldReader; +pub type PSRM_R = crate::FieldReader; #[doc = "Prescaler external start configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -46,7 +14,7 @@ pub enum PSRM_A { VALUE2 = 1, #[doc = "2: Clear prescaler"] VALUE3 = 2, - #[doc = "3: Clear & Start prescaler"] + #[doc = "3: Clear & Start prescaler"] VALUE4 = 3, } impl From for u8 { @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PSRM_A { + type Ux = u8; +} impl PSRM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSRM_A { + pub const fn variant(&self) -> PSRM_A { match self.bits { 0 => PSRM_A::VALUE1, 1 => PSRM_A::VALUE2, @@ -67,53 +38,57 @@ impl PSRM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External start trigger is ignored"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSRM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Start prescaler"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSRM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Clear prescaler"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PSRM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Clear & Start prescaler"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PSRM_A::VALUE4 } } #[doc = "Field `PSRM` writer - Prescaler external start configuration"] -pub type PSRM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SC_SPEC, u8, PSRM_A, 2, O>; -impl<'a, const O: u8> PSRM_W<'a, O> { +pub type PSRM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PSRM_A>; +impl<'a, REG> PSRM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External start trigger is ignored"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSRM_A::VALUE1) } #[doc = "Start prescaler"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSRM_A::VALUE2) } #[doc = "Clear prescaler"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PSRM_A::VALUE3) } - #[doc = "Clear & Start prescaler"] + #[doc = "Clear & Start prescaler"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PSRM_A::VALUE4) } } #[doc = "Field `PSTM` reader - Prescaler external stop configuration"] -pub type PSTM_R = crate::FieldReader; +pub type PSTM_R = crate::FieldReader; #[doc = "Prescaler external stop configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -124,7 +99,7 @@ pub enum PSTM_A { VALUE2 = 1, #[doc = "2: Clear prescaler"] VALUE3 = 2, - #[doc = "3: Clear & Stop prescaler"] + #[doc = "3: Clear & Stop prescaler"] VALUE4 = 3, } impl From for u8 { @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PSTM_A { + type Ux = u8; +} impl PSTM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSTM_A { + pub const fn variant(&self) -> PSTM_A { match self.bits { 0 => PSTM_A::VALUE1, 1 => PSTM_A::VALUE2, @@ -145,48 +123,52 @@ impl PSTM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External stop trigger is ignored"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSTM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Stop prescaler"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSTM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Clear prescaler"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PSTM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Clear & Stop prescaler"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PSTM_A::VALUE4 } } #[doc = "Field `PSTM` writer - Prescaler external stop configuration"] -pub type PSTM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SC_SPEC, u8, PSTM_A, 2, O>; -impl<'a, const O: u8> PSTM_W<'a, O> { +pub type PSTM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PSTM_A>; +impl<'a, REG> PSTM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External stop trigger is ignored"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSTM_A::VALUE1) } #[doc = "Stop prescaler"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSTM_A::VALUE2) } #[doc = "Clear prescaler"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PSTM_A::VALUE3) } - #[doc = "Clear & Stop prescaler"] + #[doc = "Clear & Stop prescaler"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PSTM_A::VALUE4) } } @@ -209,39 +191,42 @@ impl From for bool { impl FPD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FPD_A { + pub const fn variant(&self) -> FPD_A { match self.bits { false => FPD_A::VALUE1, true => FPD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Division by 4 enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FPD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Division by 4 disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FPD_A::VALUE2 } } #[doc = "Field `FPD` writer - Fixed division disable"] -pub type FPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, SC_SPEC, FPD_A, O>; -impl<'a, const O: u8> FPD_W<'a, O> { +pub type FPD_W<'a, REG> = crate::BitWriter<'a, REG, FPD_A>; +impl<'a, REG> FPD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Division by 4 enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FPD_A::VALUE1) } #[doc = "Division by 4 disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FPD_A::VALUE2) } } #[doc = "Field `PSV` reader - Prescaler division factor"] -pub type PSV_R = crate::FieldReader; +pub type PSV_R = crate::FieldReader; #[doc = "Prescaler division factor\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -261,10 +246,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PSV_A { + type Ux = u8; +} impl PSV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSV_A { + pub const fn variant(&self) -> PSV_A { match self.bits { 0 => PSV_A::VALUE1, 1 => PSV_A::VALUE2, @@ -273,53 +261,57 @@ impl PSV_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "division by 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "division by 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSV_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "division by 4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PSV_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "division by 8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PSV_A::VALUE4 } } #[doc = "Field `PSV` writer - Prescaler division factor"] -pub type PSV_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SC_SPEC, u8, PSV_A, 2, O>; -impl<'a, const O: u8> PSV_W<'a, O> { +pub type PSV_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PSV_A>; +impl<'a, REG> PSV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "division by 1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSV_A::VALUE1) } #[doc = "division by 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSV_A::VALUE2) } #[doc = "division by 4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PSV_A::VALUE3) } #[doc = "division by 8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PSV_A::VALUE4) } } #[doc = "Field `SCM` reader - Slope control mode"] -pub type SCM_R = crate::FieldReader; +pub type SCM_R = crate::FieldReader; #[doc = "Slope control mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -339,10 +331,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SCM_A { + type Ux = u8; +} impl SCM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCM_A { + pub const fn variant(&self) -> SCM_A { match self.bits { 0 => SCM_A::VALUE1, 1 => SCM_A::VALUE2, @@ -351,53 +346,57 @@ impl SCM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == SCM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Decrementing slope generation."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Incrementing slope generation."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SCM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Triangular slope generation."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SCM_A::VALUE4 } } #[doc = "Field `SCM` writer - Slope control mode"] -pub type SCM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SC_SPEC, u8, SCM_A, 2, O>; -impl<'a, const O: u8> SCM_W<'a, O> { +pub type SCM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SCM_A>; +impl<'a, REG> SCM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCM_A::VALUE1) } #[doc = "Decrementing slope generation."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCM_A::VALUE2) } #[doc = "Incrementing slope generation."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SCM_A::VALUE3) } #[doc = "Triangular slope generation."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SCM_A::VALUE4) } } #[doc = "Field `SSRM` reader - Slope external start configuration"] -pub type SSRM_R = crate::FieldReader; +pub type SSRM_R = crate::FieldReader; #[doc = "Slope external start configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -415,10 +414,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SSRM_A { + type Ux = u8; +} impl SSRM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SSRM_A::VALUE1), 1 => Some(SSRM_A::VALUE2), @@ -426,43 +428,47 @@ impl SSRM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External start trigger is ignored"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SSRM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Start/restart slope generation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SSRM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Resumes slope"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SSRM_A::VALUE3 } } #[doc = "Field `SSRM` writer - Slope external start configuration"] -pub type SSRM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SC_SPEC, u8, SSRM_A, 2, O>; -impl<'a, const O: u8> SSRM_W<'a, O> { +pub type SSRM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SSRM_A>; +impl<'a, REG> SSRM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External start trigger is ignored"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SSRM_A::VALUE1) } #[doc = "Start/restart slope generation"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SSRM_A::VALUE2) } #[doc = "Resumes slope"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SSRM_A::VALUE3) } } #[doc = "Field `SSTM` reader - Slope external stop configuration"] -pub type SSTM_R = crate::FieldReader; +pub type SSTM_R = crate::FieldReader; #[doc = "Slope external stop configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -480,10 +486,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SSTM_A { + type Ux = u8; +} impl SSTM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SSTM_A::VALUE1), 1 => Some(SSTM_A::VALUE2), @@ -491,43 +500,47 @@ impl SSTM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External stop trigger is ignored"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SSTM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Stops/Halts the slope generation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SSTM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Used in hybrid mode. It freezes the slope generation and feeds constantly the value programmed in CSGyDSV2This register contains the actual value used for the DSV2 reference. to the DAC."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SSTM_A::VALUE3 } } #[doc = "Field `SSTM` writer - Slope external stop configuration"] -pub type SSTM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SC_SPEC, u8, SSTM_A, 2, O>; -impl<'a, const O: u8> SSTM_W<'a, O> { +pub type SSTM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SSTM_A>; +impl<'a, REG> SSTM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External stop trigger is ignored"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SSTM_A::VALUE1) } #[doc = "Stops/Halts the slope generation"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SSTM_A::VALUE2) } #[doc = "Used in hybrid mode. It freezes the slope generation and feeds constantly the value programmed in CSGyDSV2This register contains the actual value used for the DSV2 reference. to the DAC."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SSTM_A::VALUE3) } } #[doc = "Field `SVSC` reader - Slope reference value mode"] -pub type SVSC_R = crate::FieldReader; +pub type SVSC_R = crate::FieldReader; #[doc = "Slope reference value mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -545,10 +558,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SVSC_A { + type Ux = u8; +} impl SVSC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SVSC_A::VALUE1), 1 => Some(SVSC_A::VALUE2), @@ -556,43 +572,47 @@ impl SVSC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Only CSGyDSV1This register contains the actual value used for the DSV1 reference. value is used for the slope generation: if slope is incrementing, CSGyDSV1This register contains the actual value used for the DSV1 reference. is the bottom reference value from where the ramp starts; if decrementing, then CSGyDSV1This register contains the actual value used for the DSV1 reference. is the upper reference value from where the ramp starts."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SVSC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The two reference values are being used: CSGyDSV1This register contains the actual value used for the DSV1 reference. is the low or high reference value from where the ramp starts (incrementing or decrementing respectively); CSGyDSV2This register contains the actual value used for the DSV2 reference. is used as a static value (this value is constantly fed to the DAC after a stop trigger as been detected)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SVSC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The two reference values are used: CSGyDSV1This register contains the actual value used for the DSV1 reference. is the low or high reference value from where the slope starts (incrementing or decrementing respectively); CSGyDSV2This register contains the actual value used for the DSV2 reference. is used as an internal re start condition for the slope."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SVSC_A::VALUE3 } } #[doc = "Field `SVSC` writer - Slope reference value mode"] -pub type SVSC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SC_SPEC, u8, SVSC_A, 2, O>; -impl<'a, const O: u8> SVSC_W<'a, O> { +pub type SVSC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SVSC_A>; +impl<'a, REG> SVSC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Only CSGyDSV1This register contains the actual value used for the DSV1 reference. value is used for the slope generation: if slope is incrementing, CSGyDSV1This register contains the actual value used for the DSV1 reference. is the bottom reference value from where the ramp starts; if decrementing, then CSGyDSV1This register contains the actual value used for the DSV1 reference. is the upper reference value from where the ramp starts."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SVSC_A::VALUE1) } #[doc = "The two reference values are being used: CSGyDSV1This register contains the actual value used for the DSV1 reference. is the low or high reference value from where the ramp starts (incrementing or decrementing respectively); CSGyDSV2This register contains the actual value used for the DSV2 reference. is used as a static value (this value is constantly fed to the DAC after a stop trigger as been detected)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SVSC_A::VALUE2) } #[doc = "The two reference values are used: CSGyDSV1This register contains the actual value used for the DSV1 reference. is the low or high reference value from where the slope starts (incrementing or decrementing respectively); CSGyDSV2This register contains the actual value used for the DSV2 reference. is used as an internal re start condition for the slope."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SVSC_A::VALUE3) } } #[doc = "Field `SWSM` reader - Initial DAC start mode"] -pub type SWSM_R = crate::FieldReader; +pub type SWSM_R = crate::FieldReader; #[doc = "Initial DAC start mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -612,10 +632,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SWSM_A { + type Ux = u8; +} impl SWSM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SWSM_A { + pub const fn variant(&self) -> SWSM_A { match self.bits { 0 => SWSM_A::VALUE1, 1 => SWSM_A::VALUE2, @@ -624,53 +647,57 @@ impl SWSM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == SWSM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGyDSV1This register contains the actual value used for the DSV1 reference. is fed to the DAC and initial conversion trigger is generated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SWSM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CSGyDSV2This register contains the actual value used for the DSV2 reference. is fed to the DAC but initial conversion trigger is not generated."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SWSM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGyDSV1This register contains the actual value used for the DSV1 reference. is fed to the DAC but initial conversion trigger is not generated."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SWSM_A::VALUE4 } } #[doc = "Field `SWSM` writer - Initial DAC start mode"] -pub type SWSM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SC_SPEC, u8, SWSM_A, 2, O>; -impl<'a, const O: u8> SWSM_W<'a, O> { +pub type SWSM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SWSM_A>; +impl<'a, REG> SWSM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SWSM_A::VALUE1) } #[doc = "CSGyDSV1This register contains the actual value used for the DSV1 reference. is fed to the DAC and initial conversion trigger is generated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SWSM_A::VALUE2) } #[doc = "CSGyDSV2This register contains the actual value used for the DSV2 reference. is fed to the DAC but initial conversion trigger is not generated."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SWSM_A::VALUE3) } #[doc = "CSGyDSV1This register contains the actual value used for the DSV1 reference. is fed to the DAC but initial conversion trigger is not generated."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SWSM_A::VALUE4) } } #[doc = "Field `GCFG` reader - Slope step gain configuration"] -pub type GCFG_R = crate::FieldReader; +pub type GCFG_R = crate::FieldReader; #[doc = "Slope step gain configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -690,10 +717,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for GCFG_A { + type Ux = u8; +} impl GCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GCFG_A { + pub const fn variant(&self) -> GCFG_A { match self.bits { 0 => GCFG_A::VALUE1, 1 => GCFG_A::VALUE2, @@ -702,55 +732,59 @@ impl GCFG_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Each slope step has an increment/decrement of 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Each slope step has an increment/decrement of 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GCFG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Each slope step has an increment/decrement of 4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == GCFG_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Each slope step has an increment/decrement of 8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == GCFG_A::VALUE4 } } #[doc = "Field `GCFG` writer - Slope step gain configuration"] -pub type GCFG_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SC_SPEC, u8, GCFG_A, 2, O>; -impl<'a, const O: u8> GCFG_W<'a, O> { +pub type GCFG_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, GCFG_A>; +impl<'a, REG> GCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Each slope step has an increment/decrement of 1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GCFG_A::VALUE1) } #[doc = "Each slope step has an increment/decrement of 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GCFG_A::VALUE2) } #[doc = "Each slope step has an increment/decrement of 4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(GCFG_A::VALUE3) } #[doc = "Each slope step has an increment/decrement of 8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(GCFG_A::VALUE4) } } #[doc = "Field `IST` reader - Immediate shadow transfer"] -pub type IST_R = crate::BitReader; +pub type IST_R = crate::BitReader; #[doc = "Field `IST` writer - Immediate shadow transfer"] -pub type IST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SC_SPEC, bool, O>; +pub type IST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PSE` reader - Pulse swallow enable"] pub type PSE_R = crate::BitReader; #[doc = "Pulse swallow enable\n\nValue on reset: 0"] @@ -770,39 +804,42 @@ impl From for bool { impl PSE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSE_A { + pub const fn variant(&self) -> PSE_A { match self.bits { false => PSE_A::VALUE1, true => PSE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pulse swallow disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pulse swallow enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSE_A::VALUE2 } } #[doc = "Field `PSE` writer - Pulse swallow enable"] -pub type PSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SC_SPEC, PSE_A, O>; -impl<'a, const O: u8> PSE_W<'a, O> { +pub type PSE_W<'a, REG> = crate::BitWriter<'a, REG, PSE_A>; +impl<'a, REG> PSE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pulse swallow disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSE_A::VALUE1) } #[doc = "Pulse swallow enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSE_A::VALUE2) } } #[doc = "Field `PSWM` reader - Pulse swallow window mode"] -pub type PSWM_R = crate::FieldReader; +pub type PSWM_R = crate::FieldReader; #[doc = "Pulse swallow window mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -820,10 +857,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PSWM_A { + type Ux = u8; +} impl PSWM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PSWM_A::VALUE1), 1 => Some(PSWM_A::VALUE2), @@ -831,38 +871,42 @@ impl PSWM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "16 clock cycle window"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSWM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "32 clock cycle window"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSWM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "64 clock cycle window"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PSWM_A::VALUE3 } } #[doc = "Field `PSWM` writer - Pulse swallow window mode"] -pub type PSWM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SC_SPEC, u8, PSWM_A, 2, O>; -impl<'a, const O: u8> PSWM_W<'a, O> { +pub type PSWM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PSWM_A>; +impl<'a, REG> PSWM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "16 clock cycle window"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSWM_A::VALUE1) } #[doc = "32 clock cycle window"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSWM_A::VALUE2) } #[doc = "64 clock cycle window"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PSWM_A::VALUE3) } } @@ -937,100 +981,101 @@ impl W { #[doc = "Bits 0:1 - Prescaler external start configuration"] #[inline(always)] #[must_use] - pub fn psrm(&mut self) -> PSRM_W<0> { - PSRM_W::new(self) + pub fn psrm(&mut self) -> PSRM_W { + PSRM_W::new(self, 0) } #[doc = "Bits 2:3 - Prescaler external stop configuration"] #[inline(always)] #[must_use] - pub fn pstm(&mut self) -> PSTM_W<2> { - PSTM_W::new(self) + pub fn pstm(&mut self) -> PSTM_W { + PSTM_W::new(self, 2) } #[doc = "Bit 4 - Fixed division disable"] #[inline(always)] #[must_use] - pub fn fpd(&mut self) -> FPD_W<4> { - FPD_W::new(self) + pub fn fpd(&mut self) -> FPD_W { + FPD_W::new(self, 4) } #[doc = "Bits 5:6 - Prescaler division factor"] #[inline(always)] #[must_use] - pub fn psv(&mut self) -> PSV_W<5> { - PSV_W::new(self) + pub fn psv(&mut self) -> PSV_W { + PSV_W::new(self, 5) } #[doc = "Bits 8:9 - Slope control mode"] #[inline(always)] #[must_use] - pub fn scm(&mut self) -> SCM_W<8> { - SCM_W::new(self) + pub fn scm(&mut self) -> SCM_W { + SCM_W::new(self, 8) } #[doc = "Bits 10:11 - Slope external start configuration"] #[inline(always)] #[must_use] - pub fn ssrm(&mut self) -> SSRM_W<10> { - SSRM_W::new(self) + pub fn ssrm(&mut self) -> SSRM_W { + SSRM_W::new(self, 10) } #[doc = "Bits 12:13 - Slope external stop configuration"] #[inline(always)] #[must_use] - pub fn sstm(&mut self) -> SSTM_W<12> { - SSTM_W::new(self) + pub fn sstm(&mut self) -> SSTM_W { + SSTM_W::new(self, 12) } #[doc = "Bits 14:15 - Slope reference value mode"] #[inline(always)] #[must_use] - pub fn svsc(&mut self) -> SVSC_W<14> { - SVSC_W::new(self) + pub fn svsc(&mut self) -> SVSC_W { + SVSC_W::new(self, 14) } #[doc = "Bits 16:17 - Initial DAC start mode"] #[inline(always)] #[must_use] - pub fn swsm(&mut self) -> SWSM_W<16> { - SWSM_W::new(self) + pub fn swsm(&mut self) -> SWSM_W { + SWSM_W::new(self, 16) } #[doc = "Bits 18:19 - Slope step gain configuration"] #[inline(always)] #[must_use] - pub fn gcfg(&mut self) -> GCFG_W<18> { - GCFG_W::new(self) + pub fn gcfg(&mut self) -> GCFG_W { + GCFG_W::new(self, 18) } #[doc = "Bit 20 - Immediate shadow transfer"] #[inline(always)] #[must_use] - pub fn ist(&mut self) -> IST_W<20> { - IST_W::new(self) + pub fn ist(&mut self) -> IST_W { + IST_W::new(self, 20) } #[doc = "Bit 21 - Pulse swallow enable"] #[inline(always)] #[must_use] - pub fn pse(&mut self) -> PSE_W<21> { - PSE_W::new(self) + pub fn pse(&mut self) -> PSE_W { + PSE_W::new(self, 21) } #[doc = "Bits 24:25 - Pulse swallow window mode"] #[inline(always)] #[must_use] - pub fn pswm(&mut self) -> PSWM_W<24> { - PSWM_W::new(self) + pub fn pswm(&mut self) -> PSWM_W { + PSWM_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Slope generation control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sc::R`](R) reader structure"] +impl crate::Readable for SC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sc::W`](W) writer structure"] impl crate::Writable for SC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/sdsv1.rs b/src/hrpwm0_csg0/sdsv1.rs index 2db1553c..7fe1a621 100644 --- a/src/hrpwm0_csg0/sdsv1.rs +++ b/src/hrpwm0_csg0/sdsv1.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SDSV1` reader - Shadow DAC reference value 1"] -pub type SDSV1_R = crate::FieldReader; +pub type SDSV1_R = crate::FieldReader; #[doc = "Field `SDSV1` writer - Shadow DAC reference value 1"] -pub type SDSV1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SDSV1_SPEC, u16, u16, 10, O>; +pub type SDSV1_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; impl R { #[doc = "Bits 0:9 - Shadow DAC reference value 1"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:9 - Shadow DAC reference value 1"] #[inline(always)] #[must_use] - pub fn sdsv1(&mut self) -> SDSV1_W<0> { - SDSV1_W::new(self) + pub fn sdsv1(&mut self) -> SDSV1_W { + SDSV1_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Shadow reference value 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sdsv1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sdsv1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sdsv1::R`](R) reader structure"] +impl crate::Readable for SDSV1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sdsv1::W`](W) writer structure"] impl crate::Writable for SDSV1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/spc.rs b/src/hrpwm0_csg0/spc.rs index 35876dc7..a47234fc 100644 --- a/src/hrpwm0_csg0/spc.rs +++ b/src/hrpwm0_csg0/spc.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SPSWV` reader - Shadow pulse swallow value"] -pub type SPSWV_R = crate::FieldReader; +pub type SPSWV_R = crate::FieldReader; #[doc = "Field `SPSWV` writer - Shadow pulse swallow value"] -pub type SPSWV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SPC_SPEC, u8, u8, 6, O>; +pub type SPSWV_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; impl R { #[doc = "Bits 0:5 - Shadow pulse swallow value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:5 - Shadow pulse swallow value"] #[inline(always)] #[must_use] - pub fn spswv(&mut self) -> SPSWV_W<0> { - SPSWV_W::new(self) + pub fn spswv(&mut self) -> SPSWV_W { + SPSWV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Shadow Pulse swallow value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`spc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`spc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`spc::R`](R) reader structure"] +impl crate::Readable for SPC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`spc::W`](W) writer structure"] impl crate::Writable for SPC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/sre.rs b/src/hrpwm0_csg0/sre.rs index f473a0b5..e8e0c020 100644 --- a/src/hrpwm0_csg0/sre.rs +++ b/src/hrpwm0_csg0/sre.rs @@ -1,75 +1,43 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VLS1E` reader - Value switch from CSGyDSV1 to CSGyDSV2 interrupt enable"] -pub type VLS1E_R = crate::BitReader; +pub type VLS1E_R = crate::BitReader; #[doc = "Field `VLS1E` writer - Value switch from CSGyDSV1 to CSGyDSV2 interrupt enable"] -pub type VLS1E_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type VLS1E_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `VLS2E` reader - Value switch from CSGyDSV2 to CSGyDSV1 interrupt enable"] -pub type VLS2E_R = crate::BitReader; +pub type VLS2E_R = crate::BitReader; #[doc = "Field `VLS2E` writer - Value switch from CSGyDSV2 to CSGyDSV1 interrupt enable"] -pub type VLS2E_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type VLS2E_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TRGSE` reader - Conversion trigger interrupt enable"] -pub type TRGSE_R = crate::BitReader; +pub type TRGSE_R = crate::BitReader; #[doc = "Field `TRGSE` writer - Conversion trigger interrupt enable"] -pub type TRGSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type TRGSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STRSE` reader - Start trigger interrupt enable"] -pub type STRSE_R = crate::BitReader; +pub type STRSE_R = crate::BitReader; #[doc = "Field `STRSE` writer - Start trigger interrupt enable"] -pub type STRSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type STRSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STPSE` reader - Stop trigger interrupt enable"] -pub type STPSE_R = crate::BitReader; +pub type STPSE_R = crate::BitReader; #[doc = "Field `STPSE` writer - Stop trigger interrupt enable"] -pub type STPSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type STPSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STDE` reader - Shadow transfer done interrupt enable"] -pub type STDE_R = crate::BitReader; +pub type STDE_R = crate::BitReader; #[doc = "Field `STDE` writer - Shadow transfer done interrupt enable"] -pub type STDE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type STDE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CRSE` reader - Comparator rise interrupt enable"] -pub type CRSE_R = crate::BitReader; +pub type CRSE_R = crate::BitReader; #[doc = "Field `CRSE` writer - Comparator rise interrupt enable"] -pub type CRSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type CRSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CFSE` reader - Comparator fall interrupt enable"] -pub type CFSE_R = crate::BitReader; +pub type CFSE_R = crate::BitReader; #[doc = "Field `CFSE` writer - Comparator fall interrupt enable"] -pub type CFSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type CFSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CSEE` reader - Clamped state interrupt enable"] -pub type CSEE_R = crate::BitReader; +pub type CSEE_R = crate::BitReader; #[doc = "Field `CSEE` writer - Clamped state interrupt enable"] -pub type CSEE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRE_SPEC, bool, O>; +pub type CSEE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Value switch from CSGyDSV1 to CSGyDSV2 interrupt enable"] #[inline(always)] @@ -121,76 +89,77 @@ impl W { #[doc = "Bit 0 - Value switch from CSGyDSV1 to CSGyDSV2 interrupt enable"] #[inline(always)] #[must_use] - pub fn vls1e(&mut self) -> VLS1E_W<0> { - VLS1E_W::new(self) + pub fn vls1e(&mut self) -> VLS1E_W { + VLS1E_W::new(self, 0) } #[doc = "Bit 1 - Value switch from CSGyDSV2 to CSGyDSV1 interrupt enable"] #[inline(always)] #[must_use] - pub fn vls2e(&mut self) -> VLS2E_W<1> { - VLS2E_W::new(self) + pub fn vls2e(&mut self) -> VLS2E_W { + VLS2E_W::new(self, 1) } #[doc = "Bit 2 - Conversion trigger interrupt enable"] #[inline(always)] #[must_use] - pub fn trgse(&mut self) -> TRGSE_W<2> { - TRGSE_W::new(self) + pub fn trgse(&mut self) -> TRGSE_W { + TRGSE_W::new(self, 2) } #[doc = "Bit 3 - Start trigger interrupt enable"] #[inline(always)] #[must_use] - pub fn strse(&mut self) -> STRSE_W<3> { - STRSE_W::new(self) + pub fn strse(&mut self) -> STRSE_W { + STRSE_W::new(self, 3) } #[doc = "Bit 4 - Stop trigger interrupt enable"] #[inline(always)] #[must_use] - pub fn stpse(&mut self) -> STPSE_W<4> { - STPSE_W::new(self) + pub fn stpse(&mut self) -> STPSE_W { + STPSE_W::new(self, 4) } #[doc = "Bit 5 - Shadow transfer done interrupt enable"] #[inline(always)] #[must_use] - pub fn stde(&mut self) -> STDE_W<5> { - STDE_W::new(self) + pub fn stde(&mut self) -> STDE_W { + STDE_W::new(self, 5) } #[doc = "Bit 6 - Comparator rise interrupt enable"] #[inline(always)] #[must_use] - pub fn crse(&mut self) -> CRSE_W<6> { - CRSE_W::new(self) + pub fn crse(&mut self) -> CRSE_W { + CRSE_W::new(self, 6) } #[doc = "Bit 7 - Comparator fall interrupt enable"] #[inline(always)] #[must_use] - pub fn cfse(&mut self) -> CFSE_W<7> { - CFSE_W::new(self) + pub fn cfse(&mut self) -> CFSE_W { + CFSE_W::new(self, 7) } #[doc = "Bit 8 - Clamped state interrupt enable"] #[inline(always)] #[must_use] - pub fn csee(&mut self) -> CSEE_W<8> { - CSEE_W::new(self) + pub fn csee(&mut self) -> CSEE_W { + CSEE_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service request enable\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sre::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sre::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sre::R`](R) reader structure"] +impl crate::Readable for SRE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sre::W`](W) writer structure"] impl crate::Writable for SRE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/srs.rs b/src/hrpwm0_csg0/srs.rs index 829e950e..a2c6061a 100644 --- a/src/hrpwm0_csg0/srs.rs +++ b/src/hrpwm0_csg0/srs.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VLS1S` reader - Value switch from CSGyDSV1 to CSGyDSV2 interrupt line selection"] -pub type VLS1S_R = crate::FieldReader; +pub type VLS1S_R = crate::FieldReader; #[doc = "Value switch from CSGyDSV1 to CSGyDSV2 interrupt line selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for VLS1S_A { + type Ux = u8; +} impl VLS1S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VLS1S_A { + pub const fn variant(&self) -> VLS1S_A { match self.bits { 0 => VLS1S_A::VALUE1, 1 => VLS1S_A::VALUE2, @@ -67,53 +38,57 @@ impl VLS1S_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSGySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VLS1S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VLS1S_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CSGySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == VLS1S_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == VLS1S_A::VALUE4 } } #[doc = "Field `VLS1S` writer - Value switch from CSGyDSV1 to CSGyDSV2 interrupt line selection"] -pub type VLS1S_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, VLS1S_A, 2, O>; -impl<'a, const O: u8> VLS1S_W<'a, O> { +pub type VLS1S_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, VLS1S_A>; +impl<'a, REG> VLS1S_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSGySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VLS1S_A::VALUE1) } #[doc = "CSGySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VLS1S_A::VALUE2) } #[doc = "CSGySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(VLS1S_A::VALUE3) } #[doc = "CSGySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(VLS1S_A::VALUE4) } } #[doc = "Field `VLS2S` reader - Value switch from CSGyDSV2 to CSGyDSV1 interrupt line selection"] -pub type VLS2S_R = crate::FieldReader; +pub type VLS2S_R = crate::FieldReader; #[doc = "Value switch from CSGyDSV2 to CSGyDSV1 interrupt line selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for VLS2S_A { + type Ux = u8; +} impl VLS2S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VLS2S_A { + pub const fn variant(&self) -> VLS2S_A { match self.bits { 0 => VLS2S_A::VALUE1, 1 => VLS2S_A::VALUE2, @@ -145,53 +123,57 @@ impl VLS2S_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSGySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VLS2S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VLS2S_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CSGySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == VLS2S_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == VLS2S_A::VALUE4 } } #[doc = "Field `VLS2S` writer - Value switch from CSGyDSV2 to CSGyDSV1 interrupt line selection"] -pub type VLS2S_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, VLS2S_A, 2, O>; -impl<'a, const O: u8> VLS2S_W<'a, O> { +pub type VLS2S_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, VLS2S_A>; +impl<'a, REG> VLS2S_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSGySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VLS2S_A::VALUE1) } #[doc = "CSGySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VLS2S_A::VALUE2) } #[doc = "CSGySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(VLS2S_A::VALUE3) } #[doc = "CSGySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(VLS2S_A::VALUE4) } } #[doc = "Field `TRLS` reader - Conversion trigger interrupt line selection"] -pub type TRLS_R = crate::FieldReader; +pub type TRLS_R = crate::FieldReader; #[doc = "Conversion trigger interrupt line selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TRLS_A { + type Ux = u8; +} impl TRLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRLS_A { + pub const fn variant(&self) -> TRLS_A { match self.bits { 0 => TRLS_A::VALUE1, 1 => TRLS_A::VALUE2, @@ -223,53 +208,57 @@ impl TRLS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSGySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRLS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CSGySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TRLS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TRLS_A::VALUE4 } } #[doc = "Field `TRLS` writer - Conversion trigger interrupt line selection"] -pub type TRLS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, TRLS_A, 2, O>; -impl<'a, const O: u8> TRLS_W<'a, O> { +pub type TRLS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, TRLS_A>; +impl<'a, REG> TRLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSGySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRLS_A::VALUE1) } #[doc = "CSGySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRLS_A::VALUE2) } #[doc = "CSGySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TRLS_A::VALUE3) } #[doc = "CSGySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TRLS_A::VALUE4) } } #[doc = "Field `SSLS` reader - Start/Stop trigger interrupt line selection"] -pub type SSLS_R = crate::FieldReader; +pub type SSLS_R = crate::FieldReader; #[doc = "Start/Stop trigger interrupt line selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SSLS_A { + type Ux = u8; +} impl SSLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SSLS_A { + pub const fn variant(&self) -> SSLS_A { match self.bits { 0 => SSLS_A::VALUE1, 1 => SSLS_A::VALUE2, @@ -301,53 +293,57 @@ impl SSLS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSGySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SSLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SSLS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CSGySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SSLS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SSLS_A::VALUE4 } } #[doc = "Field `SSLS` writer - Start/Stop trigger interrupt line selection"] -pub type SSLS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, SSLS_A, 2, O>; -impl<'a, const O: u8> SSLS_W<'a, O> { +pub type SSLS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SSLS_A>; +impl<'a, REG> SSLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSGySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SSLS_A::VALUE1) } #[doc = "CSGySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SSLS_A::VALUE2) } #[doc = "CSGySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SSLS_A::VALUE3) } #[doc = "CSGySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SSLS_A::VALUE4) } } #[doc = "Field `STLS` reader - Shadow transfer done interrupt line selection"] -pub type STLS_R = crate::FieldReader; +pub type STLS_R = crate::FieldReader; #[doc = "Shadow transfer done interrupt line selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STLS_A { + type Ux = u8; +} impl STLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STLS_A { + pub const fn variant(&self) -> STLS_A { match self.bits { 0 => STLS_A::VALUE1, 1 => STLS_A::VALUE2, @@ -379,53 +378,57 @@ impl STLS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSGySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STLS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CSGySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STLS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STLS_A::VALUE4 } } #[doc = "Field `STLS` writer - Shadow transfer done interrupt line selection"] -pub type STLS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, STLS_A, 2, O>; -impl<'a, const O: u8> STLS_W<'a, O> { +pub type STLS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, STLS_A>; +impl<'a, REG> STLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSGySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STLS_A::VALUE1) } #[doc = "CSGySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STLS_A::VALUE2) } #[doc = "CSGySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STLS_A::VALUE3) } #[doc = "CSGySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STLS_A::VALUE4) } } #[doc = "Field `CRFLS` reader - Comparator rise/fall interrupt line selection"] -pub type CRFLS_R = crate::FieldReader; +pub type CRFLS_R = crate::FieldReader; #[doc = "Comparator rise/fall interrupt line selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CRFLS_A { + type Ux = u8; +} impl CRFLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CRFLS_A { + pub const fn variant(&self) -> CRFLS_A { match self.bits { 0 => CRFLS_A::VALUE1, 1 => CRFLS_A::VALUE2, @@ -457,53 +463,57 @@ impl CRFLS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSGySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CRFLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CRFLS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CSGySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CRFLS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CRFLS_A::VALUE4 } } #[doc = "Field `CRFLS` writer - Comparator rise/fall interrupt line selection"] -pub type CRFLS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, CRFLS_A, 2, O>; -impl<'a, const O: u8> CRFLS_W<'a, O> { +pub type CRFLS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CRFLS_A>; +impl<'a, REG> CRFLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSGySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CRFLS_A::VALUE1) } #[doc = "CSGySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CRFLS_A::VALUE2) } #[doc = "CSGySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CRFLS_A::VALUE3) } #[doc = "CSGySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CRFLS_A::VALUE4) } } #[doc = "Field `CSLS` reader - Comparator clamped state interrupt line selection"] -pub type CSLS_R = crate::FieldReader; +pub type CSLS_R = crate::FieldReader; #[doc = "Comparator clamped state interrupt line selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -523,10 +533,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CSLS_A { + type Ux = u8; +} impl CSLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CSLS_A { + pub const fn variant(&self) -> CSLS_A { match self.bits { 0 => CSLS_A::VALUE1, 1 => CSLS_A::VALUE2, @@ -535,48 +548,52 @@ impl CSLS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CSGySR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CSLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CSGySR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CSLS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CSGySR2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CSLS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CSGySR3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CSLS_A::VALUE4 } } #[doc = "Field `CSLS` writer - Comparator clamped state interrupt line selection"] -pub type CSLS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SRS_SPEC, u8, CSLS_A, 2, O>; -impl<'a, const O: u8> CSLS_W<'a, O> { +pub type CSLS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CSLS_A>; +impl<'a, REG> CSLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CSGySR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CSLS_A::VALUE1) } #[doc = "CSGySR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CSLS_A::VALUE2) } #[doc = "CSGySR2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CSLS_A::VALUE3) } #[doc = "CSGySR3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CSLS_A::VALUE4) } } @@ -621,64 +638,65 @@ impl W { #[doc = "Bits 0:1 - Value switch from CSGyDSV1 to CSGyDSV2 interrupt line selection"] #[inline(always)] #[must_use] - pub fn vls1s(&mut self) -> VLS1S_W<0> { - VLS1S_W::new(self) + pub fn vls1s(&mut self) -> VLS1S_W { + VLS1S_W::new(self, 0) } #[doc = "Bits 2:3 - Value switch from CSGyDSV2 to CSGyDSV1 interrupt line selection"] #[inline(always)] #[must_use] - pub fn vls2s(&mut self) -> VLS2S_W<2> { - VLS2S_W::new(self) + pub fn vls2s(&mut self) -> VLS2S_W { + VLS2S_W::new(self, 2) } #[doc = "Bits 4:5 - Conversion trigger interrupt line selection"] #[inline(always)] #[must_use] - pub fn trls(&mut self) -> TRLS_W<4> { - TRLS_W::new(self) + pub fn trls(&mut self) -> TRLS_W { + TRLS_W::new(self, 4) } #[doc = "Bits 6:7 - Start/Stop trigger interrupt line selection"] #[inline(always)] #[must_use] - pub fn ssls(&mut self) -> SSLS_W<6> { - SSLS_W::new(self) + pub fn ssls(&mut self) -> SSLS_W { + SSLS_W::new(self, 6) } #[doc = "Bits 8:9 - Shadow transfer done interrupt line selection"] #[inline(always)] #[must_use] - pub fn stls(&mut self) -> STLS_W<8> { - STLS_W::new(self) + pub fn stls(&mut self) -> STLS_W { + STLS_W::new(self, 8) } #[doc = "Bits 10:11 - Comparator rise/fall interrupt line selection"] #[inline(always)] #[must_use] - pub fn crfls(&mut self) -> CRFLS_W<10> { - CRFLS_W::new(self) + pub fn crfls(&mut self) -> CRFLS_W { + CRFLS_W::new(self, 10) } #[doc = "Bits 12:13 - Comparator clamped state interrupt line selection"] #[inline(always)] #[must_use] - pub fn csls(&mut self) -> CSLS_W<12> { - CSLS_W::new(self) + pub fn csls(&mut self) -> CSLS_W { + CSLS_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service request line selector\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`srs::R`](R) reader structure"] +impl crate::Readable for SRS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`srs::W`](W) writer structure"] impl crate::Writable for SRS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/swc.rs b/src/hrpwm0_csg0/swc.rs index 5374fdf7..6a1b05a8 100644 --- a/src/hrpwm0_csg0/swc.rs +++ b/src/hrpwm0_csg0/swc.rs @@ -1,112 +1,96 @@ #[doc = "Register `SWC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CVLS1` writer - Value switch from CSGyDSV1 to CSGyDSV2 status clear"] -pub type CVLS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CVLS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CVLS2` writer - Value switch from CSGyDSV2 to CSGyDSV1 status clear"] -pub type CVLS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CVLS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTRGS` writer - Conversion trigger status clear"] -pub type CTRGS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CTRGS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CSTRS` writer - Start trigger status clear"] -pub type CSTRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CSTRS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CSTPS` writer - Stop trigger status clear"] -pub type CSTPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CSTPS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CSTD` writer - Shadow transfer status clear"] -pub type CSTD_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CSTD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CCRS` writer - Comparator rise status clear"] -pub type CCRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CCRS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CCFS` writer - Comparator fall status clear"] -pub type CCFS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CCFS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CCSS` writer - Comparator clamped status clear"] -pub type CCSS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWC_SPEC, bool, O>; +pub type CCSS_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Value switch from CSGyDSV1 to CSGyDSV2 status clear"] #[inline(always)] #[must_use] - pub fn cvls1(&mut self) -> CVLS1_W<0> { - CVLS1_W::new(self) + pub fn cvls1(&mut self) -> CVLS1_W { + CVLS1_W::new(self, 0) } #[doc = "Bit 1 - Value switch from CSGyDSV2 to CSGyDSV1 status clear"] #[inline(always)] #[must_use] - pub fn cvls2(&mut self) -> CVLS2_W<1> { - CVLS2_W::new(self) + pub fn cvls2(&mut self) -> CVLS2_W { + CVLS2_W::new(self, 1) } #[doc = "Bit 2 - Conversion trigger status clear"] #[inline(always)] #[must_use] - pub fn ctrgs(&mut self) -> CTRGS_W<2> { - CTRGS_W::new(self) + pub fn ctrgs(&mut self) -> CTRGS_W { + CTRGS_W::new(self, 2) } #[doc = "Bit 3 - Start trigger status clear"] #[inline(always)] #[must_use] - pub fn cstrs(&mut self) -> CSTRS_W<3> { - CSTRS_W::new(self) + pub fn cstrs(&mut self) -> CSTRS_W { + CSTRS_W::new(self, 3) } #[doc = "Bit 4 - Stop trigger status clear"] #[inline(always)] #[must_use] - pub fn cstps(&mut self) -> CSTPS_W<4> { - CSTPS_W::new(self) + pub fn cstps(&mut self) -> CSTPS_W { + CSTPS_W::new(self, 4) } #[doc = "Bit 5 - Shadow transfer status clear"] #[inline(always)] #[must_use] - pub fn cstd(&mut self) -> CSTD_W<5> { - CSTD_W::new(self) + pub fn cstd(&mut self) -> CSTD_W { + CSTD_W::new(self, 5) } #[doc = "Bit 6 - Comparator rise status clear"] #[inline(always)] #[must_use] - pub fn ccrs(&mut self) -> CCRS_W<6> { - CCRS_W::new(self) + pub fn ccrs(&mut self) -> CCRS_W { + CCRS_W::new(self, 6) } #[doc = "Bit 7 - Comparator fall status clear"] #[inline(always)] #[must_use] - pub fn ccfs(&mut self) -> CCFS_W<7> { - CCFS_W::new(self) + pub fn ccfs(&mut self) -> CCFS_W { + CCFS_W::new(self, 7) } #[doc = "Bit 8 - Comparator clamped status clear"] #[inline(always)] #[must_use] - pub fn ccss(&mut self) -> CCSS_W<8> { - CCSS_W::new(self) + pub fn ccss(&mut self) -> CCSS_W { + CCSS_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service request SW clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`swc::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SWC_SPEC; impl crate::RegisterSpec for SWC_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [swc::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`swc::W`](W) writer structure"] impl crate::Writable for SWC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_csg0/sws.rs b/src/hrpwm0_csg0/sws.rs index 1dc30b98..9ee485db 100644 --- a/src/hrpwm0_csg0/sws.rs +++ b/src/hrpwm0_csg0/sws.rs @@ -1,112 +1,96 @@ #[doc = "Register `SWS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SVLS1` writer - Value switch from CSGyDSV1 to CSGyDSV2 status set"] -pub type SVLS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SVLS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SVLS2` writer - Value switch from CSGyDSV2 to CSGyDSV1 status set"] -pub type SVLS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SVLS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STRGS` writer - Conversion trigger status set"] -pub type STRGS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type STRGS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SSTRS` writer - Start trigger status set"] -pub type SSTRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SSTRS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SSTPS` writer - Stop trigger status set"] -pub type SSTPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SSTPS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SSTD` writer - Shadow transfer status set"] -pub type SSTD_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SSTD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCRS` writer - Comparator rise status set"] -pub type SCRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCRS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCFS` writer - Comparator fall status set"] -pub type SCFS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCFS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCSS` writer - Comparator clamped state status set"] -pub type SCSS_W<'a, const O: u8> = crate::BitWriter<'a, u32, SWS_SPEC, bool, O>; +pub type SCSS_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Value switch from CSGyDSV1 to CSGyDSV2 status set"] #[inline(always)] #[must_use] - pub fn svls1(&mut self) -> SVLS1_W<0> { - SVLS1_W::new(self) + pub fn svls1(&mut self) -> SVLS1_W { + SVLS1_W::new(self, 0) } #[doc = "Bit 1 - Value switch from CSGyDSV2 to CSGyDSV1 status set"] #[inline(always)] #[must_use] - pub fn svls2(&mut self) -> SVLS2_W<1> { - SVLS2_W::new(self) + pub fn svls2(&mut self) -> SVLS2_W { + SVLS2_W::new(self, 1) } #[doc = "Bit 2 - Conversion trigger status set"] #[inline(always)] #[must_use] - pub fn strgs(&mut self) -> STRGS_W<2> { - STRGS_W::new(self) + pub fn strgs(&mut self) -> STRGS_W { + STRGS_W::new(self, 2) } #[doc = "Bit 3 - Start trigger status set"] #[inline(always)] #[must_use] - pub fn sstrs(&mut self) -> SSTRS_W<3> { - SSTRS_W::new(self) + pub fn sstrs(&mut self) -> SSTRS_W { + SSTRS_W::new(self, 3) } #[doc = "Bit 4 - Stop trigger status set"] #[inline(always)] #[must_use] - pub fn sstps(&mut self) -> SSTPS_W<4> { - SSTPS_W::new(self) + pub fn sstps(&mut self) -> SSTPS_W { + SSTPS_W::new(self, 4) } #[doc = "Bit 5 - Shadow transfer status set"] #[inline(always)] #[must_use] - pub fn sstd(&mut self) -> SSTD_W<5> { - SSTD_W::new(self) + pub fn sstd(&mut self) -> SSTD_W { + SSTD_W::new(self, 5) } #[doc = "Bit 6 - Comparator rise status set"] #[inline(always)] #[must_use] - pub fn scrs(&mut self) -> SCRS_W<6> { - SCRS_W::new(self) + pub fn scrs(&mut self) -> SCRS_W { + SCRS_W::new(self, 6) } #[doc = "Bit 7 - Comparator fall status set"] #[inline(always)] #[must_use] - pub fn scfs(&mut self) -> SCFS_W<7> { - SCFS_W::new(self) + pub fn scfs(&mut self) -> SCFS_W { + SCFS_W::new(self, 7) } #[doc = "Bit 8 - Comparator clamped state status set"] #[inline(always)] #[must_use] - pub fn scss(&mut self) -> SCSS_W<8> { - SCSS_W::new(self) + pub fn scss(&mut self) -> SCSS_W { + SCSS_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service request SW set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sws::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SWS_SPEC; impl crate::RegisterSpec for SWS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [sws::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`sws::W`](W) writer structure"] impl crate::Writable for SWS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0.rs b/src/hrpwm0_hrc0.rs index 68ba44a3..be79e4b8 100644 --- a/src/hrpwm0_hrc0.rs +++ b/src/hrpwm0_hrc0.rs @@ -1,88 +1,160 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + gc: GC, + pl: PL, + gsel: GSEL, + tsel: TSEL, + sc: SC, + dcr: DCR, + dcf: DCF, + cr1: CR1, + cr2: CR2, + ssc: SSC, + sdcr: SDCR, + sdcf: SDCF, + scr1: SCR1, + scr2: SCR2, +} +impl RegisterBlock { #[doc = "0x00 - HRC mode configuration"] - pub gc: GC, + #[inline(always)] + pub const fn gc(&self) -> &GC { + &self.gc + } #[doc = "0x04 - HRC output passive level"] - pub pl: PL, + #[inline(always)] + pub const fn pl(&self) -> &PL { + &self.pl + } #[doc = "0x08 - HRC global control selection"] - pub gsel: GSEL, + #[inline(always)] + pub const fn gsel(&self) -> &GSEL { + &self.gsel + } #[doc = "0x0c - HRC timer selection"] - pub tsel: TSEL, + #[inline(always)] + pub const fn tsel(&self) -> &TSEL { + &self.tsel + } #[doc = "0x10 - HRC current source for shadow"] - pub sc: SC, + #[inline(always)] + pub const fn sc(&self) -> &SC { + &self.sc + } #[doc = "0x14 - HRC dead time rising value"] - pub dcr: DCR, + #[inline(always)] + pub const fn dcr(&self) -> &DCR { + &self.dcr + } #[doc = "0x18 - HRC dead time falling value"] - pub dcf: DCF, + #[inline(always)] + pub const fn dcf(&self) -> &DCF { + &self.dcf + } #[doc = "0x1c - HRC rising edge value"] - pub cr1: CR1, + #[inline(always)] + pub const fn cr1(&self) -> &CR1 { + &self.cr1 + } #[doc = "0x20 - HRC falling edge value"] - pub cr2: CR2, + #[inline(always)] + pub const fn cr2(&self) -> &CR2 { + &self.cr2 + } #[doc = "0x24 - HRC next source for shadow"] - pub ssc: SSC, + #[inline(always)] + pub const fn ssc(&self) -> &SSC { + &self.ssc + } #[doc = "0x28 - HRC shadow dead time rising"] - pub sdcr: SDCR, + #[inline(always)] + pub const fn sdcr(&self) -> &SDCR { + &self.sdcr + } #[doc = "0x2c - HRC shadow dead time falling"] - pub sdcf: SDCF, + #[inline(always)] + pub const fn sdcf(&self) -> &SDCF { + &self.sdcf + } #[doc = "0x30 - HRC shadow rising edge value"] - pub scr1: SCR1, + #[inline(always)] + pub const fn scr1(&self) -> &SCR1 { + &self.scr1 + } #[doc = "0x34 - HRC shadow falling edge value"] - pub scr2: SCR2, + #[inline(always)] + pub const fn scr2(&self) -> &SCR2 { + &self.scr2 + } } -#[doc = "GC (rw) register accessor: an alias for `Reg`"] +#[doc = "GC (rw) register accessor: HRC mode configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gc`] +module"] pub type GC = crate::Reg; #[doc = "HRC mode configuration"] pub mod gc; -#[doc = "PL (rw) register accessor: an alias for `Reg`"] +#[doc = "PL (rw) register accessor: HRC output passive level\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pl`] +module"] pub type PL = crate::Reg; #[doc = "HRC output passive level"] pub mod pl; -#[doc = "GSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "GSEL (rw) register accessor: HRC global control selection\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gsel`] +module"] pub type GSEL = crate::Reg; #[doc = "HRC global control selection"] pub mod gsel; -#[doc = "TSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "TSEL (rw) register accessor: HRC timer selection\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tsel`] +module"] pub type TSEL = crate::Reg; #[doc = "HRC timer selection"] pub mod tsel; -#[doc = "SC (r) register accessor: an alias for `Reg`"] +#[doc = "SC (r) register accessor: HRC current source for shadow\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sc::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sc`] +module"] pub type SC = crate::Reg; #[doc = "HRC current source for shadow"] pub mod sc; -#[doc = "DCR (r) register accessor: an alias for `Reg`"] +#[doc = "DCR (r) register accessor: HRC dead time rising value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dcr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dcr`] +module"] pub type DCR = crate::Reg; #[doc = "HRC dead time rising value"] pub mod dcr; -#[doc = "DCF (r) register accessor: an alias for `Reg`"] +#[doc = "DCF (r) register accessor: HRC dead time falling value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dcf::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dcf`] +module"] pub type DCF = crate::Reg; #[doc = "HRC dead time falling value"] pub mod dcf; -#[doc = "CR1 (r) register accessor: an alias for `Reg`"] +#[doc = "CR1 (r) register accessor: HRC rising edge value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr1`] +module"] pub type CR1 = crate::Reg; #[doc = "HRC rising edge value"] pub mod cr1; -#[doc = "CR2 (r) register accessor: an alias for `Reg`"] +#[doc = "CR2 (r) register accessor: HRC falling edge value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr2::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr2`] +module"] pub type CR2 = crate::Reg; #[doc = "HRC falling edge value"] pub mod cr2; -#[doc = "SSC (rw) register accessor: an alias for `Reg`"] +#[doc = "SSC (rw) register accessor: HRC next source for shadow\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ssc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ssc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ssc`] +module"] pub type SSC = crate::Reg; #[doc = "HRC next source for shadow"] pub mod ssc; -#[doc = "SDCR (rw) register accessor: an alias for `Reg`"] +#[doc = "SDCR (rw) register accessor: HRC shadow dead time rising\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sdcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sdcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sdcr`] +module"] pub type SDCR = crate::Reg; #[doc = "HRC shadow dead time rising"] pub mod sdcr; -#[doc = "SDCF (rw) register accessor: an alias for `Reg`"] +#[doc = "SDCF (rw) register accessor: HRC shadow dead time falling\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sdcf::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sdcf::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sdcf`] +module"] pub type SDCF = crate::Reg; #[doc = "HRC shadow dead time falling"] pub mod sdcf; -#[doc = "SCR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "SCR1 (rw) register accessor: HRC shadow rising edge value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`scr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`scr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@scr1`] +module"] pub type SCR1 = crate::Reg; #[doc = "HRC shadow rising edge value"] pub mod scr1; -#[doc = "SCR2 (rw) register accessor: an alias for `Reg`"] +#[doc = "SCR2 (rw) register accessor: HRC shadow falling edge value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`scr2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`scr2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@scr2`] +module"] 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 eeab00c1..d2eb7fad 100644 --- a/src/hrpwm0_hrc0/cr1.rs +++ b/src/hrpwm0_hrc0/cr1.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CR1` reader - High resolution rising edge value"] -pub type CR1_R = crate::FieldReader; +pub type CR1_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - High resolution rising edge value"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "HRC rising edge value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cr1::R`](R) reader structure"] +impl crate::Readable for CR1_SPEC {} #[doc = "`reset()` method sets CR1 to value 0"] impl crate::Resettable for CR1_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0_hrc0/cr2.rs b/src/hrpwm0_hrc0/cr2.rs index 6e708255..ede94592 100644 --- a/src/hrpwm0_hrc0/cr2.rs +++ b/src/hrpwm0_hrc0/cr2.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CR2` reader - High resolution falling edge value"] -pub type CR2_R = crate::FieldReader; +pub type CR2_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - High resolution falling edge value"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "HRC falling edge value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cr2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cr2::R`](R) reader structure"] +impl crate::Readable for CR2_SPEC {} #[doc = "`reset()` method sets CR2 to value 0"] impl crate::Resettable for CR2_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0_hrc0/dcf.rs b/src/hrpwm0_hrc0/dcf.rs index 97a5d345..19704dc2 100644 --- a/src/hrpwm0_hrc0/dcf.rs +++ b/src/hrpwm0_hrc0/dcf.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DTFV` reader - Dead time falling value"] -pub type DTFV_R = crate::FieldReader; +pub type DTFV_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Dead time falling value"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "HRC dead time falling value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dcf::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dcf::R`](R) reader structure"] +impl crate::Readable for DCF_SPEC {} #[doc = "`reset()` method sets DCF to value 0x01"] impl crate::Resettable for DCF_SPEC { const RESET_VALUE: Self::Ux = 0x01; diff --git a/src/hrpwm0_hrc0/dcr.rs b/src/hrpwm0_hrc0/dcr.rs index 8e91c7a7..3421d0a3 100644 --- a/src/hrpwm0_hrc0/dcr.rs +++ b/src/hrpwm0_hrc0/dcr.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DTRV` reader - Dead time rising value"] -pub type DTRV_R = crate::FieldReader; +pub type DTRV_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Dead time rising value"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "HRC dead time rising value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dcr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dcr::R`](R) reader structure"] +impl crate::Readable for DCR_SPEC {} #[doc = "`reset()` method sets DCR to value 0x01"] impl crate::Resettable for DCR_SPEC { const RESET_VALUE: Self::Ux = 0x01; diff --git a/src/hrpwm0_hrc0/gc.rs b/src/hrpwm0_hrc0/gc.rs index 520ad4d5..7602222a 100644 --- a/src/hrpwm0_hrc0/gc.rs +++ b/src/hrpwm0_hrc0/gc.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HRM0` reader - HRCy high resolution mode configuration for source selector 0"] -pub type HRM0_R = crate::FieldReader; +pub type HRM0_R = crate::FieldReader; #[doc = "HRCy high resolution mode configuration for source selector 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HRM0_A { + type Ux = u8; +} impl HRM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRM0_A { + pub const fn variant(&self) -> HRM0_A { match self.bits { 0 => HRM0_A::VALUE1, 1 => HRM0_A::VALUE2, @@ -67,53 +38,57 @@ impl HRM0_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Rising edge high resolution signal positioning enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HRM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Falling edge high resolution signal positioning enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRM0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Both edges high resolution signal positioning is enabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HRM0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "No high resolution positioning"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == HRM0_A::VALUE4 } } #[doc = "Field `HRM0` writer - HRCy high resolution mode configuration for source selector 0"] -pub type HRM0_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GC_SPEC, u8, HRM0_A, 2, O>; -impl<'a, const O: u8> HRM0_W<'a, O> { +pub type HRM0_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, HRM0_A>; +impl<'a, REG> HRM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Rising edge high resolution signal positioning enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRM0_A::VALUE1) } #[doc = "Falling edge high resolution signal positioning enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRM0_A::VALUE2) } #[doc = "Both edges high resolution signal positioning is enabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HRM0_A::VALUE3) } #[doc = "No high resolution positioning"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(HRM0_A::VALUE4) } } #[doc = "Field `HRM1` reader - HRCy high resolution mode configuration for source selector 1"] -pub type HRM1_R = crate::FieldReader; +pub type HRM1_R = crate::FieldReader; #[doc = "HRCy high resolution mode configuration for source selector 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HRM1_A { + type Ux = u8; +} impl HRM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRM1_A { + pub const fn variant(&self) -> HRM1_A { match self.bits { 0 => HRM1_A::VALUE1, 1 => HRM1_A::VALUE2, @@ -145,48 +123,52 @@ impl HRM1_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Rising edge high resolution signal positioning enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HRM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Falling edge high resolution signal positioning enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRM1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Both edges high resolution signal positioning is enabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HRM1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "No high resolution positioning"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == HRM1_A::VALUE4 } } #[doc = "Field `HRM1` writer - HRCy high resolution mode configuration for source selector 1"] -pub type HRM1_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GC_SPEC, u8, HRM1_A, 2, O>; -impl<'a, const O: u8> HRM1_W<'a, O> { +pub type HRM1_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, HRM1_A>; +impl<'a, REG> HRM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Rising edge high resolution signal positioning enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRM1_A::VALUE1) } #[doc = "Falling edge high resolution signal positioning enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRM1_A::VALUE2) } #[doc = "Both edges high resolution signal positioning is enabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HRM1_A::VALUE3) } #[doc = "No high resolution positioning"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(HRM1_A::VALUE4) } } @@ -209,34 +191,37 @@ impl From for bool { impl DTE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DTE_A { + pub const fn variant(&self) -> DTE_A { match self.bits { false => DTE_A::VALUE1, true => DTE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Dead time insertion is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DTE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Dead time insertion is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DTE_A::VALUE2 } } #[doc = "Field `DTE` writer - HRCy dead time enable"] -pub type DTE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GC_SPEC, DTE_A, O>; -impl<'a, const O: u8> DTE_W<'a, O> { +pub type DTE_W<'a, REG> = crate::BitWriter<'a, REG, DTE_A>; +impl<'a, REG> DTE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Dead time insertion is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DTE_A::VALUE1) } #[doc = "Dead time insertion is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DTE_A::VALUE2) } } @@ -259,34 +244,37 @@ impl From for bool { impl TR0E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TR0E_A { + pub const fn variant(&self) -> TR0E_A { match self.bits { false => TR0E_A::VALUE1, true => TR0E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap function for HRPWMx.HROUTy0 is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TR0E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap function for HRPWMx.HROUTy0 is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TR0E_A::VALUE2 } } #[doc = "Field `TR0E` writer - HRCy trap enable"] -pub type TR0E_W<'a, const O: u8> = crate::BitWriter<'a, u32, GC_SPEC, TR0E_A, O>; -impl<'a, const O: u8> TR0E_W<'a, O> { +pub type TR0E_W<'a, REG> = crate::BitWriter<'a, REG, TR0E_A>; +impl<'a, REG> TR0E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap function for HRPWMx.HROUTy0 is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TR0E_A::VALUE1) } #[doc = "Trap function for HRPWMx.HROUTy0 is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TR0E_A::VALUE2) } } @@ -309,34 +297,37 @@ impl From for bool { impl TR1E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TR1E_A { + pub const fn variant(&self) -> TR1E_A { match self.bits { false => TR1E_A::VALUE1, true => TR1E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap function for HRPWMx.HROUTy1 is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TR1E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap function for HRPWMx.HROUTy1 is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TR1E_A::VALUE2 } } #[doc = "Field `TR1E` writer - HRCy complementary trap enable"] -pub type TR1E_W<'a, const O: u8> = crate::BitWriter<'a, u32, GC_SPEC, TR1E_A, O>; -impl<'a, const O: u8> TR1E_W<'a, O> { +pub type TR1E_W<'a, REG> = crate::BitWriter<'a, REG, TR1E_A>; +impl<'a, REG> TR1E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap function for HRPWMx.HROUTy1 is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TR1E_A::VALUE1) } #[doc = "Trap function for HRPWMx.HROUTy1 is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TR1E_A::VALUE2) } } @@ -359,34 +350,37 @@ impl From for bool { impl STC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STC_A { + pub const fn variant(&self) -> STC_A { match self.bits { false => STC_A::VALUE1, true => STC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == STC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[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 linked with the specific Capture/Compare Unit timer."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STC_A::VALUE2 } } #[doc = "Field `STC` writer - HRCy shadow transfer configuration"] -pub type STC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GC_SPEC, STC_A, O>; -impl<'a, const O: u8> STC_W<'a, O> { +pub type STC_W<'a, REG> = crate::BitWriter<'a, REG, STC_A>; +impl<'a, REG> STC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STC_A::VALUE1) } #[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 linked with the specific Capture/Compare Unit timer."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STC_A::VALUE2) } } @@ -409,34 +403,37 @@ impl From for bool { impl DSTC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSTC_A { + pub const fn variant(&self) -> DSTC_A { match self.bits { false => DSTC_A::VALUE1, true => DSTC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == DSTC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[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 linked with the specific Capture/Compare Unit timer."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSTC_A::VALUE2 } } #[doc = "Field `DSTC` writer - HRCy dead time shadow transfer configuration"] -pub type DSTC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GC_SPEC, DSTC_A, O>; -impl<'a, const O: u8> DSTC_W<'a, O> { +pub type DSTC_W<'a, REG> = crate::BitWriter<'a, REG, DSTC_A>; +impl<'a, REG> DSTC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSTC_A::VALUE1) } #[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 linked with the specific Capture/Compare Unit timer."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSTC_A::VALUE2) } } @@ -459,34 +456,37 @@ impl From for bool { impl OCS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OCS0_A { + pub const fn variant(&self) -> OCS0_A { match self.bits { false => OCS0_A::VALUE1, true => OCS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.OUTy0 is connected to the latch Q channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OCS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.OUTy0 is connected to the latch Qn channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OCS0_A::VALUE2 } } #[doc = "Field `OCS0` writer - HRPWMx.OUTy0 channel selector"] -pub type OCS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, GC_SPEC, OCS0_A, O>; -impl<'a, const O: u8> OCS0_W<'a, O> { +pub type OCS0_W<'a, REG> = crate::BitWriter<'a, REG, OCS0_A>; +impl<'a, REG> OCS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HRPWMx.OUTy0 is connected to the latch Q channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OCS0_A::VALUE1) } #[doc = "HRPWMx.OUTy0 is connected to the latch Qn channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OCS0_A::VALUE2) } } @@ -509,34 +509,37 @@ impl From for bool { impl OCS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OCS1_A { + pub const fn variant(&self) -> OCS1_A { match self.bits { false => OCS1_A::VALUE1, true => OCS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.OUTy1 is connected to the latch Qn channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OCS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.OUTy1 is connected to the latch Q channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OCS1_A::VALUE2 } } #[doc = "Field `OCS1` writer - HRPWMx.OUTy1 channel selector"] -pub type OCS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, GC_SPEC, OCS1_A, O>; -impl<'a, const O: u8> OCS1_W<'a, O> { +pub type OCS1_W<'a, REG> = crate::BitWriter<'a, REG, OCS1_A>; +impl<'a, REG> OCS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HRPWMx.OUTy1 is connected to the latch Qn channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OCS1_A::VALUE1) } #[doc = "HRPWMx.OUTy1 is connected to the latch Q channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OCS1_A::VALUE2) } } @@ -559,34 +562,37 @@ impl From for bool { impl DTUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DTUS_A { + pub const fn variant(&self) -> DTUS_A { match self.bits { false => DTUS_A::VALUE1, true => DTUS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == DTUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The update of the dead time values is done when the dead time counter is not running, independently of 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, . registers."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DTUS_A::VALUE2 } } #[doc = "Field `DTUS` writer - Dead Time update trigger selector"] -pub type DTUS_W<'a, const O: u8> = crate::BitWriter<'a, u32, GC_SPEC, DTUS_A, O>; -impl<'a, const O: u8> DTUS_W<'a, O> { +pub type DTUS_W<'a, REG> = crate::BitWriter<'a, REG, DTUS_A>; +impl<'a, REG> DTUS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DTUS_A::VALUE1) } #[doc = "The update of the dead time values is done when the dead time counter is not running, independently of 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, . registers."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DTUS_A::VALUE2) } } @@ -646,82 +652,83 @@ impl W { #[doc = "Bits 0:1 - HRCy high resolution mode configuration for source selector 0"] #[inline(always)] #[must_use] - pub fn hrm0(&mut self) -> HRM0_W<0> { - HRM0_W::new(self) + pub fn hrm0(&mut self) -> HRM0_W { + HRM0_W::new(self, 0) } #[doc = "Bits 2:3 - HRCy high resolution mode configuration for source selector 1"] #[inline(always)] #[must_use] - pub fn hrm1(&mut self) -> HRM1_W<2> { - HRM1_W::new(self) + pub fn hrm1(&mut self) -> HRM1_W { + HRM1_W::new(self, 2) } #[doc = "Bit 8 - HRCy dead time enable"] #[inline(always)] #[must_use] - pub fn dte(&mut self) -> DTE_W<8> { - DTE_W::new(self) + pub fn dte(&mut self) -> DTE_W { + DTE_W::new(self, 8) } #[doc = "Bit 9 - HRCy trap enable"] #[inline(always)] #[must_use] - pub fn tr0e(&mut self) -> TR0E_W<9> { - TR0E_W::new(self) + pub fn tr0e(&mut self) -> TR0E_W { + TR0E_W::new(self, 9) } #[doc = "Bit 10 - HRCy complementary trap enable"] #[inline(always)] #[must_use] - pub fn tr1e(&mut self) -> TR1E_W<10> { - TR1E_W::new(self) + pub fn tr1e(&mut self) -> TR1E_W { + TR1E_W::new(self, 10) } #[doc = "Bit 11 - HRCy shadow transfer configuration"] #[inline(always)] #[must_use] - pub fn stc(&mut self) -> STC_W<11> { - STC_W::new(self) + pub fn stc(&mut self) -> STC_W { + STC_W::new(self, 11) } #[doc = "Bit 12 - HRCy dead time shadow transfer configuration"] #[inline(always)] #[must_use] - pub fn dstc(&mut self) -> DSTC_W<12> { - DSTC_W::new(self) + pub fn dstc(&mut self) -> DSTC_W { + DSTC_W::new(self, 12) } #[doc = "Bit 13 - HRPWMx.OUTy0 channel selector"] #[inline(always)] #[must_use] - pub fn ocs0(&mut self) -> OCS0_W<13> { - OCS0_W::new(self) + pub fn ocs0(&mut self) -> OCS0_W { + OCS0_W::new(self, 13) } #[doc = "Bit 14 - HRPWMx.OUTy1 channel selector"] #[inline(always)] #[must_use] - pub fn ocs1(&mut self) -> OCS1_W<14> { - OCS1_W::new(self) + pub fn ocs1(&mut self) -> OCS1_W { + OCS1_W::new(self, 14) } #[doc = "Bit 16 - Dead Time update trigger selector"] #[inline(always)] #[must_use] - pub fn dtus(&mut self) -> DTUS_W<16> { - DTUS_W::new(self) + pub fn dtus(&mut self) -> DTUS_W { + DTUS_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC mode configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gc::R`](R) reader structure"] +impl crate::Readable for GC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gc::W`](W) writer structure"] impl crate::Writable for GC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0/gsel.rs b/src/hrpwm0_hrc0/gsel.rs index 30640190..619aeda5 100644 --- a/src/hrpwm0_hrc0/gsel.rs +++ b/src/hrpwm0_hrc0/gsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `C0SS` reader - Source selector 0 comparator set configuration"] -pub type C0SS_R = crate::FieldReader; +pub type C0SS_R = crate::FieldReader; #[doc = "Source selector 0 comparator set configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C0SS_A { + type Ux = u8; +} impl C0SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C0SS_A::VALUE1), 1 => Some(C0SS_A::VALUE2), @@ -64,43 +35,47 @@ impl C0SS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP output of CSG0 unit can be used as set source for the output latch"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C0SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP output of CSG1 unit can be used as set source for the output latch"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C0SS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CMP output of CSG2 unit can be used as set source for the output latch"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == C0SS_A::VALUE3 } } #[doc = "Field `C0SS` writer - Source selector 0 comparator set configuration"] -pub type C0SS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GSEL_SPEC, u8, C0SS_A, 3, O>; -impl<'a, const O: u8> C0SS_W<'a, O> { +pub type C0SS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, C0SS_A>; +impl<'a, REG> C0SS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CMP output of CSG0 unit can be used as set source for the output latch"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C0SS_A::VALUE1) } #[doc = "CMP output of CSG1 unit can be used as set source for the output latch"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C0SS_A::VALUE2) } #[doc = "CMP output of CSG2 unit can be used as set source for the output latch"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(C0SS_A::VALUE3) } } #[doc = "Field `C0CS` reader - Source selector 0 comparator clear configuration"] -pub type C0CS_R = crate::FieldReader; +pub type C0CS_R = crate::FieldReader; #[doc = "Source selector 0 comparator clear configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C0CS_A { + type Ux = u8; +} impl C0CS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C0CS_A::VALUE1), 1 => Some(C0CS_A::VALUE2), @@ -129,43 +107,47 @@ impl C0CS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP output of CSG0 unit can be used as clear source for the output latch"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C0CS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP output of CSG1 unit can be used as clear source for the output latch"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C0CS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CMP output of CSG2 unit can be used as clear source for the output latch"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == C0CS_A::VALUE3 } } #[doc = "Field `C0CS` writer - Source selector 0 comparator clear configuration"] -pub type C0CS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GSEL_SPEC, u8, C0CS_A, 3, O>; -impl<'a, const O: u8> C0CS_W<'a, O> { +pub type C0CS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, C0CS_A>; +impl<'a, REG> C0CS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CMP output of CSG0 unit can be used as clear source for the output latch"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C0CS_A::VALUE1) } #[doc = "CMP output of CSG1 unit can be used as clear source for the output latch"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C0CS_A::VALUE2) } #[doc = "CMP output of CSG2 unit can be used as clear source for the output latch"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(C0CS_A::VALUE3) } } #[doc = "Field `S0M` reader - Source selector 0 set configuration"] -pub type S0M_R = crate::FieldReader; +pub type S0M_R = crate::FieldReader; #[doc = "Source selector 0 set configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -181,43 +163,50 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for S0M_A { + type Ux = u8; +} impl S0M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(S0M_A::VALUE1), 1 => Some(S0M_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Set from source selector 0 is controlled via the Capture/Compare Unit timer, CCSTy signal"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Set from source selector 0 is controlled via the CMP output from the CSGy unit. Which unit is being used is configured via the C0SS field."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0M_A::VALUE2 } } #[doc = "Field `S0M` writer - Source selector 0 set configuration"] -pub type S0M_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GSEL_SPEC, u8, S0M_A, 2, O>; -impl<'a, const O: u8> S0M_W<'a, O> { +pub type S0M_W<'a, REG> = crate::FieldWriter<'a, REG, 2, S0M_A>; +impl<'a, REG> S0M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Set from source selector 0 is controlled via the Capture/Compare Unit timer, CCSTy signal"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(S0M_A::VALUE1) } #[doc = "Set from source selector 0 is controlled via the CMP output from the CSGy unit. Which unit is being used is configured via the C0SS field."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(S0M_A::VALUE2) } } #[doc = "Field `C0M` reader - Source selector 0 clear configuration"] -pub type C0M_R = crate::FieldReader; +pub type C0M_R = crate::FieldReader; #[doc = "Source selector 0 clear configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -233,43 +222,50 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C0M_A { + type Ux = u8; +} impl C0M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C0M_A::VALUE1), 1 => Some(C0M_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clear from source selector 0 is controlled via the Capture/Compare Unit timer, CCSTy signal"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C0M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clear from source selector 0 is controlled via the CMP output from the CSGy unit. Which unit is being used is configured via the C0CS field."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C0M_A::VALUE2 } } #[doc = "Field `C0M` writer - Source selector 0 clear configuration"] -pub type C0M_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GSEL_SPEC, u8, C0M_A, 2, O>; -impl<'a, const O: u8> C0M_W<'a, O> { +pub type C0M_W<'a, REG> = crate::FieldWriter<'a, REG, 2, C0M_A>; +impl<'a, REG> C0M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Clear from source selector 0 is controlled via the Capture/Compare Unit timer, CCSTy signal"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C0M_A::VALUE1) } #[doc = "Clear from source selector 0 is controlled via the CMP output from the CSGy unit. Which unit is being used is configured via the C0CS field."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C0M_A::VALUE2) } } #[doc = "Field `S0ES` reader - Source selector 0 set edge configuration"] -pub type S0ES_R = crate::FieldReader; +pub type S0ES_R = crate::FieldReader; #[doc = "Source selector 0 set edge configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +285,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for S0ES_A { + type Ux = u8; +} impl S0ES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S0ES_A { + pub const fn variant(&self) -> S0ES_A { match self.bits { 0 => S0ES_A::VALUE1, 1 => S0ES_A::VALUE2, @@ -301,53 +300,57 @@ impl S0ES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Generation of the set signal is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S0ES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Set signal is generated on a LOW to HIGH transition of the selected input"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S0ES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Set signal is generated on a HIGH to LOW transition of the selected input"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == S0ES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Set signal is generated on both transitions of the selected input"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == S0ES_A::VALUE4 } } #[doc = "Field `S0ES` writer - Source selector 0 set edge configuration"] -pub type S0ES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GSEL_SPEC, u8, S0ES_A, 2, O>; -impl<'a, const O: u8> S0ES_W<'a, O> { +pub type S0ES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, S0ES_A>; +impl<'a, REG> S0ES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Generation of the set signal is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(S0ES_A::VALUE1) } #[doc = "Set signal is generated on a LOW to HIGH transition of the selected input"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(S0ES_A::VALUE2) } #[doc = "Set signal is generated on a HIGH to LOW transition of the selected input"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(S0ES_A::VALUE3) } #[doc = "Set signal is generated on both transitions of the selected input"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(S0ES_A::VALUE4) } } #[doc = "Field `C0ES` reader - Source selector 0 clear edge configuration"] -pub type C0ES_R = crate::FieldReader; +pub type C0ES_R = crate::FieldReader; #[doc = "Source selector 0 clear edge configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +370,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C0ES_A { + type Ux = u8; +} impl C0ES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> C0ES_A { + pub const fn variant(&self) -> C0ES_A { match self.bits { 0 => C0ES_A::VALUE1, 1 => C0ES_A::VALUE2, @@ -379,53 +385,57 @@ impl C0ES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Generation of the clear signal is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C0ES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clear signal is generated on a LOW to HIGH transition of the selected input"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C0ES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Clear signal is generated on a HIGH to LOW transition of the selected input"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == C0ES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Clear signal is generated on both transitions of the selected input"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == C0ES_A::VALUE4 } } #[doc = "Field `C0ES` writer - Source selector 0 clear edge configuration"] -pub type C0ES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GSEL_SPEC, u8, C0ES_A, 2, O>; -impl<'a, const O: u8> C0ES_W<'a, O> { +pub type C0ES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, C0ES_A>; +impl<'a, REG> C0ES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Generation of the clear signal is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C0ES_A::VALUE1) } #[doc = "Clear signal is generated on a LOW to HIGH transition of the selected input"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C0ES_A::VALUE2) } #[doc = "Clear signal is generated on a HIGH to LOW transition of the selected input"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(C0ES_A::VALUE3) } #[doc = "Clear signal is generated on both transitions of the selected input"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(C0ES_A::VALUE4) } } #[doc = "Field `C1SS` reader - Source selector 1 comparator set configuration"] -pub type C1SS_R = crate::FieldReader; +pub type C1SS_R = crate::FieldReader; #[doc = "Source selector 1 comparator set configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C1SS_A { + type Ux = u8; +} impl C1SS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C1SS_A::VALUE1), 1 => Some(C1SS_A::VALUE2), @@ -454,43 +467,47 @@ impl C1SS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP output of CSG0 unit can be used as set source for the output latch"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C1SS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP output of CSG2 unit can be used as set source for the output latch"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C1SS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CMP output of CSG2 unit can be used as set source for the output latch"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == C1SS_A::VALUE3 } } #[doc = "Field `C1SS` writer - Source selector 1 comparator set configuration"] -pub type C1SS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GSEL_SPEC, u8, C1SS_A, 3, O>; -impl<'a, const O: u8> C1SS_W<'a, O> { +pub type C1SS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, C1SS_A>; +impl<'a, REG> C1SS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CMP output of CSG0 unit can be used as set source for the output latch"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C1SS_A::VALUE1) } #[doc = "CMP output of CSG2 unit can be used as set source for the output latch"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C1SS_A::VALUE2) } #[doc = "CMP output of CSG2 unit can be used as set source for the output latch"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(C1SS_A::VALUE3) } } #[doc = "Field `C1CS` reader - Source selector 1 comparator clear configuration"] -pub type C1CS_R = crate::FieldReader; +pub type C1CS_R = crate::FieldReader; #[doc = "Source selector 1 comparator clear configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C1CS_A { + type Ux = u8; +} impl C1CS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C1CS_A::VALUE1), 1 => Some(C1CS_A::VALUE2), @@ -519,43 +539,47 @@ impl C1CS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "CMP output of CSG0 unit can be used as clear source for the output latch"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C1CS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "CMP output of CSG2 unit can be used as clear source for the output latch"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C1CS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "CMP output of CSG2 unit can be used as clear source for the output latch"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == C1CS_A::VALUE3 } } #[doc = "Field `C1CS` writer - Source selector 1 comparator clear configuration"] -pub type C1CS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GSEL_SPEC, u8, C1CS_A, 3, O>; -impl<'a, const O: u8> C1CS_W<'a, O> { +pub type C1CS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, C1CS_A>; +impl<'a, REG> C1CS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "CMP output of CSG0 unit can be used as clear source for the output latch"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C1CS_A::VALUE1) } #[doc = "CMP output of CSG2 unit can be used as clear source for the output latch"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C1CS_A::VALUE2) } #[doc = "CMP output of CSG2 unit can be used as clear source for the output latch"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(C1CS_A::VALUE3) } } #[doc = "Field `S1M` reader - Source selector 1 set configuration"] -pub type S1M_R = crate::FieldReader; +pub type S1M_R = crate::FieldReader; #[doc = "Source selector 1 set configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -571,43 +595,50 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for S1M_A { + type Ux = u8; +} impl S1M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(S1M_A::VALUE1), 1 => Some(S1M_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Set from source selector 1 is controlled via the Capture/Compare Unit timer, CCSTy signal"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Set from source selector 1 is controlled via the CMP output from the CSGy unit. Which unit is being used is configured via the C1SS field."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1M_A::VALUE2 } } #[doc = "Field `S1M` writer - Source selector 1 set configuration"] -pub type S1M_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GSEL_SPEC, u8, S1M_A, 2, O>; -impl<'a, const O: u8> S1M_W<'a, O> { +pub type S1M_W<'a, REG> = crate::FieldWriter<'a, REG, 2, S1M_A>; +impl<'a, REG> S1M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Set from source selector 1 is controlled via the Capture/Compare Unit timer, CCSTy signal"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(S1M_A::VALUE1) } #[doc = "Set from source selector 1 is controlled via the CMP output from the CSGy unit. Which unit is being used is configured via the C1SS field."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(S1M_A::VALUE2) } } #[doc = "Field `C1M` reader - Source selector 1 clear configuration"] -pub type C1M_R = crate::FieldReader; +pub type C1M_R = crate::FieldReader; #[doc = "Source selector 1 clear configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -623,43 +654,50 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C1M_A { + type Ux = u8; +} impl C1M_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(C1M_A::VALUE1), 1 => Some(C1M_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clear from source selector 1 is controlled via the Capture/Compare Unit timer, CCSTy signal"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C1M_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clear from source selector 1 is controlled via the CMP output from the CSGy unit. Which unit is being used is configured via the C1CS field."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C1M_A::VALUE2 } } #[doc = "Field `C1M` writer - Source selector 1 clear configuration"] -pub type C1M_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GSEL_SPEC, u8, C1M_A, 2, O>; -impl<'a, const O: u8> C1M_W<'a, O> { +pub type C1M_W<'a, REG> = crate::FieldWriter<'a, REG, 2, C1M_A>; +impl<'a, REG> C1M_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Clear from source selector 1 is controlled via the Capture/Compare Unit timer, CCSTy signal"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C1M_A::VALUE1) } #[doc = "Clear from source selector 1 is controlled via the CMP output from the CSGy unit. Which unit is being used is configured via the C1CS field."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C1M_A::VALUE2) } } #[doc = "Field `S1ES` reader - Source selector 1 set edge configuration"] -pub type S1ES_R = crate::FieldReader; +pub type S1ES_R = crate::FieldReader; #[doc = "Source selector 1 set edge configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -679,10 +717,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for S1ES_A { + type Ux = u8; +} impl S1ES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> S1ES_A { + pub const fn variant(&self) -> S1ES_A { match self.bits { 0 => S1ES_A::VALUE1, 1 => S1ES_A::VALUE2, @@ -691,53 +732,57 @@ impl S1ES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Generation of the set signal is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == S1ES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Set signal is generated on a LOW to HIGH transition of the selected input"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == S1ES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Set signal is generated on a HIGH to LOW transition of the selected input"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == S1ES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Set signal is generated on both transitions of the selected input"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == S1ES_A::VALUE4 } } #[doc = "Field `S1ES` writer - Source selector 1 set edge configuration"] -pub type S1ES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GSEL_SPEC, u8, S1ES_A, 2, O>; -impl<'a, const O: u8> S1ES_W<'a, O> { +pub type S1ES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, S1ES_A>; +impl<'a, REG> S1ES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Generation of the set signal is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(S1ES_A::VALUE1) } #[doc = "Set signal is generated on a LOW to HIGH transition of the selected input"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(S1ES_A::VALUE2) } #[doc = "Set signal is generated on a HIGH to LOW transition of the selected input"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(S1ES_A::VALUE3) } #[doc = "Set signal is generated on both transitions of the selected input"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(S1ES_A::VALUE4) } } #[doc = "Field `C1ES` reader - Source selector 1 clear edge configuration"] -pub type C1ES_R = crate::FieldReader; +pub type C1ES_R = crate::FieldReader; #[doc = "Source selector 1 clear edge configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -757,10 +802,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for C1ES_A { + type Ux = u8; +} impl C1ES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> C1ES_A { + pub const fn variant(&self) -> C1ES_A { match self.bits { 0 => C1ES_A::VALUE1, 1 => C1ES_A::VALUE2, @@ -769,48 +817,52 @@ impl C1ES_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Generation of the clear signal is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == C1ES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clear signal is generated on a LOW to HIGH transition of the selected input"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == C1ES_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Clear signal is generated on a HIGH to LOW transition of the selected input"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == C1ES_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Clear signal is generated on both transitions of the selected input"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == C1ES_A::VALUE4 } } #[doc = "Field `C1ES` writer - Source selector 1 clear edge configuration"] -pub type C1ES_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GSEL_SPEC, u8, C1ES_A, 2, O>; -impl<'a, const O: u8> C1ES_W<'a, O> { +pub type C1ES_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, C1ES_A>; +impl<'a, REG> C1ES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Generation of the clear signal is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(C1ES_A::VALUE1) } #[doc = "Clear signal is generated on a LOW to HIGH transition of the selected input"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(C1ES_A::VALUE2) } #[doc = "Clear signal is generated on a HIGH to LOW transition of the selected input"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(C1ES_A::VALUE3) } #[doc = "Clear signal is generated on both transitions of the selected input"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(C1ES_A::VALUE4) } } @@ -880,94 +932,95 @@ impl W { #[doc = "Bits 0:2 - Source selector 0 comparator set configuration"] #[inline(always)] #[must_use] - pub fn c0ss(&mut self) -> C0SS_W<0> { - C0SS_W::new(self) + pub fn c0ss(&mut self) -> C0SS_W { + C0SS_W::new(self, 0) } #[doc = "Bits 3:5 - Source selector 0 comparator clear configuration"] #[inline(always)] #[must_use] - pub fn c0cs(&mut self) -> C0CS_W<3> { - C0CS_W::new(self) + pub fn c0cs(&mut self) -> C0CS_W { + C0CS_W::new(self, 3) } #[doc = "Bits 6:7 - Source selector 0 set configuration"] #[inline(always)] #[must_use] - pub fn s0m(&mut self) -> S0M_W<6> { - S0M_W::new(self) + pub fn s0m(&mut self) -> S0M_W { + S0M_W::new(self, 6) } #[doc = "Bits 8:9 - Source selector 0 clear configuration"] #[inline(always)] #[must_use] - pub fn c0m(&mut self) -> C0M_W<8> { - C0M_W::new(self) + pub fn c0m(&mut self) -> C0M_W { + C0M_W::new(self, 8) } #[doc = "Bits 10:11 - Source selector 0 set edge configuration"] #[inline(always)] #[must_use] - pub fn s0es(&mut self) -> S0ES_W<10> { - S0ES_W::new(self) + pub fn s0es(&mut self) -> S0ES_W { + S0ES_W::new(self, 10) } #[doc = "Bits 12:13 - Source selector 0 clear edge configuration"] #[inline(always)] #[must_use] - pub fn c0es(&mut self) -> C0ES_W<12> { - C0ES_W::new(self) + pub fn c0es(&mut self) -> C0ES_W { + C0ES_W::new(self, 12) } #[doc = "Bits 16:18 - Source selector 1 comparator set configuration"] #[inline(always)] #[must_use] - pub fn c1ss(&mut self) -> C1SS_W<16> { - C1SS_W::new(self) + pub fn c1ss(&mut self) -> C1SS_W { + C1SS_W::new(self, 16) } #[doc = "Bits 19:21 - Source selector 1 comparator clear configuration"] #[inline(always)] #[must_use] - pub fn c1cs(&mut self) -> C1CS_W<19> { - C1CS_W::new(self) + pub fn c1cs(&mut self) -> C1CS_W { + C1CS_W::new(self, 19) } #[doc = "Bits 22:23 - Source selector 1 set configuration"] #[inline(always)] #[must_use] - pub fn s1m(&mut self) -> S1M_W<22> { - S1M_W::new(self) + pub fn s1m(&mut self) -> S1M_W { + S1M_W::new(self, 22) } #[doc = "Bits 24:25 - Source selector 1 clear configuration"] #[inline(always)] #[must_use] - pub fn c1m(&mut self) -> C1M_W<24> { - C1M_W::new(self) + pub fn c1m(&mut self) -> C1M_W { + C1M_W::new(self, 24) } #[doc = "Bits 26:27 - Source selector 1 set edge configuration"] #[inline(always)] #[must_use] - pub fn s1es(&mut self) -> S1ES_W<26> { - S1ES_W::new(self) + pub fn s1es(&mut self) -> S1ES_W { + S1ES_W::new(self, 26) } #[doc = "Bits 28:29 - Source selector 1 clear edge configuration"] #[inline(always)] #[must_use] - pub fn c1es(&mut self) -> C1ES_W<28> { - C1ES_W::new(self) + pub fn c1es(&mut self) -> C1ES_W { + C1ES_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC global control selection\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gsel::R`](R) reader structure"] +impl crate::Readable for GSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gsel::W`](W) writer structure"] impl crate::Writable for GSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0/pl.rs b/src/hrpwm0_hrc0/pl.rs index 1dc4ef0e..10dcda0b 100644 --- a/src/hrpwm0_hrc0/pl.rs +++ b/src/hrpwm0_hrc0/pl.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PSL0` reader - HRPWMx.OUTy0 passive level"] pub type PSL0_R = crate::BitReader; #[doc = "HRPWMx.OUTy0 passive level\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PSL0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSL0_A { + pub const fn variant(&self) -> PSL0_A { match self.bits { false => PSL0_A::VALUE1, true => PSL0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.OUTy0 output passive level is set to LOW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSL0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.OUTy0 output passive level is set to HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSL0_A::VALUE2 } } #[doc = "Field `PSL0` writer - HRPWMx.OUTy0 passive level"] -pub type PSL0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PL_SPEC, PSL0_A, O>; -impl<'a, const O: u8> PSL0_W<'a, O> { +pub type PSL0_W<'a, REG> = crate::BitWriter<'a, REG, PSL0_A>; +impl<'a, REG> PSL0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HRPWMx.OUTy0 output passive level is set to LOW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSL0_A::VALUE1) } #[doc = "HRPWMx.OUTy0 output passive level is set to HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSL0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PSL1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PSL1_A { + pub const fn variant(&self) -> PSL1_A { match self.bits { false => PSL1_A::VALUE1, true => PSL1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HRPWMx.OUTy1 output passive level is set to LOW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PSL1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HRPWMx.OUTy1 output passive level is set to HIGH"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PSL1_A::VALUE2 } } #[doc = "Field `PSL1` writer - HRPWMx.OUTy1 passive level"] -pub type PSL1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PL_SPEC, PSL1_A, O>; -impl<'a, const O: u8> PSL1_W<'a, O> { +pub type PSL1_W<'a, REG> = crate::BitWriter<'a, REG, PSL1_A>; +impl<'a, REG> PSL1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HRPWMx.OUTy1 output passive level is set to LOW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PSL1_A::VALUE1) } #[doc = "HRPWMx.OUTy1 output passive level is set to HIGH"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PSL1_A::VALUE2) } } @@ -150,34 +124,35 @@ impl W { #[doc = "Bit 0 - HRPWMx.OUTy0 passive level"] #[inline(always)] #[must_use] - pub fn psl0(&mut self) -> PSL0_W<0> { - PSL0_W::new(self) + pub fn psl0(&mut self) -> PSL0_W { + PSL0_W::new(self, 0) } #[doc = "Bit 1 - HRPWMx.OUTy1 passive level"] #[inline(always)] #[must_use] - pub fn psl1(&mut self) -> PSL1_W<1> { - PSL1_W::new(self) + pub fn psl1(&mut self) -> PSL1_W { + PSL1_W::new(self, 1) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC output passive level\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pl::R`](R) reader structure"] +impl crate::Readable for PL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pl::W`](W) writer structure"] impl crate::Writable for PL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0/sc.rs b/src/hrpwm0_hrc0/sc.rs index 9838c1ff..22309c7c 100644 --- a/src/hrpwm0_hrc0/sc.rs +++ b/src/hrpwm0_hrc0/sc.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `ST` reader - Source selector for the shadow transfer"] pub type ST_R = crate::BitReader; #[doc = "Source selector for the shadow transfer\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl ST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ST_A { + pub const fn variant(&self) -> ST_A { match self.bits { false => ST_A::VALUE1, true => ST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer signals (shadow transfer trigger and shadow transfer enable) are linked with the timer CC8y connected to the Source Selector 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer signals (shadow transfer trigger and shadow transfer enable) are linked with the timer CC8y connected to the Source Selector 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ST_A::VALUE2 @@ -56,15 +43,13 @@ impl R { ST_R::new((self.bits & 1) != 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"] +#[doc = "HRC current source for shadow\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sc::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`sc::R`](R) reader structure"] +impl crate::Readable for SC_SPEC {} #[doc = "`reset()` method sets SC to value 0"] impl crate::Resettable for SC_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/hrpwm0_hrc0/scr1.rs b/src/hrpwm0_hrc0/scr1.rs index b0807d48..367658cb 100644 --- a/src/hrpwm0_hrc0/scr1.rs +++ b/src/hrpwm0_hrc0/scr1.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SCR1` reader - High resolution falling edge value"] -pub type SCR1_R = crate::FieldReader; +pub type SCR1_R = crate::FieldReader; #[doc = "Field `SCR1` writer - High resolution falling edge value"] -pub type SCR1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCR1_SPEC, u8, u8, 8, O>; +pub type SCR1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - High resolution falling edge value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:7 - High resolution falling edge value"] #[inline(always)] #[must_use] - pub fn scr1(&mut self) -> SCR1_W<0> { - SCR1_W::new(self) + pub fn scr1(&mut self) -> SCR1_W { + SCR1_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC shadow rising edge value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`scr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`scr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`scr1::R`](R) reader structure"] +impl crate::Readable for SCR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`scr1::W`](W) writer structure"] impl crate::Writable for SCR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0/scr2.rs b/src/hrpwm0_hrc0/scr2.rs index f128d1a8..4fadc037 100644 --- a/src/hrpwm0_hrc0/scr2.rs +++ b/src/hrpwm0_hrc0/scr2.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SCR2` reader - High resolution rising edge value"] -pub type SCR2_R = crate::FieldReader; +pub type SCR2_R = crate::FieldReader; #[doc = "Field `SCR2` writer - High resolution rising edge value"] -pub type SCR2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCR2_SPEC, u8, u8, 8, O>; +pub type SCR2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - High resolution rising edge value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:7 - High resolution rising edge value"] #[inline(always)] #[must_use] - pub fn scr2(&mut self) -> SCR2_W<0> { - SCR2_W::new(self) + pub fn scr2(&mut self) -> SCR2_W { + SCR2_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC shadow falling edge value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`scr2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`scr2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`scr2::R`](R) reader structure"] +impl crate::Readable for SCR2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`scr2::W`](W) writer structure"] impl crate::Writable for SCR2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0/sdcf.rs b/src/hrpwm0_hrc0/sdcf.rs index 9988df10..11db69d0 100644 --- a/src/hrpwm0_hrc0/sdcf.rs +++ b/src/hrpwm0_hrc0/sdcf.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SDTFV` reader - Shadow dead time falling value"] -pub type SDTFV_R = crate::FieldReader; +pub type SDTFV_R = crate::FieldReader; #[doc = "Field `SDTFV` writer - Shadow dead time falling value"] -pub type SDTFV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SDCF_SPEC, u16, u16, 16, O>; +pub type SDTFV_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Shadow dead time falling value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Shadow dead time falling value"] #[inline(always)] #[must_use] - pub fn sdtfv(&mut self) -> SDTFV_W<0> { - SDTFV_W::new(self) + pub fn sdtfv(&mut self) -> SDTFV_W { + SDTFV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC shadow dead time falling\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sdcf::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sdcf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sdcf::R`](R) reader structure"] +impl crate::Readable for SDCF_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sdcf::W`](W) writer structure"] impl crate::Writable for SDCF_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0/sdcr.rs b/src/hrpwm0_hrc0/sdcr.rs index 8eda470b..8d5d47c8 100644 --- a/src/hrpwm0_hrc0/sdcr.rs +++ b/src/hrpwm0_hrc0/sdcr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SDTRV` reader - Shadow dead time rising value"] -pub type SDTRV_R = crate::FieldReader; +pub type SDTRV_R = crate::FieldReader; #[doc = "Field `SDTRV` writer - Shadow dead time rising value"] -pub type SDTRV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SDCR_SPEC, u16, u16, 16, O>; +pub type SDTRV_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Shadow dead time rising value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Shadow dead time rising value"] #[inline(always)] #[must_use] - pub fn sdtrv(&mut self) -> SDTRV_W<0> { - SDTRV_W::new(self) + pub fn sdtrv(&mut self) -> SDTRV_W { + SDTRV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC shadow dead time rising\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sdcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sdcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sdcr::R`](R) reader structure"] +impl crate::Readable for SDCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sdcr::W`](W) writer structure"] impl crate::Writable for SDCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0/ssc.rs b/src/hrpwm0_hrc0/ssc.rs index 2f5bb0bf..eb149d7d 100644 --- a/src/hrpwm0_hrc0/ssc.rs +++ b/src/hrpwm0_hrc0/ssc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SST` reader - Source selector for the shadow transfer"] pub type SST_R = crate::BitReader; #[doc = "Source selector for the shadow transfer\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SST_A { + pub const fn variant(&self) -> SST_A { match self.bits { false => SST_A::VALUE1, true => SST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == SST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Next shadow transfer signals (shadow transfer trigger and shadow transfer enable) are linked with the timer CC8y connected to the Source Selector 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SST_A::VALUE2 } } #[doc = "Field `SST` writer - Source selector for the shadow transfer"] -pub type SST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SSC_SPEC, SST_A, O>; -impl<'a, const O: u8> SST_W<'a, O> { +pub type SST_W<'a, REG> = crate::BitWriter<'a, REG, SST_A>; +impl<'a, REG> SST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SST_A::VALUE1) } #[doc = "Next shadow transfer signals (shadow transfer trigger and shadow transfer enable) are linked with the timer CC8y connected to the Source Selector 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SST_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - Source selector for the shadow transfer"] #[inline(always)] #[must_use] - pub fn sst(&mut self) -> SST_W<0> { - SST_W::new(self) + pub fn sst(&mut self) -> SST_W { + SST_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC next source for shadow\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ssc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ssc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ssc::R`](R) reader structure"] +impl crate::Readable for SSC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ssc::W`](W) writer structure"] impl crate::Writable for SSC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/hrpwm0_hrc0/tsel.rs b/src/hrpwm0_hrc0/tsel.rs index a58af12b..a313aa3b 100644 --- a/src/hrpwm0_hrc0/tsel.rs +++ b/src/hrpwm0_hrc0/tsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TSEL0` reader - Source Selector 0 Timer connection"] -pub type TSEL0_R = crate::FieldReader; +pub type TSEL0_R = crate::FieldReader; #[doc = "Source Selector 0 Timer connection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TSEL0_A { + type Ux = u8; +} impl TSEL0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TSEL0_A::VALUE1), 1 => Some(TSEL0_A::VALUE2), @@ -67,53 +38,57 @@ impl TSEL0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Source Selector 0 is connected to Capture/Compare Unit Timer 0 (CCST0 can be used)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSEL0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Source Selector 0 is connected to Capture/Compare Unit Timer 1 (CCST1 can be used)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSEL0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Source Selector 0 is connected to Capture/Compare Unit Timer 2 (CCST2 can be used)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TSEL0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Source Selector 0 is connected to Capture/Compare Unit Timer 3 (CCST3 can be used)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TSEL0_A::VALUE4 } } #[doc = "Field `TSEL0` writer - Source Selector 0 Timer connection"] -pub type TSEL0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSEL_SPEC, u8, TSEL0_A, 3, O>; -impl<'a, const O: u8> TSEL0_W<'a, O> { +pub type TSEL0_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TSEL0_A>; +impl<'a, REG> TSEL0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Source Selector 0 is connected to Capture/Compare Unit Timer 0 (CCST0 can be used)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSEL0_A::VALUE1) } #[doc = "Source Selector 0 is connected to Capture/Compare Unit Timer 1 (CCST1 can be used)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSEL0_A::VALUE2) } #[doc = "Source Selector 0 is connected to Capture/Compare Unit Timer 2 (CCST2 can be used)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TSEL0_A::VALUE3) } #[doc = "Source Selector 0 is connected to Capture/Compare Unit Timer 3 (CCST3 can be used)"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TSEL0_A::VALUE4) } } #[doc = "Field `TSEL1` reader - Source Selector 1 Timer connection"] -pub type TSEL1_R = crate::FieldReader; +pub type TSEL1_R = crate::FieldReader; #[doc = "Source Selector 1 Timer connection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TSEL1_A { + type Ux = u8; +} impl TSEL1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TSEL1_A::VALUE1), 1 => Some(TSEL1_A::VALUE2), @@ -145,48 +123,52 @@ impl TSEL1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Source Selector 1 is connected to Capture/Compare Unit Timer 0 (CCST0 can be used)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSEL1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Source Selector 1 is connected to Capture/Compare Unit Timer 1 (CCST1 can be used)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSEL1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Source Selector 1 is connected to Capture/Compare Unit Timer 2 (CCST2 can be used)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TSEL1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Source Selector 1 is connected to Capture/Compare Unit Timer 3 (CCST3 can be used)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TSEL1_A::VALUE4 } } #[doc = "Field `TSEL1` writer - Source Selector 1 Timer connection"] -pub type TSEL1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSEL_SPEC, u8, TSEL1_A, 3, O>; -impl<'a, const O: u8> TSEL1_W<'a, O> { +pub type TSEL1_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TSEL1_A>; +impl<'a, REG> TSEL1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Source Selector 1 is connected to Capture/Compare Unit Timer 0 (CCST0 can be used)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSEL1_A::VALUE1) } #[doc = "Source Selector 1 is connected to Capture/Compare Unit Timer 1 (CCST1 can be used)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSEL1_A::VALUE2) } #[doc = "Source Selector 1 is connected to Capture/Compare Unit Timer 2 (CCST2 can be used)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TSEL1_A::VALUE3) } #[doc = "Source Selector 1 is connected to Capture/Compare Unit Timer 3 (CCST3 can be used)"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TSEL1_A::VALUE4) } } @@ -209,34 +191,37 @@ impl From for bool { impl TS0E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TS0E_A { + pub const fn variant(&self) -> TS0E_A { match self.bits { false => TS0E_A::VALUE1, true => TS0E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "TRAP signal generated from the Timer connected to Source Selector 0 is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TS0E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TRAP signal generated from the Timer connected to Source Selector 0 is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TS0E_A::VALUE2 } } #[doc = "Field `TS0E` writer - Source selector 0 TRAP enable"] -pub type TS0E_W<'a, const O: u8> = crate::BitWriter<'a, u32, TSEL_SPEC, TS0E_A, O>; -impl<'a, const O: u8> TS0E_W<'a, O> { +pub type TS0E_W<'a, REG> = crate::BitWriter<'a, REG, TS0E_A>; +impl<'a, REG> TS0E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "TRAP signal generated from the Timer connected to Source Selector 0 is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TS0E_A::VALUE1) } #[doc = "TRAP signal generated from the Timer connected to Source Selector 0 is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TS0E_A::VALUE2) } } @@ -259,34 +244,37 @@ impl From for bool { impl TS1E_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TS1E_A { + pub const fn variant(&self) -> TS1E_A { match self.bits { false => TS1E_A::VALUE1, true => TS1E_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "TRAP signal generated from the Timer connected to Source Selector 1 is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TS1E_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TRAP signal generated from the Timer connected to Source Selector 1 is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TS1E_A::VALUE2 } } #[doc = "Field `TS1E` writer - Source selector 1 TRAP enable"] -pub type TS1E_W<'a, const O: u8> = crate::BitWriter<'a, u32, TSEL_SPEC, TS1E_A, O>; -impl<'a, const O: u8> TS1E_W<'a, O> { +pub type TS1E_W<'a, REG> = crate::BitWriter<'a, REG, TS1E_A>; +impl<'a, REG> TS1E_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "TRAP signal generated from the Timer connected to Source Selector 1 is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TS1E_A::VALUE1) } #[doc = "TRAP signal generated from the Timer connected to Source Selector 1 is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TS1E_A::VALUE2) } } @@ -316,46 +304,47 @@ impl W { #[doc = "Bits 0:2 - Source Selector 0 Timer connection"] #[inline(always)] #[must_use] - pub fn tsel0(&mut self) -> TSEL0_W<0> { - TSEL0_W::new(self) + pub fn tsel0(&mut self) -> TSEL0_W { + TSEL0_W::new(self, 0) } #[doc = "Bits 3:5 - Source Selector 1 Timer connection"] #[inline(always)] #[must_use] - pub fn tsel1(&mut self) -> TSEL1_W<3> { - TSEL1_W::new(self) + pub fn tsel1(&mut self) -> TSEL1_W { + TSEL1_W::new(self, 3) } #[doc = "Bit 16 - Source selector 0 TRAP enable"] #[inline(always)] #[must_use] - pub fn ts0e(&mut self) -> TS0E_W<16> { - TS0E_W::new(self) + pub fn ts0e(&mut self) -> TS0E_W { + TS0E_W::new(self, 16) } #[doc = "Bit 17 - Source selector 1 TRAP enable"] #[inline(always)] #[must_use] - pub fn ts1e(&mut self) -> TS1E_W<17> { - TS1E_W::new(self) + pub fn ts1e(&mut self) -> TS1E_W { + TS1E_W::new(self, 17) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HRC timer selection\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tsel::R`](R) reader structure"] +impl crate::Readable for TSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tsel::W`](W) writer structure"] impl crate::Writable for TSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0.rs b/src/ledts0.rs index b5aaaf16..9603f433 100644 --- a/src/ledts0.rs +++ b/src/ledts0.rs @@ -1,70 +1,127 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + id: ID, + globctl: GLOBCTL, + fnctl: FNCTL, + evfr: EVFR, + tsval: TSVAL, + line0: LINE0, + line1: LINE1, + ldcmp0: LDCMP0, + ldcmp1: LDCMP1, + tscmp0: TSCMP0, + tscmp1: TSCMP1, +} +impl RegisterBlock { #[doc = "0x00 - Module Identification Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } #[doc = "0x04 - Global Control Register"] - pub globctl: GLOBCTL, + #[inline(always)] + pub const fn globctl(&self) -> &GLOBCTL { + &self.globctl + } #[doc = "0x08 - Function Control Register"] - pub fnctl: FNCTL, + #[inline(always)] + pub const fn fnctl(&self) -> &FNCTL { + &self.fnctl + } #[doc = "0x0c - Event Flag Register"] - pub evfr: EVFR, + #[inline(always)] + pub const fn evfr(&self) -> &EVFR { + &self.evfr + } #[doc = "0x10 - Touch-sense TS-Counter Value"] - pub tsval: TSVAL, + #[inline(always)] + pub const fn tsval(&self) -> &TSVAL { + &self.tsval + } #[doc = "0x14 - Line Pattern Register 0"] - pub line0: LINE0, + #[inline(always)] + pub const fn line0(&self) -> &LINE0 { + &self.line0 + } #[doc = "0x18 - Line Pattern Register 1"] - pub line1: LINE1, + #[inline(always)] + pub const fn line1(&self) -> &LINE1 { + &self.line1 + } #[doc = "0x1c - LED Compare Register 0"] - pub ldcmp0: LDCMP0, + #[inline(always)] + pub const fn ldcmp0(&self) -> &LDCMP0 { + &self.ldcmp0 + } #[doc = "0x20 - LED Compare Register 1"] - pub ldcmp1: LDCMP1, + #[inline(always)] + pub const fn ldcmp1(&self) -> &LDCMP1 { + &self.ldcmp1 + } #[doc = "0x24 - Touch-sense Compare Register 0"] - pub tscmp0: TSCMP0, + #[inline(always)] + pub const fn tscmp0(&self) -> &TSCMP0 { + &self.tscmp0 + } #[doc = "0x28 - Touch-sense Compare Register 1"] - pub tscmp1: TSCMP1, + #[inline(always)] + pub const fn tscmp1(&self) -> &TSCMP1 { + &self.tscmp1 + } } -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "GLOBCTL (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBCTL (rw) register accessor: Global Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globctl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globctl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globctl`] +module"] pub type GLOBCTL = crate::Reg; #[doc = "Global Control Register"] pub mod globctl; -#[doc = "FNCTL (rw) register accessor: an alias for `Reg`"] +#[doc = "FNCTL (rw) register accessor: Function Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fnctl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fnctl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fnctl`] +module"] pub type FNCTL = crate::Reg; #[doc = "Function Control Register"] pub mod fnctl; -#[doc = "EVFR (rw) register accessor: an alias for `Reg`"] +#[doc = "EVFR (rw) register accessor: Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`evfr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`evfr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@evfr`] +module"] pub type EVFR = crate::Reg; #[doc = "Event Flag Register"] pub mod evfr; -#[doc = "TSVAL (rw) register accessor: an alias for `Reg`"] +#[doc = "TSVAL (rw) register accessor: Touch-sense TS-Counter Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tsval::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tsval::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tsval`] +module"] pub type TSVAL = crate::Reg; #[doc = "Touch-sense TS-Counter Value"] pub mod tsval; -#[doc = "LINE0 (rw) register accessor: an alias for `Reg`"] +#[doc = "LINE0 (rw) register accessor: Line Pattern Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`line0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`line0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@line0`] +module"] pub type LINE0 = crate::Reg; #[doc = "Line Pattern Register 0"] pub mod line0; -#[doc = "LINE1 (rw) register accessor: an alias for `Reg`"] +#[doc = "LINE1 (rw) register accessor: Line Pattern Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`line1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`line1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@line1`] +module"] pub type LINE1 = crate::Reg; #[doc = "Line Pattern Register 1"] pub mod line1; -#[doc = "LDCMP0 (rw) register accessor: an alias for `Reg`"] +#[doc = "LDCMP0 (rw) register accessor: LED Compare Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ldcmp0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ldcmp0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ldcmp0`] +module"] pub type LDCMP0 = crate::Reg; #[doc = "LED Compare Register 0"] pub mod ldcmp0; -#[doc = "LDCMP1 (rw) register accessor: an alias for `Reg`"] +#[doc = "LDCMP1 (rw) register accessor: LED Compare Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ldcmp1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ldcmp1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ldcmp1`] +module"] pub type LDCMP1 = crate::Reg; #[doc = "LED Compare Register 1"] pub mod ldcmp1; -#[doc = "TSCMP0 (rw) register accessor: an alias for `Reg`"] +#[doc = "TSCMP0 (rw) register accessor: Touch-sense Compare Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tscmp0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tscmp0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tscmp0`] +module"] pub type TSCMP0 = crate::Reg; #[doc = "Touch-sense Compare Register 0"] pub mod tscmp0; -#[doc = "TSCMP1 (rw) register accessor: an alias for `Reg`"] +#[doc = "TSCMP1 (rw) register accessor: Touch-sense Compare Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tscmp1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tscmp1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tscmp1`] +module"] 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 b0e605b5..96a485bf 100644 --- a/src/ledts0/evfr.rs +++ b/src/ledts0/evfr.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TSF` reader - Time Slice Interrupt Flag"] -pub type TSF_R = crate::BitReader; +pub type TSF_R = crate::BitReader; #[doc = "Field `TFF` reader - (Extended) Time Frame Interrupt Flag"] -pub type TFF_R = crate::BitReader; +pub type TFF_R = crate::BitReader; #[doc = "Field `TPF` reader - Autoscan Time Period Interrupt Flag"] -pub type TPF_R = crate::BitReader; +pub type TPF_R = crate::BitReader; #[doc = "Field `TSCTROVF` reader - TS-Counter Overflow Indication"] pub type TSCTROVF_R = crate::BitReader; #[doc = "TS-Counter Overflow Indication\n\nValue on reset: 0"] @@ -59,18 +27,18 @@ impl From for bool { impl TSCTROVF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSCTROVF_A { + pub const fn variant(&self) -> TSCTROVF_A { match self.bits { false => TSCTROVF_A::VALUE1, true => TSCTROVF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No overflow has occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSCTROVF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The TS-counter has overflowed at least once."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSCTROVF_A::VALUE2 @@ -91,16 +59,19 @@ impl From for bool { } } #[doc = "Field `CTSF` writer - Clear Time Slice Interrupt Flag"] -pub type CTSF_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFR_SPEC, CTSF_AW, O>; -impl<'a, const O: u8> CTSF_W<'a, O> { +pub type CTSF_W<'a, REG> = crate::BitWriter<'a, REG, CTSF_AW>; +impl<'a, REG> CTSF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTSF_AW::VALUE1) } #[doc = "Bit TSF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTSF_AW::VALUE2) } } @@ -119,16 +90,19 @@ impl From for bool { } } #[doc = "Field `CTFF` writer - Clear (Extended) Time Frame Interrupt Flag"] -pub type CTFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFR_SPEC, CTFF_AW, O>; -impl<'a, const O: u8> CTFF_W<'a, O> { +pub type CTFF_W<'a, REG> = crate::BitWriter<'a, REG, CTFF_AW>; +impl<'a, REG> CTFF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTFF_AW::VALUE1) } #[doc = "Bit TFF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTFF_AW::VALUE2) } } @@ -147,16 +121,19 @@ impl From for bool { } } #[doc = "Field `CTPF` writer - Clear Autoscan Time Period Interrupt Flag"] -pub type CTPF_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVFR_SPEC, CTPF_AW, O>; -impl<'a, const O: u8> CTPF_W<'a, O> { +pub type CTPF_W<'a, REG> = crate::BitWriter<'a, REG, CTPF_AW>; +impl<'a, REG> CTPF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTPF_AW::VALUE1) } #[doc = "Bit TPF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTPF_AW::VALUE2) } } @@ -186,40 +163,41 @@ impl W { #[doc = "Bit 16 - Clear Time Slice Interrupt Flag"] #[inline(always)] #[must_use] - pub fn ctsf(&mut self) -> CTSF_W<16> { - CTSF_W::new(self) + pub fn ctsf(&mut self) -> CTSF_W { + CTSF_W::new(self, 16) } #[doc = "Bit 17 - Clear (Extended) Time Frame Interrupt Flag"] #[inline(always)] #[must_use] - pub fn ctff(&mut self) -> CTFF_W<17> { - CTFF_W::new(self) + pub fn ctff(&mut self) -> CTFF_W { + CTFF_W::new(self, 17) } #[doc = "Bit 18 - Clear Autoscan Time Period Interrupt Flag"] #[inline(always)] #[must_use] - pub fn ctpf(&mut self) -> CTPF_W<18> { - CTPF_W::new(self) + pub fn ctpf(&mut self) -> CTPF_W { + CTPF_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`evfr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`evfr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`evfr::R`](R) reader structure"] +impl crate::Readable for EVFR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`evfr::W`](W) writer structure"] impl crate::Writable for EVFR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/fnctl.rs b/src/ledts0/fnctl.rs index eb6cd498..5c4d386f 100644 --- a/src/ledts0/fnctl.rs +++ b/src/ledts0/fnctl.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PADT` reader - Touch-Sense TSIN Pad Turn"] -pub type PADT_R = crate::FieldReader; +pub type PADT_R = crate::FieldReader; #[doc = "Touch-Sense TSIN Pad Turn\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -51,38 +19,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PADT_A { + type Ux = u8; +} impl PADT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PADT_A::VALUE1), 7 => Some(PADT_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "TSIN0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PADT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TSIN7"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PADT_A::VALUE2 } } #[doc = "Field `PADT` writer - Touch-Sense TSIN Pad Turn"] -pub type PADT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FNCTL_SPEC, u8, PADT_A, 3, O>; -impl<'a, const O: u8> PADT_W<'a, O> { +pub type PADT_W<'a, REG> = crate::FieldWriter<'a, REG, 3, PADT_A>; +impl<'a, REG> PADT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "TSIN0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PADT_A::VALUE1) } #[doc = "TSIN7"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PADT_A::VALUE2) } } @@ -105,34 +80,37 @@ impl From for bool { impl PADTSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PADTSW_A { + pub const fn variant(&self) -> PADTSW_A { match self.bits { false => PADTSW_A::VALUE1, true => PADTSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The hardware automatically enables the touch-sense inputs in sequence round-robin, starting from TSIN0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PADTSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Disable hardware control for software control only. The touch-sense input is configured in bit PADT."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PADTSW_A::VALUE2 } } #[doc = "Field `PADTSW` writer - Software Control for Touch-Sense Pad Turn"] -pub type PADTSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, FNCTL_SPEC, PADTSW_A, O>; -impl<'a, const O: u8> PADTSW_W<'a, O> { +pub type PADTSW_W<'a, REG> = crate::BitWriter<'a, REG, PADTSW_A>; +impl<'a, REG> PADTSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The hardware automatically enables the touch-sense inputs in sequence round-robin, starting from TSIN0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PADTSW_A::VALUE1) } #[doc = "Disable hardware control for software control only. The touch-sense input is configured in bit PADT."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PADTSW_A::VALUE2) } } @@ -156,42 +134,46 @@ impl From for bool { impl EPULL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPULL_A { + pub const fn variant(&self) -> EPULL_A { match self.bits { false => EPULL_A::VALUE1, true => EPULL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPULL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable external pull-up: Output 1 on pin COLA for whole duration of touch-sense time slice."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPULL_A::VALUE2 } } #[doc = "Field `EPULL` writer - Enable External Pull-up Configuration on Pin COLA"] -pub type EPULL_W<'a, const O: u8> = crate::BitWriter<'a, u32, FNCTL_SPEC, EPULL_A, O>; -impl<'a, const O: u8> EPULL_W<'a, O> { +pub type EPULL_W<'a, REG> = crate::BitWriter<'a, REG, EPULL_A>; +impl<'a, REG> EPULL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPULL_A::VALUE1) } #[doc = "Enable external pull-up: Output 1 on pin COLA for whole duration of touch-sense time slice."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPULL_A::VALUE2) } } #[doc = "Field `FNCOL` reader - Previous Active Function/LED Column Status"] -pub type FNCOL_R = crate::FieldReader; +pub type FNCOL_R = crate::FieldReader; #[doc = "Field `ACCCNT` reader - Accumulate Count on Touch-Sense Input"] -pub type ACCCNT_R = crate::FieldReader; +pub type ACCCNT_R = crate::FieldReader; #[doc = "Accumulate Count on Touch-Sense Input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -209,10 +191,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ACCCNT_A { + type Ux = u8; +} impl ACCCNT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ACCCNT_A::VALUE1), 1 => Some(ACCCNT_A::VALUE2), @@ -220,38 +205,42 @@ impl ACCCNT_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "1 time"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ACCCNT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "2 times"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ACCCNT_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "16 times"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ACCCNT_A::VALUE3 } } #[doc = "Field `ACCCNT` writer - Accumulate Count on Touch-Sense Input"] -pub type ACCCNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FNCTL_SPEC, u8, ACCCNT_A, 4, O>; -impl<'a, const O: u8> ACCCNT_W<'a, O> { +pub type ACCCNT_W<'a, REG> = crate::FieldWriter<'a, REG, 4, ACCCNT_A>; +impl<'a, REG> ACCCNT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "1 time"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ACCCNT_A::VALUE1) } #[doc = "2 times"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ACCCNT_A::VALUE2) } #[doc = "16 times"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ACCCNT_A::VALUE3) } } @@ -274,39 +263,42 @@ impl From for bool { impl TSCCMP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSCCMP_A { + pub const fn variant(&self) -> TSCCMP_A { match self.bits { false => TSCCMP_A::VALUE1, true => TSCCMP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable common compare for touch-sense"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSCCMP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable common compare for touch-sense"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSCCMP_A::VALUE2 } } #[doc = "Field `TSCCMP` writer - Common Compare Enable for Touch-Sense"] -pub type TSCCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, FNCTL_SPEC, TSCCMP_A, O>; -impl<'a, const O: u8> TSCCMP_W<'a, O> { +pub type TSCCMP_W<'a, REG> = crate::BitWriter<'a, REG, TSCCMP_A>; +impl<'a, REG> TSCCMP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable common compare for touch-sense"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSCCMP_A::VALUE1) } #[doc = "Enable common compare for touch-sense"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSCCMP_A::VALUE2) } } #[doc = "Field `TSOEXT` reader - Extension for Touch-Sense Output for Pin-Low-Level"] -pub type TSOEXT_R = crate::FieldReader; +pub type TSOEXT_R = crate::FieldReader; #[doc = "Extension for Touch-Sense Output for Pin-Low-Level\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -326,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TSOEXT_A { + type Ux = u8; +} impl TSOEXT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSOEXT_A { + pub const fn variant(&self) -> TSOEXT_A { match self.bits { 0 => TSOEXT_A::VALUE1, 1 => TSOEXT_A::VALUE2, @@ -338,48 +333,52 @@ impl TSOEXT_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Extend by 1 ledts_clk"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSOEXT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Extend by 4 ledts_clk"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSOEXT_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Extend by 8 ledts_clk"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TSOEXT_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Extend by 16 ledts_clk"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TSOEXT_A::VALUE4 } } #[doc = "Field `TSOEXT` writer - Extension for Touch-Sense Output for Pin-Low-Level"] -pub type TSOEXT_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, FNCTL_SPEC, u8, TSOEXT_A, 2, O>; -impl<'a, const O: u8> TSOEXT_W<'a, O> { +pub type TSOEXT_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, TSOEXT_A>; +impl<'a, REG> TSOEXT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Extend by 1 ledts_clk"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSOEXT_A::VALUE1) } #[doc = "Extend by 4 ledts_clk"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSOEXT_A::VALUE2) } #[doc = "Extend by 8 ledts_clk"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TSOEXT_A::VALUE3) } #[doc = "Extend by 16 ledts_clk"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TSOEXT_A::VALUE4) } } @@ -402,34 +401,37 @@ impl From for bool { impl TSCTRR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSCTRR_A { + pub const fn variant(&self) -> TSCTRR_A { match self.bits { false => TSCTRR_A::VALUE1, true => TSCTRR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable TS-counter automatic reset"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSCTRR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable TS-counter automatic reset to 00H on the first pad turn of a new TSIN\\[x\\]. Triggered on compare match in time slice."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSCTRR_A::VALUE2 } } #[doc = "Field `TSCTRR` writer - TS-Counter Auto Reset"] -pub type TSCTRR_W<'a, const O: u8> = crate::BitWriter<'a, u32, FNCTL_SPEC, TSCTRR_A, O>; -impl<'a, const O: u8> TSCTRR_W<'a, O> { +pub type TSCTRR_W<'a, REG> = crate::BitWriter<'a, REG, TSCTRR_A>; +impl<'a, REG> TSCTRR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable TS-counter automatic reset"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSCTRR_A::VALUE1) } #[doc = "Enable TS-counter automatic reset to 00H on the first pad turn of a new TSIN\\[x\\]. Triggered on compare match in time slice."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSCTRR_A::VALUE2) } } @@ -452,39 +454,42 @@ impl From for bool { impl TSCTRSAT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSCTRSAT_A { + pub const fn variant(&self) -> TSCTRSAT_A { match self.bits { false => TSCTRSAT_A::VALUE1, true => TSCTRSAT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSCTRSAT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable. TS-counter stops counting in the touch-sense time slice(s) of the same (extended) frame when it reaches FFH. Counter starts to count again on the first pad turn of a new TSIN\\[x\\], triggered on compare match."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSCTRSAT_A::VALUE2 } } #[doc = "Field `TSCTRSAT` writer - Saturation of TS-Counter"] -pub type TSCTRSAT_W<'a, const O: u8> = crate::BitWriter<'a, u32, FNCTL_SPEC, TSCTRSAT_A, O>; -impl<'a, const O: u8> TSCTRSAT_W<'a, O> { +pub type TSCTRSAT_W<'a, REG> = crate::BitWriter<'a, REG, TSCTRSAT_A>; +impl<'a, REG> TSCTRSAT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSCTRSAT_A::VALUE1) } #[doc = "Enable. TS-counter stops counting in the touch-sense time slice(s) of the same (extended) frame when it reaches FFH. Counter starts to count again on the first pad turn of a new TSIN\\[x\\], triggered on compare match."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSCTRSAT_A::VALUE2) } } #[doc = "Field `NR_TSIN` reader - Number of Touch-Sense Input"] -pub type NR_TSIN_R = crate::FieldReader; +pub type NR_TSIN_R = crate::FieldReader; #[doc = "Number of Touch-Sense Input\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -500,38 +505,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for NR_TSIN_A { + type Ux = u8; +} impl NR_TSIN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(NR_TSIN_A::VALUE1), 7 => Some(NR_TSIN_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NR_TSIN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "8"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NR_TSIN_A::VALUE2 } } #[doc = "Field `NR_TSIN` writer - Number of Touch-Sense Input"] -pub type NR_TSIN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FNCTL_SPEC, u8, NR_TSIN_A, 3, O>; -impl<'a, const O: u8> NR_TSIN_W<'a, O> { +pub type NR_TSIN_W<'a, REG> = crate::FieldWriter<'a, REG, 3, NR_TSIN_A>; +impl<'a, REG> NR_TSIN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NR_TSIN_A::VALUE1) } #[doc = "8"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NR_TSIN_A::VALUE2) } } @@ -554,39 +566,42 @@ impl From for bool { impl COLLEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> COLLEV_A { + pub const fn variant(&self) -> COLLEV_A { match self.bits { false => COLLEV_A::VALUE1, true => COLLEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Active low"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == COLLEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active high"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == COLLEV_A::VALUE2 } } #[doc = "Field `COLLEV` writer - Active Level of LED Column"] -pub type COLLEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, FNCTL_SPEC, COLLEV_A, O>; -impl<'a, const O: u8> COLLEV_W<'a, O> { +pub type COLLEV_W<'a, REG> = crate::BitWriter<'a, REG, COLLEV_A>; +impl<'a, REG> COLLEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Active low"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(COLLEV_A::VALUE1) } #[doc = "Active high"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(COLLEV_A::VALUE2) } } #[doc = "Field `NR_LEDCOL` reader - Number of LED Columns"] -pub type NR_LEDCOL_R = crate::FieldReader; +pub type NR_LEDCOL_R = crate::FieldReader; #[doc = "Number of LED Columns\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -614,10 +629,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for NR_LEDCOL_A { + type Ux = u8; +} impl NR_LEDCOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NR_LEDCOL_A { + pub const fn variant(&self) -> NR_LEDCOL_A { match self.bits { 0 => NR_LEDCOL_A::VALUE1, 1 => NR_LEDCOL_A::VALUE2, @@ -630,88 +648,92 @@ impl NR_LEDCOL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "1 LED column"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NR_LEDCOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "2 LED columns"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NR_LEDCOL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "3 LED columns"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == NR_LEDCOL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "4 LED columns"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == NR_LEDCOL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "5 LED columns"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == NR_LEDCOL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "6 LED columns"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == NR_LEDCOL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "7 LED columns"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == NR_LEDCOL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "8 LED columns (max. LED columns = 7 if bit TS_EN = 1)"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == NR_LEDCOL_A::VALUE8 } } #[doc = "Field `NR_LEDCOL` writer - Number of LED Columns"] -pub type NR_LEDCOL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, FNCTL_SPEC, u8, NR_LEDCOL_A, 3, O>; -impl<'a, const O: u8> NR_LEDCOL_W<'a, O> { +pub type NR_LEDCOL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, NR_LEDCOL_A>; +impl<'a, REG> NR_LEDCOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "1 LED column"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NR_LEDCOL_A::VALUE1) } #[doc = "2 LED columns"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NR_LEDCOL_A::VALUE2) } #[doc = "3 LED columns"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(NR_LEDCOL_A::VALUE3) } #[doc = "4 LED columns"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(NR_LEDCOL_A::VALUE4) } #[doc = "5 LED columns"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(NR_LEDCOL_A::VALUE5) } #[doc = "6 LED columns"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(NR_LEDCOL_A::VALUE6) } #[doc = "7 LED columns"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(NR_LEDCOL_A::VALUE7) } #[doc = "8 LED columns (max. LED columns = 7 if bit TS_EN = 1)"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(NR_LEDCOL_A::VALUE8) } } @@ -781,88 +803,89 @@ impl W { #[doc = "Bits 0:2 - Touch-Sense TSIN Pad Turn"] #[inline(always)] #[must_use] - pub fn padt(&mut self) -> PADT_W<0> { - PADT_W::new(self) + pub fn padt(&mut self) -> PADT_W { + PADT_W::new(self, 0) } #[doc = "Bit 3 - Software Control for Touch-Sense Pad Turn"] #[inline(always)] #[must_use] - pub fn padtsw(&mut self) -> PADTSW_W<3> { - PADTSW_W::new(self) + pub fn padtsw(&mut self) -> PADTSW_W { + PADTSW_W::new(self, 3) } #[doc = "Bit 4 - Enable External Pull-up Configuration on Pin COLA"] #[inline(always)] #[must_use] - pub fn epull(&mut self) -> EPULL_W<4> { - EPULL_W::new(self) + pub fn epull(&mut self) -> EPULL_W { + EPULL_W::new(self, 4) } #[doc = "Bits 16:19 - Accumulate Count on Touch-Sense Input"] #[inline(always)] #[must_use] - pub fn acccnt(&mut self) -> ACCCNT_W<16> { - ACCCNT_W::new(self) + pub fn acccnt(&mut self) -> ACCCNT_W { + ACCCNT_W::new(self, 16) } #[doc = "Bit 20 - Common Compare Enable for Touch-Sense"] #[inline(always)] #[must_use] - pub fn tsccmp(&mut self) -> TSCCMP_W<20> { - TSCCMP_W::new(self) + pub fn tsccmp(&mut self) -> TSCCMP_W { + TSCCMP_W::new(self, 20) } #[doc = "Bits 21:22 - Extension for Touch-Sense Output for Pin-Low-Level"] #[inline(always)] #[must_use] - pub fn tsoext(&mut self) -> TSOEXT_W<21> { - TSOEXT_W::new(self) + pub fn tsoext(&mut self) -> TSOEXT_W { + TSOEXT_W::new(self, 21) } #[doc = "Bit 23 - TS-Counter Auto Reset"] #[inline(always)] #[must_use] - pub fn tsctrr(&mut self) -> TSCTRR_W<23> { - TSCTRR_W::new(self) + pub fn tsctrr(&mut self) -> TSCTRR_W { + TSCTRR_W::new(self, 23) } #[doc = "Bit 24 - Saturation of TS-Counter"] #[inline(always)] #[must_use] - pub fn tsctrsat(&mut self) -> TSCTRSAT_W<24> { - TSCTRSAT_W::new(self) + pub fn tsctrsat(&mut self) -> TSCTRSAT_W { + TSCTRSAT_W::new(self, 24) } #[doc = "Bits 25:27 - Number of Touch-Sense Input"] #[inline(always)] #[must_use] - pub fn nr_tsin(&mut self) -> NR_TSIN_W<25> { - NR_TSIN_W::new(self) + pub fn nr_tsin(&mut self) -> NR_TSIN_W { + NR_TSIN_W::new(self, 25) } #[doc = "Bit 28 - Active Level of LED Column"] #[inline(always)] #[must_use] - pub fn collev(&mut self) -> COLLEV_W<28> { - COLLEV_W::new(self) + pub fn collev(&mut self) -> COLLEV_W { + COLLEV_W::new(self, 28) } #[doc = "Bits 29:31 - Number of LED Columns"] #[inline(always)] #[must_use] - pub fn nr_ledcol(&mut self) -> NR_LEDCOL_W<29> { - NR_LEDCOL_W::new(self) + pub fn nr_ledcol(&mut self) -> NR_LEDCOL_W { + NR_LEDCOL_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Function Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fnctl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fnctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fnctl::R`](R) reader structure"] +impl crate::Readable for FNCTL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fnctl::W`](W) writer structure"] impl crate::Writable for FNCTL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/globctl.rs b/src/ledts0/globctl.rs index f945bdb9..3495df55 100644 --- a/src/ledts0/globctl.rs +++ b/src/ledts0/globctl.rs @@ -1,47 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TS_EN` reader - Touch-Sense Function Enable"] -pub type TS_EN_R = crate::BitReader; +pub type TS_EN_R = crate::BitReader; #[doc = "Field `TS_EN` writer - Touch-Sense Function Enable"] -pub type TS_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, bool, O>; +pub type TS_EN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `LD_EN` reader - LED Function Enable"] -pub type LD_EN_R = crate::BitReader; +pub type LD_EN_R = crate::BitReader; #[doc = "Field `LD_EN` writer - LED Function Enable"] -pub type LD_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, bool, O>; +pub type LD_EN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CMTR` reader - Clock Master Disable"] pub type CMTR_R = crate::BitReader; #[doc = "Clock Master Disable\n\nValue on reset: 0"] @@ -61,34 +29,37 @@ impl From for bool { impl CMTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CMTR_A { + pub const fn variant(&self) -> CMTR_A { match self.bits { false => CMTR_A::VALUE1, true => CMTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Kernel generates its own clock for LEDTS-counter based on SFR setting"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "LEDTS-counter takes its clock from another master kernel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMTR_A::VALUE2 } } #[doc = "Field `CMTR` writer - Clock Master Disable"] -pub type CMTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, CMTR_A, O>; -impl<'a, const O: u8> CMTR_W<'a, O> { +pub type CMTR_W<'a, REG> = crate::BitWriter<'a, REG, CMTR_A>; +impl<'a, REG> CMTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Kernel generates its own clock for LEDTS-counter based on SFR setting"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMTR_A::VALUE1) } #[doc = "LEDTS-counter takes its clock from another master kernel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMTR_A::VALUE2) } } @@ -111,34 +82,37 @@ impl From for bool { impl ENSYNC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENSYNC_A { + pub const fn variant(&self) -> ENSYNC_A { match self.bits { false => ENSYNC_A::VALUE1, true => ENSYNC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No synchronization"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENSYNC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Synchronization enabled on Kernel0 autoscan time period"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENSYNC_A::VALUE2 } } #[doc = "Field `ENSYNC` writer - Enable Autoscan Time Period Synchronization"] -pub type ENSYNC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, ENSYNC_A, O>; -impl<'a, const O: u8> ENSYNC_W<'a, O> { +pub type ENSYNC_W<'a, REG> = crate::BitWriter<'a, REG, ENSYNC_A>; +impl<'a, REG> ENSYNC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No synchronization"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENSYNC_A::VALUE1) } #[doc = "Synchronization enabled on Kernel0 autoscan time period"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENSYNC_A::VALUE2) } } @@ -161,39 +135,42 @@ impl From for bool { impl SUSCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SUSCFG_A { + pub const fn variant(&self) -> SUSCFG_A { match self.bits { false => SUSCFG_A::VALUE1, true => SUSCFG_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore suspend request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUSCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable suspend according to request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUSCFG_A::VALUE2 } } #[doc = "Field `SUSCFG` writer - Suspend Request Configuration"] -pub type SUSCFG_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, SUSCFG_A, O>; -impl<'a, const O: u8> SUSCFG_W<'a, O> { +pub type SUSCFG_W<'a, REG> = crate::BitWriter<'a, REG, SUSCFG_A>; +impl<'a, REG> SUSCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore suspend request"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE1) } #[doc = "Enable suspend according to request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUSCFG_A::VALUE2) } } #[doc = "Field `MASKVAL` reader - Mask Number of LSB Bits for Event Validation"] -pub type MASKVAL_R = crate::FieldReader; +pub type MASKVAL_R = crate::FieldReader; #[doc = "Mask Number of LSB Bits for Event Validation\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +188,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MASKVAL_A { + type Ux = u8; +} impl MASKVAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(MASKVAL_A::VALUE1), 1 => Some(MASKVAL_A::VALUE2), @@ -222,38 +202,42 @@ impl MASKVAL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Mask LSB bit"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MASKVAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Mask 2 LSB bits"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MASKVAL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Mask 8 LSB bits"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MASKVAL_A::VALUE3 } } #[doc = "Field `MASKVAL` writer - Mask Number of LSB Bits for Event Validation"] -pub type MASKVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBCTL_SPEC, u8, MASKVAL_A, 3, O>; -impl<'a, const O: u8> MASKVAL_W<'a, O> { +pub type MASKVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, MASKVAL_A>; +impl<'a, REG> MASKVAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Mask LSB bit"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MASKVAL_A::VALUE1) } #[doc = "Mask 2 LSB bits"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MASKVAL_A::VALUE2) } #[doc = "Mask 8 LSB bits"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MASKVAL_A::VALUE3) } } @@ -276,34 +260,37 @@ impl From for bool { impl FENVAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FENVAL_A { + pub const fn variant(&self) -> FENVAL_A { match self.bits { false => FENVAL_A::VALUE1, true => FENVAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FENVAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FENVAL_A::VALUE2 } } #[doc = "Field `FENVAL` writer - Enable (Extended) Time Frame Validation"] -pub type FENVAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, FENVAL_A, O>; -impl<'a, const O: u8> FENVAL_W<'a, O> { +pub type FENVAL_W<'a, REG> = crate::BitWriter<'a, REG, FENVAL_A>; +impl<'a, REG> FENVAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FENVAL_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FENVAL_A::VALUE2) } } @@ -326,34 +313,37 @@ impl From for bool { impl ITS_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ITS_EN_A { + pub const fn variant(&self) -> ITS_EN_A { match self.bits { false => ITS_EN_A::VALUE1, true => ITS_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ITS_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ITS_EN_A::VALUE2 } } #[doc = "Field `ITS_EN` writer - Enable Time Slice Interrupt"] -pub type ITS_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, ITS_EN_A, O>; -impl<'a, const O: u8> ITS_EN_W<'a, O> { +pub type ITS_EN_W<'a, REG> = crate::BitWriter<'a, REG, ITS_EN_A>; +impl<'a, REG> ITS_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ITS_EN_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ITS_EN_A::VALUE2) } } @@ -376,34 +366,37 @@ impl From for bool { impl ITF_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ITF_EN_A { + pub const fn variant(&self) -> ITF_EN_A { match self.bits { false => ITF_EN_A::VALUE1, true => ITF_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ITF_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ITF_EN_A::VALUE2 } } #[doc = "Field `ITF_EN` writer - Enable (Extended) Time Frame Interrupt"] -pub type ITF_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, ITF_EN_A, O>; -impl<'a, const O: u8> ITF_EN_W<'a, O> { +pub type ITF_EN_W<'a, REG> = crate::BitWriter<'a, REG, ITF_EN_A>; +impl<'a, REG> ITF_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ITF_EN_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ITF_EN_A::VALUE2) } } @@ -426,41 +419,44 @@ impl From for bool { impl ITP_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ITP_EN_A { + pub const fn variant(&self) -> ITP_EN_A { match self.bits { false => ITP_EN_A::VALUE1, true => ITP_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ITP_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable (valid only for case of hardware-enabled pad turn control)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ITP_EN_A::VALUE2 } } #[doc = "Field `ITP_EN` writer - Enable Autoscan Time Period Interrupt"] -pub type ITP_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCTL_SPEC, ITP_EN_A, O>; -impl<'a, const O: u8> ITP_EN_W<'a, O> { +pub type ITP_EN_W<'a, REG> = crate::BitWriter<'a, REG, ITP_EN_A>; +impl<'a, REG> ITP_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ITP_EN_A::VALUE1) } #[doc = "Enable (valid only for case of hardware-enabled pad turn control)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ITP_EN_A::VALUE2) } } #[doc = "Field `CLK_PS` reader - LEDTS-Counter Clock Pre-Scale Factor"] -pub type CLK_PS_R = crate::FieldReader; +pub type CLK_PS_R = crate::FieldReader; #[doc = "Field `CLK_PS` writer - LEDTS-Counter Clock Pre-Scale Factor"] -pub type CLK_PS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBCTL_SPEC, u16, u16, 16, O>; +pub type CLK_PS_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bit 0 - Touch-Sense Function Enable"] #[inline(always)] @@ -522,88 +518,89 @@ impl W { #[doc = "Bit 0 - Touch-Sense Function Enable"] #[inline(always)] #[must_use] - pub fn ts_en(&mut self) -> TS_EN_W<0> { - TS_EN_W::new(self) + pub fn ts_en(&mut self) -> TS_EN_W { + TS_EN_W::new(self, 0) } #[doc = "Bit 1 - LED Function Enable"] #[inline(always)] #[must_use] - pub fn ld_en(&mut self) -> LD_EN_W<1> { - LD_EN_W::new(self) + pub fn ld_en(&mut self) -> LD_EN_W { + LD_EN_W::new(self, 1) } #[doc = "Bit 2 - Clock Master Disable"] #[inline(always)] #[must_use] - pub fn cmtr(&mut self) -> CMTR_W<2> { - CMTR_W::new(self) + pub fn cmtr(&mut self) -> CMTR_W { + CMTR_W::new(self, 2) } #[doc = "Bit 3 - Enable Autoscan Time Period Synchronization"] #[inline(always)] #[must_use] - pub fn ensync(&mut self) -> ENSYNC_W<3> { - ENSYNC_W::new(self) + pub fn ensync(&mut self) -> ENSYNC_W { + ENSYNC_W::new(self, 3) } #[doc = "Bit 8 - Suspend Request Configuration"] #[inline(always)] #[must_use] - pub fn suscfg(&mut self) -> SUSCFG_W<8> { - SUSCFG_W::new(self) + pub fn suscfg(&mut self) -> SUSCFG_W { + SUSCFG_W::new(self, 8) } #[doc = "Bits 9:11 - Mask Number of LSB Bits for Event Validation"] #[inline(always)] #[must_use] - pub fn maskval(&mut self) -> MASKVAL_W<9> { - MASKVAL_W::new(self) + pub fn maskval(&mut self) -> MASKVAL_W { + MASKVAL_W::new(self, 9) } #[doc = "Bit 12 - Enable (Extended) Time Frame Validation"] #[inline(always)] #[must_use] - pub fn fenval(&mut self) -> FENVAL_W<12> { - FENVAL_W::new(self) + pub fn fenval(&mut self) -> FENVAL_W { + FENVAL_W::new(self, 12) } #[doc = "Bit 13 - Enable Time Slice Interrupt"] #[inline(always)] #[must_use] - pub fn its_en(&mut self) -> ITS_EN_W<13> { - ITS_EN_W::new(self) + pub fn its_en(&mut self) -> ITS_EN_W { + ITS_EN_W::new(self, 13) } #[doc = "Bit 14 - Enable (Extended) Time Frame Interrupt"] #[inline(always)] #[must_use] - pub fn itf_en(&mut self) -> ITF_EN_W<14> { - ITF_EN_W::new(self) + pub fn itf_en(&mut self) -> ITF_EN_W { + ITF_EN_W::new(self, 14) } #[doc = "Bit 15 - Enable Autoscan Time Period Interrupt"] #[inline(always)] #[must_use] - pub fn itp_en(&mut self) -> ITP_EN_W<15> { - ITP_EN_W::new(self) + pub fn itp_en(&mut self) -> ITP_EN_W { + ITP_EN_W::new(self, 15) } #[doc = "Bits 16:31 - LEDTS-Counter Clock Pre-Scale Factor"] #[inline(always)] #[must_use] - pub fn clk_ps(&mut self) -> CLK_PS_W<16> { - CLK_PS_W::new(self) + pub fn clk_ps(&mut self) -> CLK_PS_W { + CLK_PS_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globctl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globctl::R`](R) reader structure"] +impl crate::Readable for GLOBCTL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globctl::W`](W) writer structure"] impl crate::Writable for GLOBCTL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/id.rs b/src/ledts0/id.rs index f80b270c..9327e490 100644 --- a/src/ledts0/id.rs +++ b/src/ledts0/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision Number"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number Value"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00ab_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00ab_c000; diff --git a/src/ledts0/ldcmp0.rs b/src/ledts0/ldcmp0.rs index 373a4458..028b74b4 100644 --- a/src/ledts0/ldcmp0.rs +++ b/src/ledts0/ldcmp0.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CMP_LD0` reader - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD0_R = crate::FieldReader; +pub type CMP_LD0_R = crate::FieldReader; #[doc = "Field `CMP_LD0` writer - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LDCMP0_SPEC, u8, u8, 8, O>; +pub type CMP_LD0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_LD1` reader - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD1_R = crate::FieldReader; +pub type CMP_LD1_R = crate::FieldReader; #[doc = "Field `CMP_LD1` writer - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LDCMP0_SPEC, u8, u8, 8, O>; +pub type CMP_LD1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_LD2` reader - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD2_R = crate::FieldReader; +pub type CMP_LD2_R = crate::FieldReader; #[doc = "Field `CMP_LD2` writer - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LDCMP0_SPEC, u8, u8, 8, O>; +pub type CMP_LD2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_LD3` reader - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD3_R = crate::FieldReader; +pub type CMP_LD3_R = crate::FieldReader; #[doc = "Field `CMP_LD3` writer - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LDCMP0_SPEC, u8, u8, 8, O>; +pub type CMP_LD3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Compare Value for LED COL\\[x\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Compare Value for LED COL\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ld0(&mut self) -> CMP_LD0_W<0> { - CMP_LD0_W::new(self) + pub fn cmp_ld0(&mut self) -> CMP_LD0_W { + CMP_LD0_W::new(self, 0) } #[doc = "Bits 8:15 - Compare Value for LED COL\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ld1(&mut self) -> CMP_LD1_W<8> { - CMP_LD1_W::new(self) + pub fn cmp_ld1(&mut self) -> CMP_LD1_W { + CMP_LD1_W::new(self, 8) } #[doc = "Bits 16:23 - Compare Value for LED COL\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ld2(&mut self) -> CMP_LD2_W<16> { - CMP_LD2_W::new(self) + pub fn cmp_ld2(&mut self) -> CMP_LD2_W { + CMP_LD2_W::new(self, 16) } #[doc = "Bits 24:31 - Compare Value for LED COL\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ld3(&mut self) -> CMP_LD3_W<24> { - CMP_LD3_W::new(self) + pub fn cmp_ld3(&mut self) -> CMP_LD3_W { + CMP_LD3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "LED Compare Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ldcmp0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ldcmp0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ldcmp0::R`](R) reader structure"] +impl crate::Readable for LDCMP0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ldcmp0::W`](W) writer structure"] impl crate::Writable for LDCMP0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/ldcmp1.rs b/src/ledts0/ldcmp1.rs index 951386b0..aa8b1254 100644 --- a/src/ledts0/ldcmp1.rs +++ b/src/ledts0/ldcmp1.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CMP_LD4` reader - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD4_R = crate::FieldReader; +pub type CMP_LD4_R = crate::FieldReader; #[doc = "Field `CMP_LD4` writer - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LDCMP1_SPEC, u8, u8, 8, O>; +pub type CMP_LD4_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_LD5` reader - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD5_R = crate::FieldReader; +pub type CMP_LD5_R = crate::FieldReader; #[doc = "Field `CMP_LD5` writer - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LDCMP1_SPEC, u8, u8, 8, O>; +pub type CMP_LD5_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_LD6` reader - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD6_R = crate::FieldReader; +pub type CMP_LD6_R = crate::FieldReader; #[doc = "Field `CMP_LD6` writer - Compare Value for LED COL\\[x\\]"] -pub type CMP_LD6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LDCMP1_SPEC, u8, u8, 8, O>; +pub type CMP_LD6_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_LDA_TSCOM` reader - Compare Value for LED COLA / Common Compare Value for Touch-sense Pad Turns"] -pub type CMP_LDA_TSCOM_R = crate::FieldReader; +pub type CMP_LDA_TSCOM_R = crate::FieldReader; #[doc = "Field `CMP_LDA_TSCOM` writer - Compare Value for LED COLA / Common Compare Value for Touch-sense Pad Turns"] -pub type CMP_LDA_TSCOM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LDCMP1_SPEC, u8, u8, 8, O>; +pub type CMP_LDA_TSCOM_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Compare Value for LED COL\\[x\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Compare Value for LED COL\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ld4(&mut self) -> CMP_LD4_W<0> { - CMP_LD4_W::new(self) + pub fn cmp_ld4(&mut self) -> CMP_LD4_W { + CMP_LD4_W::new(self, 0) } #[doc = "Bits 8:15 - Compare Value for LED COL\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ld5(&mut self) -> CMP_LD5_W<8> { - CMP_LD5_W::new(self) + pub fn cmp_ld5(&mut self) -> CMP_LD5_W { + CMP_LD5_W::new(self, 8) } #[doc = "Bits 16:23 - Compare Value for LED COL\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ld6(&mut self) -> CMP_LD6_W<16> { - CMP_LD6_W::new(self) + pub fn cmp_ld6(&mut self) -> CMP_LD6_W { + CMP_LD6_W::new(self, 16) } #[doc = "Bits 24:31 - Compare Value for LED COLA / Common Compare Value for Touch-sense Pad Turns"] #[inline(always)] #[must_use] - pub fn cmp_lda_tscom(&mut self) -> CMP_LDA_TSCOM_W<24> { - CMP_LDA_TSCOM_W::new(self) + pub fn cmp_lda_tscom(&mut self) -> CMP_LDA_TSCOM_W { + CMP_LDA_TSCOM_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "LED Compare Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ldcmp1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ldcmp1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ldcmp1::R`](R) reader structure"] +impl crate::Readable for LDCMP1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ldcmp1::W`](W) writer structure"] impl crate::Writable for LDCMP1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/line0.rs b/src/ledts0/line0.rs index e80386b1..2edeaf64 100644 --- a/src/ledts0/line0.rs +++ b/src/ledts0/line0.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `LINE_0` reader - Output on LINE\\[x\\]"] -pub type LINE_0_R = crate::FieldReader; +pub type LINE_0_R = crate::FieldReader; #[doc = "Field `LINE_0` writer - Output on LINE\\[x\\]"] -pub type LINE_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LINE0_SPEC, u8, u8, 8, O>; +pub type LINE_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `LINE_1` reader - Output on LINE\\[x\\]"] -pub type LINE_1_R = crate::FieldReader; +pub type LINE_1_R = crate::FieldReader; #[doc = "Field `LINE_1` writer - Output on LINE\\[x\\]"] -pub type LINE_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LINE0_SPEC, u8, u8, 8, O>; +pub type LINE_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `LINE_2` reader - Output on LINE\\[x\\]"] -pub type LINE_2_R = crate::FieldReader; +pub type LINE_2_R = crate::FieldReader; #[doc = "Field `LINE_2` writer - Output on LINE\\[x\\]"] -pub type LINE_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LINE0_SPEC, u8, u8, 8, O>; +pub type LINE_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `LINE_3` reader - Output on LINE\\[x\\]"] -pub type LINE_3_R = crate::FieldReader; +pub type LINE_3_R = crate::FieldReader; #[doc = "Field `LINE_3` writer - Output on LINE\\[x\\]"] -pub type LINE_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LINE0_SPEC, u8, u8, 8, O>; +pub type LINE_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Output on LINE\\[x\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Output on LINE\\[x\\]"] #[inline(always)] #[must_use] - pub fn line_0(&mut self) -> LINE_0_W<0> { - LINE_0_W::new(self) + pub fn line_0(&mut self) -> LINE_0_W { + LINE_0_W::new(self, 0) } #[doc = "Bits 8:15 - Output on LINE\\[x\\]"] #[inline(always)] #[must_use] - pub fn line_1(&mut self) -> LINE_1_W<8> { - LINE_1_W::new(self) + pub fn line_1(&mut self) -> LINE_1_W { + LINE_1_W::new(self, 8) } #[doc = "Bits 16:23 - Output on LINE\\[x\\]"] #[inline(always)] #[must_use] - pub fn line_2(&mut self) -> LINE_2_W<16> { - LINE_2_W::new(self) + pub fn line_2(&mut self) -> LINE_2_W { + LINE_2_W::new(self, 16) } #[doc = "Bits 24:31 - Output on LINE\\[x\\]"] #[inline(always)] #[must_use] - pub fn line_3(&mut self) -> LINE_3_W<24> { - LINE_3_W::new(self) + pub fn line_3(&mut self) -> LINE_3_W { + LINE_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Line Pattern Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`line0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`line0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`line0::R`](R) reader structure"] +impl crate::Readable for LINE0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`line0::W`](W) writer structure"] impl crate::Writable for LINE0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/line1.rs b/src/ledts0/line1.rs index deb69941..b61f5f7b 100644 --- a/src/ledts0/line1.rs +++ b/src/ledts0/line1.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `LINE_4` reader - Output on LINE\\[x\\]"] -pub type LINE_4_R = crate::FieldReader; +pub type LINE_4_R = crate::FieldReader; #[doc = "Field `LINE_4` writer - Output on LINE\\[x\\]"] -pub type LINE_4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LINE1_SPEC, u8, u8, 8, O>; +pub type LINE_4_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `LINE_5` reader - Output on LINE\\[x\\]"] -pub type LINE_5_R = crate::FieldReader; +pub type LINE_5_R = crate::FieldReader; #[doc = "Field `LINE_5` writer - Output on LINE\\[x\\]"] -pub type LINE_5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LINE1_SPEC, u8, u8, 8, O>; +pub type LINE_5_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `LINE_6` reader - Output on LINE\\[x\\]"] -pub type LINE_6_R = crate::FieldReader; +pub type LINE_6_R = crate::FieldReader; #[doc = "Field `LINE_6` writer - Output on LINE\\[x\\]"] -pub type LINE_6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LINE1_SPEC, u8, u8, 8, O>; +pub type LINE_6_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `LINE_A` reader - Output on LINE\\[x\\]"] -pub type LINE_A_R = crate::FieldReader; +pub type LINE_A_R = crate::FieldReader; #[doc = "Field `LINE_A` writer - Output on LINE\\[x\\]"] -pub type LINE_A_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LINE1_SPEC, u8, u8, 8, O>; +pub type LINE_A_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Output on LINE\\[x\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Output on LINE\\[x\\]"] #[inline(always)] #[must_use] - pub fn line_4(&mut self) -> LINE_4_W<0> { - LINE_4_W::new(self) + pub fn line_4(&mut self) -> LINE_4_W { + LINE_4_W::new(self, 0) } #[doc = "Bits 8:15 - Output on LINE\\[x\\]"] #[inline(always)] #[must_use] - pub fn line_5(&mut self) -> LINE_5_W<8> { - LINE_5_W::new(self) + pub fn line_5(&mut self) -> LINE_5_W { + LINE_5_W::new(self, 8) } #[doc = "Bits 16:23 - Output on LINE\\[x\\]"] #[inline(always)] #[must_use] - pub fn line_6(&mut self) -> LINE_6_W<16> { - LINE_6_W::new(self) + pub fn line_6(&mut self) -> LINE_6_W { + LINE_6_W::new(self, 16) } #[doc = "Bits 24:31 - Output on LINE\\[x\\]"] #[inline(always)] #[must_use] - pub fn line_a(&mut self) -> LINE_A_W<24> { - LINE_A_W::new(self) + pub fn line_a(&mut self) -> LINE_A_W { + LINE_A_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Line Pattern Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`line1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`line1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`line1::R`](R) reader structure"] +impl crate::Readable for LINE1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`line1::W`](W) writer structure"] impl crate::Writable for LINE1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/tscmp0.rs b/src/ledts0/tscmp0.rs index a2a0bd71..0379828e 100644 --- a/src/ledts0/tscmp0.rs +++ b/src/ledts0/tscmp0.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CMP_TS0` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS0_R = crate::FieldReader; +pub type CMP_TS0_R = crate::FieldReader; #[doc = "Field `CMP_TS0` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSCMP0_SPEC, u8, u8, 8, O>; +pub type CMP_TS0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_TS1` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS1_R = crate::FieldReader; +pub type CMP_TS1_R = crate::FieldReader; #[doc = "Field `CMP_TS1` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSCMP0_SPEC, u8, u8, 8, O>; +pub type CMP_TS1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_TS2` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS2_R = crate::FieldReader; +pub type CMP_TS2_R = crate::FieldReader; #[doc = "Field `CMP_TS2` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSCMP0_SPEC, u8, u8, 8, O>; +pub type CMP_TS2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_TS3` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS3_R = crate::FieldReader; +pub type CMP_TS3_R = crate::FieldReader; #[doc = "Field `CMP_TS3` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSCMP0_SPEC, u8, u8, 8, O>; +pub type CMP_TS3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ts0(&mut self) -> CMP_TS0_W<0> { - CMP_TS0_W::new(self) + pub fn cmp_ts0(&mut self) -> CMP_TS0_W { + CMP_TS0_W::new(self, 0) } #[doc = "Bits 8:15 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ts1(&mut self) -> CMP_TS1_W<8> { - CMP_TS1_W::new(self) + pub fn cmp_ts1(&mut self) -> CMP_TS1_W { + CMP_TS1_W::new(self, 8) } #[doc = "Bits 16:23 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ts2(&mut self) -> CMP_TS2_W<16> { - CMP_TS2_W::new(self) + pub fn cmp_ts2(&mut self) -> CMP_TS2_W { + CMP_TS2_W::new(self, 16) } #[doc = "Bits 24:31 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ts3(&mut self) -> CMP_TS3_W<24> { - CMP_TS3_W::new(self) + pub fn cmp_ts3(&mut self) -> CMP_TS3_W { + CMP_TS3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Touch-sense Compare Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tscmp0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tscmp0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tscmp0::R`](R) reader structure"] +impl crate::Readable for TSCMP0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tscmp0::W`](W) writer structure"] impl crate::Writable for TSCMP0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/tscmp1.rs b/src/ledts0/tscmp1.rs index aff7fc01..449003ab 100644 --- a/src/ledts0/tscmp1.rs +++ b/src/ledts0/tscmp1.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CMP_TS4` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS4_R = crate::FieldReader; +pub type CMP_TS4_R = crate::FieldReader; #[doc = "Field `CMP_TS4` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSCMP1_SPEC, u8, u8, 8, O>; +pub type CMP_TS4_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_TS5` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS5_R = crate::FieldReader; +pub type CMP_TS5_R = crate::FieldReader; #[doc = "Field `CMP_TS5` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSCMP1_SPEC, u8, u8, 8, O>; +pub type CMP_TS5_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_TS6` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS6_R = crate::FieldReader; +pub type CMP_TS6_R = crate::FieldReader; #[doc = "Field `CMP_TS6` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSCMP1_SPEC, u8, u8, 8, O>; +pub type CMP_TS6_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `CMP_TS7` reader - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS7_R = crate::FieldReader; +pub type CMP_TS7_R = crate::FieldReader; #[doc = "Field `CMP_TS7` writer - Compare Value for Touch-Sense TSIN\\[x\\]"] -pub type CMP_TS7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSCMP1_SPEC, u8, u8, 8, O>; +pub type CMP_TS7_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ts4(&mut self) -> CMP_TS4_W<0> { - CMP_TS4_W::new(self) + pub fn cmp_ts4(&mut self) -> CMP_TS4_W { + CMP_TS4_W::new(self, 0) } #[doc = "Bits 8:15 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ts5(&mut self) -> CMP_TS5_W<8> { - CMP_TS5_W::new(self) + pub fn cmp_ts5(&mut self) -> CMP_TS5_W { + CMP_TS5_W::new(self, 8) } #[doc = "Bits 16:23 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ts6(&mut self) -> CMP_TS6_W<16> { - CMP_TS6_W::new(self) + pub fn cmp_ts6(&mut self) -> CMP_TS6_W { + CMP_TS6_W::new(self, 16) } #[doc = "Bits 24:31 - Compare Value for Touch-Sense TSIN\\[x\\]"] #[inline(always)] #[must_use] - pub fn cmp_ts7(&mut self) -> CMP_TS7_W<24> { - CMP_TS7_W::new(self) + pub fn cmp_ts7(&mut self) -> CMP_TS7_W { + CMP_TS7_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Touch-sense Compare Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tscmp1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tscmp1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tscmp1::R`](R) reader structure"] +impl crate::Readable for TSCMP1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tscmp1::W`](W) writer structure"] impl crate::Writable for TSCMP1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ledts0/tsval.rs b/src/ledts0/tsval.rs index b70909db..ada1c577 100644 --- a/src/ledts0/tsval.rs +++ b/src/ledts0/tsval.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TSCTRVALR` reader - Shadow TS-Counter (Read)"] -pub type TSCTRVALR_R = crate::FieldReader; +pub type TSCTRVALR_R = crate::FieldReader; #[doc = "Field `TSCTRVAL` reader - TS-Counter Value"] -pub type TSCTRVAL_R = crate::FieldReader; +pub type TSCTRVAL_R = crate::FieldReader; #[doc = "Field `TSCTRVAL` writer - TS-Counter Value"] -pub type TSCTRVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TSVAL_SPEC, u16, u16, 16, O>; +pub type TSCTRVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Shadow TS-Counter (Read)"] #[inline(always)] @@ -56,28 +24,29 @@ impl W { #[doc = "Bits 16:31 - TS-Counter Value"] #[inline(always)] #[must_use] - pub fn tsctrval(&mut self) -> TSCTRVAL_W<16> { - TSCTRVAL_W::new(self) + pub fn tsctrval(&mut self) -> TSCTRVAL_W { + TSCTRVAL_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Touch-sense TS-Counter Value\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tsval::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tsval::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tsval::R`](R) reader structure"] +impl crate::Readable for TSVAL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tsval::W`](W) writer structure"] impl crate::Writable for TSVAL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/lib.rs b/src/lib.rs index 1b308541..f3d55c20 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,19 +1,5 @@ -#![doc = "Peripheral access API for XMC4400 microcontrollers (generated using svd2rust v0.28.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.28.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(dead_code)] -#![deny(improper_ctypes)] -#![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(private_in_public)] -#![deny(unconditional_recursion)] -#![deny(unused_allocation)] -#![deny(unused_comparisons)] -#![deny(unused_parens)] -#![deny(while_true)] +#![doc = "Peripheral access API for XMC4400 microcontrollers (generated using svd2rust v0.31.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.31.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"] #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![no_std] @@ -21,12 +7,6 @@ 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"] @@ -132,6 +112,7 @@ extern "C" { fn ETH0_0(); } #[doc(hidden)] +#[repr(C)] pub union Vector { _handler: unsafe extern "C" fn(), _reserved: u32, @@ -469,6 +450,22 @@ impl PPB { pub const fn ptr() -> *const ppb::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PPB { type Target = ppb::RegisterBlock; @@ -497,6 +494,22 @@ impl DLR { pub const fn ptr() -> *const dlr::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for DLR { type Target = dlr::RegisterBlock; @@ -525,6 +538,22 @@ impl ERU0 { pub const fn ptr() -> *const eru0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for ERU0 { type Target = eru0::RegisterBlock; @@ -553,6 +582,22 @@ impl ERU1 { pub const fn ptr() -> *const eru0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for ERU1 { type Target = eru0::RegisterBlock; @@ -581,6 +626,22 @@ impl GPDMA0 { pub const fn ptr() -> *const gpdma0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0 { type Target = gpdma0::RegisterBlock; @@ -609,6 +670,22 @@ impl GPDMA0_CH0 { pub const fn ptr() -> *const gpdma0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0_CH0 { type Target = gpdma0_ch0::RegisterBlock; @@ -637,6 +714,22 @@ impl GPDMA0_CH1 { pub const fn ptr() -> *const gpdma0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0_CH1 { type Target = gpdma0_ch0::RegisterBlock; @@ -665,6 +758,22 @@ impl GPDMA0_CH2 { pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0_CH2 { type Target = gpdma0_ch2::RegisterBlock; @@ -693,6 +802,22 @@ impl GPDMA0_CH3 { pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0_CH3 { type Target = gpdma0_ch2::RegisterBlock; @@ -721,6 +846,22 @@ impl GPDMA0_CH4 { pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0_CH4 { type Target = gpdma0_ch2::RegisterBlock; @@ -749,6 +890,22 @@ impl GPDMA0_CH5 { pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0_CH5 { type Target = gpdma0_ch2::RegisterBlock; @@ -777,6 +934,22 @@ impl GPDMA0_CH6 { pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0_CH6 { type Target = gpdma0_ch2::RegisterBlock; @@ -805,6 +978,22 @@ impl GPDMA0_CH7 { pub const fn ptr() -> *const gpdma0_ch2::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for GPDMA0_CH7 { type Target = gpdma0_ch2::RegisterBlock; @@ -833,6 +1022,22 @@ impl FCE { pub const fn ptr() -> *const fce::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for FCE { type Target = fce::RegisterBlock; @@ -861,6 +1066,22 @@ impl FCE_KE0 { pub const fn ptr() -> *const fce_ke0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for FCE_KE0 { type Target = fce_ke0::RegisterBlock; @@ -889,6 +1110,22 @@ impl FCE_KE1 { pub const fn ptr() -> *const fce_ke0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for FCE_KE1 { type Target = fce_ke0::RegisterBlock; @@ -917,6 +1154,22 @@ impl FCE_KE2 { pub const fn ptr() -> *const fce_ke0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for FCE_KE2 { type Target = fce_ke0::RegisterBlock; @@ -945,6 +1198,22 @@ impl FCE_KE3 { pub const fn ptr() -> *const fce_ke0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for FCE_KE3 { type Target = fce_ke0::RegisterBlock; @@ -973,6 +1242,22 @@ impl PBA0 { pub const fn ptr() -> *const pba0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PBA0 { type Target = pba0::RegisterBlock; @@ -1001,6 +1286,22 @@ impl PBA1 { pub const fn ptr() -> *const pba0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PBA1 { type Target = pba0::RegisterBlock; @@ -1029,6 +1330,22 @@ impl FLASH0 { pub const fn ptr() -> *const flash0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for FLASH0 { type Target = flash0::RegisterBlock; @@ -1057,6 +1374,22 @@ impl PREF { pub const fn ptr() -> *const pref::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PREF { type Target = pref::RegisterBlock; @@ -1085,6 +1418,22 @@ impl PMU0 { pub const fn ptr() -> *const pmu0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PMU0 { type Target = pmu0::RegisterBlock; @@ -1113,6 +1462,22 @@ impl WDT { pub const fn ptr() -> *const wdt::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for WDT { type Target = wdt::RegisterBlock; @@ -1141,6 +1506,22 @@ impl RTC { pub const fn ptr() -> *const rtc::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for RTC { type Target = rtc::RegisterBlock; @@ -1169,6 +1550,22 @@ impl SCU_CLK { pub const fn ptr() -> *const scu_clk::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_CLK { type Target = scu_clk::RegisterBlock; @@ -1197,6 +1594,22 @@ impl SCU_OSC { pub const fn ptr() -> *const scu_osc::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_OSC { type Target = scu_osc::RegisterBlock; @@ -1225,6 +1638,22 @@ impl SCU_PLL { pub const fn ptr() -> *const scu_pll::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_PLL { type Target = scu_pll::RegisterBlock; @@ -1253,6 +1682,22 @@ impl SCU_GENERAL { pub const fn ptr() -> *const scu_general::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_GENERAL { type Target = scu_general::RegisterBlock; @@ -1281,6 +1726,22 @@ impl SCU_INTERRUPT { pub const fn ptr() -> *const scu_interrupt::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_INTERRUPT { type Target = scu_interrupt::RegisterBlock; @@ -1309,6 +1770,22 @@ impl SCU_PARITY { pub const fn ptr() -> *const scu_parity::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_PARITY { type Target = scu_parity::RegisterBlock; @@ -1337,6 +1814,22 @@ impl SCU_TRAP { pub const fn ptr() -> *const scu_trap::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_TRAP { type Target = scu_trap::RegisterBlock; @@ -1365,6 +1858,22 @@ impl SCU_HIBERNATE { pub const fn ptr() -> *const scu_hibernate::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_HIBERNATE { type Target = scu_hibernate::RegisterBlock; @@ -1393,6 +1902,22 @@ impl SCU_POWER { pub const fn ptr() -> *const scu_power::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_POWER { type Target = scu_power::RegisterBlock; @@ -1421,6 +1946,22 @@ impl SCU_RESET { pub const fn ptr() -> *const scu_reset::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for SCU_RESET { type Target = scu_reset::RegisterBlock; @@ -1449,6 +1990,22 @@ impl LEDTS0 { pub const fn ptr() -> *const ledts0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for LEDTS0 { type Target = ledts0::RegisterBlock; @@ -1477,6 +2034,22 @@ impl ETH0_CON { pub const fn ptr() -> *const eth0_con::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for ETH0_CON { type Target = eth0_con::RegisterBlock; @@ -1505,6 +2078,22 @@ impl ETH0 { pub const fn ptr() -> *const eth0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for ETH0 { type Target = eth0::RegisterBlock; @@ -1533,6 +2122,22 @@ impl USB0 { pub const fn ptr() -> *const usb0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0 { type Target = usb0::RegisterBlock; @@ -1561,6 +2166,22 @@ impl USB0_EP0 { pub const fn ptr() -> *const usb0_ep0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_EP0 { type Target = usb0_ep0::RegisterBlock; @@ -1589,6 +2210,22 @@ impl USB0_EP1 { pub const fn ptr() -> *const usb0_ep1::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_EP1 { type Target = usb0_ep1::RegisterBlock; @@ -1617,6 +2254,22 @@ impl USB0_EP2 { pub const fn ptr() -> *const usb0_ep1::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_EP2 { type Target = usb0_ep1::RegisterBlock; @@ -1645,8 +2298,24 @@ impl USB0_EP3 { pub const fn ptr() -> *const usb0_ep1::RegisterBlock { Self::PTR } -} -impl Deref for USB0_EP3 { + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } +} +impl Deref for USB0_EP3 { type Target = usb0_ep1::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { @@ -1673,6 +2342,22 @@ impl USB0_EP4 { pub const fn ptr() -> *const usb0_ep1::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_EP4 { type Target = usb0_ep1::RegisterBlock; @@ -1701,6 +2386,22 @@ impl USB0_EP5 { pub const fn ptr() -> *const usb0_ep1::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_EP5 { type Target = usb0_ep1::RegisterBlock; @@ -1729,6 +2430,22 @@ impl USB0_EP6 { pub const fn ptr() -> *const usb0_ep1::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_EP6 { type Target = usb0_ep1::RegisterBlock; @@ -1757,6 +2474,22 @@ impl USB0_CH0 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH0 { type Target = usb0_ch0::RegisterBlock; @@ -1785,6 +2518,22 @@ impl USB0_CH1 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH1 { type Target = usb0_ch0::RegisterBlock; @@ -1813,6 +2562,22 @@ impl USB0_CH2 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH2 { type Target = usb0_ch0::RegisterBlock; @@ -1841,6 +2606,22 @@ impl USB0_CH3 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH3 { type Target = usb0_ch0::RegisterBlock; @@ -1869,6 +2650,22 @@ impl USB0_CH4 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH4 { type Target = usb0_ch0::RegisterBlock; @@ -1897,6 +2694,22 @@ impl USB0_CH5 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH5 { type Target = usb0_ch0::RegisterBlock; @@ -1925,6 +2738,22 @@ impl USB0_CH6 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH6 { type Target = usb0_ch0::RegisterBlock; @@ -1953,6 +2782,22 @@ impl USB0_CH7 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH7 { type Target = usb0_ch0::RegisterBlock; @@ -1981,6 +2826,22 @@ impl USB0_CH8 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH8 { type Target = usb0_ch0::RegisterBlock; @@ -2009,6 +2870,22 @@ impl USB0_CH9 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH9 { type Target = usb0_ch0::RegisterBlock; @@ -2037,6 +2914,22 @@ impl USB0_CH10 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH10 { type Target = usb0_ch0::RegisterBlock; @@ -2065,6 +2958,22 @@ impl USB0_CH11 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH11 { type Target = usb0_ch0::RegisterBlock; @@ -2093,6 +3002,22 @@ impl USB0_CH12 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH12 { type Target = usb0_ch0::RegisterBlock; @@ -2121,6 +3046,22 @@ impl USB0_CH13 { pub const fn ptr() -> *const usb0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USB0_CH13 { type Target = usb0_ch0::RegisterBlock; @@ -2149,6 +3090,22 @@ impl USIC0 { pub const fn ptr() -> *const usic0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USIC0 { type Target = usic0::RegisterBlock; @@ -2177,6 +3134,22 @@ impl USIC1 { pub const fn ptr() -> *const usic0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USIC1 { type Target = usic0::RegisterBlock; @@ -2205,6 +3178,22 @@ impl USIC0_CH0 { pub const fn ptr() -> *const usic0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USIC0_CH0 { type Target = usic0_ch0::RegisterBlock; @@ -2233,6 +3222,22 @@ impl USIC0_CH1 { pub const fn ptr() -> *const usic0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USIC0_CH1 { type Target = usic0_ch0::RegisterBlock; @@ -2261,6 +3266,22 @@ impl USIC1_CH0 { pub const fn ptr() -> *const usic0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USIC1_CH0 { type Target = usic0_ch0::RegisterBlock; @@ -2289,6 +3310,22 @@ impl USIC1_CH1 { pub const fn ptr() -> *const usic0_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for USIC1_CH1 { type Target = usic0_ch0::RegisterBlock; @@ -2317,6 +3354,22 @@ impl CAN { pub const fn ptr() -> *const can::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN { type Target = can::RegisterBlock; @@ -2345,6 +3398,22 @@ impl CAN_NODE0 { pub const fn ptr() -> *const can_node0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_NODE0 { type Target = can_node0::RegisterBlock; @@ -2373,6 +3442,22 @@ impl CAN_NODE1 { pub const fn ptr() -> *const can_node0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_NODE1 { type Target = can_node0::RegisterBlock; @@ -2401,6 +3486,22 @@ impl CAN_MO0 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO0 { type Target = can_mo0::RegisterBlock; @@ -2429,6 +3530,22 @@ impl CAN_MO1 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO1 { type Target = can_mo0::RegisterBlock; @@ -2457,6 +3574,22 @@ impl CAN_MO2 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO2 { type Target = can_mo0::RegisterBlock; @@ -2485,6 +3618,22 @@ impl CAN_MO3 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO3 { type Target = can_mo0::RegisterBlock; @@ -2513,6 +3662,22 @@ impl CAN_MO4 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO4 { type Target = can_mo0::RegisterBlock; @@ -2541,6 +3706,22 @@ impl CAN_MO5 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO5 { type Target = can_mo0::RegisterBlock; @@ -2569,6 +3750,22 @@ impl CAN_MO6 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO6 { type Target = can_mo0::RegisterBlock; @@ -2597,6 +3794,22 @@ impl CAN_MO7 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO7 { type Target = can_mo0::RegisterBlock; @@ -2625,6 +3838,22 @@ impl CAN_MO8 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO8 { type Target = can_mo0::RegisterBlock; @@ -2653,6 +3882,22 @@ impl CAN_MO9 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO9 { type Target = can_mo0::RegisterBlock; @@ -2681,6 +3926,22 @@ impl CAN_MO10 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO10 { type Target = can_mo0::RegisterBlock; @@ -2709,6 +3970,22 @@ impl CAN_MO11 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO11 { type Target = can_mo0::RegisterBlock; @@ -2737,6 +4014,22 @@ impl CAN_MO12 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO12 { type Target = can_mo0::RegisterBlock; @@ -2765,6 +4058,22 @@ impl CAN_MO13 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO13 { type Target = can_mo0::RegisterBlock; @@ -2793,6 +4102,22 @@ impl CAN_MO14 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO14 { type Target = can_mo0::RegisterBlock; @@ -2821,6 +4146,22 @@ impl CAN_MO15 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO15 { type Target = can_mo0::RegisterBlock; @@ -2849,6 +4190,22 @@ impl CAN_MO16 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO16 { type Target = can_mo0::RegisterBlock; @@ -2877,6 +4234,22 @@ impl CAN_MO17 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO17 { type Target = can_mo0::RegisterBlock; @@ -2905,6 +4278,22 @@ impl CAN_MO18 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO18 { type Target = can_mo0::RegisterBlock; @@ -2933,6 +4322,22 @@ impl CAN_MO19 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO19 { type Target = can_mo0::RegisterBlock; @@ -2961,6 +4366,22 @@ impl CAN_MO20 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO20 { type Target = can_mo0::RegisterBlock; @@ -2989,6 +4410,22 @@ impl CAN_MO21 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO21 { type Target = can_mo0::RegisterBlock; @@ -3017,6 +4454,22 @@ impl CAN_MO22 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO22 { type Target = can_mo0::RegisterBlock; @@ -3045,6 +4498,22 @@ impl CAN_MO23 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO23 { type Target = can_mo0::RegisterBlock; @@ -3073,6 +4542,22 @@ impl CAN_MO24 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO24 { type Target = can_mo0::RegisterBlock; @@ -3101,6 +4586,22 @@ impl CAN_MO25 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO25 { type Target = can_mo0::RegisterBlock; @@ -3129,6 +4630,22 @@ impl CAN_MO26 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO26 { type Target = can_mo0::RegisterBlock; @@ -3157,6 +4674,22 @@ impl CAN_MO27 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO27 { type Target = can_mo0::RegisterBlock; @@ -3185,6 +4718,22 @@ impl CAN_MO28 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO28 { type Target = can_mo0::RegisterBlock; @@ -3213,6 +4762,22 @@ impl CAN_MO29 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO29 { type Target = can_mo0::RegisterBlock; @@ -3241,6 +4806,22 @@ impl CAN_MO30 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO30 { type Target = can_mo0::RegisterBlock; @@ -3269,6 +4850,22 @@ impl CAN_MO31 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO31 { type Target = can_mo0::RegisterBlock; @@ -3297,6 +4894,22 @@ impl CAN_MO32 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO32 { type Target = can_mo0::RegisterBlock; @@ -3325,6 +4938,22 @@ impl CAN_MO33 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO33 { type Target = can_mo0::RegisterBlock; @@ -3353,6 +4982,22 @@ impl CAN_MO34 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO34 { type Target = can_mo0::RegisterBlock; @@ -3381,6 +5026,22 @@ impl CAN_MO35 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO35 { type Target = can_mo0::RegisterBlock; @@ -3409,6 +5070,22 @@ impl CAN_MO36 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO36 { type Target = can_mo0::RegisterBlock; @@ -3437,6 +5114,22 @@ impl CAN_MO37 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO37 { type Target = can_mo0::RegisterBlock; @@ -3465,6 +5158,22 @@ impl CAN_MO38 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO38 { type Target = can_mo0::RegisterBlock; @@ -3493,6 +5202,22 @@ impl CAN_MO39 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO39 { type Target = can_mo0::RegisterBlock; @@ -3521,6 +5246,22 @@ impl CAN_MO40 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO40 { type Target = can_mo0::RegisterBlock; @@ -3549,6 +5290,22 @@ impl CAN_MO41 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO41 { type Target = can_mo0::RegisterBlock; @@ -3577,6 +5334,22 @@ impl CAN_MO42 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO42 { type Target = can_mo0::RegisterBlock; @@ -3605,6 +5378,22 @@ impl CAN_MO43 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO43 { type Target = can_mo0::RegisterBlock; @@ -3633,6 +5422,22 @@ impl CAN_MO44 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO44 { type Target = can_mo0::RegisterBlock; @@ -3661,6 +5466,22 @@ impl CAN_MO45 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO45 { type Target = can_mo0::RegisterBlock; @@ -3689,6 +5510,22 @@ impl CAN_MO46 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO46 { type Target = can_mo0::RegisterBlock; @@ -3717,6 +5554,22 @@ impl CAN_MO47 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO47 { type Target = can_mo0::RegisterBlock; @@ -3745,6 +5598,22 @@ impl CAN_MO48 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO48 { type Target = can_mo0::RegisterBlock; @@ -3773,6 +5642,22 @@ impl CAN_MO49 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO49 { type Target = can_mo0::RegisterBlock; @@ -3801,6 +5686,22 @@ impl CAN_MO50 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO50 { type Target = can_mo0::RegisterBlock; @@ -3829,6 +5730,22 @@ impl CAN_MO51 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO51 { type Target = can_mo0::RegisterBlock; @@ -3857,6 +5774,22 @@ impl CAN_MO52 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO52 { type Target = can_mo0::RegisterBlock; @@ -3885,6 +5818,22 @@ impl CAN_MO53 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO53 { type Target = can_mo0::RegisterBlock; @@ -3913,6 +5862,22 @@ impl CAN_MO54 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO54 { type Target = can_mo0::RegisterBlock; @@ -3941,6 +5906,22 @@ impl CAN_MO55 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO55 { type Target = can_mo0::RegisterBlock; @@ -3969,6 +5950,22 @@ impl CAN_MO56 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO56 { type Target = can_mo0::RegisterBlock; @@ -3997,6 +5994,22 @@ impl CAN_MO57 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO57 { type Target = can_mo0::RegisterBlock; @@ -4025,6 +6038,22 @@ impl CAN_MO58 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO58 { type Target = can_mo0::RegisterBlock; @@ -4053,6 +6082,22 @@ impl CAN_MO59 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO59 { type Target = can_mo0::RegisterBlock; @@ -4081,6 +6126,22 @@ impl CAN_MO60 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO60 { type Target = can_mo0::RegisterBlock; @@ -4109,6 +6170,22 @@ impl CAN_MO61 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO61 { type Target = can_mo0::RegisterBlock; @@ -4137,6 +6214,22 @@ impl CAN_MO62 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO62 { type Target = can_mo0::RegisterBlock; @@ -4165,6 +6258,22 @@ impl CAN_MO63 { pub const fn ptr() -> *const can_mo0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CAN_MO63 { type Target = can_mo0::RegisterBlock; @@ -4193,6 +6302,22 @@ impl VADC { pub const fn ptr() -> *const vadc::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for VADC { type Target = vadc::RegisterBlock; @@ -4221,6 +6346,22 @@ impl VADC_G0 { pub const fn ptr() -> *const vadc_g0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for VADC_G0 { type Target = vadc_g0::RegisterBlock; @@ -4249,6 +6390,22 @@ impl VADC_G1 { pub const fn ptr() -> *const vadc_g0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for VADC_G1 { type Target = vadc_g0::RegisterBlock; @@ -4277,6 +6434,22 @@ impl VADC_G2 { pub const fn ptr() -> *const vadc_g0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for VADC_G2 { type Target = vadc_g0::RegisterBlock; @@ -4305,6 +6478,22 @@ impl VADC_G3 { pub const fn ptr() -> *const vadc_g0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for VADC_G3 { type Target = vadc_g0::RegisterBlock; @@ -4333,6 +6522,22 @@ impl DSD { pub const fn ptr() -> *const dsd::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for DSD { type Target = dsd::RegisterBlock; @@ -4361,6 +6566,22 @@ impl DSD_CH0 { pub const fn ptr() -> *const dsd_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for DSD_CH0 { type Target = dsd_ch0::RegisterBlock; @@ -4389,6 +6610,22 @@ impl DSD_CH1 { pub const fn ptr() -> *const dsd_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for DSD_CH1 { type Target = dsd_ch0::RegisterBlock; @@ -4417,6 +6654,22 @@ impl DSD_CH2 { pub const fn ptr() -> *const dsd_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for DSD_CH2 { type Target = dsd_ch0::RegisterBlock; @@ -4445,6 +6698,22 @@ impl DSD_CH3 { pub const fn ptr() -> *const dsd_ch0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for DSD_CH3 { type Target = dsd_ch0::RegisterBlock; @@ -4473,6 +6742,22 @@ impl DAC { pub const fn ptr() -> *const dac::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for DAC { type Target = dac::RegisterBlock; @@ -4501,6 +6786,22 @@ impl CCU40 { pub const fn ptr() -> *const ccu40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU40 { type Target = ccu40::RegisterBlock; @@ -4529,6 +6830,22 @@ impl CCU41 { pub const fn ptr() -> *const ccu40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU41 { type Target = ccu40::RegisterBlock; @@ -4557,6 +6874,22 @@ impl CCU42 { pub const fn ptr() -> *const ccu40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU42 { type Target = ccu40::RegisterBlock; @@ -4585,6 +6918,22 @@ impl CCU43 { pub const fn ptr() -> *const ccu40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU43 { type Target = ccu40::RegisterBlock; @@ -4613,6 +6962,22 @@ impl CCU40_CC40 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU40_CC40 { type Target = ccu40_cc40::RegisterBlock; @@ -4641,6 +7006,22 @@ impl CCU40_CC41 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU40_CC41 { type Target = ccu40_cc40::RegisterBlock; @@ -4669,6 +7050,22 @@ impl CCU40_CC42 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU40_CC42 { type Target = ccu40_cc40::RegisterBlock; @@ -4697,6 +7094,22 @@ impl CCU40_CC43 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU40_CC43 { type Target = ccu40_cc40::RegisterBlock; @@ -4725,6 +7138,22 @@ impl CCU41_CC40 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU41_CC40 { type Target = ccu40_cc40::RegisterBlock; @@ -4753,6 +7182,22 @@ impl CCU41_CC41 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU41_CC41 { type Target = ccu40_cc40::RegisterBlock; @@ -4781,6 +7226,22 @@ impl CCU41_CC42 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU41_CC42 { type Target = ccu40_cc40::RegisterBlock; @@ -4809,6 +7270,22 @@ impl CCU41_CC43 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU41_CC43 { type Target = ccu40_cc40::RegisterBlock; @@ -4837,6 +7314,22 @@ impl CCU42_CC40 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU42_CC40 { type Target = ccu40_cc40::RegisterBlock; @@ -4865,6 +7358,22 @@ impl CCU42_CC41 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU42_CC41 { type Target = ccu40_cc40::RegisterBlock; @@ -4893,6 +7402,22 @@ impl CCU42_CC42 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU42_CC42 { type Target = ccu40_cc40::RegisterBlock; @@ -4921,6 +7446,22 @@ impl CCU42_CC43 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU42_CC43 { type Target = ccu40_cc40::RegisterBlock; @@ -4949,6 +7490,22 @@ impl CCU43_CC40 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU43_CC40 { type Target = ccu40_cc40::RegisterBlock; @@ -4977,6 +7534,22 @@ impl CCU43_CC41 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU43_CC41 { type Target = ccu40_cc40::RegisterBlock; @@ -5005,6 +7578,22 @@ impl CCU43_CC42 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU43_CC42 { type Target = ccu40_cc40::RegisterBlock; @@ -5033,6 +7622,22 @@ impl CCU43_CC43 { pub const fn ptr() -> *const ccu40_cc40::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU43_CC43 { type Target = ccu40_cc40::RegisterBlock; @@ -5061,6 +7666,22 @@ impl CCU80 { pub const fn ptr() -> *const ccu80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU80 { type Target = ccu80::RegisterBlock; @@ -5089,6 +7710,22 @@ impl CCU81 { pub const fn ptr() -> *const ccu80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU81 { type Target = ccu80::RegisterBlock; @@ -5117,6 +7754,22 @@ impl CCU80_CC80 { pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU80_CC80 { type Target = ccu80_cc80::RegisterBlock; @@ -5145,6 +7798,22 @@ impl CCU80_CC81 { pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU80_CC81 { type Target = ccu80_cc80::RegisterBlock; @@ -5173,6 +7842,22 @@ impl CCU80_CC82 { pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU80_CC82 { type Target = ccu80_cc80::RegisterBlock; @@ -5201,6 +7886,22 @@ impl CCU80_CC83 { pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU80_CC83 { type Target = ccu80_cc80::RegisterBlock; @@ -5229,6 +7930,22 @@ impl CCU81_CC80 { pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU81_CC80 { type Target = ccu80_cc80::RegisterBlock; @@ -5257,6 +7974,22 @@ impl CCU81_CC81 { pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU81_CC81 { type Target = ccu80_cc80::RegisterBlock; @@ -5285,6 +8018,22 @@ impl CCU81_CC82 { pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU81_CC82 { type Target = ccu80_cc80::RegisterBlock; @@ -5313,6 +8062,22 @@ impl CCU81_CC83 { pub const fn ptr() -> *const ccu80_cc80::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for CCU81_CC83 { type Target = ccu80_cc80::RegisterBlock; @@ -5341,6 +8106,22 @@ impl HRPWM0 { pub const fn ptr() -> *const hrpwm0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for HRPWM0 { type Target = hrpwm0::RegisterBlock; @@ -5369,6 +8150,22 @@ impl HRPWM0_CSG0 { pub const fn ptr() -> *const hrpwm0_csg0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for HRPWM0_CSG0 { type Target = hrpwm0_csg0::RegisterBlock; @@ -5397,6 +8194,22 @@ impl HRPWM0_CSG1 { pub const fn ptr() -> *const hrpwm0_csg0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for HRPWM0_CSG1 { type Target = hrpwm0_csg0::RegisterBlock; @@ -5425,6 +8238,22 @@ impl HRPWM0_CSG2 { pub const fn ptr() -> *const hrpwm0_csg0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for HRPWM0_CSG2 { type Target = hrpwm0_csg0::RegisterBlock; @@ -5453,6 +8282,22 @@ impl HRPWM0_HRC0 { pub const fn ptr() -> *const hrpwm0_hrc0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for HRPWM0_HRC0 { type Target = hrpwm0_hrc0::RegisterBlock; @@ -5481,6 +8326,22 @@ impl HRPWM0_HRC1 { pub const fn ptr() -> *const hrpwm0_hrc0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for HRPWM0_HRC1 { type Target = hrpwm0_hrc0::RegisterBlock; @@ -5509,6 +8370,22 @@ impl HRPWM0_HRC2 { pub const fn ptr() -> *const hrpwm0_hrc0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for HRPWM0_HRC2 { type Target = hrpwm0_hrc0::RegisterBlock; @@ -5537,6 +8414,22 @@ impl HRPWM0_HRC3 { pub const fn ptr() -> *const hrpwm0_hrc0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for HRPWM0_HRC3 { type Target = hrpwm0_hrc0::RegisterBlock; @@ -5565,6 +8458,22 @@ impl POSIF0 { pub const fn ptr() -> *const posif0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for POSIF0 { type Target = posif0::RegisterBlock; @@ -5593,6 +8502,22 @@ impl POSIF1 { pub const fn ptr() -> *const posif0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for POSIF1 { type Target = posif0::RegisterBlock; @@ -5621,6 +8546,22 @@ impl PORT0 { pub const fn ptr() -> *const port0::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PORT0 { type Target = port0::RegisterBlock; @@ -5649,6 +8590,22 @@ impl PORT1 { pub const fn ptr() -> *const port1::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PORT1 { type Target = port1::RegisterBlock; @@ -5677,6 +8634,22 @@ impl PORT2 { pub const fn ptr() -> *const port2::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PORT2 { type Target = port2::RegisterBlock; @@ -5705,6 +8678,22 @@ impl PORT3 { pub const fn ptr() -> *const port3::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PORT3 { type Target = port3::RegisterBlock; @@ -5733,6 +8722,22 @@ impl PORT4 { pub const fn ptr() -> *const port4::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PORT4 { type Target = port4::RegisterBlock; @@ -5761,6 +8766,22 @@ impl PORT5 { pub const fn ptr() -> *const port5::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PORT5 { type Target = port5::RegisterBlock; @@ -5789,6 +8810,22 @@ impl PORT14 { pub const fn ptr() -> *const port14::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PORT14 { type Target = port14::RegisterBlock; @@ -5817,6 +8854,22 @@ impl PORT15 { pub const fn ptr() -> *const port15::RegisterBlock { Self::PTR } + #[doc = r" Steal an instance of this peripheral"] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Ensure that the new instance of the peripheral cannot be used in a way"] + #[doc = r" that may race with any existing instances, for example by only"] + #[doc = r" accessing read-only or write-only registers, or by consuming the"] + #[doc = r" original peripheral and using critical sections to coordinate"] + #[doc = r" access between multiple new instances."] + #[doc = r""] + #[doc = r" Additionally, other software such as HALs may rely on only one"] + #[doc = r" peripheral instance existing to ensure memory safety; ensure"] + #[doc = r" no stolen instances are passed to such software."] + pub unsafe fn steal() -> Self { + Self { _marker: PhantomData } + } } impl Deref for PORT15 { type Target = port15::RegisterBlock; diff --git a/src/pba0.rs b/src/pba0.rs index 2519ca23..132491a2 100644 --- a/src/pba0.rs +++ b/src/pba0.rs @@ -1,16 +1,28 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + sts: STS, + waddr: WADDR, +} +impl RegisterBlock { #[doc = "0x00 - Peripheral Bridge Status Register"] - pub sts: STS, + #[inline(always)] + pub const fn sts(&self) -> &STS { + &self.sts + } #[doc = "0x04 - PBA Write Error Address Register"] - pub waddr: WADDR, + #[inline(always)] + pub const fn waddr(&self) -> &WADDR { + &self.waddr + } } -#[doc = "STS (rw) register accessor: an alias for `Reg`"] +#[doc = "STS (rw) register accessor: Peripheral Bridge Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sts::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sts::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sts`] +module"] pub type STS = crate::Reg; #[doc = "Peripheral Bridge Status Register"] pub mod sts; -#[doc = "WADDR (r) register accessor: an alias for `Reg`"] +#[doc = "WADDR (r) register accessor: PBA Write Error Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`waddr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@waddr`] +module"] 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 126686b4..8e9bc7ec 100644 --- a/src/pba0/sts.rs +++ b/src/pba0/sts.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WERR` reader - Bufferable Write Access Error"] pub type WERR_R = crate::BitReader; #[doc = "Bufferable Write Access Error\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl WERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WERR_A { + pub const fn variant(&self) -> WERR_A { match self.bits { false => WERR_A::VALUE1, true => WERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no write error occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "write error occurred, interrupt request is pending."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WERR_A::VALUE2 } } #[doc = "Field `WERR` writer - Bufferable Write Access Error"] -pub type WERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, STS_SPEC, WERR_A, O>; -impl<'a, const O: u8> WERR_W<'a, O> { +pub type WERR_W<'a, REG> = crate::BitWriter<'a, REG, WERR_A>; +impl<'a, REG> WERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no write error occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WERR_A::VALUE1) } #[doc = "write error occurred, interrupt request is pending."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WERR_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - Bufferable Write Access Error"] #[inline(always)] #[must_use] - pub fn werr(&mut self) -> WERR_W<0> { - WERR_W::new(self) + pub fn werr(&mut self) -> WERR_W { + WERR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Peripheral Bridge Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sts::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sts::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sts::R`](R) reader structure"] +impl crate::Readable for STS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sts::W`](W) writer structure"] impl crate::Writable for STS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/pba0/waddr.rs b/src/pba0/waddr.rs index a2963a11..21a5ce25 100644 --- a/src/pba0/waddr.rs +++ b/src/pba0/waddr.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `WADDR` reader - Write Error Address"] -pub type WADDR_R = crate::FieldReader; +pub type WADDR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Write Error Address"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { WADDR_R::new(self.bits) } } -#[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"] +#[doc = "PBA Write Error Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`waddr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`waddr::R`](R) reader structure"] +impl crate::Readable for WADDR_SPEC {} #[doc = "`reset()` method sets WADDR to value 0"] impl crate::Resettable for WADDR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/pmu0.rs b/src/pmu0.rs index f23b59bb..953a9903 100644 --- a/src/pmu0.rs +++ b/src/pmu0.rs @@ -1,10 +1,17 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + id: ID, +} +impl RegisterBlock { #[doc = "0x00 - PMU0 Identification Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } } -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: PMU0 Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] 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 e8ff2a5b..949d89f8 100644 --- a/src/pmu0/id.rs +++ b/src/pmu0/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision Number"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number Value"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "PMU0 Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x009e_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x009e_c000; diff --git a/src/port0.rs b/src/port0.rs index 7983bec1..68a7d4b5 100644 --- a/src/port0.rs +++ b/src/port0.rs @@ -1,81 +1,143 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + out: OUT, + omr: OMR, + _reserved2: [u8; 0x08], + iocr0: IOCR0, + iocr4: IOCR4, + iocr8: IOCR8, + iocr12: IOCR12, + _reserved6: [u8; 0x04], + in_: IN, + _reserved7: [u8; 0x18], + pdr0: PDR0, + pdr1: PDR1, + _reserved9: [u8; 0x18], + pdisc: PDISC, + _reserved10: [u8; 0x0c], + pps: PPS, + hwsel: HWSEL, +} +impl RegisterBlock { #[doc = "0x00 - Port 0 Output Register"] - pub out: OUT, + #[inline(always)] + pub const fn out(&self) -> &OUT { + &self.out + } #[doc = "0x04 - Port 0 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn omr(&self) -> &OMR { + &self.omr + } #[doc = "0x10 - Port 0 Input/Output Control Register 0"] - pub iocr0: IOCR0, + #[inline(always)] + pub const fn iocr0(&self) -> &IOCR0 { + &self.iocr0 + } #[doc = "0x14 - Port 0 Input/Output Control Register 4"] - pub iocr4: IOCR4, + #[inline(always)] + pub const fn iocr4(&self) -> &IOCR4 { + &self.iocr4 + } #[doc = "0x18 - Port 0 Input/Output Control Register 8"] - pub iocr8: IOCR8, + #[inline(always)] + pub const fn iocr8(&self) -> &IOCR8 { + &self.iocr8 + } #[doc = "0x1c - Port 0 Input/Output Control Register 12"] - pub iocr12: IOCR12, - _reserved6: [u8; 0x04], + #[inline(always)] + pub const fn iocr12(&self) -> &IOCR12 { + &self.iocr12 + } #[doc = "0x24 - Port 0 Input Register"] - pub in_: IN, - _reserved7: [u8; 0x18], + #[inline(always)] + pub const fn in_(&self) -> &IN { + &self.in_ + } #[doc = "0x40 - Port 0 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, + #[inline(always)] + pub const fn pdr0(&self) -> &PDR0 { + &self.pdr0 + } #[doc = "0x44 - Port 0 Pad Driver Mode 1 Register"] - pub pdr1: PDR1, - _reserved9: [u8; 0x18], + #[inline(always)] + pub const fn pdr1(&self) -> &PDR1 { + &self.pdr1 + } #[doc = "0x60 - Port 0 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved10: [u8; 0x0c], + #[inline(always)] + pub const fn pdisc(&self) -> &PDISC { + &self.pdisc + } #[doc = "0x70 - Port 0 Pin Power Save Register"] - pub pps: PPS, + #[inline(always)] + pub const fn pps(&self) -> &PPS { + &self.pps + } #[doc = "0x74 - Port 0 Pin Hardware Select Register"] - pub hwsel: HWSEL, + #[inline(always)] + pub const fn hwsel(&self) -> &HWSEL { + &self.hwsel + } } -#[doc = "OUT (rw) register accessor: an alias for `Reg`"] +#[doc = "OUT (rw) register accessor: Port 0 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out`] +module"] pub type OUT = crate::Reg; #[doc = "Port 0 Output Register"] pub mod out; -#[doc = "OMR (w) register accessor: an alias for `Reg`"] +#[doc = "OMR (w) register accessor: Port 0 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@omr`] +module"] pub type OMR = crate::Reg; #[doc = "Port 0 Output Modification Register"] pub mod omr; -#[doc = "IOCR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR0 (rw) register accessor: Port 0 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr0`] +module"] pub type IOCR0 = crate::Reg; #[doc = "Port 0 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "IOCR4 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR4 (rw) register accessor: Port 0 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr4`] +module"] pub type IOCR4 = crate::Reg; #[doc = "Port 0 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "IOCR8 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR8 (rw) register accessor: Port 0 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr8`] +module"] pub type IOCR8 = crate::Reg; #[doc = "Port 0 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "IOCR12 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR12 (rw) register accessor: Port 0 Input/Output Control Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr12::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr12::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr12`] +module"] pub type IOCR12 = crate::Reg; #[doc = "Port 0 Input/Output Control Register 12"] pub mod iocr12; -#[doc = "IN (r) register accessor: an alias for `Reg`"] +#[doc = "IN (r) register accessor: Port 0 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] pub type IN = crate::Reg; #[doc = "Port 0 Input Register"] pub mod in_; -#[doc = "PDR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR0 (rw) register accessor: Port 0 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr0`] +module"] pub type PDR0 = crate::Reg; #[doc = "Port 0 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "PDR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR1 (rw) register accessor: Port 0 Pad Driver Mode 1 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr1`] +module"] pub type PDR1 = crate::Reg; #[doc = "Port 0 Pad Driver Mode 1 Register"] pub mod pdr1; -#[doc = "PDISC (r) register accessor: an alias for `Reg`"] +#[doc = "PDISC (r) register accessor: Port 0 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdisc`] +module"] pub type PDISC = crate::Reg; #[doc = "Port 0 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "PPS (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS (rw) register accessor: Port 0 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps`] +module"] pub type PPS = crate::Reg; #[doc = "Port 0 Pin Power Save Register"] pub mod pps; -#[doc = "HWSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "HWSEL (rw) register accessor: Port 0 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hwsel`] +module"] 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 8ba80fc3..db5b662a 100644 --- a/src/port0/hwsel.rs +++ b/src/port0/hwsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] -pub type HW0_R = crate::FieldReader; +pub type HW0_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW0_A { + type Ux = u8; +} impl HW0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW0_A::VALUE1), 1 => Some(HW0_A::VALUE2), @@ -64,43 +35,47 @@ impl HW0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW0_A::VALUE3 } } #[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] -pub type HW0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW0_A, 2, O>; -impl<'a, const O: u8> HW0_W<'a, O> { +pub type HW0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW0_A>; +impl<'a, REG> HW0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE3) } } #[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] -pub type HW1_R = crate::FieldReader; +pub type HW1_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW1_A { + type Ux = u8; +} impl HW1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW1_A::VALUE1), 1 => Some(HW1_A::VALUE2), @@ -129,43 +107,47 @@ impl HW1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW1_A::VALUE3 } } #[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] -pub type HW1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW1_A, 2, O>; -impl<'a, const O: u8> HW1_W<'a, O> { +pub type HW1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW1_A>; +impl<'a, REG> HW1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE3) } } #[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] -pub type HW2_R = crate::FieldReader; +pub type HW2_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW2_A { + type Ux = u8; +} impl HW2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW2_A::VALUE1), 1 => Some(HW2_A::VALUE2), @@ -194,43 +179,47 @@ impl HW2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW2_A::VALUE3 } } #[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] -pub type HW2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW2_A, 2, O>; -impl<'a, const O: u8> HW2_W<'a, O> { +pub type HW2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW2_A>; +impl<'a, REG> HW2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE3) } } #[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] -pub type HW3_R = crate::FieldReader; +pub type HW3_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW3_A { + type Ux = u8; +} impl HW3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW3_A::VALUE1), 1 => Some(HW3_A::VALUE2), @@ -259,43 +251,47 @@ impl HW3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW3_A::VALUE3 } } #[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] -pub type HW3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW3_A, 2, O>; -impl<'a, const O: u8> HW3_W<'a, O> { +pub type HW3_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW3_A>; +impl<'a, REG> HW3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE3) } } #[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] -pub type HW4_R = crate::FieldReader; +pub type HW4_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +309,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW4_A { + type Ux = u8; +} impl HW4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW4_A::VALUE1), 1 => Some(HW4_A::VALUE2), @@ -324,43 +323,47 @@ impl HW4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW4_A::VALUE3 } } #[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] -pub type HW4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW4_A, 2, O>; -impl<'a, const O: u8> HW4_W<'a, O> { +pub type HW4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW4_A>; +impl<'a, REG> HW4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE3) } } #[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] -pub type HW5_R = crate::FieldReader; +pub type HW5_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -378,10 +381,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW5_A { + type Ux = u8; +} impl HW5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW5_A::VALUE1), 1 => Some(HW5_A::VALUE2), @@ -389,43 +395,47 @@ impl HW5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW5_A::VALUE3 } } #[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] -pub type HW5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW5_A, 2, O>; -impl<'a, const O: u8> HW5_W<'a, O> { +pub type HW5_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW5_A>; +impl<'a, REG> HW5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE3) } } #[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] -pub type HW6_R = crate::FieldReader; +pub type HW6_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW6_A { + type Ux = u8; +} impl HW6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW6_A::VALUE1), 1 => Some(HW6_A::VALUE2), @@ -454,43 +467,47 @@ impl HW6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW6_A::VALUE3 } } #[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] -pub type HW6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW6_A, 2, O>; -impl<'a, const O: u8> HW6_W<'a, O> { +pub type HW6_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW6_A>; +impl<'a, REG> HW6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE3) } } #[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] -pub type HW7_R = crate::FieldReader; +pub type HW7_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 7\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW7_A { + type Ux = u8; +} impl HW7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW7_A::VALUE1), 1 => Some(HW7_A::VALUE2), @@ -519,43 +539,47 @@ impl HW7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW7_A::VALUE3 } } #[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] -pub type HW7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW7_A, 2, O>; -impl<'a, const O: u8> HW7_W<'a, O> { +pub type HW7_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW7_A>; +impl<'a, REG> HW7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE3) } } #[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] -pub type HW8_R = crate::FieldReader; +pub type HW8_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 8\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -573,10 +597,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW8_A { + type Ux = u8; +} impl HW8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW8_A::VALUE1), 1 => Some(HW8_A::VALUE2), @@ -584,43 +611,47 @@ impl HW8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW8_A::VALUE3 } } #[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] -pub type HW8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW8_A, 2, O>; -impl<'a, const O: u8> HW8_W<'a, O> { +pub type HW8_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW8_A>; +impl<'a, REG> HW8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE3) } } #[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] -pub type HW9_R = crate::FieldReader; +pub type HW9_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 9\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -638,10 +669,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW9_A { + type Ux = u8; +} impl HW9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW9_A::VALUE1), 1 => Some(HW9_A::VALUE2), @@ -649,43 +683,47 @@ impl HW9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW9_A::VALUE3 } } #[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] -pub type HW9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW9_A, 2, O>; -impl<'a, const O: u8> HW9_W<'a, O> { +pub type HW9_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW9_A>; +impl<'a, REG> HW9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE3) } } #[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] -pub type HW10_R = crate::FieldReader; +pub type HW10_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -703,10 +741,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW10_A { + type Ux = u8; +} impl HW10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW10_A::VALUE1), 1 => Some(HW10_A::VALUE2), @@ -714,43 +755,47 @@ impl HW10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW10_A::VALUE3 } } #[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] -pub type HW10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW10_A, 2, O>; -impl<'a, const O: u8> HW10_W<'a, O> { +pub type HW10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW10_A>; +impl<'a, REG> HW10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE3) } } #[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] -pub type HW11_R = crate::FieldReader; +pub type HW11_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -768,10 +813,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW11_A { + type Ux = u8; +} impl HW11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW11_A::VALUE1), 1 => Some(HW11_A::VALUE2), @@ -779,43 +827,47 @@ impl HW11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW11_A::VALUE3 } } #[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] -pub type HW11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW11_A, 2, O>; -impl<'a, const O: u8> HW11_W<'a, O> { +pub type HW11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW11_A>; +impl<'a, REG> HW11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE3) } } #[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] -pub type HW12_R = crate::FieldReader; +pub type HW12_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 12\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -833,10 +885,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW12_A { + type Ux = u8; +} impl HW12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW12_A::VALUE1), 1 => Some(HW12_A::VALUE2), @@ -844,43 +899,47 @@ impl HW12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW12_A::VALUE3 } } #[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] -pub type HW12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW12_A, 2, O>; -impl<'a, const O: u8> HW12_W<'a, O> { +pub type HW12_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW12_A>; +impl<'a, REG> HW12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE3) } } #[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] -pub type HW13_R = crate::FieldReader; +pub type HW13_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 13\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -898,10 +957,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW13_A { + type Ux = u8; +} impl HW13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW13_A::VALUE1), 1 => Some(HW13_A::VALUE2), @@ -909,43 +971,47 @@ impl HW13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW13_A::VALUE3 } } #[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] -pub type HW13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW13_A, 2, O>; -impl<'a, const O: u8> HW13_W<'a, O> { +pub type HW13_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW13_A>; +impl<'a, REG> HW13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE3) } } #[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] -pub type HW14_R = crate::FieldReader; +pub type HW14_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -963,10 +1029,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW14_A { + type Ux = u8; +} impl HW14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW14_A::VALUE1), 1 => Some(HW14_A::VALUE2), @@ -974,43 +1043,47 @@ impl HW14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW14_A::VALUE3 } } #[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] -pub type HW14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW14_A, 2, O>; -impl<'a, const O: u8> HW14_W<'a, O> { +pub type HW14_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW14_A>; +impl<'a, REG> HW14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE3) } } #[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] -pub type HW15_R = crate::FieldReader; +pub type HW15_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1028,10 +1101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW15_A { + type Ux = u8; +} impl HW15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW15_A::VALUE1), 1 => Some(HW15_A::VALUE2), @@ -1039,38 +1115,42 @@ impl HW15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW15_A::VALUE3 } } #[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] -pub type HW15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW15_A, 2, O>; -impl<'a, const O: u8> HW15_W<'a, O> { +pub type HW15_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW15_A>; +impl<'a, REG> HW15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE3) } } @@ -1160,118 +1240,119 @@ impl W { #[doc = "Bits 0:1 - Port n Pin Hardware Select Bit 0"] #[inline(always)] #[must_use] - pub fn hw0(&mut self) -> HW0_W<0> { - HW0_W::new(self) + pub fn hw0(&mut self) -> HW0_W { + HW0_W::new(self, 0) } #[doc = "Bits 2:3 - Port n Pin Hardware Select Bit 1"] #[inline(always)] #[must_use] - pub fn hw1(&mut self) -> HW1_W<2> { - HW1_W::new(self) + pub fn hw1(&mut self) -> HW1_W { + HW1_W::new(self, 2) } #[doc = "Bits 4:5 - Port n Pin Hardware Select Bit 2"] #[inline(always)] #[must_use] - pub fn hw2(&mut self) -> HW2_W<4> { - HW2_W::new(self) + pub fn hw2(&mut self) -> HW2_W { + HW2_W::new(self, 4) } #[doc = "Bits 6:7 - Port n Pin Hardware Select Bit 3"] #[inline(always)] #[must_use] - pub fn hw3(&mut self) -> HW3_W<6> { - HW3_W::new(self) + pub fn hw3(&mut self) -> HW3_W { + HW3_W::new(self, 6) } #[doc = "Bits 8:9 - Port n Pin Hardware Select Bit 4"] #[inline(always)] #[must_use] - pub fn hw4(&mut self) -> HW4_W<8> { - HW4_W::new(self) + pub fn hw4(&mut self) -> HW4_W { + HW4_W::new(self, 8) } #[doc = "Bits 10:11 - Port n Pin Hardware Select Bit 5"] #[inline(always)] #[must_use] - pub fn hw5(&mut self) -> HW5_W<10> { - HW5_W::new(self) + pub fn hw5(&mut self) -> HW5_W { + HW5_W::new(self, 10) } #[doc = "Bits 12:13 - Port n Pin Hardware Select Bit 6"] #[inline(always)] #[must_use] - pub fn hw6(&mut self) -> HW6_W<12> { - HW6_W::new(self) + pub fn hw6(&mut self) -> HW6_W { + HW6_W::new(self, 12) } #[doc = "Bits 14:15 - Port n Pin Hardware Select Bit 7"] #[inline(always)] #[must_use] - pub fn hw7(&mut self) -> HW7_W<14> { - HW7_W::new(self) + pub fn hw7(&mut self) -> HW7_W { + HW7_W::new(self, 14) } #[doc = "Bits 16:17 - Port n Pin Hardware Select Bit 8"] #[inline(always)] #[must_use] - pub fn hw8(&mut self) -> HW8_W<16> { - HW8_W::new(self) + pub fn hw8(&mut self) -> HW8_W { + HW8_W::new(self, 16) } #[doc = "Bits 18:19 - Port n Pin Hardware Select Bit 9"] #[inline(always)] #[must_use] - pub fn hw9(&mut self) -> HW9_W<18> { - HW9_W::new(self) + pub fn hw9(&mut self) -> HW9_W { + HW9_W::new(self, 18) } #[doc = "Bits 20:21 - Port n Pin Hardware Select Bit 10"] #[inline(always)] #[must_use] - pub fn hw10(&mut self) -> HW10_W<20> { - HW10_W::new(self) + pub fn hw10(&mut self) -> HW10_W { + HW10_W::new(self, 20) } #[doc = "Bits 22:23 - Port n Pin Hardware Select Bit 11"] #[inline(always)] #[must_use] - pub fn hw11(&mut self) -> HW11_W<22> { - HW11_W::new(self) + pub fn hw11(&mut self) -> HW11_W { + HW11_W::new(self, 22) } #[doc = "Bits 24:25 - Port n Pin Hardware Select Bit 12"] #[inline(always)] #[must_use] - pub fn hw12(&mut self) -> HW12_W<24> { - HW12_W::new(self) + pub fn hw12(&mut self) -> HW12_W { + HW12_W::new(self, 24) } #[doc = "Bits 26:27 - Port n Pin Hardware Select Bit 13"] #[inline(always)] #[must_use] - pub fn hw13(&mut self) -> HW13_W<26> { - HW13_W::new(self) + pub fn hw13(&mut self) -> HW13_W { + HW13_W::new(self, 26) } #[doc = "Bits 28:29 - Port n Pin Hardware Select Bit 14"] #[inline(always)] #[must_use] - pub fn hw14(&mut self) -> HW14_W<28> { - HW14_W::new(self) + pub fn hw14(&mut self) -> HW14_W { + HW14_W::new(self, 28) } #[doc = "Bits 30:31 - Port n Pin Hardware Select Bit 15"] #[inline(always)] #[must_use] - pub fn hw15(&mut self) -> HW15_W<30> { - HW15_W::new(self) + pub fn hw15(&mut self) -> HW15_W { + HW15_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hwsel::R`](R) reader structure"] +impl crate::Readable for HWSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hwsel::W`](W) writer structure"] impl crate::Writable for HWSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/in_.rs b/src/port0/in_.rs index b1f7a5f8..c7f25369 100644 --- a/src/port0/in_.rs +++ b/src/port0/in_.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `P0` reader - Port n Input Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { P15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 0 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`in_::R`](R) reader structure"] +impl crate::Readable for IN_SPEC {} #[doc = "`reset()` method sets IN to value 0"] impl crate::Resettable for IN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port0/iocr0.rs b/src/port0/iocr0.rs index 466d94f9..982cb012 100644 --- a/src/port0/iocr0.rs +++ b/src/port0/iocr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] -pub type PC0_R = crate::FieldReader; +pub type PC0_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC0_A { + type Ux = u8; +} impl PC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC0_A::VALUE1), 1 => Some(PC0_A::VALUE2), @@ -109,193 +80,197 @@ impl PC0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC0_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC0_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC0_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC0_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC0_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC0_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC0_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC0_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC0_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC0_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC0_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC0_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC0_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC0_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC0_A::VALUE18 } } #[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] -pub type PC0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC0_A, 5, O>; -impl<'a, const O: u8> PC0_W<'a, O> { +pub type PC0_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC0_A>; +impl<'a, REG> PC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE18) } } #[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] -pub type PC1_R = crate::FieldReader; +pub type PC1_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC1_A { + type Ux = u8; +} impl PC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC1_A::VALUE1), 1 => Some(PC1_A::VALUE2), @@ -369,193 +347,197 @@ impl PC1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC1_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC1_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC1_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC1_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC1_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC1_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC1_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC1_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC1_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC1_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC1_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC1_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC1_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC1_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC1_A::VALUE18 } } #[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] -pub type PC1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC1_A, 5, O>; -impl<'a, const O: u8> PC1_W<'a, O> { +pub type PC1_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC1_A>; +impl<'a, REG> PC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE18) } } #[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] -pub type PC2_R = crate::FieldReader; +pub type PC2_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC2_A { + type Ux = u8; +} impl PC2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC2_A::VALUE1), 1 => Some(PC2_A::VALUE2), @@ -629,193 +614,197 @@ impl PC2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC2_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC2_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC2_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC2_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC2_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC2_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC2_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC2_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC2_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC2_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC2_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC2_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC2_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC2_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC2_A::VALUE18 } } #[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] -pub type PC2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC2_A, 5, O>; -impl<'a, const O: u8> PC2_W<'a, O> { +pub type PC2_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC2_A>; +impl<'a, REG> PC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE18) } } #[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] -pub type PC3_R = crate::FieldReader; +pub type PC3_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC3_A { + type Ux = u8; +} impl PC3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC3_A::VALUE1), 1 => Some(PC3_A::VALUE2), @@ -889,188 +881,192 @@ impl PC3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC3_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC3_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC3_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC3_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC3_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC3_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC3_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC3_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC3_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC3_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC3_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC3_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC3_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC3_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC3_A::VALUE18 } } #[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] -pub type PC3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC3_A, 5, O>; -impl<'a, const O: u8> PC3_W<'a, O> { +pub type PC3_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC3_A>; +impl<'a, REG> PC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc0(&mut self) -> PC0_W<3> { - PC0_W::new(self) + pub fn pc0(&mut self) -> PC0_W { + PC0_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc1(&mut self) -> PC1_W<11> { - PC1_W::new(self) + pub fn pc1(&mut self) -> PC1_W { + PC1_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc2(&mut self) -> PC2_W<19> { - PC2_W::new(self) + pub fn pc2(&mut self) -> PC2_W { + PC2_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc3(&mut self) -> PC3_W<27> { - PC3_W::new(self) + pub fn pc3(&mut self) -> PC3_W { + PC3_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr0::R`](R) reader structure"] +impl crate::Readable for IOCR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr0::W`](W) writer structure"] impl crate::Writable for IOCR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/iocr12.rs b/src/port0/iocr12.rs index 77015d7c..6fddb189 100644 --- a/src/port0/iocr12.rs +++ b/src/port0/iocr12.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC12` reader - Port Control for Port n Pin 12 to 15"] -pub type PC12_R = crate::FieldReader; +pub type PC12_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC12_A { + type Ux = u8; +} impl PC12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC12_A::VALUE1), 1 => Some(PC12_A::VALUE2), @@ -109,193 +80,197 @@ impl PC12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC12_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC12_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC12_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC12_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC12_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC12_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC12_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC12_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC12_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC12_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC12_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC12_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC12_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC12_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC12_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC12_A::VALUE18 } } #[doc = "Field `PC12` writer - Port Control for Port n Pin 12 to 15"] -pub type PC12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC12_A, 5, O>; -impl<'a, const O: u8> PC12_W<'a, O> { +pub type PC12_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC12_A>; +impl<'a, REG> PC12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE18) } } #[doc = "Field `PC13` reader - Port Control for Port n Pin 12 to 15"] -pub type PC13_R = crate::FieldReader; +pub type PC13_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC13_A { + type Ux = u8; +} impl PC13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC13_A::VALUE1), 1 => Some(PC13_A::VALUE2), @@ -369,193 +347,197 @@ impl PC13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC13_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC13_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC13_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC13_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC13_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC13_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC13_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC13_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC13_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC13_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC13_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC13_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC13_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC13_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC13_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC13_A::VALUE18 } } #[doc = "Field `PC13` writer - Port Control for Port n Pin 12 to 15"] -pub type PC13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC13_A, 5, O>; -impl<'a, const O: u8> PC13_W<'a, O> { +pub type PC13_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC13_A>; +impl<'a, REG> PC13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE18) } } #[doc = "Field `PC14` reader - Port Control for Port n Pin 12 to 15"] -pub type PC14_R = crate::FieldReader; +pub type PC14_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC14_A { + type Ux = u8; +} impl PC14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC14_A::VALUE1), 1 => Some(PC14_A::VALUE2), @@ -629,193 +614,197 @@ impl PC14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC14_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC14_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC14_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC14_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC14_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC14_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC14_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC14_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC14_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC14_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC14_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC14_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC14_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC14_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC14_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC14_A::VALUE18 } } #[doc = "Field `PC14` writer - Port Control for Port n Pin 12 to 15"] -pub type PC14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC14_A, 5, O>; -impl<'a, const O: u8> PC14_W<'a, O> { +pub type PC14_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC14_A>; +impl<'a, REG> PC14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE18) } } #[doc = "Field `PC15` reader - Port Control for Port n Pin 12 to 15"] -pub type PC15_R = crate::FieldReader; +pub type PC15_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC15_A { + type Ux = u8; +} impl PC15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC15_A::VALUE1), 1 => Some(PC15_A::VALUE2), @@ -889,188 +881,192 @@ impl PC15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC15_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC15_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC15_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC15_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC15_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC15_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC15_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC15_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC15_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC15_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC15_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC15_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC15_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC15_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC15_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC15_A::VALUE18 } } #[doc = "Field `PC15` writer - Port Control for Port n Pin 12 to 15"] -pub type PC15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC15_A, 5, O>; -impl<'a, const O: u8> PC15_W<'a, O> { +pub type PC15_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC15_A>; +impl<'a, REG> PC15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc12(&mut self) -> PC12_W<3> { - PC12_W::new(self) + pub fn pc12(&mut self) -> PC12_W { + PC12_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc13(&mut self) -> PC13_W<11> { - PC13_W::new(self) + pub fn pc13(&mut self) -> PC13_W { + PC13_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc14(&mut self) -> PC14_W<19> { - PC14_W::new(self) + pub fn pc14(&mut self) -> PC14_W { + PC14_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc15(&mut self) -> PC15_W<27> { - PC15_W::new(self) + pub fn pc15(&mut self) -> PC15_W { + PC15_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 0 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"] +#[doc = "Port 0 Input/Output Control Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr12::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr12::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr12::R`](R) reader structure"] +impl crate::Readable for IOCR12_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr12::W`](W) writer structure"] impl crate::Writable for IOCR12_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/iocr4.rs b/src/port0/iocr4.rs index 0aac2630..a5c22110 100644 --- a/src/port0/iocr4.rs +++ b/src/port0/iocr4.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] -pub type PC4_R = crate::FieldReader; +pub type PC4_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC4_A { + type Ux = u8; +} impl PC4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC4_A::VALUE1), 1 => Some(PC4_A::VALUE2), @@ -109,193 +80,197 @@ impl PC4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC4_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC4_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC4_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC4_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC4_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC4_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC4_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC4_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC4_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC4_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC4_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC4_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC4_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC4_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC4_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC4_A::VALUE18 } } #[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] -pub type PC4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC4_A, 5, O>; -impl<'a, const O: u8> PC4_W<'a, O> { +pub type PC4_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC4_A>; +impl<'a, REG> PC4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE18) } } #[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] -pub type PC5_R = crate::FieldReader; +pub type PC5_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC5_A { + type Ux = u8; +} impl PC5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC5_A::VALUE1), 1 => Some(PC5_A::VALUE2), @@ -369,193 +347,197 @@ impl PC5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC5_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC5_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC5_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC5_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC5_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC5_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC5_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC5_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC5_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC5_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC5_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC5_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC5_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC5_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC5_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC5_A::VALUE18 } } #[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] -pub type PC5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC5_A, 5, O>; -impl<'a, const O: u8> PC5_W<'a, O> { +pub type PC5_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC5_A>; +impl<'a, REG> PC5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE18) } } #[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] -pub type PC6_R = crate::FieldReader; +pub type PC6_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC6_A { + type Ux = u8; +} impl PC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC6_A::VALUE1), 1 => Some(PC6_A::VALUE2), @@ -629,193 +614,197 @@ impl PC6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC6_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC6_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC6_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC6_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC6_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC6_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC6_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC6_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC6_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC6_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC6_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC6_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC6_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC6_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC6_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC6_A::VALUE18 } } #[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] -pub type PC6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC6_A, 5, O>; -impl<'a, const O: u8> PC6_W<'a, O> { +pub type PC6_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC6_A>; +impl<'a, REG> PC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE18) } } #[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] -pub type PC7_R = crate::FieldReader; +pub type PC7_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC7_A { + type Ux = u8; +} impl PC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC7_A::VALUE1), 1 => Some(PC7_A::VALUE2), @@ -889,188 +881,192 @@ impl PC7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC7_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC7_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC7_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC7_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC7_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC7_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC7_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC7_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC7_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC7_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC7_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC7_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC7_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC7_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC7_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC7_A::VALUE18 } } #[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] -pub type PC7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC7_A, 5, O>; -impl<'a, const O: u8> PC7_W<'a, O> { +pub type PC7_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC7_A>; +impl<'a, REG> PC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc4(&mut self) -> PC4_W<3> { - PC4_W::new(self) + pub fn pc4(&mut self) -> PC4_W { + PC4_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc5(&mut self) -> PC5_W<11> { - PC5_W::new(self) + pub fn pc5(&mut self) -> PC5_W { + PC5_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc6(&mut self) -> PC6_W<19> { - PC6_W::new(self) + pub fn pc6(&mut self) -> PC6_W { + PC6_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc7(&mut self) -> PC7_W<27> { - PC7_W::new(self) + pub fn pc7(&mut self) -> PC7_W { + PC7_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr4::R`](R) reader structure"] +impl crate::Readable for IOCR4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr4::W`](W) writer structure"] impl crate::Writable for IOCR4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/iocr8.rs b/src/port0/iocr8.rs index d899152b..e50facba 100644 --- a/src/port0/iocr8.rs +++ b/src/port0/iocr8.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] -pub type PC8_R = crate::FieldReader; +pub type PC8_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC8_A { + type Ux = u8; +} impl PC8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC8_A::VALUE1), 1 => Some(PC8_A::VALUE2), @@ -109,193 +80,197 @@ impl PC8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC8_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC8_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC8_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC8_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC8_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC8_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC8_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC8_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC8_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC8_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC8_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC8_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC8_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC8_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC8_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC8_A::VALUE18 } } #[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] -pub type PC8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC8_A, 5, O>; -impl<'a, const O: u8> PC8_W<'a, O> { +pub type PC8_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC8_A>; +impl<'a, REG> PC8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE18) } } #[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] -pub type PC9_R = crate::FieldReader; +pub type PC9_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC9_A { + type Ux = u8; +} impl PC9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC9_A::VALUE1), 1 => Some(PC9_A::VALUE2), @@ -369,193 +347,197 @@ impl PC9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC9_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC9_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC9_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC9_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC9_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC9_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC9_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC9_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC9_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC9_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC9_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC9_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC9_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC9_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC9_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC9_A::VALUE18 } } #[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] -pub type PC9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC9_A, 5, O>; -impl<'a, const O: u8> PC9_W<'a, O> { +pub type PC9_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC9_A>; +impl<'a, REG> PC9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE18) } } #[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] -pub type PC10_R = crate::FieldReader; +pub type PC10_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC10_A { + type Ux = u8; +} impl PC10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC10_A::VALUE1), 1 => Some(PC10_A::VALUE2), @@ -629,193 +614,197 @@ impl PC10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC10_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC10_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC10_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC10_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC10_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC10_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC10_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC10_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC10_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC10_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC10_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC10_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC10_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC10_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC10_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC10_A::VALUE18 } } #[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] -pub type PC10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC10_A, 5, O>; -impl<'a, const O: u8> PC10_W<'a, O> { +pub type PC10_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC10_A>; +impl<'a, REG> PC10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE18) } } #[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] -pub type PC11_R = crate::FieldReader; +pub type PC11_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC11_A { + type Ux = u8; +} impl PC11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC11_A::VALUE1), 1 => Some(PC11_A::VALUE2), @@ -889,188 +881,192 @@ impl PC11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC11_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC11_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC11_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC11_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC11_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC11_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC11_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC11_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC11_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC11_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC11_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC11_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC11_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC11_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC11_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC11_A::VALUE18 } } #[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] -pub type PC11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC11_A, 5, O>; -impl<'a, const O: u8> PC11_W<'a, O> { +pub type PC11_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC11_A>; +impl<'a, REG> PC11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc8(&mut self) -> PC8_W<3> { - PC8_W::new(self) + pub fn pc8(&mut self) -> PC8_W { + PC8_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc9(&mut self) -> PC9_W<11> { - PC9_W::new(self) + pub fn pc9(&mut self) -> PC9_W { + PC9_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc10(&mut self) -> PC10_W<19> { - PC10_W::new(self) + pub fn pc10(&mut self) -> PC10_W { + PC10_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc11(&mut self) -> PC11_W<27> { - PC11_W::new(self) + pub fn pc11(&mut self) -> PC11_W { + PC11_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr8::R`](R) reader structure"] +impl crate::Readable for IOCR8_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr8::W`](W) writer structure"] impl crate::Writable for IOCR8_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/omr.rs b/src/port0/omr.rs index 73ba8ce5..09446618 100644 --- a/src/port0/omr.rs +++ b/src/port0/omr.rs @@ -1,296 +1,280 @@ #[doc = "Register `OMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PS0` writer - Port n Set Bit 0"] -pub type PS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1` writer - Port n Set Bit 1"] -pub type PS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2` writer - Port n Set Bit 2"] -pub type PS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS3` writer - Port n Set Bit 3"] -pub type PS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS4` writer - Port n Set Bit 4"] -pub type PS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS5` writer - Port n Set Bit 5"] -pub type PS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS6` writer - Port n Set Bit 6"] -pub type PS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS7` writer - Port n Set Bit 7"] -pub type PS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS8` writer - Port n Set Bit 8"] -pub type PS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS9` writer - Port n Set Bit 9"] -pub type PS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS10` writer - Port n Set Bit 10"] -pub type PS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS11` writer - Port n Set Bit 11"] -pub type PS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS12` writer - Port n Set Bit 12"] -pub type PS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS13` writer - Port n Set Bit 13"] -pub type PS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS14` writer - Port n Set Bit 14"] -pub type PS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS15` writer - Port n Set Bit 15"] -pub type PS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR0` writer - Port n Reset Bit 0"] -pub type PR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR1` writer - Port n Reset Bit 1"] -pub type PR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR2` writer - Port n Reset Bit 2"] -pub type PR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR3` writer - Port n Reset Bit 3"] -pub type PR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR4` writer - Port n Reset Bit 4"] -pub type PR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR5` writer - Port n Reset Bit 5"] -pub type PR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR6` writer - Port n Reset Bit 6"] -pub type PR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR7` writer - Port n Reset Bit 7"] -pub type PR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR8` writer - Port n Reset Bit 8"] -pub type PR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR9` writer - Port n Reset Bit 9"] -pub type PR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR10` writer - Port n Reset Bit 10"] -pub type PR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR11` writer - Port n Reset Bit 11"] -pub type PR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR12` writer - Port n Reset Bit 12"] -pub type PR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR13` writer - Port n Reset Bit 13"] -pub type PR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR14` writer - Port n Reset Bit 14"] -pub type PR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR15` writer - Port n Reset Bit 15"] -pub type PR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR15_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Port n Set Bit 0"] #[inline(always)] #[must_use] - pub fn ps0(&mut self) -> PS0_W<0> { - PS0_W::new(self) + pub fn ps0(&mut self) -> PS0_W { + PS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Set Bit 1"] #[inline(always)] #[must_use] - pub fn ps1(&mut self) -> PS1_W<1> { - PS1_W::new(self) + pub fn ps1(&mut self) -> PS1_W { + PS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Set Bit 2"] #[inline(always)] #[must_use] - pub fn ps2(&mut self) -> PS2_W<2> { - PS2_W::new(self) + pub fn ps2(&mut self) -> PS2_W { + PS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Set Bit 3"] #[inline(always)] #[must_use] - pub fn ps3(&mut self) -> PS3_W<3> { - PS3_W::new(self) + pub fn ps3(&mut self) -> PS3_W { + PS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Set Bit 4"] #[inline(always)] #[must_use] - pub fn ps4(&mut self) -> PS4_W<4> { - PS4_W::new(self) + pub fn ps4(&mut self) -> PS4_W { + PS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Set Bit 5"] #[inline(always)] #[must_use] - pub fn ps5(&mut self) -> PS5_W<5> { - PS5_W::new(self) + pub fn ps5(&mut self) -> PS5_W { + PS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Set Bit 6"] #[inline(always)] #[must_use] - pub fn ps6(&mut self) -> PS6_W<6> { - PS6_W::new(self) + pub fn ps6(&mut self) -> PS6_W { + PS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Set Bit 7"] #[inline(always)] #[must_use] - pub fn ps7(&mut self) -> PS7_W<7> { - PS7_W::new(self) + pub fn ps7(&mut self) -> PS7_W { + PS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Set Bit 8"] #[inline(always)] #[must_use] - pub fn ps8(&mut self) -> PS8_W<8> { - PS8_W::new(self) + pub fn ps8(&mut self) -> PS8_W { + PS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Set Bit 9"] #[inline(always)] #[must_use] - pub fn ps9(&mut self) -> PS9_W<9> { - PS9_W::new(self) + pub fn ps9(&mut self) -> PS9_W { + PS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Set Bit 10"] #[inline(always)] #[must_use] - pub fn ps10(&mut self) -> PS10_W<10> { - PS10_W::new(self) + pub fn ps10(&mut self) -> PS10_W { + PS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Set Bit 11"] #[inline(always)] #[must_use] - pub fn ps11(&mut self) -> PS11_W<11> { - PS11_W::new(self) + pub fn ps11(&mut self) -> PS11_W { + PS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Set Bit 12"] #[inline(always)] #[must_use] - pub fn ps12(&mut self) -> PS12_W<12> { - PS12_W::new(self) + pub fn ps12(&mut self) -> PS12_W { + PS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Set Bit 13"] #[inline(always)] #[must_use] - pub fn ps13(&mut self) -> PS13_W<13> { - PS13_W::new(self) + pub fn ps13(&mut self) -> PS13_W { + PS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Set Bit 14"] #[inline(always)] #[must_use] - pub fn ps14(&mut self) -> PS14_W<14> { - PS14_W::new(self) + pub fn ps14(&mut self) -> PS14_W { + PS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Set Bit 15"] #[inline(always)] #[must_use] - pub fn ps15(&mut self) -> PS15_W<15> { - PS15_W::new(self) + pub fn ps15(&mut self) -> PS15_W { + PS15_W::new(self, 15) } #[doc = "Bit 16 - Port n Reset Bit 0"] #[inline(always)] #[must_use] - pub fn pr0(&mut self) -> PR0_W<16> { - PR0_W::new(self) + pub fn pr0(&mut self) -> PR0_W { + PR0_W::new(self, 16) } #[doc = "Bit 17 - Port n Reset Bit 1"] #[inline(always)] #[must_use] - pub fn pr1(&mut self) -> PR1_W<17> { - PR1_W::new(self) + pub fn pr1(&mut self) -> PR1_W { + PR1_W::new(self, 17) } #[doc = "Bit 18 - Port n Reset Bit 2"] #[inline(always)] #[must_use] - pub fn pr2(&mut self) -> PR2_W<18> { - PR2_W::new(self) + pub fn pr2(&mut self) -> PR2_W { + PR2_W::new(self, 18) } #[doc = "Bit 19 - Port n Reset Bit 3"] #[inline(always)] #[must_use] - pub fn pr3(&mut self) -> PR3_W<19> { - PR3_W::new(self) + pub fn pr3(&mut self) -> PR3_W { + PR3_W::new(self, 19) } #[doc = "Bit 20 - Port n Reset Bit 4"] #[inline(always)] #[must_use] - pub fn pr4(&mut self) -> PR4_W<20> { - PR4_W::new(self) + pub fn pr4(&mut self) -> PR4_W { + PR4_W::new(self, 20) } #[doc = "Bit 21 - Port n Reset Bit 5"] #[inline(always)] #[must_use] - pub fn pr5(&mut self) -> PR5_W<21> { - PR5_W::new(self) + pub fn pr5(&mut self) -> PR5_W { + PR5_W::new(self, 21) } #[doc = "Bit 22 - Port n Reset Bit 6"] #[inline(always)] #[must_use] - pub fn pr6(&mut self) -> PR6_W<22> { - PR6_W::new(self) + pub fn pr6(&mut self) -> PR6_W { + PR6_W::new(self, 22) } #[doc = "Bit 23 - Port n Reset Bit 7"] #[inline(always)] #[must_use] - pub fn pr7(&mut self) -> PR7_W<23> { - PR7_W::new(self) + pub fn pr7(&mut self) -> PR7_W { + PR7_W::new(self, 23) } #[doc = "Bit 24 - Port n Reset Bit 8"] #[inline(always)] #[must_use] - pub fn pr8(&mut self) -> PR8_W<24> { - PR8_W::new(self) + pub fn pr8(&mut self) -> PR8_W { + PR8_W::new(self, 24) } #[doc = "Bit 25 - Port n Reset Bit 9"] #[inline(always)] #[must_use] - pub fn pr9(&mut self) -> PR9_W<25> { - PR9_W::new(self) + pub fn pr9(&mut self) -> PR9_W { + PR9_W::new(self, 25) } #[doc = "Bit 26 - Port n Reset Bit 10"] #[inline(always)] #[must_use] - pub fn pr10(&mut self) -> PR10_W<26> { - PR10_W::new(self) + pub fn pr10(&mut self) -> PR10_W { + PR10_W::new(self, 26) } #[doc = "Bit 27 - Port n Reset Bit 11"] #[inline(always)] #[must_use] - pub fn pr11(&mut self) -> PR11_W<27> { - PR11_W::new(self) + pub fn pr11(&mut self) -> PR11_W { + PR11_W::new(self, 27) } #[doc = "Bit 28 - Port n Reset Bit 12"] #[inline(always)] #[must_use] - pub fn pr12(&mut self) -> PR12_W<28> { - PR12_W::new(self) + pub fn pr12(&mut self) -> PR12_W { + PR12_W::new(self, 28) } #[doc = "Bit 29 - Port n Reset Bit 13"] #[inline(always)] #[must_use] - pub fn pr13(&mut self) -> PR13_W<29> { - PR13_W::new(self) + pub fn pr13(&mut self) -> PR13_W { + PR13_W::new(self, 29) } #[doc = "Bit 30 - Port n Reset Bit 14"] #[inline(always)] #[must_use] - pub fn pr14(&mut self) -> PR14_W<30> { - PR14_W::new(self) + pub fn pr14(&mut self) -> PR14_W { + PR14_W::new(self, 30) } #[doc = "Bit 31 - Port n Reset Bit 15"] #[inline(always)] #[must_use] - pub fn pr15(&mut self) -> PR15_W<31> { - PR15_W::new(self) + pub fn pr15(&mut self) -> PR15_W { + PR15_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OMR_SPEC; impl crate::RegisterSpec for OMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`omr::W`](W) writer structure"] impl crate::Writable for OMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/out.rs b/src/port0/out.rs index f42e342f..c56b2475 100644 --- a/src/port0/out.rs +++ b/src/port0/out.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `P0` reader - Port n Output Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 } } #[doc = "Field `P0` writer - Port n Output Bit 0"] -pub type P0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P0_A, O>; -impl<'a, const O: u8> P0_W<'a, O> { +pub type P0_W<'a, REG> = crate::BitWriter<'a, REG, P0_A>; +impl<'a, REG> P0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P0_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 } } #[doc = "Field `P1` writer - Port n Output Bit 1"] -pub type P1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P1_A, O>; -impl<'a, const O: u8> P1_W<'a, O> { +pub type P1_W<'a, REG> = crate::BitWriter<'a, REG, P1_A>; +impl<'a, REG> P1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P1_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 } } #[doc = "Field `P2` writer - Port n Output Bit 2"] -pub type P2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P2_A, O>; -impl<'a, const O: u8> P2_W<'a, O> { +pub type P2_W<'a, REG> = crate::BitWriter<'a, REG, P2_A>; +impl<'a, REG> P2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P2_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 } } #[doc = "Field `P3` writer - Port n Output Bit 3"] -pub type P3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P3_A, O>; -impl<'a, const O: u8> P3_W<'a, O> { +pub type P3_W<'a, REG> = crate::BitWriter<'a, REG, P3_A>; +impl<'a, REG> P3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P3_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 } } #[doc = "Field `P4` writer - Port n Output Bit 4"] -pub type P4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P4_A, O>; -impl<'a, const O: u8> P4_W<'a, O> { +pub type P4_W<'a, REG> = crate::BitWriter<'a, REG, P4_A>; +impl<'a, REG> P4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P4_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 } } #[doc = "Field `P5` writer - Port n Output Bit 5"] -pub type P5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P5_A, O>; -impl<'a, const O: u8> P5_W<'a, O> { +pub type P5_W<'a, REG> = crate::BitWriter<'a, REG, P5_A>; +impl<'a, REG> P5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P5_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 } } #[doc = "Field `P6` writer - Port n Output Bit 6"] -pub type P6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P6_A, O>; -impl<'a, const O: u8> P6_W<'a, O> { +pub type P6_W<'a, REG> = crate::BitWriter<'a, REG, P6_A>; +impl<'a, REG> P6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P6_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 } } #[doc = "Field `P7` writer - Port n Output Bit 7"] -pub type P7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P7_A, O>; -impl<'a, const O: u8> P7_W<'a, O> { +pub type P7_W<'a, REG> = crate::BitWriter<'a, REG, P7_A>; +impl<'a, REG> P7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P7_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 } } #[doc = "Field `P8` writer - Port n Output Bit 8"] -pub type P8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P8_A, O>; -impl<'a, const O: u8> P8_W<'a, O> { +pub type P8_W<'a, REG> = crate::BitWriter<'a, REG, P8_A>; +impl<'a, REG> P8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P8_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 } } #[doc = "Field `P9` writer - Port n Output Bit 9"] -pub type P9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P9_A, O>; -impl<'a, const O: u8> P9_W<'a, O> { +pub type P9_W<'a, REG> = crate::BitWriter<'a, REG, P9_A>; +impl<'a, REG> P9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P9_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 } } #[doc = "Field `P10` writer - Port n Output Bit 10"] -pub type P10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P10_A, O>; -impl<'a, const O: u8> P10_W<'a, O> { +pub type P10_W<'a, REG> = crate::BitWriter<'a, REG, P10_A>; +impl<'a, REG> P10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P10_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 } } #[doc = "Field `P11` writer - Port n Output Bit 11"] -pub type P11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P11_A, O>; -impl<'a, const O: u8> P11_W<'a, O> { +pub type P11_W<'a, REG> = crate::BitWriter<'a, REG, P11_A>; +impl<'a, REG> P11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P11_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 } } #[doc = "Field `P12` writer - Port n Output Bit 12"] -pub type P12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P12_A, O>; -impl<'a, const O: u8> P12_W<'a, O> { +pub type P12_W<'a, REG> = crate::BitWriter<'a, REG, P12_A>; +impl<'a, REG> P12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P12_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 } } #[doc = "Field `P13` writer - Port n Output Bit 13"] -pub type P13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P13_A, O>; -impl<'a, const O: u8> P13_W<'a, O> { +pub type P13_W<'a, REG> = crate::BitWriter<'a, REG, P13_A>; +impl<'a, REG> P13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P13_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 } } #[doc = "Field `P14` writer - Port n Output Bit 14"] -pub type P14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P14_A, O>; -impl<'a, const O: u8> P14_W<'a, O> { +pub type P14_W<'a, REG> = crate::BitWriter<'a, REG, P14_A>; +impl<'a, REG> P14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P14_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 } } #[doc = "Field `P15` writer - Port n Output Bit 15"] -pub type P15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P15_A, O>; -impl<'a, const O: u8> P15_W<'a, O> { +pub type P15_W<'a, REG> = crate::BitWriter<'a, REG, P15_A>; +impl<'a, REG> P15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P15_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Output Bit 0"] #[inline(always)] #[must_use] - pub fn p0(&mut self) -> P0_W<0> { - P0_W::new(self) + pub fn p0(&mut self) -> P0_W { + P0_W::new(self, 0) } #[doc = "Bit 1 - Port n Output Bit 1"] #[inline(always)] #[must_use] - pub fn p1(&mut self) -> P1_W<1> { - P1_W::new(self) + pub fn p1(&mut self) -> P1_W { + P1_W::new(self, 1) } #[doc = "Bit 2 - Port n Output Bit 2"] #[inline(always)] #[must_use] - pub fn p2(&mut self) -> P2_W<2> { - P2_W::new(self) + pub fn p2(&mut self) -> P2_W { + P2_W::new(self, 2) } #[doc = "Bit 3 - Port n Output Bit 3"] #[inline(always)] #[must_use] - pub fn p3(&mut self) -> P3_W<3> { - P3_W::new(self) + pub fn p3(&mut self) -> P3_W { + P3_W::new(self, 3) } #[doc = "Bit 4 - Port n Output Bit 4"] #[inline(always)] #[must_use] - pub fn p4(&mut self) -> P4_W<4> { - P4_W::new(self) + pub fn p4(&mut self) -> P4_W { + P4_W::new(self, 4) } #[doc = "Bit 5 - Port n Output Bit 5"] #[inline(always)] #[must_use] - pub fn p5(&mut self) -> P5_W<5> { - P5_W::new(self) + pub fn p5(&mut self) -> P5_W { + P5_W::new(self, 5) } #[doc = "Bit 6 - Port n Output Bit 6"] #[inline(always)] #[must_use] - pub fn p6(&mut self) -> P6_W<6> { - P6_W::new(self) + pub fn p6(&mut self) -> P6_W { + P6_W::new(self, 6) } #[doc = "Bit 7 - Port n Output Bit 7"] #[inline(always)] #[must_use] - pub fn p7(&mut self) -> P7_W<7> { - P7_W::new(self) + pub fn p7(&mut self) -> P7_W { + P7_W::new(self, 7) } #[doc = "Bit 8 - Port n Output Bit 8"] #[inline(always)] #[must_use] - pub fn p8(&mut self) -> P8_W<8> { - P8_W::new(self) + pub fn p8(&mut self) -> P8_W { + P8_W::new(self, 8) } #[doc = "Bit 9 - Port n Output Bit 9"] #[inline(always)] #[must_use] - pub fn p9(&mut self) -> P9_W<9> { - P9_W::new(self) + pub fn p9(&mut self) -> P9_W { + P9_W::new(self, 9) } #[doc = "Bit 10 - Port n Output Bit 10"] #[inline(always)] #[must_use] - pub fn p10(&mut self) -> P10_W<10> { - P10_W::new(self) + pub fn p10(&mut self) -> P10_W { + P10_W::new(self, 10) } #[doc = "Bit 11 - Port n Output Bit 11"] #[inline(always)] #[must_use] - pub fn p11(&mut self) -> P11_W<11> { - P11_W::new(self) + pub fn p11(&mut self) -> P11_W { + P11_W::new(self, 11) } #[doc = "Bit 12 - Port n Output Bit 12"] #[inline(always)] #[must_use] - pub fn p12(&mut self) -> P12_W<12> { - P12_W::new(self) + pub fn p12(&mut self) -> P12_W { + P12_W::new(self, 12) } #[doc = "Bit 13 - Port n Output Bit 13"] #[inline(always)] #[must_use] - pub fn p13(&mut self) -> P13_W<13> { - P13_W::new(self) + pub fn p13(&mut self) -> P13_W { + P13_W::new(self, 13) } #[doc = "Bit 14 - Port n Output Bit 14"] #[inline(always)] #[must_use] - pub fn p14(&mut self) -> P14_W<14> { - P14_W::new(self) + pub fn p14(&mut self) -> P14_W { + P14_W::new(self, 14) } #[doc = "Bit 15 - Port n Output Bit 15"] #[inline(always)] #[must_use] - pub fn p15(&mut self) -> P15_W<15> { - P15_W::new(self) + pub fn p15(&mut self) -> P15_W { + P15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`out::R`](R) reader structure"] +impl crate::Readable for OUT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`out::W`](W) writer structure"] impl crate::Writable for OUT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/pdisc.rs b/src/port0/pdisc.rs index b544b414..8e72a974 100644 --- a/src/port0/pdisc.rs +++ b/src/port0/pdisc.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] pub type PDIS0_R = crate::BitReader; #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl PDIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS0_A { + pub const fn variant(&self) -> PDIS0_A { match self.bits { false => PDIS0_A::VALUE1, true => PDIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl PDIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS1_A { + pub const fn variant(&self) -> PDIS1_A { match self.bits { false => PDIS1_A::VALUE1, true => PDIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl PDIS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS2_A { + pub const fn variant(&self) -> PDIS2_A { match self.bits { false => PDIS2_A::VALUE1, true => PDIS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl PDIS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS3_A { + pub const fn variant(&self) -> PDIS3_A { match self.bits { false => PDIS3_A::VALUE1, true => PDIS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl PDIS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS4_A { + pub const fn variant(&self) -> PDIS4_A { match self.bits { false => PDIS4_A::VALUE1, true => PDIS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PDIS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS5_A { + pub const fn variant(&self) -> PDIS5_A { match self.bits { false => PDIS5_A::VALUE1, true => PDIS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl PDIS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS6_A { + pub const fn variant(&self) -> PDIS6_A { match self.bits { false => PDIS6_A::VALUE1, true => PDIS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl PDIS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS7_A { + pub const fn variant(&self) -> PDIS7_A { match self.bits { false => PDIS7_A::VALUE1, true => PDIS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PDIS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS8_A { + pub const fn variant(&self) -> PDIS8_A { match self.bits { false => PDIS8_A::VALUE1, true => PDIS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl PDIS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS9_A { + pub const fn variant(&self) -> PDIS9_A { match self.bits { false => PDIS9_A::VALUE1, true => PDIS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl PDIS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS10_A { + pub const fn variant(&self) -> PDIS10_A { match self.bits { false => PDIS10_A::VALUE1, true => PDIS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl PDIS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS11_A { + pub const fn variant(&self) -> PDIS11_A { match self.bits { false => PDIS11_A::VALUE1, true => PDIS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl PDIS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS12_A { + pub const fn variant(&self) -> PDIS12_A { match self.bits { false => PDIS12_A::VALUE1, true => PDIS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl PDIS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS13_A { + pub const fn variant(&self) -> PDIS13_A { match self.bits { false => PDIS13_A::VALUE1, true => PDIS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl PDIS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS14_A { + pub const fn variant(&self) -> PDIS14_A { match self.bits { false => PDIS14_A::VALUE1, true => PDIS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl PDIS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS15_A { + pub const fn variant(&self) -> PDIS15_A { match self.bits { false => PDIS15_A::VALUE1, true => PDIS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 0 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pdisc::R`](R) reader structure"] +impl crate::Readable for PDISC_SPEC {} #[doc = "`reset()` method sets PDISC to value 0"] impl crate::Resettable for PDISC_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port0/pdr0.rs b/src/port0/pdr0.rs index 22445b65..a5012415 100644 --- a/src/port0/pdr0.rs +++ b/src/port0/pdr0.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] -pub type PD0_R = crate::FieldReader; +pub type PD0_R = crate::FieldReader; #[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] -pub type PD0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] -pub type PD1_R = crate::FieldReader; +pub type PD1_R = crate::FieldReader; #[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] -pub type PD1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] -pub type PD2_R = crate::FieldReader; +pub type PD2_R = crate::FieldReader; #[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] -pub type PD2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] -pub type PD3_R = crate::FieldReader; +pub type PD3_R = crate::FieldReader; #[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] -pub type PD3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD3_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] -pub type PD4_R = crate::FieldReader; +pub type PD4_R = crate::FieldReader; #[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] -pub type PD4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD4_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] -pub type PD5_R = crate::FieldReader; +pub type PD5_R = crate::FieldReader; #[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] -pub type PD5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD5_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] -pub type PD6_R = crate::FieldReader; +pub type PD6_R = crate::FieldReader; #[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] -pub type PD6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD6_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] -pub type PD7_R = crate::FieldReader; +pub type PD7_R = crate::FieldReader; #[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] -pub type PD7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD7_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] #[must_use] - pub fn pd0(&mut self) -> PD0_W<0> { - PD0_W::new(self) + pub fn pd0(&mut self) -> PD0_W { + PD0_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.1"] #[inline(always)] #[must_use] - pub fn pd1(&mut self) -> PD1_W<4> { - PD1_W::new(self) + pub fn pd1(&mut self) -> PD1_W { + PD1_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.2"] #[inline(always)] #[must_use] - pub fn pd2(&mut self) -> PD2_W<8> { - PD2_W::new(self) + pub fn pd2(&mut self) -> PD2_W { + PD2_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.3"] #[inline(always)] #[must_use] - pub fn pd3(&mut self) -> PD3_W<12> { - PD3_W::new(self) + pub fn pd3(&mut self) -> PD3_W { + PD3_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.4"] #[inline(always)] #[must_use] - pub fn pd4(&mut self) -> PD4_W<16> { - PD4_W::new(self) + pub fn pd4(&mut self) -> PD4_W { + PD4_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.5"] #[inline(always)] #[must_use] - pub fn pd5(&mut self) -> PD5_W<20> { - PD5_W::new(self) + pub fn pd5(&mut self) -> PD5_W { + PD5_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.6"] #[inline(always)] #[must_use] - pub fn pd6(&mut self) -> PD6_W<24> { - PD6_W::new(self) + pub fn pd6(&mut self) -> PD6_W { + PD6_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.7"] #[inline(always)] #[must_use] - pub fn pd7(&mut self) -> PD7_W<28> { - PD7_W::new(self) + pub fn pd7(&mut self) -> PD7_W { + PD7_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr0::R`](R) reader structure"] +impl crate::Readable for PDR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr0::W`](W) writer structure"] impl crate::Writable for PDR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/pdr1.rs b/src/port0/pdr1.rs index 395bff8c..4d2148a1 100644 --- a/src/port0/pdr1.rs +++ b/src/port0/pdr1.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD8` reader - Pad Driver Mode for Pn.8"] -pub type PD8_R = crate::FieldReader; +pub type PD8_R = crate::FieldReader; #[doc = "Field `PD8` writer - Pad Driver Mode for Pn.8"] -pub type PD8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD8_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD9` reader - Pad Driver Mode for Pn.9"] -pub type PD9_R = crate::FieldReader; +pub type PD9_R = crate::FieldReader; #[doc = "Field `PD9` writer - Pad Driver Mode for Pn.9"] -pub type PD9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD9_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD10` reader - Pad Driver Mode for Pn.10"] -pub type PD10_R = crate::FieldReader; +pub type PD10_R = crate::FieldReader; #[doc = "Field `PD10` writer - Pad Driver Mode for Pn.10"] -pub type PD10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD10_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD11` reader - Pad Driver Mode for Pn.11"] -pub type PD11_R = crate::FieldReader; +pub type PD11_R = crate::FieldReader; #[doc = "Field `PD11` writer - Pad Driver Mode for Pn.11"] -pub type PD11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD11_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD12` reader - Pad Driver Mode for Pn.12"] -pub type PD12_R = crate::FieldReader; +pub type PD12_R = crate::FieldReader; #[doc = "Field `PD12` writer - Pad Driver Mode for Pn.12"] -pub type PD12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD12_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD13` reader - Pad Driver Mode for Pn.13"] -pub type PD13_R = crate::FieldReader; +pub type PD13_R = crate::FieldReader; #[doc = "Field `PD13` writer - Pad Driver Mode for Pn.13"] -pub type PD13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD13_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD14` reader - Pad Driver Mode for Pn.14"] -pub type PD14_R = crate::FieldReader; +pub type PD14_R = crate::FieldReader; #[doc = "Field `PD14` writer - Pad Driver Mode for Pn.14"] -pub type PD14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD14_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD15` reader - Pad Driver Mode for Pn.15"] -pub type PD15_R = crate::FieldReader; +pub type PD15_R = crate::FieldReader; #[doc = "Field `PD15` writer - Pad Driver Mode for Pn.15"] -pub type PD15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD15_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.8"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.8"] #[inline(always)] #[must_use] - pub fn pd8(&mut self) -> PD8_W<0> { - PD8_W::new(self) + pub fn pd8(&mut self) -> PD8_W { + PD8_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.9"] #[inline(always)] #[must_use] - pub fn pd9(&mut self) -> PD9_W<4> { - PD9_W::new(self) + pub fn pd9(&mut self) -> PD9_W { + PD9_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.10"] #[inline(always)] #[must_use] - pub fn pd10(&mut self) -> PD10_W<8> { - PD10_W::new(self) + pub fn pd10(&mut self) -> PD10_W { + PD10_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.11"] #[inline(always)] #[must_use] - pub fn pd11(&mut self) -> PD11_W<12> { - PD11_W::new(self) + pub fn pd11(&mut self) -> PD11_W { + PD11_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.12"] #[inline(always)] #[must_use] - pub fn pd12(&mut self) -> PD12_W<16> { - PD12_W::new(self) + pub fn pd12(&mut self) -> PD12_W { + PD12_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.13"] #[inline(always)] #[must_use] - pub fn pd13(&mut self) -> PD13_W<20> { - PD13_W::new(self) + pub fn pd13(&mut self) -> PD13_W { + PD13_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.14"] #[inline(always)] #[must_use] - pub fn pd14(&mut self) -> PD14_W<24> { - PD14_W::new(self) + pub fn pd14(&mut self) -> PD14_W { + PD14_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.15"] #[inline(always)] #[must_use] - pub fn pd15(&mut self) -> PD15_W<28> { - PD15_W::new(self) + pub fn pd15(&mut self) -> PD15_W { + PD15_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Pad Driver Mode 1 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr1::R`](R) reader structure"] +impl crate::Readable for PDR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr1::W`](W) writer structure"] impl crate::Writable for PDR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port0/pps.rs b/src/port0/pps.rs index 2e49ad29..980dea4e 100644 --- a/src/port0/pps.rs +++ b/src/port0/pps.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] pub type PPS0_R = crate::BitReader; #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PPS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS0_A { + pub const fn variant(&self) -> PPS0_A { match self.bits { false => PPS0_A::VALUE1, true => PPS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS0_A::VALUE2 } } #[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] -pub type PPS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS0_A, O>; -impl<'a, const O: u8> PPS0_W<'a, O> { +pub type PPS0_W<'a, REG> = crate::BitWriter<'a, REG, PPS0_A>; +impl<'a, REG> PPS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PPS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS1_A { + pub const fn variant(&self) -> PPS1_A { match self.bits { false => PPS1_A::VALUE1, true => PPS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS1_A::VALUE2 } } #[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] -pub type PPS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS1_A, O>; -impl<'a, const O: u8> PPS1_W<'a, O> { +pub type PPS1_W<'a, REG> = crate::BitWriter<'a, REG, PPS1_A>; +impl<'a, REG> PPS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PPS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS2_A { + pub const fn variant(&self) -> PPS2_A { match self.bits { false => PPS2_A::VALUE1, true => PPS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS2_A::VALUE2 } } #[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] -pub type PPS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS2_A, O>; -impl<'a, const O: u8> PPS2_W<'a, O> { +pub type PPS2_W<'a, REG> = crate::BitWriter<'a, REG, PPS2_A>; +impl<'a, REG> PPS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PPS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS3_A { + pub const fn variant(&self) -> PPS3_A { match self.bits { false => PPS3_A::VALUE1, true => PPS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS3_A::VALUE2 } } #[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] -pub type PPS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS3_A, O>; -impl<'a, const O: u8> PPS3_W<'a, O> { +pub type PPS3_W<'a, REG> = crate::BitWriter<'a, REG, PPS3_A>; +impl<'a, REG> PPS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PPS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS4_A { + pub const fn variant(&self) -> PPS4_A { match self.bits { false => PPS4_A::VALUE1, true => PPS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS4_A::VALUE2 } } #[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] -pub type PPS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS4_A, O>; -impl<'a, const O: u8> PPS4_W<'a, O> { +pub type PPS4_W<'a, REG> = crate::BitWriter<'a, REG, PPS4_A>; +impl<'a, REG> PPS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PPS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS5_A { + pub const fn variant(&self) -> PPS5_A { match self.bits { false => PPS5_A::VALUE1, true => PPS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS5_A::VALUE2 } } #[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] -pub type PPS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS5_A, O>; -impl<'a, const O: u8> PPS5_W<'a, O> { +pub type PPS5_W<'a, REG> = crate::BitWriter<'a, REG, PPS5_A>; +impl<'a, REG> PPS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS6_A { + pub const fn variant(&self) -> PPS6_A { match self.bits { false => PPS6_A::VALUE1, true => PPS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS6_A::VALUE2 } } #[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] -pub type PPS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS6_A, O>; -impl<'a, const O: u8> PPS6_W<'a, O> { +pub type PPS6_W<'a, REG> = crate::BitWriter<'a, REG, PPS6_A>; +impl<'a, REG> PPS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PPS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS7_A { + pub const fn variant(&self) -> PPS7_A { match self.bits { false => PPS7_A::VALUE1, true => PPS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS7_A::VALUE2 } } #[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] -pub type PPS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS7_A, O>; -impl<'a, const O: u8> PPS7_W<'a, O> { +pub type PPS7_W<'a, REG> = crate::BitWriter<'a, REG, PPS7_A>; +impl<'a, REG> PPS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PPS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS8_A { + pub const fn variant(&self) -> PPS8_A { match self.bits { false => PPS8_A::VALUE1, true => PPS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS8_A::VALUE2 } } #[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] -pub type PPS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS8_A, O>; -impl<'a, const O: u8> PPS8_W<'a, O> { +pub type PPS8_W<'a, REG> = crate::BitWriter<'a, REG, PPS8_A>; +impl<'a, REG> PPS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PPS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS9_A { + pub const fn variant(&self) -> PPS9_A { match self.bits { false => PPS9_A::VALUE1, true => PPS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS9_A::VALUE2 } } #[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] -pub type PPS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS9_A, O>; -impl<'a, const O: u8> PPS9_W<'a, O> { +pub type PPS9_W<'a, REG> = crate::BitWriter<'a, REG, PPS9_A>; +impl<'a, REG> PPS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PPS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS10_A { + pub const fn variant(&self) -> PPS10_A { match self.bits { false => PPS10_A::VALUE1, true => PPS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS10_A::VALUE2 } } #[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] -pub type PPS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS10_A, O>; -impl<'a, const O: u8> PPS10_W<'a, O> { +pub type PPS10_W<'a, REG> = crate::BitWriter<'a, REG, PPS10_A>; +impl<'a, REG> PPS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PPS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS11_A { + pub const fn variant(&self) -> PPS11_A { match self.bits { false => PPS11_A::VALUE1, true => PPS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS11_A::VALUE2 } } #[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] -pub type PPS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS11_A, O>; -impl<'a, const O: u8> PPS11_W<'a, O> { +pub type PPS11_W<'a, REG> = crate::BitWriter<'a, REG, PPS11_A>; +impl<'a, REG> PPS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PPS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS12_A { + pub const fn variant(&self) -> PPS12_A { match self.bits { false => PPS12_A::VALUE1, true => PPS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS12_A::VALUE2 } } #[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] -pub type PPS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS12_A, O>; -impl<'a, const O: u8> PPS12_W<'a, O> { +pub type PPS12_W<'a, REG> = crate::BitWriter<'a, REG, PPS12_A>; +impl<'a, REG> PPS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PPS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS13_A { + pub const fn variant(&self) -> PPS13_A { match self.bits { false => PPS13_A::VALUE1, true => PPS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS13_A::VALUE2 } } #[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] -pub type PPS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS13_A, O>; -impl<'a, const O: u8> PPS13_W<'a, O> { +pub type PPS13_W<'a, REG> = crate::BitWriter<'a, REG, PPS13_A>; +impl<'a, REG> PPS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PPS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS14_A { + pub const fn variant(&self) -> PPS14_A { match self.bits { false => PPS14_A::VALUE1, true => PPS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS14_A::VALUE2 } } #[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] -pub type PPS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS14_A, O>; -impl<'a, const O: u8> PPS14_W<'a, O> { +pub type PPS14_W<'a, REG> = crate::BitWriter<'a, REG, PPS14_A>; +impl<'a, REG> PPS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PPS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS15_A { + pub const fn variant(&self) -> PPS15_A { match self.bits { false => PPS15_A::VALUE1, true => PPS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS15_A::VALUE2 } } #[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] -pub type PPS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS15_A, O>; -impl<'a, const O: u8> PPS15_W<'a, O> { +pub type PPS15_W<'a, REG> = crate::BitWriter<'a, REG, PPS15_A>; +impl<'a, REG> PPS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Pin Power Save Bit 0"] #[inline(always)] #[must_use] - pub fn pps0(&mut self) -> PPS0_W<0> { - PPS0_W::new(self) + pub fn pps0(&mut self) -> PPS0_W { + PPS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Pin Power Save Bit 1"] #[inline(always)] #[must_use] - pub fn pps1(&mut self) -> PPS1_W<1> { - PPS1_W::new(self) + pub fn pps1(&mut self) -> PPS1_W { + PPS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Pin Power Save Bit 2"] #[inline(always)] #[must_use] - pub fn pps2(&mut self) -> PPS2_W<2> { - PPS2_W::new(self) + pub fn pps2(&mut self) -> PPS2_W { + PPS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Pin Power Save Bit 3"] #[inline(always)] #[must_use] - pub fn pps3(&mut self) -> PPS3_W<3> { - PPS3_W::new(self) + pub fn pps3(&mut self) -> PPS3_W { + PPS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Pin Power Save Bit 4"] #[inline(always)] #[must_use] - pub fn pps4(&mut self) -> PPS4_W<4> { - PPS4_W::new(self) + pub fn pps4(&mut self) -> PPS4_W { + PPS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Pin Power Save Bit 5"] #[inline(always)] #[must_use] - pub fn pps5(&mut self) -> PPS5_W<5> { - PPS5_W::new(self) + pub fn pps5(&mut self) -> PPS5_W { + PPS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Pin Power Save Bit 6"] #[inline(always)] #[must_use] - pub fn pps6(&mut self) -> PPS6_W<6> { - PPS6_W::new(self) + pub fn pps6(&mut self) -> PPS6_W { + PPS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Pin Power Save Bit 7"] #[inline(always)] #[must_use] - pub fn pps7(&mut self) -> PPS7_W<7> { - PPS7_W::new(self) + pub fn pps7(&mut self) -> PPS7_W { + PPS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Pin Power Save Bit 8"] #[inline(always)] #[must_use] - pub fn pps8(&mut self) -> PPS8_W<8> { - PPS8_W::new(self) + pub fn pps8(&mut self) -> PPS8_W { + PPS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Pin Power Save Bit 9"] #[inline(always)] #[must_use] - pub fn pps9(&mut self) -> PPS9_W<9> { - PPS9_W::new(self) + pub fn pps9(&mut self) -> PPS9_W { + PPS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Pin Power Save Bit 10"] #[inline(always)] #[must_use] - pub fn pps10(&mut self) -> PPS10_W<10> { - PPS10_W::new(self) + pub fn pps10(&mut self) -> PPS10_W { + PPS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Pin Power Save Bit 11"] #[inline(always)] #[must_use] - pub fn pps11(&mut self) -> PPS11_W<11> { - PPS11_W::new(self) + pub fn pps11(&mut self) -> PPS11_W { + PPS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Pin Power Save Bit 12"] #[inline(always)] #[must_use] - pub fn pps12(&mut self) -> PPS12_W<12> { - PPS12_W::new(self) + pub fn pps12(&mut self) -> PPS12_W { + PPS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Pin Power Save Bit 13"] #[inline(always)] #[must_use] - pub fn pps13(&mut self) -> PPS13_W<13> { - PPS13_W::new(self) + pub fn pps13(&mut self) -> PPS13_W { + PPS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Pin Power Save Bit 14"] #[inline(always)] #[must_use] - pub fn pps14(&mut self) -> PPS14_W<14> { - PPS14_W::new(self) + pub fn pps14(&mut self) -> PPS14_W { + PPS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Pin Power Save Bit 15"] #[inline(always)] #[must_use] - pub fn pps15(&mut self) -> PPS15_W<15> { - PPS15_W::new(self) + pub fn pps15(&mut self) -> PPS15_W { + PPS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 0 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pps::R`](R) reader structure"] +impl crate::Readable for PPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps::W`](W) writer structure"] impl crate::Writable for PPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1.rs b/src/port1.rs index 39857aa7..c942855f 100644 --- a/src/port1.rs +++ b/src/port1.rs @@ -1,81 +1,143 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + out: OUT, + omr: OMR, + _reserved2: [u8; 0x08], + iocr0: IOCR0, + iocr4: IOCR4, + iocr8: IOCR8, + iocr12: IOCR12, + _reserved6: [u8; 0x04], + in_: IN, + _reserved7: [u8; 0x18], + pdr0: PDR0, + pdr1: PDR1, + _reserved9: [u8; 0x18], + pdisc: PDISC, + _reserved10: [u8; 0x0c], + pps: PPS, + hwsel: HWSEL, +} +impl RegisterBlock { #[doc = "0x00 - Port 1 Output Register"] - pub out: OUT, + #[inline(always)] + pub const fn out(&self) -> &OUT { + &self.out + } #[doc = "0x04 - Port 1 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn omr(&self) -> &OMR { + &self.omr + } #[doc = "0x10 - Port 1 Input/Output Control Register 0"] - pub iocr0: IOCR0, + #[inline(always)] + pub const fn iocr0(&self) -> &IOCR0 { + &self.iocr0 + } #[doc = "0x14 - Port 1 Input/Output Control Register 4"] - pub iocr4: IOCR4, + #[inline(always)] + pub const fn iocr4(&self) -> &IOCR4 { + &self.iocr4 + } #[doc = "0x18 - Port 1 Input/Output Control Register 8"] - pub iocr8: IOCR8, + #[inline(always)] + pub const fn iocr8(&self) -> &IOCR8 { + &self.iocr8 + } #[doc = "0x1c - Port 1 Input/Output Control Register 12"] - pub iocr12: IOCR12, - _reserved6: [u8; 0x04], + #[inline(always)] + pub const fn iocr12(&self) -> &IOCR12 { + &self.iocr12 + } #[doc = "0x24 - Port 1 Input Register"] - pub in_: IN, - _reserved7: [u8; 0x18], + #[inline(always)] + pub const fn in_(&self) -> &IN { + &self.in_ + } #[doc = "0x40 - Port 1 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, + #[inline(always)] + pub const fn pdr0(&self) -> &PDR0 { + &self.pdr0 + } #[doc = "0x44 - Port 1 Pad Driver Mode 1 Register"] - pub pdr1: PDR1, - _reserved9: [u8; 0x18], + #[inline(always)] + pub const fn pdr1(&self) -> &PDR1 { + &self.pdr1 + } #[doc = "0x60 - Port 1 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved10: [u8; 0x0c], + #[inline(always)] + pub const fn pdisc(&self) -> &PDISC { + &self.pdisc + } #[doc = "0x70 - Port 1 Pin Power Save Register"] - pub pps: PPS, + #[inline(always)] + pub const fn pps(&self) -> &PPS { + &self.pps + } #[doc = "0x74 - Port 1 Pin Hardware Select Register"] - pub hwsel: HWSEL, + #[inline(always)] + pub const fn hwsel(&self) -> &HWSEL { + &self.hwsel + } } -#[doc = "OUT (rw) register accessor: an alias for `Reg`"] +#[doc = "OUT (rw) register accessor: Port 1 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out`] +module"] pub type OUT = crate::Reg; #[doc = "Port 1 Output Register"] pub mod out; -#[doc = "OMR (w) register accessor: an alias for `Reg`"] +#[doc = "OMR (w) register accessor: Port 1 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@omr`] +module"] pub type OMR = crate::Reg; #[doc = "Port 1 Output Modification Register"] pub mod omr; -#[doc = "IOCR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR0 (rw) register accessor: Port 1 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr0`] +module"] pub type IOCR0 = crate::Reg; #[doc = "Port 1 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "IOCR4 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR4 (rw) register accessor: Port 1 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr4`] +module"] pub type IOCR4 = crate::Reg; #[doc = "Port 1 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "IOCR8 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR8 (rw) register accessor: Port 1 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr8`] +module"] pub type IOCR8 = crate::Reg; #[doc = "Port 1 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "IOCR12 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR12 (rw) register accessor: Port 1 Input/Output Control Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr12::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr12::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr12`] +module"] pub type IOCR12 = crate::Reg; #[doc = "Port 1 Input/Output Control Register 12"] pub mod iocr12; -#[doc = "IN (r) register accessor: an alias for `Reg`"] +#[doc = "IN (r) register accessor: Port 1 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] pub type IN = crate::Reg; #[doc = "Port 1 Input Register"] pub mod in_; -#[doc = "PDR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR0 (rw) register accessor: Port 1 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr0`] +module"] pub type PDR0 = crate::Reg; #[doc = "Port 1 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "PDR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR1 (rw) register accessor: Port 1 Pad Driver Mode 1 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr1`] +module"] pub type PDR1 = crate::Reg; #[doc = "Port 1 Pad Driver Mode 1 Register"] pub mod pdr1; -#[doc = "PDISC (r) register accessor: an alias for `Reg`"] +#[doc = "PDISC (r) register accessor: Port 1 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdisc`] +module"] pub type PDISC = crate::Reg; #[doc = "Port 1 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "PPS (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS (rw) register accessor: Port 1 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps`] +module"] pub type PPS = crate::Reg; #[doc = "Port 1 Pin Power Save Register"] pub mod pps; -#[doc = "HWSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "HWSEL (rw) register accessor: Port 1 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hwsel`] +module"] 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 0b084318..10e815cc 100644 --- a/src/port1/hwsel.rs +++ b/src/port1/hwsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] -pub type HW0_R = crate::FieldReader; +pub type HW0_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW0_A { + type Ux = u8; +} impl HW0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW0_A::VALUE1), 1 => Some(HW0_A::VALUE2), @@ -64,43 +35,47 @@ impl HW0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW0_A::VALUE3 } } #[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] -pub type HW0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW0_A, 2, O>; -impl<'a, const O: u8> HW0_W<'a, O> { +pub type HW0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW0_A>; +impl<'a, REG> HW0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE3) } } #[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] -pub type HW1_R = crate::FieldReader; +pub type HW1_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW1_A { + type Ux = u8; +} impl HW1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW1_A::VALUE1), 1 => Some(HW1_A::VALUE2), @@ -129,43 +107,47 @@ impl HW1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW1_A::VALUE3 } } #[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] -pub type HW1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW1_A, 2, O>; -impl<'a, const O: u8> HW1_W<'a, O> { +pub type HW1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW1_A>; +impl<'a, REG> HW1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE3) } } #[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] -pub type HW2_R = crate::FieldReader; +pub type HW2_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW2_A { + type Ux = u8; +} impl HW2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW2_A::VALUE1), 1 => Some(HW2_A::VALUE2), @@ -194,43 +179,47 @@ impl HW2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW2_A::VALUE3 } } #[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] -pub type HW2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW2_A, 2, O>; -impl<'a, const O: u8> HW2_W<'a, O> { +pub type HW2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW2_A>; +impl<'a, REG> HW2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE3) } } #[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] -pub type HW3_R = crate::FieldReader; +pub type HW3_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW3_A { + type Ux = u8; +} impl HW3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW3_A::VALUE1), 1 => Some(HW3_A::VALUE2), @@ -259,43 +251,47 @@ impl HW3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW3_A::VALUE3 } } #[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] -pub type HW3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW3_A, 2, O>; -impl<'a, const O: u8> HW3_W<'a, O> { +pub type HW3_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW3_A>; +impl<'a, REG> HW3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE3) } } #[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] -pub type HW4_R = crate::FieldReader; +pub type HW4_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +309,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW4_A { + type Ux = u8; +} impl HW4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW4_A::VALUE1), 1 => Some(HW4_A::VALUE2), @@ -324,43 +323,47 @@ impl HW4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW4_A::VALUE3 } } #[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] -pub type HW4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW4_A, 2, O>; -impl<'a, const O: u8> HW4_W<'a, O> { +pub type HW4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW4_A>; +impl<'a, REG> HW4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE3) } } #[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] -pub type HW5_R = crate::FieldReader; +pub type HW5_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -378,10 +381,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW5_A { + type Ux = u8; +} impl HW5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW5_A::VALUE1), 1 => Some(HW5_A::VALUE2), @@ -389,43 +395,47 @@ impl HW5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW5_A::VALUE3 } } #[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] -pub type HW5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW5_A, 2, O>; -impl<'a, const O: u8> HW5_W<'a, O> { +pub type HW5_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW5_A>; +impl<'a, REG> HW5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE3) } } #[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] -pub type HW6_R = crate::FieldReader; +pub type HW6_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW6_A { + type Ux = u8; +} impl HW6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW6_A::VALUE1), 1 => Some(HW6_A::VALUE2), @@ -454,43 +467,47 @@ impl HW6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW6_A::VALUE3 } } #[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] -pub type HW6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW6_A, 2, O>; -impl<'a, const O: u8> HW6_W<'a, O> { +pub type HW6_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW6_A>; +impl<'a, REG> HW6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE3) } } #[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] -pub type HW7_R = crate::FieldReader; +pub type HW7_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW7_A { + type Ux = u8; +} impl HW7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW7_A::VALUE1), 1 => Some(HW7_A::VALUE2), @@ -519,43 +539,47 @@ impl HW7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW7_A::VALUE3 } } #[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] -pub type HW7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW7_A, 2, O>; -impl<'a, const O: u8> HW7_W<'a, O> { +pub type HW7_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW7_A>; +impl<'a, REG> HW7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE3) } } #[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] -pub type HW8_R = crate::FieldReader; +pub type HW8_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 8\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -573,10 +597,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW8_A { + type Ux = u8; +} impl HW8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW8_A::VALUE1), 1 => Some(HW8_A::VALUE2), @@ -584,43 +611,47 @@ impl HW8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW8_A::VALUE3 } } #[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] -pub type HW8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW8_A, 2, O>; -impl<'a, const O: u8> HW8_W<'a, O> { +pub type HW8_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW8_A>; +impl<'a, REG> HW8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE3) } } #[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] -pub type HW9_R = crate::FieldReader; +pub type HW9_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 9\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -638,10 +669,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW9_A { + type Ux = u8; +} impl HW9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW9_A::VALUE1), 1 => Some(HW9_A::VALUE2), @@ -649,43 +683,47 @@ impl HW9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW9_A::VALUE3 } } #[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] -pub type HW9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW9_A, 2, O>; -impl<'a, const O: u8> HW9_W<'a, O> { +pub type HW9_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW9_A>; +impl<'a, REG> HW9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE3) } } #[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] -pub type HW10_R = crate::FieldReader; +pub type HW10_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -703,10 +741,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW10_A { + type Ux = u8; +} impl HW10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW10_A::VALUE1), 1 => Some(HW10_A::VALUE2), @@ -714,43 +755,47 @@ impl HW10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW10_A::VALUE3 } } #[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] -pub type HW10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW10_A, 2, O>; -impl<'a, const O: u8> HW10_W<'a, O> { +pub type HW10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW10_A>; +impl<'a, REG> HW10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE3) } } #[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] -pub type HW11_R = crate::FieldReader; +pub type HW11_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -768,10 +813,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW11_A { + type Ux = u8; +} impl HW11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW11_A::VALUE1), 1 => Some(HW11_A::VALUE2), @@ -779,43 +827,47 @@ impl HW11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW11_A::VALUE3 } } #[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] -pub type HW11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW11_A, 2, O>; -impl<'a, const O: u8> HW11_W<'a, O> { +pub type HW11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW11_A>; +impl<'a, REG> HW11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE3) } } #[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] -pub type HW12_R = crate::FieldReader; +pub type HW12_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 12\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -833,10 +885,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW12_A { + type Ux = u8; +} impl HW12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW12_A::VALUE1), 1 => Some(HW12_A::VALUE2), @@ -844,43 +899,47 @@ impl HW12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW12_A::VALUE3 } } #[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] -pub type HW12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW12_A, 2, O>; -impl<'a, const O: u8> HW12_W<'a, O> { +pub type HW12_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW12_A>; +impl<'a, REG> HW12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE3) } } #[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] -pub type HW13_R = crate::FieldReader; +pub type HW13_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 13\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -898,10 +957,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW13_A { + type Ux = u8; +} impl HW13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW13_A::VALUE1), 1 => Some(HW13_A::VALUE2), @@ -909,43 +971,47 @@ impl HW13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW13_A::VALUE3 } } #[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] -pub type HW13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW13_A, 2, O>; -impl<'a, const O: u8> HW13_W<'a, O> { +pub type HW13_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW13_A>; +impl<'a, REG> HW13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE3) } } #[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] -pub type HW14_R = crate::FieldReader; +pub type HW14_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -963,10 +1029,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW14_A { + type Ux = u8; +} impl HW14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW14_A::VALUE1), 1 => Some(HW14_A::VALUE2), @@ -974,43 +1043,47 @@ impl HW14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW14_A::VALUE3 } } #[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] -pub type HW14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW14_A, 2, O>; -impl<'a, const O: u8> HW14_W<'a, O> { +pub type HW14_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW14_A>; +impl<'a, REG> HW14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE3) } } #[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] -pub type HW15_R = crate::FieldReader; +pub type HW15_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1028,10 +1101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW15_A { + type Ux = u8; +} impl HW15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW15_A::VALUE1), 1 => Some(HW15_A::VALUE2), @@ -1039,38 +1115,42 @@ impl HW15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW15_A::VALUE3 } } #[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] -pub type HW15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW15_A, 2, O>; -impl<'a, const O: u8> HW15_W<'a, O> { +pub type HW15_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW15_A>; +impl<'a, REG> HW15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE3) } } @@ -1160,118 +1240,119 @@ impl W { #[doc = "Bits 0:1 - Port n Pin Hardware Select Bit 0"] #[inline(always)] #[must_use] - pub fn hw0(&mut self) -> HW0_W<0> { - HW0_W::new(self) + pub fn hw0(&mut self) -> HW0_W { + HW0_W::new(self, 0) } #[doc = "Bits 2:3 - Port n Pin Hardware Select Bit 1"] #[inline(always)] #[must_use] - pub fn hw1(&mut self) -> HW1_W<2> { - HW1_W::new(self) + pub fn hw1(&mut self) -> HW1_W { + HW1_W::new(self, 2) } #[doc = "Bits 4:5 - Port n Pin Hardware Select Bit 2"] #[inline(always)] #[must_use] - pub fn hw2(&mut self) -> HW2_W<4> { - HW2_W::new(self) + pub fn hw2(&mut self) -> HW2_W { + HW2_W::new(self, 4) } #[doc = "Bits 6:7 - Port n Pin Hardware Select Bit 3"] #[inline(always)] #[must_use] - pub fn hw3(&mut self) -> HW3_W<6> { - HW3_W::new(self) + pub fn hw3(&mut self) -> HW3_W { + HW3_W::new(self, 6) } #[doc = "Bits 8:9 - Port n Pin Hardware Select Bit 4"] #[inline(always)] #[must_use] - pub fn hw4(&mut self) -> HW4_W<8> { - HW4_W::new(self) + pub fn hw4(&mut self) -> HW4_W { + HW4_W::new(self, 8) } #[doc = "Bits 10:11 - Port n Pin Hardware Select Bit 5"] #[inline(always)] #[must_use] - pub fn hw5(&mut self) -> HW5_W<10> { - HW5_W::new(self) + pub fn hw5(&mut self) -> HW5_W { + HW5_W::new(self, 10) } #[doc = "Bits 12:13 - Port n Pin Hardware Select Bit 6"] #[inline(always)] #[must_use] - pub fn hw6(&mut self) -> HW6_W<12> { - HW6_W::new(self) + pub fn hw6(&mut self) -> HW6_W { + HW6_W::new(self, 12) } #[doc = "Bits 14:15 - Port n Pin Hardware Select Bit 7"] #[inline(always)] #[must_use] - pub fn hw7(&mut self) -> HW7_W<14> { - HW7_W::new(self) + pub fn hw7(&mut self) -> HW7_W { + HW7_W::new(self, 14) } #[doc = "Bits 16:17 - Port n Pin Hardware Select Bit 8"] #[inline(always)] #[must_use] - pub fn hw8(&mut self) -> HW8_W<16> { - HW8_W::new(self) + pub fn hw8(&mut self) -> HW8_W { + HW8_W::new(self, 16) } #[doc = "Bits 18:19 - Port n Pin Hardware Select Bit 9"] #[inline(always)] #[must_use] - pub fn hw9(&mut self) -> HW9_W<18> { - HW9_W::new(self) + pub fn hw9(&mut self) -> HW9_W { + HW9_W::new(self, 18) } #[doc = "Bits 20:21 - Port n Pin Hardware Select Bit 10"] #[inline(always)] #[must_use] - pub fn hw10(&mut self) -> HW10_W<20> { - HW10_W::new(self) + pub fn hw10(&mut self) -> HW10_W { + HW10_W::new(self, 20) } #[doc = "Bits 22:23 - Port n Pin Hardware Select Bit 11"] #[inline(always)] #[must_use] - pub fn hw11(&mut self) -> HW11_W<22> { - HW11_W::new(self) + pub fn hw11(&mut self) -> HW11_W { + HW11_W::new(self, 22) } #[doc = "Bits 24:25 - Port n Pin Hardware Select Bit 12"] #[inline(always)] #[must_use] - pub fn hw12(&mut self) -> HW12_W<24> { - HW12_W::new(self) + pub fn hw12(&mut self) -> HW12_W { + HW12_W::new(self, 24) } #[doc = "Bits 26:27 - Port n Pin Hardware Select Bit 13"] #[inline(always)] #[must_use] - pub fn hw13(&mut self) -> HW13_W<26> { - HW13_W::new(self) + pub fn hw13(&mut self) -> HW13_W { + HW13_W::new(self, 26) } #[doc = "Bits 28:29 - Port n Pin Hardware Select Bit 14"] #[inline(always)] #[must_use] - pub fn hw14(&mut self) -> HW14_W<28> { - HW14_W::new(self) + pub fn hw14(&mut self) -> HW14_W { + HW14_W::new(self, 28) } #[doc = "Bits 30:31 - Port n Pin Hardware Select Bit 15"] #[inline(always)] #[must_use] - pub fn hw15(&mut self) -> HW15_W<30> { - HW15_W::new(self) + pub fn hw15(&mut self) -> HW15_W { + HW15_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hwsel::R`](R) reader structure"] +impl crate::Readable for HWSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hwsel::W`](W) writer structure"] impl crate::Writable for HWSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/in_.rs b/src/port1/in_.rs index fcad0c48..5688818d 100644 --- a/src/port1/in_.rs +++ b/src/port1/in_.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `P0` reader - Port n Input Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { P15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 1 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`in_::R`](R) reader structure"] +impl crate::Readable for IN_SPEC {} #[doc = "`reset()` method sets IN to value 0"] impl crate::Resettable for IN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port1/iocr0.rs b/src/port1/iocr0.rs index 9d8e9b5f..25913a4d 100644 --- a/src/port1/iocr0.rs +++ b/src/port1/iocr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] -pub type PC0_R = crate::FieldReader; +pub type PC0_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC0_A { + type Ux = u8; +} impl PC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC0_A::VALUE1), 1 => Some(PC0_A::VALUE2), @@ -109,193 +80,197 @@ impl PC0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC0_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC0_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC0_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC0_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC0_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC0_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC0_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC0_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC0_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC0_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC0_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC0_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC0_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC0_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC0_A::VALUE18 } } #[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] -pub type PC0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC0_A, 5, O>; -impl<'a, const O: u8> PC0_W<'a, O> { +pub type PC0_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC0_A>; +impl<'a, REG> PC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE18) } } #[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] -pub type PC1_R = crate::FieldReader; +pub type PC1_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC1_A { + type Ux = u8; +} impl PC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC1_A::VALUE1), 1 => Some(PC1_A::VALUE2), @@ -369,193 +347,197 @@ impl PC1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC1_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC1_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC1_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC1_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC1_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC1_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC1_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC1_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC1_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC1_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC1_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC1_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC1_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC1_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC1_A::VALUE18 } } #[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] -pub type PC1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC1_A, 5, O>; -impl<'a, const O: u8> PC1_W<'a, O> { +pub type PC1_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC1_A>; +impl<'a, REG> PC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE18) } } #[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] -pub type PC2_R = crate::FieldReader; +pub type PC2_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC2_A { + type Ux = u8; +} impl PC2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC2_A::VALUE1), 1 => Some(PC2_A::VALUE2), @@ -629,193 +614,197 @@ impl PC2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC2_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC2_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC2_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC2_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC2_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC2_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC2_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC2_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC2_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC2_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC2_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC2_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC2_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC2_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC2_A::VALUE18 } } #[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] -pub type PC2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC2_A, 5, O>; -impl<'a, const O: u8> PC2_W<'a, O> { +pub type PC2_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC2_A>; +impl<'a, REG> PC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE18) } } #[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] -pub type PC3_R = crate::FieldReader; +pub type PC3_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC3_A { + type Ux = u8; +} impl PC3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC3_A::VALUE1), 1 => Some(PC3_A::VALUE2), @@ -889,188 +881,192 @@ impl PC3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC3_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC3_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC3_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC3_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC3_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC3_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC3_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC3_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC3_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC3_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC3_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC3_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC3_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC3_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC3_A::VALUE18 } } #[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] -pub type PC3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC3_A, 5, O>; -impl<'a, const O: u8> PC3_W<'a, O> { +pub type PC3_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC3_A>; +impl<'a, REG> PC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc0(&mut self) -> PC0_W<3> { - PC0_W::new(self) + pub fn pc0(&mut self) -> PC0_W { + PC0_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc1(&mut self) -> PC1_W<11> { - PC1_W::new(self) + pub fn pc1(&mut self) -> PC1_W { + PC1_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc2(&mut self) -> PC2_W<19> { - PC2_W::new(self) + pub fn pc2(&mut self) -> PC2_W { + PC2_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc3(&mut self) -> PC3_W<27> { - PC3_W::new(self) + pub fn pc3(&mut self) -> PC3_W { + PC3_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr0::R`](R) reader structure"] +impl crate::Readable for IOCR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr0::W`](W) writer structure"] impl crate::Writable for IOCR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/iocr12.rs b/src/port1/iocr12.rs index fd943dd8..91810844 100644 --- a/src/port1/iocr12.rs +++ b/src/port1/iocr12.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC12` reader - Port Control for Port n Pin 12 to 15"] -pub type PC12_R = crate::FieldReader; +pub type PC12_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC12_A { + type Ux = u8; +} impl PC12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC12_A::VALUE1), 1 => Some(PC12_A::VALUE2), @@ -109,193 +80,197 @@ impl PC12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC12_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC12_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC12_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC12_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC12_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC12_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC12_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC12_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC12_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC12_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC12_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC12_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC12_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC12_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC12_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC12_A::VALUE18 } } #[doc = "Field `PC12` writer - Port Control for Port n Pin 12 to 15"] -pub type PC12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC12_A, 5, O>; -impl<'a, const O: u8> PC12_W<'a, O> { +pub type PC12_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC12_A>; +impl<'a, REG> PC12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE18) } } #[doc = "Field `PC13` reader - Port Control for Port n Pin 12 to 15"] -pub type PC13_R = crate::FieldReader; +pub type PC13_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC13_A { + type Ux = u8; +} impl PC13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC13_A::VALUE1), 1 => Some(PC13_A::VALUE2), @@ -369,193 +347,197 @@ impl PC13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC13_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC13_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC13_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC13_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC13_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC13_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC13_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC13_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC13_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC13_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC13_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC13_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC13_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC13_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC13_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC13_A::VALUE18 } } #[doc = "Field `PC13` writer - Port Control for Port n Pin 12 to 15"] -pub type PC13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC13_A, 5, O>; -impl<'a, const O: u8> PC13_W<'a, O> { +pub type PC13_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC13_A>; +impl<'a, REG> PC13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE18) } } #[doc = "Field `PC14` reader - Port Control for Port n Pin 12 to 15"] -pub type PC14_R = crate::FieldReader; +pub type PC14_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC14_A { + type Ux = u8; +} impl PC14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC14_A::VALUE1), 1 => Some(PC14_A::VALUE2), @@ -629,193 +614,197 @@ impl PC14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC14_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC14_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC14_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC14_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC14_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC14_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC14_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC14_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC14_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC14_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC14_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC14_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC14_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC14_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC14_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC14_A::VALUE18 } } #[doc = "Field `PC14` writer - Port Control for Port n Pin 12 to 15"] -pub type PC14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC14_A, 5, O>; -impl<'a, const O: u8> PC14_W<'a, O> { +pub type PC14_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC14_A>; +impl<'a, REG> PC14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE18) } } #[doc = "Field `PC15` reader - Port Control for Port n Pin 12 to 15"] -pub type PC15_R = crate::FieldReader; +pub type PC15_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC15_A { + type Ux = u8; +} impl PC15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC15_A::VALUE1), 1 => Some(PC15_A::VALUE2), @@ -889,188 +881,192 @@ impl PC15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC15_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC15_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC15_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC15_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC15_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC15_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC15_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC15_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC15_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC15_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC15_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC15_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC15_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC15_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC15_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC15_A::VALUE18 } } #[doc = "Field `PC15` writer - Port Control for Port n Pin 12 to 15"] -pub type PC15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC15_A, 5, O>; -impl<'a, const O: u8> PC15_W<'a, O> { +pub type PC15_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC15_A>; +impl<'a, REG> PC15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc12(&mut self) -> PC12_W<3> { - PC12_W::new(self) + pub fn pc12(&mut self) -> PC12_W { + PC12_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc13(&mut self) -> PC13_W<11> { - PC13_W::new(self) + pub fn pc13(&mut self) -> PC13_W { + PC13_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc14(&mut self) -> PC14_W<19> { - PC14_W::new(self) + pub fn pc14(&mut self) -> PC14_W { + PC14_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc15(&mut self) -> PC15_W<27> { - PC15_W::new(self) + pub fn pc15(&mut self) -> PC15_W { + PC15_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Input/Output Control Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr12::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr12::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr12::R`](R) reader structure"] +impl crate::Readable for IOCR12_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr12::W`](W) writer structure"] impl crate::Writable for IOCR12_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/iocr4.rs b/src/port1/iocr4.rs index c04d432f..00037471 100644 --- a/src/port1/iocr4.rs +++ b/src/port1/iocr4.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] -pub type PC4_R = crate::FieldReader; +pub type PC4_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC4_A { + type Ux = u8; +} impl PC4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC4_A::VALUE1), 1 => Some(PC4_A::VALUE2), @@ -109,193 +80,197 @@ impl PC4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC4_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC4_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC4_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC4_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC4_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC4_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC4_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC4_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC4_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC4_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC4_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC4_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC4_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC4_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC4_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC4_A::VALUE18 } } #[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] -pub type PC4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC4_A, 5, O>; -impl<'a, const O: u8> PC4_W<'a, O> { +pub type PC4_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC4_A>; +impl<'a, REG> PC4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE18) } } #[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] -pub type PC5_R = crate::FieldReader; +pub type PC5_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC5_A { + type Ux = u8; +} impl PC5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC5_A::VALUE1), 1 => Some(PC5_A::VALUE2), @@ -369,193 +347,197 @@ impl PC5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC5_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC5_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC5_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC5_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC5_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC5_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC5_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC5_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC5_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC5_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC5_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC5_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC5_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC5_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC5_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC5_A::VALUE18 } } #[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] -pub type PC5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC5_A, 5, O>; -impl<'a, const O: u8> PC5_W<'a, O> { +pub type PC5_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC5_A>; +impl<'a, REG> PC5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE18) } } #[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] -pub type PC6_R = crate::FieldReader; +pub type PC6_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC6_A { + type Ux = u8; +} impl PC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC6_A::VALUE1), 1 => Some(PC6_A::VALUE2), @@ -629,193 +614,197 @@ impl PC6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC6_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC6_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC6_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC6_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC6_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC6_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC6_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC6_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC6_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC6_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC6_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC6_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC6_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC6_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC6_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC6_A::VALUE18 } } #[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] -pub type PC6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC6_A, 5, O>; -impl<'a, const O: u8> PC6_W<'a, O> { +pub type PC6_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC6_A>; +impl<'a, REG> PC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE18) } } #[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] -pub type PC7_R = crate::FieldReader; +pub type PC7_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC7_A { + type Ux = u8; +} impl PC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC7_A::VALUE1), 1 => Some(PC7_A::VALUE2), @@ -889,188 +881,192 @@ impl PC7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC7_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC7_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC7_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC7_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC7_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC7_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC7_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC7_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC7_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC7_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC7_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC7_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC7_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC7_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC7_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC7_A::VALUE18 } } #[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] -pub type PC7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC7_A, 5, O>; -impl<'a, const O: u8> PC7_W<'a, O> { +pub type PC7_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC7_A>; +impl<'a, REG> PC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc4(&mut self) -> PC4_W<3> { - PC4_W::new(self) + pub fn pc4(&mut self) -> PC4_W { + PC4_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc5(&mut self) -> PC5_W<11> { - PC5_W::new(self) + pub fn pc5(&mut self) -> PC5_W { + PC5_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc6(&mut self) -> PC6_W<19> { - PC6_W::new(self) + pub fn pc6(&mut self) -> PC6_W { + PC6_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc7(&mut self) -> PC7_W<27> { - PC7_W::new(self) + pub fn pc7(&mut self) -> PC7_W { + PC7_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr4::R`](R) reader structure"] +impl crate::Readable for IOCR4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr4::W`](W) writer structure"] impl crate::Writable for IOCR4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/iocr8.rs b/src/port1/iocr8.rs index 84e81d66..7f215f3c 100644 --- a/src/port1/iocr8.rs +++ b/src/port1/iocr8.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] -pub type PC8_R = crate::FieldReader; +pub type PC8_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC8_A { + type Ux = u8; +} impl PC8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC8_A::VALUE1), 1 => Some(PC8_A::VALUE2), @@ -109,193 +80,197 @@ impl PC8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC8_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC8_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC8_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC8_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC8_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC8_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC8_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC8_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC8_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC8_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC8_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC8_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC8_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC8_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC8_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC8_A::VALUE18 } } #[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] -pub type PC8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC8_A, 5, O>; -impl<'a, const O: u8> PC8_W<'a, O> { +pub type PC8_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC8_A>; +impl<'a, REG> PC8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE18) } } #[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] -pub type PC9_R = crate::FieldReader; +pub type PC9_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC9_A { + type Ux = u8; +} impl PC9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC9_A::VALUE1), 1 => Some(PC9_A::VALUE2), @@ -369,193 +347,197 @@ impl PC9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC9_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC9_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC9_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC9_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC9_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC9_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC9_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC9_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC9_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC9_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC9_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC9_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC9_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC9_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC9_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC9_A::VALUE18 } } #[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] -pub type PC9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC9_A, 5, O>; -impl<'a, const O: u8> PC9_W<'a, O> { +pub type PC9_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC9_A>; +impl<'a, REG> PC9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE18) } } #[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] -pub type PC10_R = crate::FieldReader; +pub type PC10_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC10_A { + type Ux = u8; +} impl PC10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC10_A::VALUE1), 1 => Some(PC10_A::VALUE2), @@ -629,193 +614,197 @@ impl PC10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC10_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC10_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC10_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC10_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC10_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC10_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC10_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC10_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC10_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC10_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC10_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC10_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC10_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC10_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC10_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC10_A::VALUE18 } } #[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] -pub type PC10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC10_A, 5, O>; -impl<'a, const O: u8> PC10_W<'a, O> { +pub type PC10_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC10_A>; +impl<'a, REG> PC10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE18) } } #[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] -pub type PC11_R = crate::FieldReader; +pub type PC11_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC11_A { + type Ux = u8; +} impl PC11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC11_A::VALUE1), 1 => Some(PC11_A::VALUE2), @@ -889,188 +881,192 @@ impl PC11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC11_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC11_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC11_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC11_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC11_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC11_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC11_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC11_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC11_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC11_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC11_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC11_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC11_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC11_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC11_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC11_A::VALUE18 } } #[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] -pub type PC11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC11_A, 5, O>; -impl<'a, const O: u8> PC11_W<'a, O> { +pub type PC11_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC11_A>; +impl<'a, REG> PC11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc8(&mut self) -> PC8_W<3> { - PC8_W::new(self) + pub fn pc8(&mut self) -> PC8_W { + PC8_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc9(&mut self) -> PC9_W<11> { - PC9_W::new(self) + pub fn pc9(&mut self) -> PC9_W { + PC9_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc10(&mut self) -> PC10_W<19> { - PC10_W::new(self) + pub fn pc10(&mut self) -> PC10_W { + PC10_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc11(&mut self) -> PC11_W<27> { - PC11_W::new(self) + pub fn pc11(&mut self) -> PC11_W { + PC11_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr8::R`](R) reader structure"] +impl crate::Readable for IOCR8_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr8::W`](W) writer structure"] impl crate::Writable for IOCR8_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/omr.rs b/src/port1/omr.rs index f03c1ac5..3b123c05 100644 --- a/src/port1/omr.rs +++ b/src/port1/omr.rs @@ -1,296 +1,280 @@ #[doc = "Register `OMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PS0` writer - Port n Set Bit 0"] -pub type PS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1` writer - Port n Set Bit 1"] -pub type PS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2` writer - Port n Set Bit 2"] -pub type PS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS3` writer - Port n Set Bit 3"] -pub type PS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS4` writer - Port n Set Bit 4"] -pub type PS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS5` writer - Port n Set Bit 5"] -pub type PS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS6` writer - Port n Set Bit 6"] -pub type PS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS7` writer - Port n Set Bit 7"] -pub type PS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS8` writer - Port n Set Bit 8"] -pub type PS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS9` writer - Port n Set Bit 9"] -pub type PS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS10` writer - Port n Set Bit 10"] -pub type PS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS11` writer - Port n Set Bit 11"] -pub type PS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS12` writer - Port n Set Bit 12"] -pub type PS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS13` writer - Port n Set Bit 13"] -pub type PS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS14` writer - Port n Set Bit 14"] -pub type PS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS15` writer - Port n Set Bit 15"] -pub type PS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR0` writer - Port n Reset Bit 0"] -pub type PR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR1` writer - Port n Reset Bit 1"] -pub type PR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR2` writer - Port n Reset Bit 2"] -pub type PR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR3` writer - Port n Reset Bit 3"] -pub type PR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR4` writer - Port n Reset Bit 4"] -pub type PR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR5` writer - Port n Reset Bit 5"] -pub type PR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR6` writer - Port n Reset Bit 6"] -pub type PR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR7` writer - Port n Reset Bit 7"] -pub type PR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR8` writer - Port n Reset Bit 8"] -pub type PR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR9` writer - Port n Reset Bit 9"] -pub type PR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR10` writer - Port n Reset Bit 10"] -pub type PR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR11` writer - Port n Reset Bit 11"] -pub type PR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR12` writer - Port n Reset Bit 12"] -pub type PR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR13` writer - Port n Reset Bit 13"] -pub type PR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR14` writer - Port n Reset Bit 14"] -pub type PR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR15` writer - Port n Reset Bit 15"] -pub type PR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR15_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Port n Set Bit 0"] #[inline(always)] #[must_use] - pub fn ps0(&mut self) -> PS0_W<0> { - PS0_W::new(self) + pub fn ps0(&mut self) -> PS0_W { + PS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Set Bit 1"] #[inline(always)] #[must_use] - pub fn ps1(&mut self) -> PS1_W<1> { - PS1_W::new(self) + pub fn ps1(&mut self) -> PS1_W { + PS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Set Bit 2"] #[inline(always)] #[must_use] - pub fn ps2(&mut self) -> PS2_W<2> { - PS2_W::new(self) + pub fn ps2(&mut self) -> PS2_W { + PS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Set Bit 3"] #[inline(always)] #[must_use] - pub fn ps3(&mut self) -> PS3_W<3> { - PS3_W::new(self) + pub fn ps3(&mut self) -> PS3_W { + PS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Set Bit 4"] #[inline(always)] #[must_use] - pub fn ps4(&mut self) -> PS4_W<4> { - PS4_W::new(self) + pub fn ps4(&mut self) -> PS4_W { + PS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Set Bit 5"] #[inline(always)] #[must_use] - pub fn ps5(&mut self) -> PS5_W<5> { - PS5_W::new(self) + pub fn ps5(&mut self) -> PS5_W { + PS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Set Bit 6"] #[inline(always)] #[must_use] - pub fn ps6(&mut self) -> PS6_W<6> { - PS6_W::new(self) + pub fn ps6(&mut self) -> PS6_W { + PS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Set Bit 7"] #[inline(always)] #[must_use] - pub fn ps7(&mut self) -> PS7_W<7> { - PS7_W::new(self) + pub fn ps7(&mut self) -> PS7_W { + PS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Set Bit 8"] #[inline(always)] #[must_use] - pub fn ps8(&mut self) -> PS8_W<8> { - PS8_W::new(self) + pub fn ps8(&mut self) -> PS8_W { + PS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Set Bit 9"] #[inline(always)] #[must_use] - pub fn ps9(&mut self) -> PS9_W<9> { - PS9_W::new(self) + pub fn ps9(&mut self) -> PS9_W { + PS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Set Bit 10"] #[inline(always)] #[must_use] - pub fn ps10(&mut self) -> PS10_W<10> { - PS10_W::new(self) + pub fn ps10(&mut self) -> PS10_W { + PS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Set Bit 11"] #[inline(always)] #[must_use] - pub fn ps11(&mut self) -> PS11_W<11> { - PS11_W::new(self) + pub fn ps11(&mut self) -> PS11_W { + PS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Set Bit 12"] #[inline(always)] #[must_use] - pub fn ps12(&mut self) -> PS12_W<12> { - PS12_W::new(self) + pub fn ps12(&mut self) -> PS12_W { + PS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Set Bit 13"] #[inline(always)] #[must_use] - pub fn ps13(&mut self) -> PS13_W<13> { - PS13_W::new(self) + pub fn ps13(&mut self) -> PS13_W { + PS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Set Bit 14"] #[inline(always)] #[must_use] - pub fn ps14(&mut self) -> PS14_W<14> { - PS14_W::new(self) + pub fn ps14(&mut self) -> PS14_W { + PS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Set Bit 15"] #[inline(always)] #[must_use] - pub fn ps15(&mut self) -> PS15_W<15> { - PS15_W::new(self) + pub fn ps15(&mut self) -> PS15_W { + PS15_W::new(self, 15) } #[doc = "Bit 16 - Port n Reset Bit 0"] #[inline(always)] #[must_use] - pub fn pr0(&mut self) -> PR0_W<16> { - PR0_W::new(self) + pub fn pr0(&mut self) -> PR0_W { + PR0_W::new(self, 16) } #[doc = "Bit 17 - Port n Reset Bit 1"] #[inline(always)] #[must_use] - pub fn pr1(&mut self) -> PR1_W<17> { - PR1_W::new(self) + pub fn pr1(&mut self) -> PR1_W { + PR1_W::new(self, 17) } #[doc = "Bit 18 - Port n Reset Bit 2"] #[inline(always)] #[must_use] - pub fn pr2(&mut self) -> PR2_W<18> { - PR2_W::new(self) + pub fn pr2(&mut self) -> PR2_W { + PR2_W::new(self, 18) } #[doc = "Bit 19 - Port n Reset Bit 3"] #[inline(always)] #[must_use] - pub fn pr3(&mut self) -> PR3_W<19> { - PR3_W::new(self) + pub fn pr3(&mut self) -> PR3_W { + PR3_W::new(self, 19) } #[doc = "Bit 20 - Port n Reset Bit 4"] #[inline(always)] #[must_use] - pub fn pr4(&mut self) -> PR4_W<20> { - PR4_W::new(self) + pub fn pr4(&mut self) -> PR4_W { + PR4_W::new(self, 20) } #[doc = "Bit 21 - Port n Reset Bit 5"] #[inline(always)] #[must_use] - pub fn pr5(&mut self) -> PR5_W<21> { - PR5_W::new(self) + pub fn pr5(&mut self) -> PR5_W { + PR5_W::new(self, 21) } #[doc = "Bit 22 - Port n Reset Bit 6"] #[inline(always)] #[must_use] - pub fn pr6(&mut self) -> PR6_W<22> { - PR6_W::new(self) + pub fn pr6(&mut self) -> PR6_W { + PR6_W::new(self, 22) } #[doc = "Bit 23 - Port n Reset Bit 7"] #[inline(always)] #[must_use] - pub fn pr7(&mut self) -> PR7_W<23> { - PR7_W::new(self) + pub fn pr7(&mut self) -> PR7_W { + PR7_W::new(self, 23) } #[doc = "Bit 24 - Port n Reset Bit 8"] #[inline(always)] #[must_use] - pub fn pr8(&mut self) -> PR8_W<24> { - PR8_W::new(self) + pub fn pr8(&mut self) -> PR8_W { + PR8_W::new(self, 24) } #[doc = "Bit 25 - Port n Reset Bit 9"] #[inline(always)] #[must_use] - pub fn pr9(&mut self) -> PR9_W<25> { - PR9_W::new(self) + pub fn pr9(&mut self) -> PR9_W { + PR9_W::new(self, 25) } #[doc = "Bit 26 - Port n Reset Bit 10"] #[inline(always)] #[must_use] - pub fn pr10(&mut self) -> PR10_W<26> { - PR10_W::new(self) + pub fn pr10(&mut self) -> PR10_W { + PR10_W::new(self, 26) } #[doc = "Bit 27 - Port n Reset Bit 11"] #[inline(always)] #[must_use] - pub fn pr11(&mut self) -> PR11_W<27> { - PR11_W::new(self) + pub fn pr11(&mut self) -> PR11_W { + PR11_W::new(self, 27) } #[doc = "Bit 28 - Port n Reset Bit 12"] #[inline(always)] #[must_use] - pub fn pr12(&mut self) -> PR12_W<28> { - PR12_W::new(self) + pub fn pr12(&mut self) -> PR12_W { + PR12_W::new(self, 28) } #[doc = "Bit 29 - Port n Reset Bit 13"] #[inline(always)] #[must_use] - pub fn pr13(&mut self) -> PR13_W<29> { - PR13_W::new(self) + pub fn pr13(&mut self) -> PR13_W { + PR13_W::new(self, 29) } #[doc = "Bit 30 - Port n Reset Bit 14"] #[inline(always)] #[must_use] - pub fn pr14(&mut self) -> PR14_W<30> { - PR14_W::new(self) + pub fn pr14(&mut self) -> PR14_W { + PR14_W::new(self, 30) } #[doc = "Bit 31 - Port n Reset Bit 15"] #[inline(always)] #[must_use] - pub fn pr15(&mut self) -> PR15_W<31> { - PR15_W::new(self) + pub fn pr15(&mut self) -> PR15_W { + PR15_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OMR_SPEC; impl crate::RegisterSpec for OMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`omr::W`](W) writer structure"] impl crate::Writable for OMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/out.rs b/src/port1/out.rs index 78d35c3b..61bee4de 100644 --- a/src/port1/out.rs +++ b/src/port1/out.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `P0` reader - Port n Output Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 } } #[doc = "Field `P0` writer - Port n Output Bit 0"] -pub type P0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P0_A, O>; -impl<'a, const O: u8> P0_W<'a, O> { +pub type P0_W<'a, REG> = crate::BitWriter<'a, REG, P0_A>; +impl<'a, REG> P0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P0_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 } } #[doc = "Field `P1` writer - Port n Output Bit 1"] -pub type P1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P1_A, O>; -impl<'a, const O: u8> P1_W<'a, O> { +pub type P1_W<'a, REG> = crate::BitWriter<'a, REG, P1_A>; +impl<'a, REG> P1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P1_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 } } #[doc = "Field `P2` writer - Port n Output Bit 2"] -pub type P2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P2_A, O>; -impl<'a, const O: u8> P2_W<'a, O> { +pub type P2_W<'a, REG> = crate::BitWriter<'a, REG, P2_A>; +impl<'a, REG> P2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P2_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 } } #[doc = "Field `P3` writer - Port n Output Bit 3"] -pub type P3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P3_A, O>; -impl<'a, const O: u8> P3_W<'a, O> { +pub type P3_W<'a, REG> = crate::BitWriter<'a, REG, P3_A>; +impl<'a, REG> P3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P3_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 } } #[doc = "Field `P4` writer - Port n Output Bit 4"] -pub type P4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P4_A, O>; -impl<'a, const O: u8> P4_W<'a, O> { +pub type P4_W<'a, REG> = crate::BitWriter<'a, REG, P4_A>; +impl<'a, REG> P4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P4_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 } } #[doc = "Field `P5` writer - Port n Output Bit 5"] -pub type P5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P5_A, O>; -impl<'a, const O: u8> P5_W<'a, O> { +pub type P5_W<'a, REG> = crate::BitWriter<'a, REG, P5_A>; +impl<'a, REG> P5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P5_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 } } #[doc = "Field `P6` writer - Port n Output Bit 6"] -pub type P6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P6_A, O>; -impl<'a, const O: u8> P6_W<'a, O> { +pub type P6_W<'a, REG> = crate::BitWriter<'a, REG, P6_A>; +impl<'a, REG> P6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P6_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 } } #[doc = "Field `P7` writer - Port n Output Bit 7"] -pub type P7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P7_A, O>; -impl<'a, const O: u8> P7_W<'a, O> { +pub type P7_W<'a, REG> = crate::BitWriter<'a, REG, P7_A>; +impl<'a, REG> P7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P7_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 } } #[doc = "Field `P8` writer - Port n Output Bit 8"] -pub type P8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P8_A, O>; -impl<'a, const O: u8> P8_W<'a, O> { +pub type P8_W<'a, REG> = crate::BitWriter<'a, REG, P8_A>; +impl<'a, REG> P8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P8_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 } } #[doc = "Field `P9` writer - Port n Output Bit 9"] -pub type P9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P9_A, O>; -impl<'a, const O: u8> P9_W<'a, O> { +pub type P9_W<'a, REG> = crate::BitWriter<'a, REG, P9_A>; +impl<'a, REG> P9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P9_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 } } #[doc = "Field `P10` writer - Port n Output Bit 10"] -pub type P10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P10_A, O>; -impl<'a, const O: u8> P10_W<'a, O> { +pub type P10_W<'a, REG> = crate::BitWriter<'a, REG, P10_A>; +impl<'a, REG> P10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P10_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 } } #[doc = "Field `P11` writer - Port n Output Bit 11"] -pub type P11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P11_A, O>; -impl<'a, const O: u8> P11_W<'a, O> { +pub type P11_W<'a, REG> = crate::BitWriter<'a, REG, P11_A>; +impl<'a, REG> P11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P11_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 } } #[doc = "Field `P12` writer - Port n Output Bit 12"] -pub type P12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P12_A, O>; -impl<'a, const O: u8> P12_W<'a, O> { +pub type P12_W<'a, REG> = crate::BitWriter<'a, REG, P12_A>; +impl<'a, REG> P12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P12_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 } } #[doc = "Field `P13` writer - Port n Output Bit 13"] -pub type P13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P13_A, O>; -impl<'a, const O: u8> P13_W<'a, O> { +pub type P13_W<'a, REG> = crate::BitWriter<'a, REG, P13_A>; +impl<'a, REG> P13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P13_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 } } #[doc = "Field `P14` writer - Port n Output Bit 14"] -pub type P14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P14_A, O>; -impl<'a, const O: u8> P14_W<'a, O> { +pub type P14_W<'a, REG> = crate::BitWriter<'a, REG, P14_A>; +impl<'a, REG> P14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P14_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 } } #[doc = "Field `P15` writer - Port n Output Bit 15"] -pub type P15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P15_A, O>; -impl<'a, const O: u8> P15_W<'a, O> { +pub type P15_W<'a, REG> = crate::BitWriter<'a, REG, P15_A>; +impl<'a, REG> P15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P15_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Output Bit 0"] #[inline(always)] #[must_use] - pub fn p0(&mut self) -> P0_W<0> { - P0_W::new(self) + pub fn p0(&mut self) -> P0_W { + P0_W::new(self, 0) } #[doc = "Bit 1 - Port n Output Bit 1"] #[inline(always)] #[must_use] - pub fn p1(&mut self) -> P1_W<1> { - P1_W::new(self) + pub fn p1(&mut self) -> P1_W { + P1_W::new(self, 1) } #[doc = "Bit 2 - Port n Output Bit 2"] #[inline(always)] #[must_use] - pub fn p2(&mut self) -> P2_W<2> { - P2_W::new(self) + pub fn p2(&mut self) -> P2_W { + P2_W::new(self, 2) } #[doc = "Bit 3 - Port n Output Bit 3"] #[inline(always)] #[must_use] - pub fn p3(&mut self) -> P3_W<3> { - P3_W::new(self) + pub fn p3(&mut self) -> P3_W { + P3_W::new(self, 3) } #[doc = "Bit 4 - Port n Output Bit 4"] #[inline(always)] #[must_use] - pub fn p4(&mut self) -> P4_W<4> { - P4_W::new(self) + pub fn p4(&mut self) -> P4_W { + P4_W::new(self, 4) } #[doc = "Bit 5 - Port n Output Bit 5"] #[inline(always)] #[must_use] - pub fn p5(&mut self) -> P5_W<5> { - P5_W::new(self) + pub fn p5(&mut self) -> P5_W { + P5_W::new(self, 5) } #[doc = "Bit 6 - Port n Output Bit 6"] #[inline(always)] #[must_use] - pub fn p6(&mut self) -> P6_W<6> { - P6_W::new(self) + pub fn p6(&mut self) -> P6_W { + P6_W::new(self, 6) } #[doc = "Bit 7 - Port n Output Bit 7"] #[inline(always)] #[must_use] - pub fn p7(&mut self) -> P7_W<7> { - P7_W::new(self) + pub fn p7(&mut self) -> P7_W { + P7_W::new(self, 7) } #[doc = "Bit 8 - Port n Output Bit 8"] #[inline(always)] #[must_use] - pub fn p8(&mut self) -> P8_W<8> { - P8_W::new(self) + pub fn p8(&mut self) -> P8_W { + P8_W::new(self, 8) } #[doc = "Bit 9 - Port n Output Bit 9"] #[inline(always)] #[must_use] - pub fn p9(&mut self) -> P9_W<9> { - P9_W::new(self) + pub fn p9(&mut self) -> P9_W { + P9_W::new(self, 9) } #[doc = "Bit 10 - Port n Output Bit 10"] #[inline(always)] #[must_use] - pub fn p10(&mut self) -> P10_W<10> { - P10_W::new(self) + pub fn p10(&mut self) -> P10_W { + P10_W::new(self, 10) } #[doc = "Bit 11 - Port n Output Bit 11"] #[inline(always)] #[must_use] - pub fn p11(&mut self) -> P11_W<11> { - P11_W::new(self) + pub fn p11(&mut self) -> P11_W { + P11_W::new(self, 11) } #[doc = "Bit 12 - Port n Output Bit 12"] #[inline(always)] #[must_use] - pub fn p12(&mut self) -> P12_W<12> { - P12_W::new(self) + pub fn p12(&mut self) -> P12_W { + P12_W::new(self, 12) } #[doc = "Bit 13 - Port n Output Bit 13"] #[inline(always)] #[must_use] - pub fn p13(&mut self) -> P13_W<13> { - P13_W::new(self) + pub fn p13(&mut self) -> P13_W { + P13_W::new(self, 13) } #[doc = "Bit 14 - Port n Output Bit 14"] #[inline(always)] #[must_use] - pub fn p14(&mut self) -> P14_W<14> { - P14_W::new(self) + pub fn p14(&mut self) -> P14_W { + P14_W::new(self, 14) } #[doc = "Bit 15 - Port n Output Bit 15"] #[inline(always)] #[must_use] - pub fn p15(&mut self) -> P15_W<15> { - P15_W::new(self) + pub fn p15(&mut self) -> P15_W { + P15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`out::R`](R) reader structure"] +impl crate::Readable for OUT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`out::W`](W) writer structure"] impl crate::Writable for OUT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/pdisc.rs b/src/port1/pdisc.rs index 6ed1020f..a9894cdd 100644 --- a/src/port1/pdisc.rs +++ b/src/port1/pdisc.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] pub type PDIS0_R = crate::BitReader; #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl PDIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS0_A { + pub const fn variant(&self) -> PDIS0_A { match self.bits { false => PDIS0_A::VALUE1, true => PDIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl PDIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS1_A { + pub const fn variant(&self) -> PDIS1_A { match self.bits { false => PDIS1_A::VALUE1, true => PDIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl PDIS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS2_A { + pub const fn variant(&self) -> PDIS2_A { match self.bits { false => PDIS2_A::VALUE1, true => PDIS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl PDIS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS3_A { + pub const fn variant(&self) -> PDIS3_A { match self.bits { false => PDIS3_A::VALUE1, true => PDIS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl PDIS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS4_A { + pub const fn variant(&self) -> PDIS4_A { match self.bits { false => PDIS4_A::VALUE1, true => PDIS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PDIS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS5_A { + pub const fn variant(&self) -> PDIS5_A { match self.bits { false => PDIS5_A::VALUE1, true => PDIS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl PDIS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS6_A { + pub const fn variant(&self) -> PDIS6_A { match self.bits { false => PDIS6_A::VALUE1, true => PDIS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl PDIS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS7_A { + pub const fn variant(&self) -> PDIS7_A { match self.bits { false => PDIS7_A::VALUE1, true => PDIS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PDIS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS8_A { + pub const fn variant(&self) -> PDIS8_A { match self.bits { false => PDIS8_A::VALUE1, true => PDIS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl PDIS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS9_A { + pub const fn variant(&self) -> PDIS9_A { match self.bits { false => PDIS9_A::VALUE1, true => PDIS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl PDIS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS10_A { + pub const fn variant(&self) -> PDIS10_A { match self.bits { false => PDIS10_A::VALUE1, true => PDIS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl PDIS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS11_A { + pub const fn variant(&self) -> PDIS11_A { match self.bits { false => PDIS11_A::VALUE1, true => PDIS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl PDIS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS12_A { + pub const fn variant(&self) -> PDIS12_A { match self.bits { false => PDIS12_A::VALUE1, true => PDIS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl PDIS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS13_A { + pub const fn variant(&self) -> PDIS13_A { match self.bits { false => PDIS13_A::VALUE1, true => PDIS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl PDIS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS14_A { + pub const fn variant(&self) -> PDIS14_A { match self.bits { false => PDIS14_A::VALUE1, true => PDIS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl PDIS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS15_A { + pub const fn variant(&self) -> PDIS15_A { match self.bits { false => PDIS15_A::VALUE1, true => PDIS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 1 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pdisc::R`](R) reader structure"] +impl crate::Readable for PDISC_SPEC {} #[doc = "`reset()` method sets PDISC to value 0"] impl crate::Resettable for PDISC_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port1/pdr0.rs b/src/port1/pdr0.rs index 68619a2b..fa010035 100644 --- a/src/port1/pdr0.rs +++ b/src/port1/pdr0.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] -pub type PD0_R = crate::FieldReader; +pub type PD0_R = crate::FieldReader; #[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] -pub type PD0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] -pub type PD1_R = crate::FieldReader; +pub type PD1_R = crate::FieldReader; #[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] -pub type PD1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] -pub type PD2_R = crate::FieldReader; +pub type PD2_R = crate::FieldReader; #[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] -pub type PD2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] -pub type PD3_R = crate::FieldReader; +pub type PD3_R = crate::FieldReader; #[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] -pub type PD3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD3_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] -pub type PD4_R = crate::FieldReader; +pub type PD4_R = crate::FieldReader; #[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] -pub type PD4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD4_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] -pub type PD5_R = crate::FieldReader; +pub type PD5_R = crate::FieldReader; #[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] -pub type PD5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD5_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] -pub type PD6_R = crate::FieldReader; +pub type PD6_R = crate::FieldReader; #[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] -pub type PD6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD6_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] -pub type PD7_R = crate::FieldReader; +pub type PD7_R = crate::FieldReader; #[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] -pub type PD7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD7_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] #[must_use] - pub fn pd0(&mut self) -> PD0_W<0> { - PD0_W::new(self) + pub fn pd0(&mut self) -> PD0_W { + PD0_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.1"] #[inline(always)] #[must_use] - pub fn pd1(&mut self) -> PD1_W<4> { - PD1_W::new(self) + pub fn pd1(&mut self) -> PD1_W { + PD1_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.2"] #[inline(always)] #[must_use] - pub fn pd2(&mut self) -> PD2_W<8> { - PD2_W::new(self) + pub fn pd2(&mut self) -> PD2_W { + PD2_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.3"] #[inline(always)] #[must_use] - pub fn pd3(&mut self) -> PD3_W<12> { - PD3_W::new(self) + pub fn pd3(&mut self) -> PD3_W { + PD3_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.4"] #[inline(always)] #[must_use] - pub fn pd4(&mut self) -> PD4_W<16> { - PD4_W::new(self) + pub fn pd4(&mut self) -> PD4_W { + PD4_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.5"] #[inline(always)] #[must_use] - pub fn pd5(&mut self) -> PD5_W<20> { - PD5_W::new(self) + pub fn pd5(&mut self) -> PD5_W { + PD5_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.6"] #[inline(always)] #[must_use] - pub fn pd6(&mut self) -> PD6_W<24> { - PD6_W::new(self) + pub fn pd6(&mut self) -> PD6_W { + PD6_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.7"] #[inline(always)] #[must_use] - pub fn pd7(&mut self) -> PD7_W<28> { - PD7_W::new(self) + pub fn pd7(&mut self) -> PD7_W { + PD7_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr0::R`](R) reader structure"] +impl crate::Readable for PDR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr0::W`](W) writer structure"] impl crate::Writable for PDR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/pdr1.rs b/src/port1/pdr1.rs index 6da0f65d..fd2bb6eb 100644 --- a/src/port1/pdr1.rs +++ b/src/port1/pdr1.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD8` reader - Pad Driver Mode for Pn.8"] -pub type PD8_R = crate::FieldReader; +pub type PD8_R = crate::FieldReader; #[doc = "Field `PD8` writer - Pad Driver Mode for Pn.8"] -pub type PD8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD8_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD9` reader - Pad Driver Mode for Pn.9"] -pub type PD9_R = crate::FieldReader; +pub type PD9_R = crate::FieldReader; #[doc = "Field `PD9` writer - Pad Driver Mode for Pn.9"] -pub type PD9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD9_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD10` reader - Pad Driver Mode for Pn.10"] -pub type PD10_R = crate::FieldReader; +pub type PD10_R = crate::FieldReader; #[doc = "Field `PD10` writer - Pad Driver Mode for Pn.10"] -pub type PD10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD10_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD11` reader - Pad Driver Mode for Pn.11"] -pub type PD11_R = crate::FieldReader; +pub type PD11_R = crate::FieldReader; #[doc = "Field `PD11` writer - Pad Driver Mode for Pn.11"] -pub type PD11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD11_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD12` reader - Pad Driver Mode for Pn.12"] -pub type PD12_R = crate::FieldReader; +pub type PD12_R = crate::FieldReader; #[doc = "Field `PD12` writer - Pad Driver Mode for Pn.12"] -pub type PD12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD12_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD13` reader - Pad Driver Mode for Pn.13"] -pub type PD13_R = crate::FieldReader; +pub type PD13_R = crate::FieldReader; #[doc = "Field `PD13` writer - Pad Driver Mode for Pn.13"] -pub type PD13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD13_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD14` reader - Pad Driver Mode for Pn.14"] -pub type PD14_R = crate::FieldReader; +pub type PD14_R = crate::FieldReader; #[doc = "Field `PD14` writer - Pad Driver Mode for Pn.14"] -pub type PD14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD14_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD15` reader - Pad Driver Mode for Pn.15"] -pub type PD15_R = crate::FieldReader; +pub type PD15_R = crate::FieldReader; #[doc = "Field `PD15` writer - Pad Driver Mode for Pn.15"] -pub type PD15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD15_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.8"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.8"] #[inline(always)] #[must_use] - pub fn pd8(&mut self) -> PD8_W<0> { - PD8_W::new(self) + pub fn pd8(&mut self) -> PD8_W { + PD8_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.9"] #[inline(always)] #[must_use] - pub fn pd9(&mut self) -> PD9_W<4> { - PD9_W::new(self) + pub fn pd9(&mut self) -> PD9_W { + PD9_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.10"] #[inline(always)] #[must_use] - pub fn pd10(&mut self) -> PD10_W<8> { - PD10_W::new(self) + pub fn pd10(&mut self) -> PD10_W { + PD10_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.11"] #[inline(always)] #[must_use] - pub fn pd11(&mut self) -> PD11_W<12> { - PD11_W::new(self) + pub fn pd11(&mut self) -> PD11_W { + PD11_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.12"] #[inline(always)] #[must_use] - pub fn pd12(&mut self) -> PD12_W<16> { - PD12_W::new(self) + pub fn pd12(&mut self) -> PD12_W { + PD12_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.13"] #[inline(always)] #[must_use] - pub fn pd13(&mut self) -> PD13_W<20> { - PD13_W::new(self) + pub fn pd13(&mut self) -> PD13_W { + PD13_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.14"] #[inline(always)] #[must_use] - pub fn pd14(&mut self) -> PD14_W<24> { - PD14_W::new(self) + pub fn pd14(&mut self) -> PD14_W { + PD14_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.15"] #[inline(always)] #[must_use] - pub fn pd15(&mut self) -> PD15_W<28> { - PD15_W::new(self) + pub fn pd15(&mut self) -> PD15_W { + PD15_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Pad Driver Mode 1 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr1::R`](R) reader structure"] +impl crate::Readable for PDR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr1::W`](W) writer structure"] impl crate::Writable for PDR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port1/pps.rs b/src/port1/pps.rs index a8579f31..76944e16 100644 --- a/src/port1/pps.rs +++ b/src/port1/pps.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] pub type PPS0_R = crate::BitReader; #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PPS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS0_A { + pub const fn variant(&self) -> PPS0_A { match self.bits { false => PPS0_A::VALUE1, true => PPS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS0_A::VALUE2 } } #[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] -pub type PPS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS0_A, O>; -impl<'a, const O: u8> PPS0_W<'a, O> { +pub type PPS0_W<'a, REG> = crate::BitWriter<'a, REG, PPS0_A>; +impl<'a, REG> PPS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PPS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS1_A { + pub const fn variant(&self) -> PPS1_A { match self.bits { false => PPS1_A::VALUE1, true => PPS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS1_A::VALUE2 } } #[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] -pub type PPS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS1_A, O>; -impl<'a, const O: u8> PPS1_W<'a, O> { +pub type PPS1_W<'a, REG> = crate::BitWriter<'a, REG, PPS1_A>; +impl<'a, REG> PPS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PPS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS2_A { + pub const fn variant(&self) -> PPS2_A { match self.bits { false => PPS2_A::VALUE1, true => PPS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS2_A::VALUE2 } } #[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] -pub type PPS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS2_A, O>; -impl<'a, const O: u8> PPS2_W<'a, O> { +pub type PPS2_W<'a, REG> = crate::BitWriter<'a, REG, PPS2_A>; +impl<'a, REG> PPS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PPS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS3_A { + pub const fn variant(&self) -> PPS3_A { match self.bits { false => PPS3_A::VALUE1, true => PPS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS3_A::VALUE2 } } #[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] -pub type PPS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS3_A, O>; -impl<'a, const O: u8> PPS3_W<'a, O> { +pub type PPS3_W<'a, REG> = crate::BitWriter<'a, REG, PPS3_A>; +impl<'a, REG> PPS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PPS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS4_A { + pub const fn variant(&self) -> PPS4_A { match self.bits { false => PPS4_A::VALUE1, true => PPS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS4_A::VALUE2 } } #[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] -pub type PPS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS4_A, O>; -impl<'a, const O: u8> PPS4_W<'a, O> { +pub type PPS4_W<'a, REG> = crate::BitWriter<'a, REG, PPS4_A>; +impl<'a, REG> PPS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PPS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS5_A { + pub const fn variant(&self) -> PPS5_A { match self.bits { false => PPS5_A::VALUE1, true => PPS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS5_A::VALUE2 } } #[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] -pub type PPS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS5_A, O>; -impl<'a, const O: u8> PPS5_W<'a, O> { +pub type PPS5_W<'a, REG> = crate::BitWriter<'a, REG, PPS5_A>; +impl<'a, REG> PPS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS6_A { + pub const fn variant(&self) -> PPS6_A { match self.bits { false => PPS6_A::VALUE1, true => PPS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS6_A::VALUE2 } } #[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] -pub type PPS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS6_A, O>; -impl<'a, const O: u8> PPS6_W<'a, O> { +pub type PPS6_W<'a, REG> = crate::BitWriter<'a, REG, PPS6_A>; +impl<'a, REG> PPS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PPS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS7_A { + pub const fn variant(&self) -> PPS7_A { match self.bits { false => PPS7_A::VALUE1, true => PPS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS7_A::VALUE2 } } #[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] -pub type PPS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS7_A, O>; -impl<'a, const O: u8> PPS7_W<'a, O> { +pub type PPS7_W<'a, REG> = crate::BitWriter<'a, REG, PPS7_A>; +impl<'a, REG> PPS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PPS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS8_A { + pub const fn variant(&self) -> PPS8_A { match self.bits { false => PPS8_A::VALUE1, true => PPS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS8_A::VALUE2 } } #[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] -pub type PPS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS8_A, O>; -impl<'a, const O: u8> PPS8_W<'a, O> { +pub type PPS8_W<'a, REG> = crate::BitWriter<'a, REG, PPS8_A>; +impl<'a, REG> PPS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PPS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS9_A { + pub const fn variant(&self) -> PPS9_A { match self.bits { false => PPS9_A::VALUE1, true => PPS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS9_A::VALUE2 } } #[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] -pub type PPS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS9_A, O>; -impl<'a, const O: u8> PPS9_W<'a, O> { +pub type PPS9_W<'a, REG> = crate::BitWriter<'a, REG, PPS9_A>; +impl<'a, REG> PPS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PPS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS10_A { + pub const fn variant(&self) -> PPS10_A { match self.bits { false => PPS10_A::VALUE1, true => PPS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS10_A::VALUE2 } } #[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] -pub type PPS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS10_A, O>; -impl<'a, const O: u8> PPS10_W<'a, O> { +pub type PPS10_W<'a, REG> = crate::BitWriter<'a, REG, PPS10_A>; +impl<'a, REG> PPS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PPS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS11_A { + pub const fn variant(&self) -> PPS11_A { match self.bits { false => PPS11_A::VALUE1, true => PPS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS11_A::VALUE2 } } #[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] -pub type PPS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS11_A, O>; -impl<'a, const O: u8> PPS11_W<'a, O> { +pub type PPS11_W<'a, REG> = crate::BitWriter<'a, REG, PPS11_A>; +impl<'a, REG> PPS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PPS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS12_A { + pub const fn variant(&self) -> PPS12_A { match self.bits { false => PPS12_A::VALUE1, true => PPS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS12_A::VALUE2 } } #[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] -pub type PPS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS12_A, O>; -impl<'a, const O: u8> PPS12_W<'a, O> { +pub type PPS12_W<'a, REG> = crate::BitWriter<'a, REG, PPS12_A>; +impl<'a, REG> PPS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PPS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS13_A { + pub const fn variant(&self) -> PPS13_A { match self.bits { false => PPS13_A::VALUE1, true => PPS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS13_A::VALUE2 } } #[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] -pub type PPS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS13_A, O>; -impl<'a, const O: u8> PPS13_W<'a, O> { +pub type PPS13_W<'a, REG> = crate::BitWriter<'a, REG, PPS13_A>; +impl<'a, REG> PPS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PPS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS14_A { + pub const fn variant(&self) -> PPS14_A { match self.bits { false => PPS14_A::VALUE1, true => PPS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS14_A::VALUE2 } } #[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] -pub type PPS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS14_A, O>; -impl<'a, const O: u8> PPS14_W<'a, O> { +pub type PPS14_W<'a, REG> = crate::BitWriter<'a, REG, PPS14_A>; +impl<'a, REG> PPS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PPS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS15_A { + pub const fn variant(&self) -> PPS15_A { match self.bits { false => PPS15_A::VALUE1, true => PPS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS15_A::VALUE2 } } #[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] -pub type PPS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS15_A, O>; -impl<'a, const O: u8> PPS15_W<'a, O> { +pub type PPS15_W<'a, REG> = crate::BitWriter<'a, REG, PPS15_A>; +impl<'a, REG> PPS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Pin Power Save Bit 0"] #[inline(always)] #[must_use] - pub fn pps0(&mut self) -> PPS0_W<0> { - PPS0_W::new(self) + pub fn pps0(&mut self) -> PPS0_W { + PPS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Pin Power Save Bit 1"] #[inline(always)] #[must_use] - pub fn pps1(&mut self) -> PPS1_W<1> { - PPS1_W::new(self) + pub fn pps1(&mut self) -> PPS1_W { + PPS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Pin Power Save Bit 2"] #[inline(always)] #[must_use] - pub fn pps2(&mut self) -> PPS2_W<2> { - PPS2_W::new(self) + pub fn pps2(&mut self) -> PPS2_W { + PPS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Pin Power Save Bit 3"] #[inline(always)] #[must_use] - pub fn pps3(&mut self) -> PPS3_W<3> { - PPS3_W::new(self) + pub fn pps3(&mut self) -> PPS3_W { + PPS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Pin Power Save Bit 4"] #[inline(always)] #[must_use] - pub fn pps4(&mut self) -> PPS4_W<4> { - PPS4_W::new(self) + pub fn pps4(&mut self) -> PPS4_W { + PPS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Pin Power Save Bit 5"] #[inline(always)] #[must_use] - pub fn pps5(&mut self) -> PPS5_W<5> { - PPS5_W::new(self) + pub fn pps5(&mut self) -> PPS5_W { + PPS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Pin Power Save Bit 6"] #[inline(always)] #[must_use] - pub fn pps6(&mut self) -> PPS6_W<6> { - PPS6_W::new(self) + pub fn pps6(&mut self) -> PPS6_W { + PPS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Pin Power Save Bit 7"] #[inline(always)] #[must_use] - pub fn pps7(&mut self) -> PPS7_W<7> { - PPS7_W::new(self) + pub fn pps7(&mut self) -> PPS7_W { + PPS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Pin Power Save Bit 8"] #[inline(always)] #[must_use] - pub fn pps8(&mut self) -> PPS8_W<8> { - PPS8_W::new(self) + pub fn pps8(&mut self) -> PPS8_W { + PPS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Pin Power Save Bit 9"] #[inline(always)] #[must_use] - pub fn pps9(&mut self) -> PPS9_W<9> { - PPS9_W::new(self) + pub fn pps9(&mut self) -> PPS9_W { + PPS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Pin Power Save Bit 10"] #[inline(always)] #[must_use] - pub fn pps10(&mut self) -> PPS10_W<10> { - PPS10_W::new(self) + pub fn pps10(&mut self) -> PPS10_W { + PPS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Pin Power Save Bit 11"] #[inline(always)] #[must_use] - pub fn pps11(&mut self) -> PPS11_W<11> { - PPS11_W::new(self) + pub fn pps11(&mut self) -> PPS11_W { + PPS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Pin Power Save Bit 12"] #[inline(always)] #[must_use] - pub fn pps12(&mut self) -> PPS12_W<12> { - PPS12_W::new(self) + pub fn pps12(&mut self) -> PPS12_W { + PPS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Pin Power Save Bit 13"] #[inline(always)] #[must_use] - pub fn pps13(&mut self) -> PPS13_W<13> { - PPS13_W::new(self) + pub fn pps13(&mut self) -> PPS13_W { + PPS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Pin Power Save Bit 14"] #[inline(always)] #[must_use] - pub fn pps14(&mut self) -> PPS14_W<14> { - PPS14_W::new(self) + pub fn pps14(&mut self) -> PPS14_W { + PPS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Pin Power Save Bit 15"] #[inline(always)] #[must_use] - pub fn pps15(&mut self) -> PPS15_W<15> { - PPS15_W::new(self) + pub fn pps15(&mut self) -> PPS15_W { + PPS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 1 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pps::R`](R) reader structure"] +impl crate::Readable for PPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps::W`](W) writer structure"] impl crate::Writable for PPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14.rs b/src/port14.rs index 42a03a74..3cf0ed06 100644 --- a/src/port14.rs +++ b/src/port14.rs @@ -1,68 +1,120 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + out: OUT, + omr: OMR, + _reserved2: [u8; 0x08], + iocr0: IOCR0, + iocr4: IOCR4, + iocr8: IOCR8, + iocr12: IOCR12, + _reserved6: [u8; 0x04], + in_: IN, + _reserved7: [u8; 0x38], + pdisc: PDISC, + _reserved8: [u8; 0x0c], + pps: PPS, + hwsel: HWSEL, +} +impl RegisterBlock { #[doc = "0x00 - Port 14 Output Register"] - pub out: OUT, + #[inline(always)] + pub const fn out(&self) -> &OUT { + &self.out + } #[doc = "0x04 - Port 14 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn omr(&self) -> &OMR { + &self.omr + } #[doc = "0x10 - Port 14 Input/Output Control Register 0"] - pub iocr0: IOCR0, + #[inline(always)] + pub const fn iocr0(&self) -> &IOCR0 { + &self.iocr0 + } #[doc = "0x14 - Port 14 Input/Output Control Register 4"] - pub iocr4: IOCR4, + #[inline(always)] + pub const fn iocr4(&self) -> &IOCR4 { + &self.iocr4 + } #[doc = "0x18 - Port 14 Input/Output Control Register 8"] - pub iocr8: IOCR8, + #[inline(always)] + pub const fn iocr8(&self) -> &IOCR8 { + &self.iocr8 + } #[doc = "0x1c - Port 14 Input/Output Control Register 12"] - pub iocr12: IOCR12, - _reserved6: [u8; 0x04], + #[inline(always)] + pub const fn iocr12(&self) -> &IOCR12 { + &self.iocr12 + } #[doc = "0x24 - Port 14 Input Register"] - pub in_: IN, - _reserved7: [u8; 0x38], + #[inline(always)] + pub const fn in_(&self) -> &IN { + &self.in_ + } #[doc = "0x60 - Port 14 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved8: [u8; 0x0c], + #[inline(always)] + pub const fn pdisc(&self) -> &PDISC { + &self.pdisc + } #[doc = "0x70 - Port 14 Pin Power Save Register"] - pub pps: PPS, + #[inline(always)] + pub const fn pps(&self) -> &PPS { + &self.pps + } #[doc = "0x74 - Port 14 Pin Hardware Select Register"] - pub hwsel: HWSEL, + #[inline(always)] + pub const fn hwsel(&self) -> &HWSEL { + &self.hwsel + } } -#[doc = "OUT (rw) register accessor: an alias for `Reg`"] +#[doc = "OUT (rw) register accessor: Port 14 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out`] +module"] pub type OUT = crate::Reg; #[doc = "Port 14 Output Register"] pub mod out; -#[doc = "OMR (w) register accessor: an alias for `Reg`"] +#[doc = "OMR (w) register accessor: Port 14 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@omr`] +module"] pub type OMR = crate::Reg; #[doc = "Port 14 Output Modification Register"] pub mod omr; -#[doc = "IOCR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR0 (rw) register accessor: Port 14 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr0`] +module"] pub type IOCR0 = crate::Reg; #[doc = "Port 14 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "IOCR4 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR4 (rw) register accessor: Port 14 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr4`] +module"] pub type IOCR4 = crate::Reg; #[doc = "Port 14 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "IOCR8 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR8 (rw) register accessor: Port 14 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr8`] +module"] pub type IOCR8 = crate::Reg; #[doc = "Port 14 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "IOCR12 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR12 (rw) register accessor: Port 14 Input/Output Control Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr12::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr12::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr12`] +module"] pub type IOCR12 = crate::Reg; #[doc = "Port 14 Input/Output Control Register 12"] pub mod iocr12; -#[doc = "IN (r) register accessor: an alias for `Reg`"] +#[doc = "IN (r) register accessor: Port 14 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] pub type IN = crate::Reg; #[doc = "Port 14 Input Register"] pub mod in_; -#[doc = "PDISC (rw) register accessor: an alias for `Reg`"] +#[doc = "PDISC (rw) register accessor: Port 14 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdisc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdisc`] +module"] pub type PDISC = crate::Reg; #[doc = "Port 14 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "PPS (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS (rw) register accessor: Port 14 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps`] +module"] pub type PPS = crate::Reg; #[doc = "Port 14 Pin Power Save Register"] pub mod pps; -#[doc = "HWSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "HWSEL (rw) register accessor: Port 14 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hwsel`] +module"] 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 18a57792..f78cf9c2 100644 --- a/src/port14/hwsel.rs +++ b/src/port14/hwsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] -pub type HW0_R = crate::FieldReader; +pub type HW0_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW0_A { + type Ux = u8; +} impl HW0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW0_A::VALUE1), 1 => Some(HW0_A::VALUE2), @@ -64,43 +35,47 @@ impl HW0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW0_A::VALUE3 } } #[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] -pub type HW0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW0_A, 2, O>; -impl<'a, const O: u8> HW0_W<'a, O> { +pub type HW0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW0_A>; +impl<'a, REG> HW0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE3) } } #[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] -pub type HW1_R = crate::FieldReader; +pub type HW1_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW1_A { + type Ux = u8; +} impl HW1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW1_A::VALUE1), 1 => Some(HW1_A::VALUE2), @@ -129,43 +107,47 @@ impl HW1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW1_A::VALUE3 } } #[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] -pub type HW1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW1_A, 2, O>; -impl<'a, const O: u8> HW1_W<'a, O> { +pub type HW1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW1_A>; +impl<'a, REG> HW1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE3) } } #[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] -pub type HW2_R = crate::FieldReader; +pub type HW2_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW2_A { + type Ux = u8; +} impl HW2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW2_A::VALUE1), 1 => Some(HW2_A::VALUE2), @@ -194,43 +179,47 @@ impl HW2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW2_A::VALUE3 } } #[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] -pub type HW2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW2_A, 2, O>; -impl<'a, const O: u8> HW2_W<'a, O> { +pub type HW2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW2_A>; +impl<'a, REG> HW2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE3) } } #[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] -pub type HW3_R = crate::FieldReader; +pub type HW3_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW3_A { + type Ux = u8; +} impl HW3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW3_A::VALUE1), 1 => Some(HW3_A::VALUE2), @@ -259,43 +251,47 @@ impl HW3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW3_A::VALUE3 } } #[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] -pub type HW3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW3_A, 2, O>; -impl<'a, const O: u8> HW3_W<'a, O> { +pub type HW3_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW3_A>; +impl<'a, REG> HW3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE3) } } #[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] -pub type HW4_R = crate::FieldReader; +pub type HW4_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +309,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW4_A { + type Ux = u8; +} impl HW4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW4_A::VALUE1), 1 => Some(HW4_A::VALUE2), @@ -324,43 +323,47 @@ impl HW4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW4_A::VALUE3 } } #[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] -pub type HW4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW4_A, 2, O>; -impl<'a, const O: u8> HW4_W<'a, O> { +pub type HW4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW4_A>; +impl<'a, REG> HW4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE3) } } #[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] -pub type HW5_R = crate::FieldReader; +pub type HW5_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -378,10 +381,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW5_A { + type Ux = u8; +} impl HW5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW5_A::VALUE1), 1 => Some(HW5_A::VALUE2), @@ -389,43 +395,47 @@ impl HW5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW5_A::VALUE3 } } #[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] -pub type HW5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW5_A, 2, O>; -impl<'a, const O: u8> HW5_W<'a, O> { +pub type HW5_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW5_A>; +impl<'a, REG> HW5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE3) } } #[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] -pub type HW6_R = crate::FieldReader; +pub type HW6_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW6_A { + type Ux = u8; +} impl HW6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW6_A::VALUE1), 1 => Some(HW6_A::VALUE2), @@ -454,43 +467,47 @@ impl HW6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW6_A::VALUE3 } } #[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] -pub type HW6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW6_A, 2, O>; -impl<'a, const O: u8> HW6_W<'a, O> { +pub type HW6_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW6_A>; +impl<'a, REG> HW6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE3) } } #[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] -pub type HW7_R = crate::FieldReader; +pub type HW7_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW7_A { + type Ux = u8; +} impl HW7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW7_A::VALUE1), 1 => Some(HW7_A::VALUE2), @@ -519,43 +539,47 @@ impl HW7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW7_A::VALUE3 } } #[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] -pub type HW7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW7_A, 2, O>; -impl<'a, const O: u8> HW7_W<'a, O> { +pub type HW7_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW7_A>; +impl<'a, REG> HW7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE3) } } #[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] -pub type HW8_R = crate::FieldReader; +pub type HW8_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 8\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -573,10 +597,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW8_A { + type Ux = u8; +} impl HW8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW8_A::VALUE1), 1 => Some(HW8_A::VALUE2), @@ -584,43 +611,47 @@ impl HW8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW8_A::VALUE3 } } #[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] -pub type HW8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW8_A, 2, O>; -impl<'a, const O: u8> HW8_W<'a, O> { +pub type HW8_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW8_A>; +impl<'a, REG> HW8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE3) } } #[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] -pub type HW9_R = crate::FieldReader; +pub type HW9_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 9\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -638,10 +669,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW9_A { + type Ux = u8; +} impl HW9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW9_A::VALUE1), 1 => Some(HW9_A::VALUE2), @@ -649,43 +683,47 @@ impl HW9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW9_A::VALUE3 } } #[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] -pub type HW9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW9_A, 2, O>; -impl<'a, const O: u8> HW9_W<'a, O> { +pub type HW9_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW9_A>; +impl<'a, REG> HW9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE3) } } #[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] -pub type HW10_R = crate::FieldReader; +pub type HW10_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -703,10 +741,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW10_A { + type Ux = u8; +} impl HW10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW10_A::VALUE1), 1 => Some(HW10_A::VALUE2), @@ -714,43 +755,47 @@ impl HW10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW10_A::VALUE3 } } #[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] -pub type HW10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW10_A, 2, O>; -impl<'a, const O: u8> HW10_W<'a, O> { +pub type HW10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW10_A>; +impl<'a, REG> HW10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE3) } } #[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] -pub type HW11_R = crate::FieldReader; +pub type HW11_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -768,10 +813,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW11_A { + type Ux = u8; +} impl HW11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW11_A::VALUE1), 1 => Some(HW11_A::VALUE2), @@ -779,43 +827,47 @@ impl HW11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW11_A::VALUE3 } } #[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] -pub type HW11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW11_A, 2, O>; -impl<'a, const O: u8> HW11_W<'a, O> { +pub type HW11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW11_A>; +impl<'a, REG> HW11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE3) } } #[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] -pub type HW12_R = crate::FieldReader; +pub type HW12_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 12\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -833,10 +885,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW12_A { + type Ux = u8; +} impl HW12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW12_A::VALUE1), 1 => Some(HW12_A::VALUE2), @@ -844,43 +899,47 @@ impl HW12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW12_A::VALUE3 } } #[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] -pub type HW12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW12_A, 2, O>; -impl<'a, const O: u8> HW12_W<'a, O> { +pub type HW12_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW12_A>; +impl<'a, REG> HW12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE3) } } #[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] -pub type HW13_R = crate::FieldReader; +pub type HW13_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 13\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -898,10 +957,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW13_A { + type Ux = u8; +} impl HW13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW13_A::VALUE1), 1 => Some(HW13_A::VALUE2), @@ -909,43 +971,47 @@ impl HW13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW13_A::VALUE3 } } #[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] -pub type HW13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW13_A, 2, O>; -impl<'a, const O: u8> HW13_W<'a, O> { +pub type HW13_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW13_A>; +impl<'a, REG> HW13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE3) } } #[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] -pub type HW14_R = crate::FieldReader; +pub type HW14_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -963,10 +1029,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW14_A { + type Ux = u8; +} impl HW14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW14_A::VALUE1), 1 => Some(HW14_A::VALUE2), @@ -974,43 +1043,47 @@ impl HW14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW14_A::VALUE3 } } #[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] -pub type HW14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW14_A, 2, O>; -impl<'a, const O: u8> HW14_W<'a, O> { +pub type HW14_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW14_A>; +impl<'a, REG> HW14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE3) } } #[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] -pub type HW15_R = crate::FieldReader; +pub type HW15_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1028,10 +1101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW15_A { + type Ux = u8; +} impl HW15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW15_A::VALUE1), 1 => Some(HW15_A::VALUE2), @@ -1039,38 +1115,42 @@ impl HW15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW15_A::VALUE3 } } #[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] -pub type HW15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW15_A, 2, O>; -impl<'a, const O: u8> HW15_W<'a, O> { +pub type HW15_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW15_A>; +impl<'a, REG> HW15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE3) } } @@ -1160,118 +1240,119 @@ impl W { #[doc = "Bits 0:1 - Port n Pin Hardware Select Bit 0"] #[inline(always)] #[must_use] - pub fn hw0(&mut self) -> HW0_W<0> { - HW0_W::new(self) + pub fn hw0(&mut self) -> HW0_W { + HW0_W::new(self, 0) } #[doc = "Bits 2:3 - Port n Pin Hardware Select Bit 1"] #[inline(always)] #[must_use] - pub fn hw1(&mut self) -> HW1_W<2> { - HW1_W::new(self) + pub fn hw1(&mut self) -> HW1_W { + HW1_W::new(self, 2) } #[doc = "Bits 4:5 - Port n Pin Hardware Select Bit 2"] #[inline(always)] #[must_use] - pub fn hw2(&mut self) -> HW2_W<4> { - HW2_W::new(self) + pub fn hw2(&mut self) -> HW2_W { + HW2_W::new(self, 4) } #[doc = "Bits 6:7 - Port n Pin Hardware Select Bit 3"] #[inline(always)] #[must_use] - pub fn hw3(&mut self) -> HW3_W<6> { - HW3_W::new(self) + pub fn hw3(&mut self) -> HW3_W { + HW3_W::new(self, 6) } #[doc = "Bits 8:9 - Port n Pin Hardware Select Bit 4"] #[inline(always)] #[must_use] - pub fn hw4(&mut self) -> HW4_W<8> { - HW4_W::new(self) + pub fn hw4(&mut self) -> HW4_W { + HW4_W::new(self, 8) } #[doc = "Bits 10:11 - Port n Pin Hardware Select Bit 5"] #[inline(always)] #[must_use] - pub fn hw5(&mut self) -> HW5_W<10> { - HW5_W::new(self) + pub fn hw5(&mut self) -> HW5_W { + HW5_W::new(self, 10) } #[doc = "Bits 12:13 - Port n Pin Hardware Select Bit 6"] #[inline(always)] #[must_use] - pub fn hw6(&mut self) -> HW6_W<12> { - HW6_W::new(self) + pub fn hw6(&mut self) -> HW6_W { + HW6_W::new(self, 12) } #[doc = "Bits 14:15 - Port n Pin Hardware Select Bit 7"] #[inline(always)] #[must_use] - pub fn hw7(&mut self) -> HW7_W<14> { - HW7_W::new(self) + pub fn hw7(&mut self) -> HW7_W { + HW7_W::new(self, 14) } #[doc = "Bits 16:17 - Port n Pin Hardware Select Bit 8"] #[inline(always)] #[must_use] - pub fn hw8(&mut self) -> HW8_W<16> { - HW8_W::new(self) + pub fn hw8(&mut self) -> HW8_W { + HW8_W::new(self, 16) } #[doc = "Bits 18:19 - Port n Pin Hardware Select Bit 9"] #[inline(always)] #[must_use] - pub fn hw9(&mut self) -> HW9_W<18> { - HW9_W::new(self) + pub fn hw9(&mut self) -> HW9_W { + HW9_W::new(self, 18) } #[doc = "Bits 20:21 - Port n Pin Hardware Select Bit 10"] #[inline(always)] #[must_use] - pub fn hw10(&mut self) -> HW10_W<20> { - HW10_W::new(self) + pub fn hw10(&mut self) -> HW10_W { + HW10_W::new(self, 20) } #[doc = "Bits 22:23 - Port n Pin Hardware Select Bit 11"] #[inline(always)] #[must_use] - pub fn hw11(&mut self) -> HW11_W<22> { - HW11_W::new(self) + pub fn hw11(&mut self) -> HW11_W { + HW11_W::new(self, 22) } #[doc = "Bits 24:25 - Port n Pin Hardware Select Bit 12"] #[inline(always)] #[must_use] - pub fn hw12(&mut self) -> HW12_W<24> { - HW12_W::new(self) + pub fn hw12(&mut self) -> HW12_W { + HW12_W::new(self, 24) } #[doc = "Bits 26:27 - Port n Pin Hardware Select Bit 13"] #[inline(always)] #[must_use] - pub fn hw13(&mut self) -> HW13_W<26> { - HW13_W::new(self) + pub fn hw13(&mut self) -> HW13_W { + HW13_W::new(self, 26) } #[doc = "Bits 28:29 - Port n Pin Hardware Select Bit 14"] #[inline(always)] #[must_use] - pub fn hw14(&mut self) -> HW14_W<28> { - HW14_W::new(self) + pub fn hw14(&mut self) -> HW14_W { + HW14_W::new(self, 28) } #[doc = "Bits 30:31 - Port n Pin Hardware Select Bit 15"] #[inline(always)] #[must_use] - pub fn hw15(&mut self) -> HW15_W<30> { - HW15_W::new(self) + pub fn hw15(&mut self) -> HW15_W { + HW15_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hwsel::R`](R) reader structure"] +impl crate::Readable for HWSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hwsel::W`](W) writer structure"] impl crate::Writable for HWSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14/in_.rs b/src/port14/in_.rs index 9b53a615..3f18569f 100644 --- a/src/port14/in_.rs +++ b/src/port14/in_.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `P0` reader - Port n Input Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { P15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 14 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`in_::R`](R) reader structure"] +impl crate::Readable for IN_SPEC {} #[doc = "`reset()` method sets IN to value 0"] impl crate::Resettable for IN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port14/iocr0.rs b/src/port14/iocr0.rs index 64435458..4d4e9c07 100644 --- a/src/port14/iocr0.rs +++ b/src/port14/iocr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] -pub type PC0_R = crate::FieldReader; +pub type PC0_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC0_A { + type Ux = u8; +} impl PC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC0_A::VALUE1), 1 => Some(PC0_A::VALUE2), @@ -109,193 +80,197 @@ impl PC0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC0_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC0_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC0_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC0_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC0_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC0_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC0_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC0_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC0_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC0_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC0_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC0_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC0_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC0_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC0_A::VALUE18 } } #[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] -pub type PC0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC0_A, 5, O>; -impl<'a, const O: u8> PC0_W<'a, O> { +pub type PC0_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC0_A>; +impl<'a, REG> PC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE18) } } #[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] -pub type PC1_R = crate::FieldReader; +pub type PC1_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC1_A { + type Ux = u8; +} impl PC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC1_A::VALUE1), 1 => Some(PC1_A::VALUE2), @@ -369,193 +347,197 @@ impl PC1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC1_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC1_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC1_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC1_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC1_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC1_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC1_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC1_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC1_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC1_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC1_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC1_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC1_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC1_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC1_A::VALUE18 } } #[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] -pub type PC1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC1_A, 5, O>; -impl<'a, const O: u8> PC1_W<'a, O> { +pub type PC1_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC1_A>; +impl<'a, REG> PC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE18) } } #[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] -pub type PC2_R = crate::FieldReader; +pub type PC2_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC2_A { + type Ux = u8; +} impl PC2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC2_A::VALUE1), 1 => Some(PC2_A::VALUE2), @@ -629,193 +614,197 @@ impl PC2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC2_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC2_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC2_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC2_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC2_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC2_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC2_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC2_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC2_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC2_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC2_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC2_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC2_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC2_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC2_A::VALUE18 } } #[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] -pub type PC2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC2_A, 5, O>; -impl<'a, const O: u8> PC2_W<'a, O> { +pub type PC2_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC2_A>; +impl<'a, REG> PC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE18) } } #[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] -pub type PC3_R = crate::FieldReader; +pub type PC3_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC3_A { + type Ux = u8; +} impl PC3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC3_A::VALUE1), 1 => Some(PC3_A::VALUE2), @@ -889,188 +881,192 @@ impl PC3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC3_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC3_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC3_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC3_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC3_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC3_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC3_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC3_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC3_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC3_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC3_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC3_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC3_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC3_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC3_A::VALUE18 } } #[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] -pub type PC3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC3_A, 5, O>; -impl<'a, const O: u8> PC3_W<'a, O> { +pub type PC3_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC3_A>; +impl<'a, REG> PC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc0(&mut self) -> PC0_W<3> { - PC0_W::new(self) + pub fn pc0(&mut self) -> PC0_W { + PC0_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc1(&mut self) -> PC1_W<11> { - PC1_W::new(self) + pub fn pc1(&mut self) -> PC1_W { + PC1_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc2(&mut self) -> PC2_W<19> { - PC2_W::new(self) + pub fn pc2(&mut self) -> PC2_W { + PC2_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc3(&mut self) -> PC3_W<27> { - PC3_W::new(self) + pub fn pc3(&mut self) -> PC3_W { + PC3_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr0::R`](R) reader structure"] +impl crate::Readable for IOCR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr0::W`](W) writer structure"] impl crate::Writable for IOCR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14/iocr12.rs b/src/port14/iocr12.rs index fcd43082..04ae0791 100644 --- a/src/port14/iocr12.rs +++ b/src/port14/iocr12.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC12` reader - Port Control for Port n Pin 12 to 15"] -pub type PC12_R = crate::FieldReader; +pub type PC12_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC12_A { + type Ux = u8; +} impl PC12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC12_A::VALUE1), 1 => Some(PC12_A::VALUE2), @@ -109,193 +80,197 @@ impl PC12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC12_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC12_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC12_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC12_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC12_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC12_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC12_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC12_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC12_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC12_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC12_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC12_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC12_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC12_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC12_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC12_A::VALUE18 } } #[doc = "Field `PC12` writer - Port Control for Port n Pin 12 to 15"] -pub type PC12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC12_A, 5, O>; -impl<'a, const O: u8> PC12_W<'a, O> { +pub type PC12_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC12_A>; +impl<'a, REG> PC12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE18) } } #[doc = "Field `PC13` reader - Port Control for Port n Pin 12 to 15"] -pub type PC13_R = crate::FieldReader; +pub type PC13_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC13_A { + type Ux = u8; +} impl PC13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC13_A::VALUE1), 1 => Some(PC13_A::VALUE2), @@ -369,193 +347,197 @@ impl PC13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC13_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC13_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC13_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC13_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC13_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC13_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC13_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC13_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC13_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC13_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC13_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC13_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC13_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC13_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC13_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC13_A::VALUE18 } } #[doc = "Field `PC13` writer - Port Control for Port n Pin 12 to 15"] -pub type PC13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC13_A, 5, O>; -impl<'a, const O: u8> PC13_W<'a, O> { +pub type PC13_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC13_A>; +impl<'a, REG> PC13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE18) } } #[doc = "Field `PC14` reader - Port Control for Port n Pin 12 to 15"] -pub type PC14_R = crate::FieldReader; +pub type PC14_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC14_A { + type Ux = u8; +} impl PC14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC14_A::VALUE1), 1 => Some(PC14_A::VALUE2), @@ -629,193 +614,197 @@ impl PC14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC14_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC14_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC14_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC14_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC14_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC14_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC14_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC14_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC14_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC14_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC14_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC14_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC14_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC14_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC14_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC14_A::VALUE18 } } #[doc = "Field `PC14` writer - Port Control for Port n Pin 12 to 15"] -pub type PC14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC14_A, 5, O>; -impl<'a, const O: u8> PC14_W<'a, O> { +pub type PC14_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC14_A>; +impl<'a, REG> PC14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE18) } } #[doc = "Field `PC15` reader - Port Control for Port n Pin 12 to 15"] -pub type PC15_R = crate::FieldReader; +pub type PC15_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC15_A { + type Ux = u8; +} impl PC15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC15_A::VALUE1), 1 => Some(PC15_A::VALUE2), @@ -889,188 +881,192 @@ impl PC15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC15_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC15_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC15_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC15_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC15_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC15_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC15_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC15_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC15_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC15_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC15_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC15_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC15_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC15_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC15_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC15_A::VALUE18 } } #[doc = "Field `PC15` writer - Port Control for Port n Pin 12 to 15"] -pub type PC15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC15_A, 5, O>; -impl<'a, const O: u8> PC15_W<'a, O> { +pub type PC15_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC15_A>; +impl<'a, REG> PC15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc12(&mut self) -> PC12_W<3> { - PC12_W::new(self) + pub fn pc12(&mut self) -> PC12_W { + PC12_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc13(&mut self) -> PC13_W<11> { - PC13_W::new(self) + pub fn pc13(&mut self) -> PC13_W { + PC13_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc14(&mut self) -> PC14_W<19> { - PC14_W::new(self) + pub fn pc14(&mut self) -> PC14_W { + PC14_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc15(&mut self) -> PC15_W<27> { - PC15_W::new(self) + pub fn pc15(&mut self) -> PC15_W { + PC15_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Input/Output Control Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr12::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr12::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr12::R`](R) reader structure"] +impl crate::Readable for IOCR12_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr12::W`](W) writer structure"] impl crate::Writable for IOCR12_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14/iocr4.rs b/src/port14/iocr4.rs index 7cbfcad4..de793bf1 100644 --- a/src/port14/iocr4.rs +++ b/src/port14/iocr4.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] -pub type PC4_R = crate::FieldReader; +pub type PC4_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC4_A { + type Ux = u8; +} impl PC4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC4_A::VALUE1), 1 => Some(PC4_A::VALUE2), @@ -109,193 +80,197 @@ impl PC4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC4_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC4_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC4_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC4_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC4_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC4_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC4_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC4_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC4_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC4_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC4_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC4_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC4_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC4_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC4_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC4_A::VALUE18 } } #[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] -pub type PC4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC4_A, 5, O>; -impl<'a, const O: u8> PC4_W<'a, O> { +pub type PC4_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC4_A>; +impl<'a, REG> PC4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE18) } } #[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] -pub type PC5_R = crate::FieldReader; +pub type PC5_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC5_A { + type Ux = u8; +} impl PC5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC5_A::VALUE1), 1 => Some(PC5_A::VALUE2), @@ -369,193 +347,197 @@ impl PC5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC5_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC5_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC5_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC5_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC5_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC5_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC5_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC5_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC5_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC5_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC5_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC5_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC5_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC5_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC5_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC5_A::VALUE18 } } #[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] -pub type PC5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC5_A, 5, O>; -impl<'a, const O: u8> PC5_W<'a, O> { +pub type PC5_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC5_A>; +impl<'a, REG> PC5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE18) } } #[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] -pub type PC6_R = crate::FieldReader; +pub type PC6_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC6_A { + type Ux = u8; +} impl PC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC6_A::VALUE1), 1 => Some(PC6_A::VALUE2), @@ -629,193 +614,197 @@ impl PC6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC6_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC6_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC6_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC6_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC6_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC6_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC6_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC6_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC6_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC6_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC6_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC6_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC6_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC6_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC6_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC6_A::VALUE18 } } #[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] -pub type PC6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC6_A, 5, O>; -impl<'a, const O: u8> PC6_W<'a, O> { +pub type PC6_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC6_A>; +impl<'a, REG> PC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE18) } } #[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] -pub type PC7_R = crate::FieldReader; +pub type PC7_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC7_A { + type Ux = u8; +} impl PC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC7_A::VALUE1), 1 => Some(PC7_A::VALUE2), @@ -889,188 +881,192 @@ impl PC7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC7_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC7_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC7_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC7_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC7_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC7_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC7_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC7_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC7_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC7_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC7_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC7_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC7_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC7_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC7_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC7_A::VALUE18 } } #[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] -pub type PC7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC7_A, 5, O>; -impl<'a, const O: u8> PC7_W<'a, O> { +pub type PC7_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC7_A>; +impl<'a, REG> PC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc4(&mut self) -> PC4_W<3> { - PC4_W::new(self) + pub fn pc4(&mut self) -> PC4_W { + PC4_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc5(&mut self) -> PC5_W<11> { - PC5_W::new(self) + pub fn pc5(&mut self) -> PC5_W { + PC5_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc6(&mut self) -> PC6_W<19> { - PC6_W::new(self) + pub fn pc6(&mut self) -> PC6_W { + PC6_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc7(&mut self) -> PC7_W<27> { - PC7_W::new(self) + pub fn pc7(&mut self) -> PC7_W { + PC7_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr4::R`](R) reader structure"] +impl crate::Readable for IOCR4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr4::W`](W) writer structure"] impl crate::Writable for IOCR4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14/iocr8.rs b/src/port14/iocr8.rs index b796186f..c2aaa925 100644 --- a/src/port14/iocr8.rs +++ b/src/port14/iocr8.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] -pub type PC8_R = crate::FieldReader; +pub type PC8_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC8_A { + type Ux = u8; +} impl PC8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC8_A::VALUE1), 1 => Some(PC8_A::VALUE2), @@ -109,193 +80,197 @@ impl PC8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC8_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC8_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC8_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC8_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC8_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC8_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC8_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC8_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC8_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC8_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC8_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC8_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC8_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC8_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC8_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC8_A::VALUE18 } } #[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] -pub type PC8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC8_A, 5, O>; -impl<'a, const O: u8> PC8_W<'a, O> { +pub type PC8_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC8_A>; +impl<'a, REG> PC8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE18) } } #[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] -pub type PC9_R = crate::FieldReader; +pub type PC9_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC9_A { + type Ux = u8; +} impl PC9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC9_A::VALUE1), 1 => Some(PC9_A::VALUE2), @@ -369,193 +347,197 @@ impl PC9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC9_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC9_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC9_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC9_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC9_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC9_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC9_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC9_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC9_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC9_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC9_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC9_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC9_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC9_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC9_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC9_A::VALUE18 } } #[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] -pub type PC9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC9_A, 5, O>; -impl<'a, const O: u8> PC9_W<'a, O> { +pub type PC9_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC9_A>; +impl<'a, REG> PC9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE18) } } #[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] -pub type PC10_R = crate::FieldReader; +pub type PC10_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC10_A { + type Ux = u8; +} impl PC10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC10_A::VALUE1), 1 => Some(PC10_A::VALUE2), @@ -629,193 +614,197 @@ impl PC10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC10_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC10_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC10_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC10_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC10_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC10_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC10_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC10_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC10_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC10_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC10_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC10_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC10_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC10_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC10_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC10_A::VALUE18 } } #[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] -pub type PC10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC10_A, 5, O>; -impl<'a, const O: u8> PC10_W<'a, O> { +pub type PC10_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC10_A>; +impl<'a, REG> PC10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE18) } } #[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] -pub type PC11_R = crate::FieldReader; +pub type PC11_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC11_A { + type Ux = u8; +} impl PC11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC11_A::VALUE1), 1 => Some(PC11_A::VALUE2), @@ -889,188 +881,192 @@ impl PC11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC11_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC11_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC11_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC11_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC11_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC11_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC11_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC11_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC11_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC11_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC11_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC11_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC11_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC11_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC11_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC11_A::VALUE18 } } #[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] -pub type PC11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC11_A, 5, O>; -impl<'a, const O: u8> PC11_W<'a, O> { +pub type PC11_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC11_A>; +impl<'a, REG> PC11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc8(&mut self) -> PC8_W<3> { - PC8_W::new(self) + pub fn pc8(&mut self) -> PC8_W { + PC8_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc9(&mut self) -> PC9_W<11> { - PC9_W::new(self) + pub fn pc9(&mut self) -> PC9_W { + PC9_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc10(&mut self) -> PC10_W<19> { - PC10_W::new(self) + pub fn pc10(&mut self) -> PC10_W { + PC10_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc11(&mut self) -> PC11_W<27> { - PC11_W::new(self) + pub fn pc11(&mut self) -> PC11_W { + PC11_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr8::R`](R) reader structure"] +impl crate::Readable for IOCR8_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr8::W`](W) writer structure"] impl crate::Writable for IOCR8_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14/omr.rs b/src/port14/omr.rs index ac163c20..acb33ecf 100644 --- a/src/port14/omr.rs +++ b/src/port14/omr.rs @@ -1,296 +1,280 @@ #[doc = "Register `OMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PS0` writer - Port n Set Bit 0"] -pub type PS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1` writer - Port n Set Bit 1"] -pub type PS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2` writer - Port n Set Bit 2"] -pub type PS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS3` writer - Port n Set Bit 3"] -pub type PS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS4` writer - Port n Set Bit 4"] -pub type PS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS5` writer - Port n Set Bit 5"] -pub type PS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS6` writer - Port n Set Bit 6"] -pub type PS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS7` writer - Port n Set Bit 7"] -pub type PS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS8` writer - Port n Set Bit 8"] -pub type PS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS9` writer - Port n Set Bit 9"] -pub type PS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS10` writer - Port n Set Bit 10"] -pub type PS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS11` writer - Port n Set Bit 11"] -pub type PS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS12` writer - Port n Set Bit 12"] -pub type PS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS13` writer - Port n Set Bit 13"] -pub type PS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS14` writer - Port n Set Bit 14"] -pub type PS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS15` writer - Port n Set Bit 15"] -pub type PS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR0` writer - Port n Reset Bit 0"] -pub type PR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR1` writer - Port n Reset Bit 1"] -pub type PR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR2` writer - Port n Reset Bit 2"] -pub type PR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR3` writer - Port n Reset Bit 3"] -pub type PR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR4` writer - Port n Reset Bit 4"] -pub type PR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR5` writer - Port n Reset Bit 5"] -pub type PR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR6` writer - Port n Reset Bit 6"] -pub type PR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR7` writer - Port n Reset Bit 7"] -pub type PR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR8` writer - Port n Reset Bit 8"] -pub type PR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR9` writer - Port n Reset Bit 9"] -pub type PR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR10` writer - Port n Reset Bit 10"] -pub type PR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR11` writer - Port n Reset Bit 11"] -pub type PR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR12` writer - Port n Reset Bit 12"] -pub type PR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR13` writer - Port n Reset Bit 13"] -pub type PR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR14` writer - Port n Reset Bit 14"] -pub type PR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR15` writer - Port n Reset Bit 15"] -pub type PR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR15_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Port n Set Bit 0"] #[inline(always)] #[must_use] - pub fn ps0(&mut self) -> PS0_W<0> { - PS0_W::new(self) + pub fn ps0(&mut self) -> PS0_W { + PS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Set Bit 1"] #[inline(always)] #[must_use] - pub fn ps1(&mut self) -> PS1_W<1> { - PS1_W::new(self) + pub fn ps1(&mut self) -> PS1_W { + PS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Set Bit 2"] #[inline(always)] #[must_use] - pub fn ps2(&mut self) -> PS2_W<2> { - PS2_W::new(self) + pub fn ps2(&mut self) -> PS2_W { + PS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Set Bit 3"] #[inline(always)] #[must_use] - pub fn ps3(&mut self) -> PS3_W<3> { - PS3_W::new(self) + pub fn ps3(&mut self) -> PS3_W { + PS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Set Bit 4"] #[inline(always)] #[must_use] - pub fn ps4(&mut self) -> PS4_W<4> { - PS4_W::new(self) + pub fn ps4(&mut self) -> PS4_W { + PS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Set Bit 5"] #[inline(always)] #[must_use] - pub fn ps5(&mut self) -> PS5_W<5> { - PS5_W::new(self) + pub fn ps5(&mut self) -> PS5_W { + PS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Set Bit 6"] #[inline(always)] #[must_use] - pub fn ps6(&mut self) -> PS6_W<6> { - PS6_W::new(self) + pub fn ps6(&mut self) -> PS6_W { + PS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Set Bit 7"] #[inline(always)] #[must_use] - pub fn ps7(&mut self) -> PS7_W<7> { - PS7_W::new(self) + pub fn ps7(&mut self) -> PS7_W { + PS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Set Bit 8"] #[inline(always)] #[must_use] - pub fn ps8(&mut self) -> PS8_W<8> { - PS8_W::new(self) + pub fn ps8(&mut self) -> PS8_W { + PS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Set Bit 9"] #[inline(always)] #[must_use] - pub fn ps9(&mut self) -> PS9_W<9> { - PS9_W::new(self) + pub fn ps9(&mut self) -> PS9_W { + PS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Set Bit 10"] #[inline(always)] #[must_use] - pub fn ps10(&mut self) -> PS10_W<10> { - PS10_W::new(self) + pub fn ps10(&mut self) -> PS10_W { + PS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Set Bit 11"] #[inline(always)] #[must_use] - pub fn ps11(&mut self) -> PS11_W<11> { - PS11_W::new(self) + pub fn ps11(&mut self) -> PS11_W { + PS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Set Bit 12"] #[inline(always)] #[must_use] - pub fn ps12(&mut self) -> PS12_W<12> { - PS12_W::new(self) + pub fn ps12(&mut self) -> PS12_W { + PS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Set Bit 13"] #[inline(always)] #[must_use] - pub fn ps13(&mut self) -> PS13_W<13> { - PS13_W::new(self) + pub fn ps13(&mut self) -> PS13_W { + PS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Set Bit 14"] #[inline(always)] #[must_use] - pub fn ps14(&mut self) -> PS14_W<14> { - PS14_W::new(self) + pub fn ps14(&mut self) -> PS14_W { + PS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Set Bit 15"] #[inline(always)] #[must_use] - pub fn ps15(&mut self) -> PS15_W<15> { - PS15_W::new(self) + pub fn ps15(&mut self) -> PS15_W { + PS15_W::new(self, 15) } #[doc = "Bit 16 - Port n Reset Bit 0"] #[inline(always)] #[must_use] - pub fn pr0(&mut self) -> PR0_W<16> { - PR0_W::new(self) + pub fn pr0(&mut self) -> PR0_W { + PR0_W::new(self, 16) } #[doc = "Bit 17 - Port n Reset Bit 1"] #[inline(always)] #[must_use] - pub fn pr1(&mut self) -> PR1_W<17> { - PR1_W::new(self) + pub fn pr1(&mut self) -> PR1_W { + PR1_W::new(self, 17) } #[doc = "Bit 18 - Port n Reset Bit 2"] #[inline(always)] #[must_use] - pub fn pr2(&mut self) -> PR2_W<18> { - PR2_W::new(self) + pub fn pr2(&mut self) -> PR2_W { + PR2_W::new(self, 18) } #[doc = "Bit 19 - Port n Reset Bit 3"] #[inline(always)] #[must_use] - pub fn pr3(&mut self) -> PR3_W<19> { - PR3_W::new(self) + pub fn pr3(&mut self) -> PR3_W { + PR3_W::new(self, 19) } #[doc = "Bit 20 - Port n Reset Bit 4"] #[inline(always)] #[must_use] - pub fn pr4(&mut self) -> PR4_W<20> { - PR4_W::new(self) + pub fn pr4(&mut self) -> PR4_W { + PR4_W::new(self, 20) } #[doc = "Bit 21 - Port n Reset Bit 5"] #[inline(always)] #[must_use] - pub fn pr5(&mut self) -> PR5_W<21> { - PR5_W::new(self) + pub fn pr5(&mut self) -> PR5_W { + PR5_W::new(self, 21) } #[doc = "Bit 22 - Port n Reset Bit 6"] #[inline(always)] #[must_use] - pub fn pr6(&mut self) -> PR6_W<22> { - PR6_W::new(self) + pub fn pr6(&mut self) -> PR6_W { + PR6_W::new(self, 22) } #[doc = "Bit 23 - Port n Reset Bit 7"] #[inline(always)] #[must_use] - pub fn pr7(&mut self) -> PR7_W<23> { - PR7_W::new(self) + pub fn pr7(&mut self) -> PR7_W { + PR7_W::new(self, 23) } #[doc = "Bit 24 - Port n Reset Bit 8"] #[inline(always)] #[must_use] - pub fn pr8(&mut self) -> PR8_W<24> { - PR8_W::new(self) + pub fn pr8(&mut self) -> PR8_W { + PR8_W::new(self, 24) } #[doc = "Bit 25 - Port n Reset Bit 9"] #[inline(always)] #[must_use] - pub fn pr9(&mut self) -> PR9_W<25> { - PR9_W::new(self) + pub fn pr9(&mut self) -> PR9_W { + PR9_W::new(self, 25) } #[doc = "Bit 26 - Port n Reset Bit 10"] #[inline(always)] #[must_use] - pub fn pr10(&mut self) -> PR10_W<26> { - PR10_W::new(self) + pub fn pr10(&mut self) -> PR10_W { + PR10_W::new(self, 26) } #[doc = "Bit 27 - Port n Reset Bit 11"] #[inline(always)] #[must_use] - pub fn pr11(&mut self) -> PR11_W<27> { - PR11_W::new(self) + pub fn pr11(&mut self) -> PR11_W { + PR11_W::new(self, 27) } #[doc = "Bit 28 - Port n Reset Bit 12"] #[inline(always)] #[must_use] - pub fn pr12(&mut self) -> PR12_W<28> { - PR12_W::new(self) + pub fn pr12(&mut self) -> PR12_W { + PR12_W::new(self, 28) } #[doc = "Bit 29 - Port n Reset Bit 13"] #[inline(always)] #[must_use] - pub fn pr13(&mut self) -> PR13_W<29> { - PR13_W::new(self) + pub fn pr13(&mut self) -> PR13_W { + PR13_W::new(self, 29) } #[doc = "Bit 30 - Port n Reset Bit 14"] #[inline(always)] #[must_use] - pub fn pr14(&mut self) -> PR14_W<30> { - PR14_W::new(self) + pub fn pr14(&mut self) -> PR14_W { + PR14_W::new(self, 30) } #[doc = "Bit 31 - Port n Reset Bit 15"] #[inline(always)] #[must_use] - pub fn pr15(&mut self) -> PR15_W<31> { - PR15_W::new(self) + pub fn pr15(&mut self) -> PR15_W { + PR15_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OMR_SPEC; impl crate::RegisterSpec for OMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`omr::W`](W) writer structure"] impl crate::Writable for OMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14/out.rs b/src/port14/out.rs index 091ce686..b5df3b04 100644 --- a/src/port14/out.rs +++ b/src/port14/out.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `P0` reader - Port n Output Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 } } #[doc = "Field `P0` writer - Port n Output Bit 0"] -pub type P0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P0_A, O>; -impl<'a, const O: u8> P0_W<'a, O> { +pub type P0_W<'a, REG> = crate::BitWriter<'a, REG, P0_A>; +impl<'a, REG> P0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P0_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 } } #[doc = "Field `P1` writer - Port n Output Bit 1"] -pub type P1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P1_A, O>; -impl<'a, const O: u8> P1_W<'a, O> { +pub type P1_W<'a, REG> = crate::BitWriter<'a, REG, P1_A>; +impl<'a, REG> P1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P1_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 } } #[doc = "Field `P2` writer - Port n Output Bit 2"] -pub type P2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P2_A, O>; -impl<'a, const O: u8> P2_W<'a, O> { +pub type P2_W<'a, REG> = crate::BitWriter<'a, REG, P2_A>; +impl<'a, REG> P2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P2_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 } } #[doc = "Field `P3` writer - Port n Output Bit 3"] -pub type P3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P3_A, O>; -impl<'a, const O: u8> P3_W<'a, O> { +pub type P3_W<'a, REG> = crate::BitWriter<'a, REG, P3_A>; +impl<'a, REG> P3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P3_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 } } #[doc = "Field `P4` writer - Port n Output Bit 4"] -pub type P4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P4_A, O>; -impl<'a, const O: u8> P4_W<'a, O> { +pub type P4_W<'a, REG> = crate::BitWriter<'a, REG, P4_A>; +impl<'a, REG> P4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P4_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 } } #[doc = "Field `P5` writer - Port n Output Bit 5"] -pub type P5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P5_A, O>; -impl<'a, const O: u8> P5_W<'a, O> { +pub type P5_W<'a, REG> = crate::BitWriter<'a, REG, P5_A>; +impl<'a, REG> P5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P5_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 } } #[doc = "Field `P6` writer - Port n Output Bit 6"] -pub type P6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P6_A, O>; -impl<'a, const O: u8> P6_W<'a, O> { +pub type P6_W<'a, REG> = crate::BitWriter<'a, REG, P6_A>; +impl<'a, REG> P6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P6_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 } } #[doc = "Field `P7` writer - Port n Output Bit 7"] -pub type P7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P7_A, O>; -impl<'a, const O: u8> P7_W<'a, O> { +pub type P7_W<'a, REG> = crate::BitWriter<'a, REG, P7_A>; +impl<'a, REG> P7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P7_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 } } #[doc = "Field `P8` writer - Port n Output Bit 8"] -pub type P8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P8_A, O>; -impl<'a, const O: u8> P8_W<'a, O> { +pub type P8_W<'a, REG> = crate::BitWriter<'a, REG, P8_A>; +impl<'a, REG> P8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P8_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 } } #[doc = "Field `P9` writer - Port n Output Bit 9"] -pub type P9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P9_A, O>; -impl<'a, const O: u8> P9_W<'a, O> { +pub type P9_W<'a, REG> = crate::BitWriter<'a, REG, P9_A>; +impl<'a, REG> P9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P9_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 } } #[doc = "Field `P10` writer - Port n Output Bit 10"] -pub type P10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P10_A, O>; -impl<'a, const O: u8> P10_W<'a, O> { +pub type P10_W<'a, REG> = crate::BitWriter<'a, REG, P10_A>; +impl<'a, REG> P10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P10_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 } } #[doc = "Field `P11` writer - Port n Output Bit 11"] -pub type P11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P11_A, O>; -impl<'a, const O: u8> P11_W<'a, O> { +pub type P11_W<'a, REG> = crate::BitWriter<'a, REG, P11_A>; +impl<'a, REG> P11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P11_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 } } #[doc = "Field `P12` writer - Port n Output Bit 12"] -pub type P12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P12_A, O>; -impl<'a, const O: u8> P12_W<'a, O> { +pub type P12_W<'a, REG> = crate::BitWriter<'a, REG, P12_A>; +impl<'a, REG> P12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P12_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 } } #[doc = "Field `P13` writer - Port n Output Bit 13"] -pub type P13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P13_A, O>; -impl<'a, const O: u8> P13_W<'a, O> { +pub type P13_W<'a, REG> = crate::BitWriter<'a, REG, P13_A>; +impl<'a, REG> P13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P13_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 } } #[doc = "Field `P14` writer - Port n Output Bit 14"] -pub type P14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P14_A, O>; -impl<'a, const O: u8> P14_W<'a, O> { +pub type P14_W<'a, REG> = crate::BitWriter<'a, REG, P14_A>; +impl<'a, REG> P14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P14_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 } } #[doc = "Field `P15` writer - Port n Output Bit 15"] -pub type P15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P15_A, O>; -impl<'a, const O: u8> P15_W<'a, O> { +pub type P15_W<'a, REG> = crate::BitWriter<'a, REG, P15_A>; +impl<'a, REG> P15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P15_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Output Bit 0"] #[inline(always)] #[must_use] - pub fn p0(&mut self) -> P0_W<0> { - P0_W::new(self) + pub fn p0(&mut self) -> P0_W { + P0_W::new(self, 0) } #[doc = "Bit 1 - Port n Output Bit 1"] #[inline(always)] #[must_use] - pub fn p1(&mut self) -> P1_W<1> { - P1_W::new(self) + pub fn p1(&mut self) -> P1_W { + P1_W::new(self, 1) } #[doc = "Bit 2 - Port n Output Bit 2"] #[inline(always)] #[must_use] - pub fn p2(&mut self) -> P2_W<2> { - P2_W::new(self) + pub fn p2(&mut self) -> P2_W { + P2_W::new(self, 2) } #[doc = "Bit 3 - Port n Output Bit 3"] #[inline(always)] #[must_use] - pub fn p3(&mut self) -> P3_W<3> { - P3_W::new(self) + pub fn p3(&mut self) -> P3_W { + P3_W::new(self, 3) } #[doc = "Bit 4 - Port n Output Bit 4"] #[inline(always)] #[must_use] - pub fn p4(&mut self) -> P4_W<4> { - P4_W::new(self) + pub fn p4(&mut self) -> P4_W { + P4_W::new(self, 4) } #[doc = "Bit 5 - Port n Output Bit 5"] #[inline(always)] #[must_use] - pub fn p5(&mut self) -> P5_W<5> { - P5_W::new(self) + pub fn p5(&mut self) -> P5_W { + P5_W::new(self, 5) } #[doc = "Bit 6 - Port n Output Bit 6"] #[inline(always)] #[must_use] - pub fn p6(&mut self) -> P6_W<6> { - P6_W::new(self) + pub fn p6(&mut self) -> P6_W { + P6_W::new(self, 6) } #[doc = "Bit 7 - Port n Output Bit 7"] #[inline(always)] #[must_use] - pub fn p7(&mut self) -> P7_W<7> { - P7_W::new(self) + pub fn p7(&mut self) -> P7_W { + P7_W::new(self, 7) } #[doc = "Bit 8 - Port n Output Bit 8"] #[inline(always)] #[must_use] - pub fn p8(&mut self) -> P8_W<8> { - P8_W::new(self) + pub fn p8(&mut self) -> P8_W { + P8_W::new(self, 8) } #[doc = "Bit 9 - Port n Output Bit 9"] #[inline(always)] #[must_use] - pub fn p9(&mut self) -> P9_W<9> { - P9_W::new(self) + pub fn p9(&mut self) -> P9_W { + P9_W::new(self, 9) } #[doc = "Bit 10 - Port n Output Bit 10"] #[inline(always)] #[must_use] - pub fn p10(&mut self) -> P10_W<10> { - P10_W::new(self) + pub fn p10(&mut self) -> P10_W { + P10_W::new(self, 10) } #[doc = "Bit 11 - Port n Output Bit 11"] #[inline(always)] #[must_use] - pub fn p11(&mut self) -> P11_W<11> { - P11_W::new(self) + pub fn p11(&mut self) -> P11_W { + P11_W::new(self, 11) } #[doc = "Bit 12 - Port n Output Bit 12"] #[inline(always)] #[must_use] - pub fn p12(&mut self) -> P12_W<12> { - P12_W::new(self) + pub fn p12(&mut self) -> P12_W { + P12_W::new(self, 12) } #[doc = "Bit 13 - Port n Output Bit 13"] #[inline(always)] #[must_use] - pub fn p13(&mut self) -> P13_W<13> { - P13_W::new(self) + pub fn p13(&mut self) -> P13_W { + P13_W::new(self, 13) } #[doc = "Bit 14 - Port n Output Bit 14"] #[inline(always)] #[must_use] - pub fn p14(&mut self) -> P14_W<14> { - P14_W::new(self) + pub fn p14(&mut self) -> P14_W { + P14_W::new(self, 14) } #[doc = "Bit 15 - Port n Output Bit 15"] #[inline(always)] #[must_use] - pub fn p15(&mut self) -> P15_W<15> { - P15_W::new(self) + pub fn p15(&mut self) -> P15_W { + P15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`out::R`](R) reader structure"] +impl crate::Readable for OUT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`out::W`](W) writer structure"] impl crate::Writable for OUT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14/pdisc.rs b/src/port14/pdisc.rs index 30b3bbf3..f89493b3 100644 --- a/src/port14/pdisc.rs +++ b/src/port14/pdisc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] pub type PDIS0_R = crate::BitReader; #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PDIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS0_A { + pub const fn variant(&self) -> PDIS0_A { match self.bits { false => PDIS0_A::VALUE1, true => PDIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS0_A::VALUE2 } } #[doc = "Field `PDIS0` writer - Pad Disable for Port n Pin 0"] -pub type PDIS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS0_A, O>; -impl<'a, const O: u8> PDIS0_W<'a, O> { +pub type PDIS0_W<'a, REG> = crate::BitWriter<'a, REG, PDIS0_A>; +impl<'a, REG> PDIS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS0_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PDIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS1_A { + pub const fn variant(&self) -> PDIS1_A { match self.bits { false => PDIS1_A::VALUE1, true => PDIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS1_A::VALUE2 } } #[doc = "Field `PDIS1` writer - Pad Disable for Port n Pin 1"] -pub type PDIS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS1_A, O>; -impl<'a, const O: u8> PDIS1_W<'a, O> { +pub type PDIS1_W<'a, REG> = crate::BitWriter<'a, REG, PDIS1_A>; +impl<'a, REG> PDIS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS1_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PDIS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS2_A { + pub const fn variant(&self) -> PDIS2_A { match self.bits { false => PDIS2_A::VALUE1, true => PDIS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS2_A::VALUE2 } } #[doc = "Field `PDIS2` writer - Pad Disable for Port n Pin 2"] -pub type PDIS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS2_A, O>; -impl<'a, const O: u8> PDIS2_W<'a, O> { +pub type PDIS2_W<'a, REG> = crate::BitWriter<'a, REG, PDIS2_A>; +impl<'a, REG> PDIS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS2_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PDIS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS3_A { + pub const fn variant(&self) -> PDIS3_A { match self.bits { false => PDIS3_A::VALUE1, true => PDIS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS3_A::VALUE2 } } #[doc = "Field `PDIS3` writer - Pad Disable for Port n Pin 3"] -pub type PDIS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS3_A, O>; -impl<'a, const O: u8> PDIS3_W<'a, O> { +pub type PDIS3_W<'a, REG> = crate::BitWriter<'a, REG, PDIS3_A>; +impl<'a, REG> PDIS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS3_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PDIS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS4_A { + pub const fn variant(&self) -> PDIS4_A { match self.bits { false => PDIS4_A::VALUE1, true => PDIS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS4_A::VALUE2 } } #[doc = "Field `PDIS4` writer - Pad Disable for Port n Pin 4"] -pub type PDIS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS4_A, O>; -impl<'a, const O: u8> PDIS4_W<'a, O> { +pub type PDIS4_W<'a, REG> = crate::BitWriter<'a, REG, PDIS4_A>; +impl<'a, REG> PDIS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS4_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PDIS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS5_A { + pub const fn variant(&self) -> PDIS5_A { match self.bits { false => PDIS5_A::VALUE1, true => PDIS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS5_A::VALUE2 } } #[doc = "Field `PDIS5` writer - Pad Disable for Port n Pin 5"] -pub type PDIS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS5_A, O>; -impl<'a, const O: u8> PDIS5_W<'a, O> { +pub type PDIS5_W<'a, REG> = crate::BitWriter<'a, REG, PDIS5_A>; +impl<'a, REG> PDIS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS5_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PDIS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS6_A { + pub const fn variant(&self) -> PDIS6_A { match self.bits { false => PDIS6_A::VALUE1, true => PDIS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS6_A::VALUE2 } } #[doc = "Field `PDIS6` writer - Pad Disable for Port n Pin 6"] -pub type PDIS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS6_A, O>; -impl<'a, const O: u8> PDIS6_W<'a, O> { +pub type PDIS6_W<'a, REG> = crate::BitWriter<'a, REG, PDIS6_A>; +impl<'a, REG> PDIS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS6_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PDIS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS7_A { + pub const fn variant(&self) -> PDIS7_A { match self.bits { false => PDIS7_A::VALUE1, true => PDIS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS7_A::VALUE2 } } #[doc = "Field `PDIS7` writer - Pad Disable for Port n Pin 7"] -pub type PDIS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS7_A, O>; -impl<'a, const O: u8> PDIS7_W<'a, O> { +pub type PDIS7_W<'a, REG> = crate::BitWriter<'a, REG, PDIS7_A>; +impl<'a, REG> PDIS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS7_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PDIS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS8_A { + pub const fn variant(&self) -> PDIS8_A { match self.bits { false => PDIS8_A::VALUE1, true => PDIS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS8_A::VALUE2 } } #[doc = "Field `PDIS8` writer - Pad Disable for Port n Pin 8"] -pub type PDIS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS8_A, O>; -impl<'a, const O: u8> PDIS8_W<'a, O> { +pub type PDIS8_W<'a, REG> = crate::BitWriter<'a, REG, PDIS8_A>; +impl<'a, REG> PDIS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS8_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PDIS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS9_A { + pub const fn variant(&self) -> PDIS9_A { match self.bits { false => PDIS9_A::VALUE1, true => PDIS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS9_A::VALUE2 } } #[doc = "Field `PDIS9` writer - Pad Disable for Port n Pin 9"] -pub type PDIS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS9_A, O>; -impl<'a, const O: u8> PDIS9_W<'a, O> { +pub type PDIS9_W<'a, REG> = crate::BitWriter<'a, REG, PDIS9_A>; +impl<'a, REG> PDIS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS9_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PDIS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS10_A { + pub const fn variant(&self) -> PDIS10_A { match self.bits { false => PDIS10_A::VALUE1, true => PDIS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS10_A::VALUE2 } } #[doc = "Field `PDIS10` writer - Pad Disable for Port n Pin 10"] -pub type PDIS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS10_A, O>; -impl<'a, const O: u8> PDIS10_W<'a, O> { +pub type PDIS10_W<'a, REG> = crate::BitWriter<'a, REG, PDIS10_A>; +impl<'a, REG> PDIS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS10_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PDIS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS11_A { + pub const fn variant(&self) -> PDIS11_A { match self.bits { false => PDIS11_A::VALUE1, true => PDIS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS11_A::VALUE2 } } #[doc = "Field `PDIS11` writer - Pad Disable for Port n Pin 11"] -pub type PDIS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS11_A, O>; -impl<'a, const O: u8> PDIS11_W<'a, O> { +pub type PDIS11_W<'a, REG> = crate::BitWriter<'a, REG, PDIS11_A>; +impl<'a, REG> PDIS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS11_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PDIS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS12_A { + pub const fn variant(&self) -> PDIS12_A { match self.bits { false => PDIS12_A::VALUE1, true => PDIS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS12_A::VALUE2 } } #[doc = "Field `PDIS12` writer - Pad Disable for Port n Pin 12"] -pub type PDIS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS12_A, O>; -impl<'a, const O: u8> PDIS12_W<'a, O> { +pub type PDIS12_W<'a, REG> = crate::BitWriter<'a, REG, PDIS12_A>; +impl<'a, REG> PDIS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS12_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PDIS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS13_A { + pub const fn variant(&self) -> PDIS13_A { match self.bits { false => PDIS13_A::VALUE1, true => PDIS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS13_A::VALUE2 } } #[doc = "Field `PDIS13` writer - Pad Disable for Port n Pin 13"] -pub type PDIS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS13_A, O>; -impl<'a, const O: u8> PDIS13_W<'a, O> { +pub type PDIS13_W<'a, REG> = crate::BitWriter<'a, REG, PDIS13_A>; +impl<'a, REG> PDIS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS13_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PDIS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS14_A { + pub const fn variant(&self) -> PDIS14_A { match self.bits { false => PDIS14_A::VALUE1, true => PDIS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS14_A::VALUE2 } } #[doc = "Field `PDIS14` writer - Pad Disable for Port n Pin 14"] -pub type PDIS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS14_A, O>; -impl<'a, const O: u8> PDIS14_W<'a, O> { +pub type PDIS14_W<'a, REG> = crate::BitWriter<'a, REG, PDIS14_A>; +impl<'a, REG> PDIS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS14_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PDIS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS15_A { + pub const fn variant(&self) -> PDIS15_A { match self.bits { false => PDIS15_A::VALUE1, true => PDIS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS15_A::VALUE2 } } #[doc = "Field `PDIS15` writer - Pad Disable for Port n Pin 15"] -pub type PDIS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS15_A, O>; -impl<'a, const O: u8> PDIS15_W<'a, O> { +pub type PDIS15_W<'a, REG> = crate::BitWriter<'a, REG, PDIS15_A>; +impl<'a, REG> PDIS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS15_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Pad Disable for Port n Pin 0"] #[inline(always)] #[must_use] - pub fn pdis0(&mut self) -> PDIS0_W<0> { - PDIS0_W::new(self) + pub fn pdis0(&mut self) -> PDIS0_W { + PDIS0_W::new(self, 0) } #[doc = "Bit 1 - Pad Disable for Port n Pin 1"] #[inline(always)] #[must_use] - pub fn pdis1(&mut self) -> PDIS1_W<1> { - PDIS1_W::new(self) + pub fn pdis1(&mut self) -> PDIS1_W { + PDIS1_W::new(self, 1) } #[doc = "Bit 2 - Pad Disable for Port n Pin 2"] #[inline(always)] #[must_use] - pub fn pdis2(&mut self) -> PDIS2_W<2> { - PDIS2_W::new(self) + pub fn pdis2(&mut self) -> PDIS2_W { + PDIS2_W::new(self, 2) } #[doc = "Bit 3 - Pad Disable for Port n Pin 3"] #[inline(always)] #[must_use] - pub fn pdis3(&mut self) -> PDIS3_W<3> { - PDIS3_W::new(self) + pub fn pdis3(&mut self) -> PDIS3_W { + PDIS3_W::new(self, 3) } #[doc = "Bit 4 - Pad Disable for Port n Pin 4"] #[inline(always)] #[must_use] - pub fn pdis4(&mut self) -> PDIS4_W<4> { - PDIS4_W::new(self) + pub fn pdis4(&mut self) -> PDIS4_W { + PDIS4_W::new(self, 4) } #[doc = "Bit 5 - Pad Disable for Port n Pin 5"] #[inline(always)] #[must_use] - pub fn pdis5(&mut self) -> PDIS5_W<5> { - PDIS5_W::new(self) + pub fn pdis5(&mut self) -> PDIS5_W { + PDIS5_W::new(self, 5) } #[doc = "Bit 6 - Pad Disable for Port n Pin 6"] #[inline(always)] #[must_use] - pub fn pdis6(&mut self) -> PDIS6_W<6> { - PDIS6_W::new(self) + pub fn pdis6(&mut self) -> PDIS6_W { + PDIS6_W::new(self, 6) } #[doc = "Bit 7 - Pad Disable for Port n Pin 7"] #[inline(always)] #[must_use] - pub fn pdis7(&mut self) -> PDIS7_W<7> { - PDIS7_W::new(self) + pub fn pdis7(&mut self) -> PDIS7_W { + PDIS7_W::new(self, 7) } #[doc = "Bit 8 - Pad Disable for Port n Pin 8"] #[inline(always)] #[must_use] - pub fn pdis8(&mut self) -> PDIS8_W<8> { - PDIS8_W::new(self) + pub fn pdis8(&mut self) -> PDIS8_W { + PDIS8_W::new(self, 8) } #[doc = "Bit 9 - Pad Disable for Port n Pin 9"] #[inline(always)] #[must_use] - pub fn pdis9(&mut self) -> PDIS9_W<9> { - PDIS9_W::new(self) + pub fn pdis9(&mut self) -> PDIS9_W { + PDIS9_W::new(self, 9) } #[doc = "Bit 10 - Pad Disable for Port n Pin 10"] #[inline(always)] #[must_use] - pub fn pdis10(&mut self) -> PDIS10_W<10> { - PDIS10_W::new(self) + pub fn pdis10(&mut self) -> PDIS10_W { + PDIS10_W::new(self, 10) } #[doc = "Bit 11 - Pad Disable for Port n Pin 11"] #[inline(always)] #[must_use] - pub fn pdis11(&mut self) -> PDIS11_W<11> { - PDIS11_W::new(self) + pub fn pdis11(&mut self) -> PDIS11_W { + PDIS11_W::new(self, 11) } #[doc = "Bit 12 - Pad Disable for Port n Pin 12"] #[inline(always)] #[must_use] - pub fn pdis12(&mut self) -> PDIS12_W<12> { - PDIS12_W::new(self) + pub fn pdis12(&mut self) -> PDIS12_W { + PDIS12_W::new(self, 12) } #[doc = "Bit 13 - Pad Disable for Port n Pin 13"] #[inline(always)] #[must_use] - pub fn pdis13(&mut self) -> PDIS13_W<13> { - PDIS13_W::new(self) + pub fn pdis13(&mut self) -> PDIS13_W { + PDIS13_W::new(self, 13) } #[doc = "Bit 14 - Pad Disable for Port n Pin 14"] #[inline(always)] #[must_use] - pub fn pdis14(&mut self) -> PDIS14_W<14> { - PDIS14_W::new(self) + pub fn pdis14(&mut self) -> PDIS14_W { + PDIS14_W::new(self, 14) } #[doc = "Bit 15 - Pad Disable for Port n Pin 15"] #[inline(always)] #[must_use] - pub fn pdis15(&mut self) -> PDIS15_W<15> { - PDIS15_W::new(self) + pub fn pdis15(&mut self) -> PDIS15_W { + PDIS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdisc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdisc::R`](R) reader structure"] +impl crate::Readable for PDISC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdisc::W`](W) writer structure"] impl crate::Writable for PDISC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port14/pps.rs b/src/port14/pps.rs index 3f49ed2f..91e233b3 100644 --- a/src/port14/pps.rs +++ b/src/port14/pps.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] pub type PPS0_R = crate::BitReader; #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PPS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS0_A { + pub const fn variant(&self) -> PPS0_A { match self.bits { false => PPS0_A::VALUE1, true => PPS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS0_A::VALUE2 } } #[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] -pub type PPS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS0_A, O>; -impl<'a, const O: u8> PPS0_W<'a, O> { +pub type PPS0_W<'a, REG> = crate::BitWriter<'a, REG, PPS0_A>; +impl<'a, REG> PPS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PPS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS1_A { + pub const fn variant(&self) -> PPS1_A { match self.bits { false => PPS1_A::VALUE1, true => PPS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS1_A::VALUE2 } } #[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] -pub type PPS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS1_A, O>; -impl<'a, const O: u8> PPS1_W<'a, O> { +pub type PPS1_W<'a, REG> = crate::BitWriter<'a, REG, PPS1_A>; +impl<'a, REG> PPS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PPS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS2_A { + pub const fn variant(&self) -> PPS2_A { match self.bits { false => PPS2_A::VALUE1, true => PPS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS2_A::VALUE2 } } #[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] -pub type PPS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS2_A, O>; -impl<'a, const O: u8> PPS2_W<'a, O> { +pub type PPS2_W<'a, REG> = crate::BitWriter<'a, REG, PPS2_A>; +impl<'a, REG> PPS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PPS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS3_A { + pub const fn variant(&self) -> PPS3_A { match self.bits { false => PPS3_A::VALUE1, true => PPS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS3_A::VALUE2 } } #[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] -pub type PPS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS3_A, O>; -impl<'a, const O: u8> PPS3_W<'a, O> { +pub type PPS3_W<'a, REG> = crate::BitWriter<'a, REG, PPS3_A>; +impl<'a, REG> PPS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PPS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS4_A { + pub const fn variant(&self) -> PPS4_A { match self.bits { false => PPS4_A::VALUE1, true => PPS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS4_A::VALUE2 } } #[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] -pub type PPS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS4_A, O>; -impl<'a, const O: u8> PPS4_W<'a, O> { +pub type PPS4_W<'a, REG> = crate::BitWriter<'a, REG, PPS4_A>; +impl<'a, REG> PPS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PPS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS5_A { + pub const fn variant(&self) -> PPS5_A { match self.bits { false => PPS5_A::VALUE1, true => PPS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS5_A::VALUE2 } } #[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] -pub type PPS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS5_A, O>; -impl<'a, const O: u8> PPS5_W<'a, O> { +pub type PPS5_W<'a, REG> = crate::BitWriter<'a, REG, PPS5_A>; +impl<'a, REG> PPS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS6_A { + pub const fn variant(&self) -> PPS6_A { match self.bits { false => PPS6_A::VALUE1, true => PPS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS6_A::VALUE2 } } #[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] -pub type PPS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS6_A, O>; -impl<'a, const O: u8> PPS6_W<'a, O> { +pub type PPS6_W<'a, REG> = crate::BitWriter<'a, REG, PPS6_A>; +impl<'a, REG> PPS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PPS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS7_A { + pub const fn variant(&self) -> PPS7_A { match self.bits { false => PPS7_A::VALUE1, true => PPS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS7_A::VALUE2 } } #[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] -pub type PPS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS7_A, O>; -impl<'a, const O: u8> PPS7_W<'a, O> { +pub type PPS7_W<'a, REG> = crate::BitWriter<'a, REG, PPS7_A>; +impl<'a, REG> PPS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PPS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS8_A { + pub const fn variant(&self) -> PPS8_A { match self.bits { false => PPS8_A::VALUE1, true => PPS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS8_A::VALUE2 } } #[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] -pub type PPS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS8_A, O>; -impl<'a, const O: u8> PPS8_W<'a, O> { +pub type PPS8_W<'a, REG> = crate::BitWriter<'a, REG, PPS8_A>; +impl<'a, REG> PPS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PPS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS9_A { + pub const fn variant(&self) -> PPS9_A { match self.bits { false => PPS9_A::VALUE1, true => PPS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS9_A::VALUE2 } } #[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] -pub type PPS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS9_A, O>; -impl<'a, const O: u8> PPS9_W<'a, O> { +pub type PPS9_W<'a, REG> = crate::BitWriter<'a, REG, PPS9_A>; +impl<'a, REG> PPS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PPS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS10_A { + pub const fn variant(&self) -> PPS10_A { match self.bits { false => PPS10_A::VALUE1, true => PPS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS10_A::VALUE2 } } #[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] -pub type PPS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS10_A, O>; -impl<'a, const O: u8> PPS10_W<'a, O> { +pub type PPS10_W<'a, REG> = crate::BitWriter<'a, REG, PPS10_A>; +impl<'a, REG> PPS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PPS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS11_A { + pub const fn variant(&self) -> PPS11_A { match self.bits { false => PPS11_A::VALUE1, true => PPS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS11_A::VALUE2 } } #[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] -pub type PPS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS11_A, O>; -impl<'a, const O: u8> PPS11_W<'a, O> { +pub type PPS11_W<'a, REG> = crate::BitWriter<'a, REG, PPS11_A>; +impl<'a, REG> PPS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PPS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS12_A { + pub const fn variant(&self) -> PPS12_A { match self.bits { false => PPS12_A::VALUE1, true => PPS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS12_A::VALUE2 } } #[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] -pub type PPS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS12_A, O>; -impl<'a, const O: u8> PPS12_W<'a, O> { +pub type PPS12_W<'a, REG> = crate::BitWriter<'a, REG, PPS12_A>; +impl<'a, REG> PPS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PPS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS13_A { + pub const fn variant(&self) -> PPS13_A { match self.bits { false => PPS13_A::VALUE1, true => PPS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS13_A::VALUE2 } } #[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] -pub type PPS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS13_A, O>; -impl<'a, const O: u8> PPS13_W<'a, O> { +pub type PPS13_W<'a, REG> = crate::BitWriter<'a, REG, PPS13_A>; +impl<'a, REG> PPS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PPS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS14_A { + pub const fn variant(&self) -> PPS14_A { match self.bits { false => PPS14_A::VALUE1, true => PPS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS14_A::VALUE2 } } #[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] -pub type PPS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS14_A, O>; -impl<'a, const O: u8> PPS14_W<'a, O> { +pub type PPS14_W<'a, REG> = crate::BitWriter<'a, REG, PPS14_A>; +impl<'a, REG> PPS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PPS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS15_A { + pub const fn variant(&self) -> PPS15_A { match self.bits { false => PPS15_A::VALUE1, true => PPS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS15_A::VALUE2 } } #[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] -pub type PPS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS15_A, O>; -impl<'a, const O: u8> PPS15_W<'a, O> { +pub type PPS15_W<'a, REG> = crate::BitWriter<'a, REG, PPS15_A>; +impl<'a, REG> PPS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Pin Power Save Bit 0"] #[inline(always)] #[must_use] - pub fn pps0(&mut self) -> PPS0_W<0> { - PPS0_W::new(self) + pub fn pps0(&mut self) -> PPS0_W { + PPS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Pin Power Save Bit 1"] #[inline(always)] #[must_use] - pub fn pps1(&mut self) -> PPS1_W<1> { - PPS1_W::new(self) + pub fn pps1(&mut self) -> PPS1_W { + PPS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Pin Power Save Bit 2"] #[inline(always)] #[must_use] - pub fn pps2(&mut self) -> PPS2_W<2> { - PPS2_W::new(self) + pub fn pps2(&mut self) -> PPS2_W { + PPS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Pin Power Save Bit 3"] #[inline(always)] #[must_use] - pub fn pps3(&mut self) -> PPS3_W<3> { - PPS3_W::new(self) + pub fn pps3(&mut self) -> PPS3_W { + PPS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Pin Power Save Bit 4"] #[inline(always)] #[must_use] - pub fn pps4(&mut self) -> PPS4_W<4> { - PPS4_W::new(self) + pub fn pps4(&mut self) -> PPS4_W { + PPS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Pin Power Save Bit 5"] #[inline(always)] #[must_use] - pub fn pps5(&mut self) -> PPS5_W<5> { - PPS5_W::new(self) + pub fn pps5(&mut self) -> PPS5_W { + PPS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Pin Power Save Bit 6"] #[inline(always)] #[must_use] - pub fn pps6(&mut self) -> PPS6_W<6> { - PPS6_W::new(self) + pub fn pps6(&mut self) -> PPS6_W { + PPS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Pin Power Save Bit 7"] #[inline(always)] #[must_use] - pub fn pps7(&mut self) -> PPS7_W<7> { - PPS7_W::new(self) + pub fn pps7(&mut self) -> PPS7_W { + PPS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Pin Power Save Bit 8"] #[inline(always)] #[must_use] - pub fn pps8(&mut self) -> PPS8_W<8> { - PPS8_W::new(self) + pub fn pps8(&mut self) -> PPS8_W { + PPS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Pin Power Save Bit 9"] #[inline(always)] #[must_use] - pub fn pps9(&mut self) -> PPS9_W<9> { - PPS9_W::new(self) + pub fn pps9(&mut self) -> PPS9_W { + PPS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Pin Power Save Bit 10"] #[inline(always)] #[must_use] - pub fn pps10(&mut self) -> PPS10_W<10> { - PPS10_W::new(self) + pub fn pps10(&mut self) -> PPS10_W { + PPS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Pin Power Save Bit 11"] #[inline(always)] #[must_use] - pub fn pps11(&mut self) -> PPS11_W<11> { - PPS11_W::new(self) + pub fn pps11(&mut self) -> PPS11_W { + PPS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Pin Power Save Bit 12"] #[inline(always)] #[must_use] - pub fn pps12(&mut self) -> PPS12_W<12> { - PPS12_W::new(self) + pub fn pps12(&mut self) -> PPS12_W { + PPS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Pin Power Save Bit 13"] #[inline(always)] #[must_use] - pub fn pps13(&mut self) -> PPS13_W<13> { - PPS13_W::new(self) + pub fn pps13(&mut self) -> PPS13_W { + PPS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Pin Power Save Bit 14"] #[inline(always)] #[must_use] - pub fn pps14(&mut self) -> PPS14_W<14> { - PPS14_W::new(self) + pub fn pps14(&mut self) -> PPS14_W { + PPS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Pin Power Save Bit 15"] #[inline(always)] #[must_use] - pub fn pps15(&mut self) -> PPS15_W<15> { - PPS15_W::new(self) + pub fn pps15(&mut self) -> PPS15_W { + PPS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 14 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pps::R`](R) reader structure"] +impl crate::Readable for PPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps::W`](W) writer structure"] impl crate::Writable for PPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port15.rs b/src/port15.rs index 6639bb60..b92ae00b 100644 --- a/src/port15.rs +++ b/src/port15.rs @@ -1,62 +1,109 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + out: OUT, + omr: OMR, + _reserved2: [u8; 0x08], + iocr0: IOCR0, + iocr4: IOCR4, + iocr8: IOCR8, + _reserved5: [u8; 0x08], + in_: IN, + _reserved6: [u8; 0x38], + pdisc: PDISC, + _reserved7: [u8; 0x0c], + pps: PPS, + hwsel: HWSEL, +} +impl RegisterBlock { #[doc = "0x00 - Port 15 Output Register"] - pub out: OUT, + #[inline(always)] + pub const fn out(&self) -> &OUT { + &self.out + } #[doc = "0x04 - Port 15 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn omr(&self) -> &OMR { + &self.omr + } #[doc = "0x10 - Port 15 Input/Output Control Register 0"] - pub iocr0: IOCR0, + #[inline(always)] + pub const fn iocr0(&self) -> &IOCR0 { + &self.iocr0 + } #[doc = "0x14 - Port 15 Input/Output Control Register 4"] - pub iocr4: IOCR4, + #[inline(always)] + pub const fn iocr4(&self) -> &IOCR4 { + &self.iocr4 + } #[doc = "0x18 - Port 15 Input/Output Control Register 8"] - pub iocr8: IOCR8, - _reserved5: [u8; 0x08], + #[inline(always)] + pub const fn iocr8(&self) -> &IOCR8 { + &self.iocr8 + } #[doc = "0x24 - Port 15 Input Register"] - pub in_: IN, - _reserved6: [u8; 0x38], + #[inline(always)] + pub const fn in_(&self) -> &IN { + &self.in_ + } #[doc = "0x60 - Port 15 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved7: [u8; 0x0c], + #[inline(always)] + pub const fn pdisc(&self) -> &PDISC { + &self.pdisc + } #[doc = "0x70 - Port 15 Pin Power Save Register"] - pub pps: PPS, + #[inline(always)] + pub const fn pps(&self) -> &PPS { + &self.pps + } #[doc = "0x74 - Port 15 Pin Hardware Select Register"] - pub hwsel: HWSEL, + #[inline(always)] + pub const fn hwsel(&self) -> &HWSEL { + &self.hwsel + } } -#[doc = "OUT (rw) register accessor: an alias for `Reg`"] +#[doc = "OUT (rw) register accessor: Port 15 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out`] +module"] pub type OUT = crate::Reg; #[doc = "Port 15 Output Register"] pub mod out; -#[doc = "OMR (w) register accessor: an alias for `Reg`"] +#[doc = "OMR (w) register accessor: Port 15 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@omr`] +module"] pub type OMR = crate::Reg; #[doc = "Port 15 Output Modification Register"] pub mod omr; -#[doc = "IOCR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR0 (rw) register accessor: Port 15 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr0`] +module"] pub type IOCR0 = crate::Reg; #[doc = "Port 15 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "IOCR4 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR4 (rw) register accessor: Port 15 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr4`] +module"] pub type IOCR4 = crate::Reg; #[doc = "Port 15 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "IOCR8 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR8 (rw) register accessor: Port 15 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr8`] +module"] pub type IOCR8 = crate::Reg; #[doc = "Port 15 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "IN (r) register accessor: an alias for `Reg`"] +#[doc = "IN (r) register accessor: Port 15 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] pub type IN = crate::Reg; #[doc = "Port 15 Input Register"] pub mod in_; -#[doc = "PDISC (rw) register accessor: an alias for `Reg`"] +#[doc = "PDISC (rw) register accessor: Port 15 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdisc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdisc`] +module"] pub type PDISC = crate::Reg; #[doc = "Port 15 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "PPS (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS (rw) register accessor: Port 15 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps`] +module"] pub type PPS = crate::Reg; #[doc = "Port 15 Pin Power Save Register"] pub mod pps; -#[doc = "HWSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "HWSEL (rw) register accessor: Port 15 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hwsel`] +module"] pub type HWSEL = crate::Reg; #[doc = "Port 15 Pin Hardware Select Register"] pub mod hwsel; diff --git a/src/port15/hwsel.rs b/src/port15/hwsel.rs index 3ba4722b..77ffbb76 100644 --- a/src/port15/hwsel.rs +++ b/src/port15/hwsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] -pub type HW0_R = crate::FieldReader; +pub type HW0_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW0_A { + type Ux = u8; +} impl HW0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW0_A::VALUE1), 1 => Some(HW0_A::VALUE2), @@ -64,43 +35,47 @@ impl HW0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW0_A::VALUE3 } } #[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] -pub type HW0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW0_A, 2, O>; -impl<'a, const O: u8> HW0_W<'a, O> { +pub type HW0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW0_A>; +impl<'a, REG> HW0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE3) } } #[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] -pub type HW1_R = crate::FieldReader; +pub type HW1_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW1_A { + type Ux = u8; +} impl HW1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW1_A::VALUE1), 1 => Some(HW1_A::VALUE2), @@ -129,43 +107,47 @@ impl HW1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW1_A::VALUE3 } } #[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] -pub type HW1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW1_A, 2, O>; -impl<'a, const O: u8> HW1_W<'a, O> { +pub type HW1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW1_A>; +impl<'a, REG> HW1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE3) } } #[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] -pub type HW2_R = crate::FieldReader; +pub type HW2_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW2_A { + type Ux = u8; +} impl HW2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW2_A::VALUE1), 1 => Some(HW2_A::VALUE2), @@ -194,43 +179,47 @@ impl HW2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW2_A::VALUE3 } } #[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] -pub type HW2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW2_A, 2, O>; -impl<'a, const O: u8> HW2_W<'a, O> { +pub type HW2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW2_A>; +impl<'a, REG> HW2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE3) } } #[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] -pub type HW3_R = crate::FieldReader; +pub type HW3_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW3_A { + type Ux = u8; +} impl HW3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW3_A::VALUE1), 1 => Some(HW3_A::VALUE2), @@ -259,43 +251,47 @@ impl HW3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW3_A::VALUE3 } } #[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] -pub type HW3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW3_A, 2, O>; -impl<'a, const O: u8> HW3_W<'a, O> { +pub type HW3_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW3_A>; +impl<'a, REG> HW3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE3) } } #[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] -pub type HW4_R = crate::FieldReader; +pub type HW4_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +309,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW4_A { + type Ux = u8; +} impl HW4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW4_A::VALUE1), 1 => Some(HW4_A::VALUE2), @@ -324,43 +323,47 @@ impl HW4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW4_A::VALUE3 } } #[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] -pub type HW4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW4_A, 2, O>; -impl<'a, const O: u8> HW4_W<'a, O> { +pub type HW4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW4_A>; +impl<'a, REG> HW4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE3) } } #[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] -pub type HW5_R = crate::FieldReader; +pub type HW5_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -378,10 +381,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW5_A { + type Ux = u8; +} impl HW5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW5_A::VALUE1), 1 => Some(HW5_A::VALUE2), @@ -389,43 +395,47 @@ impl HW5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW5_A::VALUE3 } } #[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] -pub type HW5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW5_A, 2, O>; -impl<'a, const O: u8> HW5_W<'a, O> { +pub type HW5_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW5_A>; +impl<'a, REG> HW5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE3) } } #[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] -pub type HW6_R = crate::FieldReader; +pub type HW6_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW6_A { + type Ux = u8; +} impl HW6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW6_A::VALUE1), 1 => Some(HW6_A::VALUE2), @@ -454,43 +467,47 @@ impl HW6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW6_A::VALUE3 } } #[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] -pub type HW6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW6_A, 2, O>; -impl<'a, const O: u8> HW6_W<'a, O> { +pub type HW6_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW6_A>; +impl<'a, REG> HW6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE3) } } #[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] -pub type HW7_R = crate::FieldReader; +pub type HW7_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW7_A { + type Ux = u8; +} impl HW7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW7_A::VALUE1), 1 => Some(HW7_A::VALUE2), @@ -519,43 +539,47 @@ impl HW7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW7_A::VALUE3 } } #[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] -pub type HW7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW7_A, 2, O>; -impl<'a, const O: u8> HW7_W<'a, O> { +pub type HW7_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW7_A>; +impl<'a, REG> HW7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE3) } } #[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] -pub type HW8_R = crate::FieldReader; +pub type HW8_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 8\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -573,10 +597,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW8_A { + type Ux = u8; +} impl HW8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW8_A::VALUE1), 1 => Some(HW8_A::VALUE2), @@ -584,43 +611,47 @@ impl HW8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW8_A::VALUE3 } } #[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] -pub type HW8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW8_A, 2, O>; -impl<'a, const O: u8> HW8_W<'a, O> { +pub type HW8_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW8_A>; +impl<'a, REG> HW8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE3) } } #[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] -pub type HW9_R = crate::FieldReader; +pub type HW9_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 9\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -638,10 +669,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW9_A { + type Ux = u8; +} impl HW9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW9_A::VALUE1), 1 => Some(HW9_A::VALUE2), @@ -649,43 +683,47 @@ impl HW9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW9_A::VALUE3 } } #[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] -pub type HW9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW9_A, 2, O>; -impl<'a, const O: u8> HW9_W<'a, O> { +pub type HW9_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW9_A>; +impl<'a, REG> HW9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE3) } } #[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] -pub type HW10_R = crate::FieldReader; +pub type HW10_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -703,10 +741,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW10_A { + type Ux = u8; +} impl HW10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW10_A::VALUE1), 1 => Some(HW10_A::VALUE2), @@ -714,43 +755,47 @@ impl HW10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW10_A::VALUE3 } } #[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] -pub type HW10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW10_A, 2, O>; -impl<'a, const O: u8> HW10_W<'a, O> { +pub type HW10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW10_A>; +impl<'a, REG> HW10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE3) } } #[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] -pub type HW11_R = crate::FieldReader; +pub type HW11_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -768,10 +813,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW11_A { + type Ux = u8; +} impl HW11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW11_A::VALUE1), 1 => Some(HW11_A::VALUE2), @@ -779,43 +827,47 @@ impl HW11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW11_A::VALUE3 } } #[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] -pub type HW11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW11_A, 2, O>; -impl<'a, const O: u8> HW11_W<'a, O> { +pub type HW11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW11_A>; +impl<'a, REG> HW11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE3) } } #[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] -pub type HW12_R = crate::FieldReader; +pub type HW12_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 12\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -833,10 +885,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW12_A { + type Ux = u8; +} impl HW12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW12_A::VALUE1), 1 => Some(HW12_A::VALUE2), @@ -844,43 +899,47 @@ impl HW12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW12_A::VALUE3 } } #[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] -pub type HW12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW12_A, 2, O>; -impl<'a, const O: u8> HW12_W<'a, O> { +pub type HW12_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW12_A>; +impl<'a, REG> HW12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE3) } } #[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] -pub type HW13_R = crate::FieldReader; +pub type HW13_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 13\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -898,10 +957,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW13_A { + type Ux = u8; +} impl HW13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW13_A::VALUE1), 1 => Some(HW13_A::VALUE2), @@ -909,43 +971,47 @@ impl HW13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW13_A::VALUE3 } } #[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] -pub type HW13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW13_A, 2, O>; -impl<'a, const O: u8> HW13_W<'a, O> { +pub type HW13_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW13_A>; +impl<'a, REG> HW13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE3) } } #[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] -pub type HW14_R = crate::FieldReader; +pub type HW14_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -963,10 +1029,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW14_A { + type Ux = u8; +} impl HW14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW14_A::VALUE1), 1 => Some(HW14_A::VALUE2), @@ -974,43 +1043,47 @@ impl HW14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW14_A::VALUE3 } } #[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] -pub type HW14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW14_A, 2, O>; -impl<'a, const O: u8> HW14_W<'a, O> { +pub type HW14_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW14_A>; +impl<'a, REG> HW14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE3) } } #[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] -pub type HW15_R = crate::FieldReader; +pub type HW15_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1028,10 +1101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW15_A { + type Ux = u8; +} impl HW15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW15_A::VALUE1), 1 => Some(HW15_A::VALUE2), @@ -1039,38 +1115,42 @@ impl HW15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW15_A::VALUE3 } } #[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] -pub type HW15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW15_A, 2, O>; -impl<'a, const O: u8> HW15_W<'a, O> { +pub type HW15_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW15_A>; +impl<'a, REG> HW15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE3) } } @@ -1160,118 +1240,119 @@ impl W { #[doc = "Bits 0:1 - Port n Pin Hardware Select Bit 0"] #[inline(always)] #[must_use] - pub fn hw0(&mut self) -> HW0_W<0> { - HW0_W::new(self) + pub fn hw0(&mut self) -> HW0_W { + HW0_W::new(self, 0) } #[doc = "Bits 2:3 - Port n Pin Hardware Select Bit 1"] #[inline(always)] #[must_use] - pub fn hw1(&mut self) -> HW1_W<2> { - HW1_W::new(self) + pub fn hw1(&mut self) -> HW1_W { + HW1_W::new(self, 2) } #[doc = "Bits 4:5 - Port n Pin Hardware Select Bit 2"] #[inline(always)] #[must_use] - pub fn hw2(&mut self) -> HW2_W<4> { - HW2_W::new(self) + pub fn hw2(&mut self) -> HW2_W { + HW2_W::new(self, 4) } #[doc = "Bits 6:7 - Port n Pin Hardware Select Bit 3"] #[inline(always)] #[must_use] - pub fn hw3(&mut self) -> HW3_W<6> { - HW3_W::new(self) + pub fn hw3(&mut self) -> HW3_W { + HW3_W::new(self, 6) } #[doc = "Bits 8:9 - Port n Pin Hardware Select Bit 4"] #[inline(always)] #[must_use] - pub fn hw4(&mut self) -> HW4_W<8> { - HW4_W::new(self) + pub fn hw4(&mut self) -> HW4_W { + HW4_W::new(self, 8) } #[doc = "Bits 10:11 - Port n Pin Hardware Select Bit 5"] #[inline(always)] #[must_use] - pub fn hw5(&mut self) -> HW5_W<10> { - HW5_W::new(self) + pub fn hw5(&mut self) -> HW5_W { + HW5_W::new(self, 10) } #[doc = "Bits 12:13 - Port n Pin Hardware Select Bit 6"] #[inline(always)] #[must_use] - pub fn hw6(&mut self) -> HW6_W<12> { - HW6_W::new(self) + pub fn hw6(&mut self) -> HW6_W { + HW6_W::new(self, 12) } #[doc = "Bits 14:15 - Port n Pin Hardware Select Bit 7"] #[inline(always)] #[must_use] - pub fn hw7(&mut self) -> HW7_W<14> { - HW7_W::new(self) + pub fn hw7(&mut self) -> HW7_W { + HW7_W::new(self, 14) } #[doc = "Bits 16:17 - Port n Pin Hardware Select Bit 8"] #[inline(always)] #[must_use] - pub fn hw8(&mut self) -> HW8_W<16> { - HW8_W::new(self) + pub fn hw8(&mut self) -> HW8_W { + HW8_W::new(self, 16) } #[doc = "Bits 18:19 - Port n Pin Hardware Select Bit 9"] #[inline(always)] #[must_use] - pub fn hw9(&mut self) -> HW9_W<18> { - HW9_W::new(self) + pub fn hw9(&mut self) -> HW9_W { + HW9_W::new(self, 18) } #[doc = "Bits 20:21 - Port n Pin Hardware Select Bit 10"] #[inline(always)] #[must_use] - pub fn hw10(&mut self) -> HW10_W<20> { - HW10_W::new(self) + pub fn hw10(&mut self) -> HW10_W { + HW10_W::new(self, 20) } #[doc = "Bits 22:23 - Port n Pin Hardware Select Bit 11"] #[inline(always)] #[must_use] - pub fn hw11(&mut self) -> HW11_W<22> { - HW11_W::new(self) + pub fn hw11(&mut self) -> HW11_W { + HW11_W::new(self, 22) } #[doc = "Bits 24:25 - Port n Pin Hardware Select Bit 12"] #[inline(always)] #[must_use] - pub fn hw12(&mut self) -> HW12_W<24> { - HW12_W::new(self) + pub fn hw12(&mut self) -> HW12_W { + HW12_W::new(self, 24) } #[doc = "Bits 26:27 - Port n Pin Hardware Select Bit 13"] #[inline(always)] #[must_use] - pub fn hw13(&mut self) -> HW13_W<26> { - HW13_W::new(self) + pub fn hw13(&mut self) -> HW13_W { + HW13_W::new(self, 26) } #[doc = "Bits 28:29 - Port n Pin Hardware Select Bit 14"] #[inline(always)] #[must_use] - pub fn hw14(&mut self) -> HW14_W<28> { - HW14_W::new(self) + pub fn hw14(&mut self) -> HW14_W { + HW14_W::new(self, 28) } #[doc = "Bits 30:31 - Port n Pin Hardware Select Bit 15"] #[inline(always)] #[must_use] - pub fn hw15(&mut self) -> HW15_W<30> { - HW15_W::new(self) + pub fn hw15(&mut self) -> HW15_W { + HW15_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hwsel::R`](R) reader structure"] +impl crate::Readable for HWSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hwsel::W`](W) writer structure"] impl crate::Writable for HWSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port15/in_.rs b/src/port15/in_.rs index e6c72b74..da844645 100644 --- a/src/port15/in_.rs +++ b/src/port15/in_.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `P0` reader - Port n Input Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { P15_R::new(((self.bits >> 15) & 1) != 0) } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`in_::R`](R) reader structure"] +impl crate::Readable for IN_SPEC {} #[doc = "`reset()` method sets IN to value 0"] impl crate::Resettable for IN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port15/iocr0.rs b/src/port15/iocr0.rs index 1f80fd24..68080005 100644 --- a/src/port15/iocr0.rs +++ b/src/port15/iocr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] -pub type PC0_R = crate::FieldReader; +pub type PC0_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC0_A { + type Ux = u8; +} impl PC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC0_A::VALUE1), 1 => Some(PC0_A::VALUE2), @@ -109,193 +80,197 @@ impl PC0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC0_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC0_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC0_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC0_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC0_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC0_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC0_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC0_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC0_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC0_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC0_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC0_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC0_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC0_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC0_A::VALUE18 } } #[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] -pub type PC0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC0_A, 5, O>; -impl<'a, const O: u8> PC0_W<'a, O> { +pub type PC0_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC0_A>; +impl<'a, REG> PC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE18) } } #[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] -pub type PC1_R = crate::FieldReader; +pub type PC1_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC1_A { + type Ux = u8; +} impl PC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC1_A::VALUE1), 1 => Some(PC1_A::VALUE2), @@ -369,193 +347,197 @@ impl PC1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC1_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC1_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC1_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC1_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC1_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC1_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC1_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC1_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC1_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC1_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC1_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC1_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC1_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC1_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC1_A::VALUE18 } } #[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] -pub type PC1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC1_A, 5, O>; -impl<'a, const O: u8> PC1_W<'a, O> { +pub type PC1_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC1_A>; +impl<'a, REG> PC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE18) } } #[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] -pub type PC2_R = crate::FieldReader; +pub type PC2_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC2_A { + type Ux = u8; +} impl PC2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC2_A::VALUE1), 1 => Some(PC2_A::VALUE2), @@ -629,193 +614,197 @@ impl PC2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC2_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC2_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC2_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC2_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC2_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC2_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC2_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC2_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC2_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC2_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC2_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC2_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC2_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC2_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC2_A::VALUE18 } } #[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] -pub type PC2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC2_A, 5, O>; -impl<'a, const O: u8> PC2_W<'a, O> { +pub type PC2_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC2_A>; +impl<'a, REG> PC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE18) } } #[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] -pub type PC3_R = crate::FieldReader; +pub type PC3_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC3_A { + type Ux = u8; +} impl PC3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC3_A::VALUE1), 1 => Some(PC3_A::VALUE2), @@ -889,188 +881,192 @@ impl PC3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC3_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC3_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC3_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC3_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC3_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC3_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC3_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC3_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC3_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC3_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC3_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC3_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC3_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC3_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC3_A::VALUE18 } } #[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] -pub type PC3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC3_A, 5, O>; -impl<'a, const O: u8> PC3_W<'a, O> { +pub type PC3_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC3_A>; +impl<'a, REG> PC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc0(&mut self) -> PC0_W<3> { - PC0_W::new(self) + pub fn pc0(&mut self) -> PC0_W { + PC0_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc1(&mut self) -> PC1_W<11> { - PC1_W::new(self) + pub fn pc1(&mut self) -> PC1_W { + PC1_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc2(&mut self) -> PC2_W<19> { - PC2_W::new(self) + pub fn pc2(&mut self) -> PC2_W { + PC2_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc3(&mut self) -> PC3_W<27> { - PC3_W::new(self) + pub fn pc3(&mut self) -> PC3_W { + PC3_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr0::R`](R) reader structure"] +impl crate::Readable for IOCR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr0::W`](W) writer structure"] impl crate::Writable for IOCR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port15/iocr4.rs b/src/port15/iocr4.rs index a9ad0c19..5e884ec2 100644 --- a/src/port15/iocr4.rs +++ b/src/port15/iocr4.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] -pub type PC4_R = crate::FieldReader; +pub type PC4_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC4_A { + type Ux = u8; +} impl PC4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC4_A::VALUE1), 1 => Some(PC4_A::VALUE2), @@ -109,193 +80,197 @@ impl PC4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC4_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC4_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC4_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC4_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC4_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC4_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC4_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC4_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC4_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC4_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC4_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC4_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC4_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC4_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC4_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC4_A::VALUE18 } } #[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] -pub type PC4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC4_A, 5, O>; -impl<'a, const O: u8> PC4_W<'a, O> { +pub type PC4_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC4_A>; +impl<'a, REG> PC4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE18) } } #[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] -pub type PC5_R = crate::FieldReader; +pub type PC5_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC5_A { + type Ux = u8; +} impl PC5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC5_A::VALUE1), 1 => Some(PC5_A::VALUE2), @@ -369,193 +347,197 @@ impl PC5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC5_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC5_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC5_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC5_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC5_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC5_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC5_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC5_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC5_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC5_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC5_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC5_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC5_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC5_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC5_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC5_A::VALUE18 } } #[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] -pub type PC5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC5_A, 5, O>; -impl<'a, const O: u8> PC5_W<'a, O> { +pub type PC5_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC5_A>; +impl<'a, REG> PC5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE18) } } #[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] -pub type PC6_R = crate::FieldReader; +pub type PC6_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC6_A { + type Ux = u8; +} impl PC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC6_A::VALUE1), 1 => Some(PC6_A::VALUE2), @@ -629,193 +614,197 @@ impl PC6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC6_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC6_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC6_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC6_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC6_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC6_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC6_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC6_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC6_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC6_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC6_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC6_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC6_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC6_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC6_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC6_A::VALUE18 } } #[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] -pub type PC6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC6_A, 5, O>; -impl<'a, const O: u8> PC6_W<'a, O> { +pub type PC6_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC6_A>; +impl<'a, REG> PC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE18) } } #[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] -pub type PC7_R = crate::FieldReader; +pub type PC7_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC7_A { + type Ux = u8; +} impl PC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC7_A::VALUE1), 1 => Some(PC7_A::VALUE2), @@ -889,188 +881,192 @@ impl PC7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC7_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC7_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC7_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC7_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC7_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC7_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC7_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC7_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC7_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC7_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC7_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC7_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC7_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC7_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC7_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC7_A::VALUE18 } } #[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] -pub type PC7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC7_A, 5, O>; -impl<'a, const O: u8> PC7_W<'a, O> { +pub type PC7_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC7_A>; +impl<'a, REG> PC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc4(&mut self) -> PC4_W<3> { - PC4_W::new(self) + pub fn pc4(&mut self) -> PC4_W { + PC4_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc5(&mut self) -> PC5_W<11> { - PC5_W::new(self) + pub fn pc5(&mut self) -> PC5_W { + PC5_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc6(&mut self) -> PC6_W<19> { - PC6_W::new(self) + pub fn pc6(&mut self) -> PC6_W { + PC6_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc7(&mut self) -> PC7_W<27> { - PC7_W::new(self) + pub fn pc7(&mut self) -> PC7_W { + PC7_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr4::R`](R) reader structure"] +impl crate::Readable for IOCR4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr4::W`](W) writer structure"] impl crate::Writable for IOCR4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port15/iocr8.rs b/src/port15/iocr8.rs index 6371402a..b5d9d02a 100644 --- a/src/port15/iocr8.rs +++ b/src/port15/iocr8.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] -pub type PC8_R = crate::FieldReader; +pub type PC8_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC8_A { + type Ux = u8; +} impl PC8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC8_A::VALUE1), 1 => Some(PC8_A::VALUE2), @@ -109,193 +80,197 @@ impl PC8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC8_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC8_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC8_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC8_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC8_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC8_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC8_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC8_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC8_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC8_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC8_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC8_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC8_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC8_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC8_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC8_A::VALUE18 } } #[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] -pub type PC8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC8_A, 5, O>; -impl<'a, const O: u8> PC8_W<'a, O> { +pub type PC8_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC8_A>; +impl<'a, REG> PC8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE18) } } #[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] -pub type PC9_R = crate::FieldReader; +pub type PC9_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC9_A { + type Ux = u8; +} impl PC9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC9_A::VALUE1), 1 => Some(PC9_A::VALUE2), @@ -369,193 +347,197 @@ impl PC9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC9_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC9_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC9_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC9_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC9_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC9_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC9_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC9_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC9_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC9_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC9_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC9_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC9_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC9_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC9_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC9_A::VALUE18 } } #[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] -pub type PC9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC9_A, 5, O>; -impl<'a, const O: u8> PC9_W<'a, O> { +pub type PC9_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC9_A>; +impl<'a, REG> PC9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE18) } } #[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] -pub type PC10_R = crate::FieldReader; +pub type PC10_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC10_A { + type Ux = u8; +} impl PC10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC10_A::VALUE1), 1 => Some(PC10_A::VALUE2), @@ -629,193 +614,197 @@ impl PC10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC10_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC10_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC10_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC10_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC10_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC10_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC10_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC10_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC10_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC10_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC10_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC10_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC10_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC10_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC10_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC10_A::VALUE18 } } #[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] -pub type PC10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC10_A, 5, O>; -impl<'a, const O: u8> PC10_W<'a, O> { +pub type PC10_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC10_A>; +impl<'a, REG> PC10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE18) } } #[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] -pub type PC11_R = crate::FieldReader; +pub type PC11_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC11_A { + type Ux = u8; +} impl PC11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC11_A::VALUE1), 1 => Some(PC11_A::VALUE2), @@ -889,188 +881,192 @@ impl PC11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC11_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC11_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC11_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC11_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC11_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC11_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC11_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC11_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC11_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC11_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC11_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC11_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC11_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC11_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC11_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC11_A::VALUE18 } } #[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] -pub type PC11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC11_A, 5, O>; -impl<'a, const O: u8> PC11_W<'a, O> { +pub type PC11_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC11_A>; +impl<'a, REG> PC11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc8(&mut self) -> PC8_W<3> { - PC8_W::new(self) + pub fn pc8(&mut self) -> PC8_W { + PC8_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc9(&mut self) -> PC9_W<11> { - PC9_W::new(self) + pub fn pc9(&mut self) -> PC9_W { + PC9_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc10(&mut self) -> PC10_W<19> { - PC10_W::new(self) + pub fn pc10(&mut self) -> PC10_W { + PC10_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc11(&mut self) -> PC11_W<27> { - PC11_W::new(self) + pub fn pc11(&mut self) -> PC11_W { + PC11_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr8::R`](R) reader structure"] +impl crate::Readable for IOCR8_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr8::W`](W) writer structure"] impl crate::Writable for IOCR8_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port15/omr.rs b/src/port15/omr.rs index ab99355d..3070ae00 100644 --- a/src/port15/omr.rs +++ b/src/port15/omr.rs @@ -1,296 +1,280 @@ #[doc = "Register `OMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PS0` writer - Port n Set Bit 0"] -pub type PS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1` writer - Port n Set Bit 1"] -pub type PS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2` writer - Port n Set Bit 2"] -pub type PS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS3` writer - Port n Set Bit 3"] -pub type PS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS4` writer - Port n Set Bit 4"] -pub type PS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS5` writer - Port n Set Bit 5"] -pub type PS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS6` writer - Port n Set Bit 6"] -pub type PS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS7` writer - Port n Set Bit 7"] -pub type PS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS8` writer - Port n Set Bit 8"] -pub type PS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS9` writer - Port n Set Bit 9"] -pub type PS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS10` writer - Port n Set Bit 10"] -pub type PS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS11` writer - Port n Set Bit 11"] -pub type PS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS12` writer - Port n Set Bit 12"] -pub type PS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS13` writer - Port n Set Bit 13"] -pub type PS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS14` writer - Port n Set Bit 14"] -pub type PS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS15` writer - Port n Set Bit 15"] -pub type PS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR0` writer - Port n Reset Bit 0"] -pub type PR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR1` writer - Port n Reset Bit 1"] -pub type PR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR2` writer - Port n Reset Bit 2"] -pub type PR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR3` writer - Port n Reset Bit 3"] -pub type PR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR4` writer - Port n Reset Bit 4"] -pub type PR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR5` writer - Port n Reset Bit 5"] -pub type PR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR6` writer - Port n Reset Bit 6"] -pub type PR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR7` writer - Port n Reset Bit 7"] -pub type PR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR8` writer - Port n Reset Bit 8"] -pub type PR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR9` writer - Port n Reset Bit 9"] -pub type PR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR10` writer - Port n Reset Bit 10"] -pub type PR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR11` writer - Port n Reset Bit 11"] -pub type PR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR12` writer - Port n Reset Bit 12"] -pub type PR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR13` writer - Port n Reset Bit 13"] -pub type PR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR14` writer - Port n Reset Bit 14"] -pub type PR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR15` writer - Port n Reset Bit 15"] -pub type PR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR15_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Port n Set Bit 0"] #[inline(always)] #[must_use] - pub fn ps0(&mut self) -> PS0_W<0> { - PS0_W::new(self) + pub fn ps0(&mut self) -> PS0_W { + PS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Set Bit 1"] #[inline(always)] #[must_use] - pub fn ps1(&mut self) -> PS1_W<1> { - PS1_W::new(self) + pub fn ps1(&mut self) -> PS1_W { + PS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Set Bit 2"] #[inline(always)] #[must_use] - pub fn ps2(&mut self) -> PS2_W<2> { - PS2_W::new(self) + pub fn ps2(&mut self) -> PS2_W { + PS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Set Bit 3"] #[inline(always)] #[must_use] - pub fn ps3(&mut self) -> PS3_W<3> { - PS3_W::new(self) + pub fn ps3(&mut self) -> PS3_W { + PS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Set Bit 4"] #[inline(always)] #[must_use] - pub fn ps4(&mut self) -> PS4_W<4> { - PS4_W::new(self) + pub fn ps4(&mut self) -> PS4_W { + PS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Set Bit 5"] #[inline(always)] #[must_use] - pub fn ps5(&mut self) -> PS5_W<5> { - PS5_W::new(self) + pub fn ps5(&mut self) -> PS5_W { + PS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Set Bit 6"] #[inline(always)] #[must_use] - pub fn ps6(&mut self) -> PS6_W<6> { - PS6_W::new(self) + pub fn ps6(&mut self) -> PS6_W { + PS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Set Bit 7"] #[inline(always)] #[must_use] - pub fn ps7(&mut self) -> PS7_W<7> { - PS7_W::new(self) + pub fn ps7(&mut self) -> PS7_W { + PS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Set Bit 8"] #[inline(always)] #[must_use] - pub fn ps8(&mut self) -> PS8_W<8> { - PS8_W::new(self) + pub fn ps8(&mut self) -> PS8_W { + PS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Set Bit 9"] #[inline(always)] #[must_use] - pub fn ps9(&mut self) -> PS9_W<9> { - PS9_W::new(self) + pub fn ps9(&mut self) -> PS9_W { + PS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Set Bit 10"] #[inline(always)] #[must_use] - pub fn ps10(&mut self) -> PS10_W<10> { - PS10_W::new(self) + pub fn ps10(&mut self) -> PS10_W { + PS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Set Bit 11"] #[inline(always)] #[must_use] - pub fn ps11(&mut self) -> PS11_W<11> { - PS11_W::new(self) + pub fn ps11(&mut self) -> PS11_W { + PS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Set Bit 12"] #[inline(always)] #[must_use] - pub fn ps12(&mut self) -> PS12_W<12> { - PS12_W::new(self) + pub fn ps12(&mut self) -> PS12_W { + PS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Set Bit 13"] #[inline(always)] #[must_use] - pub fn ps13(&mut self) -> PS13_W<13> { - PS13_W::new(self) + pub fn ps13(&mut self) -> PS13_W { + PS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Set Bit 14"] #[inline(always)] #[must_use] - pub fn ps14(&mut self) -> PS14_W<14> { - PS14_W::new(self) + pub fn ps14(&mut self) -> PS14_W { + PS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Set Bit 15"] #[inline(always)] #[must_use] - pub fn ps15(&mut self) -> PS15_W<15> { - PS15_W::new(self) + pub fn ps15(&mut self) -> PS15_W { + PS15_W::new(self, 15) } #[doc = "Bit 16 - Port n Reset Bit 0"] #[inline(always)] #[must_use] - pub fn pr0(&mut self) -> PR0_W<16> { - PR0_W::new(self) + pub fn pr0(&mut self) -> PR0_W { + PR0_W::new(self, 16) } #[doc = "Bit 17 - Port n Reset Bit 1"] #[inline(always)] #[must_use] - pub fn pr1(&mut self) -> PR1_W<17> { - PR1_W::new(self) + pub fn pr1(&mut self) -> PR1_W { + PR1_W::new(self, 17) } #[doc = "Bit 18 - Port n Reset Bit 2"] #[inline(always)] #[must_use] - pub fn pr2(&mut self) -> PR2_W<18> { - PR2_W::new(self) + pub fn pr2(&mut self) -> PR2_W { + PR2_W::new(self, 18) } #[doc = "Bit 19 - Port n Reset Bit 3"] #[inline(always)] #[must_use] - pub fn pr3(&mut self) -> PR3_W<19> { - PR3_W::new(self) + pub fn pr3(&mut self) -> PR3_W { + PR3_W::new(self, 19) } #[doc = "Bit 20 - Port n Reset Bit 4"] #[inline(always)] #[must_use] - pub fn pr4(&mut self) -> PR4_W<20> { - PR4_W::new(self) + pub fn pr4(&mut self) -> PR4_W { + PR4_W::new(self, 20) } #[doc = "Bit 21 - Port n Reset Bit 5"] #[inline(always)] #[must_use] - pub fn pr5(&mut self) -> PR5_W<21> { - PR5_W::new(self) + pub fn pr5(&mut self) -> PR5_W { + PR5_W::new(self, 21) } #[doc = "Bit 22 - Port n Reset Bit 6"] #[inline(always)] #[must_use] - pub fn pr6(&mut self) -> PR6_W<22> { - PR6_W::new(self) + pub fn pr6(&mut self) -> PR6_W { + PR6_W::new(self, 22) } #[doc = "Bit 23 - Port n Reset Bit 7"] #[inline(always)] #[must_use] - pub fn pr7(&mut self) -> PR7_W<23> { - PR7_W::new(self) + pub fn pr7(&mut self) -> PR7_W { + PR7_W::new(self, 23) } #[doc = "Bit 24 - Port n Reset Bit 8"] #[inline(always)] #[must_use] - pub fn pr8(&mut self) -> PR8_W<24> { - PR8_W::new(self) + pub fn pr8(&mut self) -> PR8_W { + PR8_W::new(self, 24) } #[doc = "Bit 25 - Port n Reset Bit 9"] #[inline(always)] #[must_use] - pub fn pr9(&mut self) -> PR9_W<25> { - PR9_W::new(self) + pub fn pr9(&mut self) -> PR9_W { + PR9_W::new(self, 25) } #[doc = "Bit 26 - Port n Reset Bit 10"] #[inline(always)] #[must_use] - pub fn pr10(&mut self) -> PR10_W<26> { - PR10_W::new(self) + pub fn pr10(&mut self) -> PR10_W { + PR10_W::new(self, 26) } #[doc = "Bit 27 - Port n Reset Bit 11"] #[inline(always)] #[must_use] - pub fn pr11(&mut self) -> PR11_W<27> { - PR11_W::new(self) + pub fn pr11(&mut self) -> PR11_W { + PR11_W::new(self, 27) } #[doc = "Bit 28 - Port n Reset Bit 12"] #[inline(always)] #[must_use] - pub fn pr12(&mut self) -> PR12_W<28> { - PR12_W::new(self) + pub fn pr12(&mut self) -> PR12_W { + PR12_W::new(self, 28) } #[doc = "Bit 29 - Port n Reset Bit 13"] #[inline(always)] #[must_use] - pub fn pr13(&mut self) -> PR13_W<29> { - PR13_W::new(self) + pub fn pr13(&mut self) -> PR13_W { + PR13_W::new(self, 29) } #[doc = "Bit 30 - Port n Reset Bit 14"] #[inline(always)] #[must_use] - pub fn pr14(&mut self) -> PR14_W<30> { - PR14_W::new(self) + pub fn pr14(&mut self) -> PR14_W { + PR14_W::new(self, 30) } #[doc = "Bit 31 - Port n Reset Bit 15"] #[inline(always)] #[must_use] - pub fn pr15(&mut self) -> PR15_W<31> { - PR15_W::new(self) + pub fn pr15(&mut self) -> PR15_W { + PR15_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OMR_SPEC; impl crate::RegisterSpec for OMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`omr::W`](W) writer structure"] impl crate::Writable for OMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port15/out.rs b/src/port15/out.rs index a7d42f1f..02c97d30 100644 --- a/src/port15/out.rs +++ b/src/port15/out.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `P0` reader - Port n Output Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 } } #[doc = "Field `P0` writer - Port n Output Bit 0"] -pub type P0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P0_A, O>; -impl<'a, const O: u8> P0_W<'a, O> { +pub type P0_W<'a, REG> = crate::BitWriter<'a, REG, P0_A>; +impl<'a, REG> P0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P0_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 } } #[doc = "Field `P1` writer - Port n Output Bit 1"] -pub type P1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P1_A, O>; -impl<'a, const O: u8> P1_W<'a, O> { +pub type P1_W<'a, REG> = crate::BitWriter<'a, REG, P1_A>; +impl<'a, REG> P1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P1_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 } } #[doc = "Field `P2` writer - Port n Output Bit 2"] -pub type P2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P2_A, O>; -impl<'a, const O: u8> P2_W<'a, O> { +pub type P2_W<'a, REG> = crate::BitWriter<'a, REG, P2_A>; +impl<'a, REG> P2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P2_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 } } #[doc = "Field `P3` writer - Port n Output Bit 3"] -pub type P3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P3_A, O>; -impl<'a, const O: u8> P3_W<'a, O> { +pub type P3_W<'a, REG> = crate::BitWriter<'a, REG, P3_A>; +impl<'a, REG> P3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P3_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 } } #[doc = "Field `P4` writer - Port n Output Bit 4"] -pub type P4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P4_A, O>; -impl<'a, const O: u8> P4_W<'a, O> { +pub type P4_W<'a, REG> = crate::BitWriter<'a, REG, P4_A>; +impl<'a, REG> P4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P4_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 } } #[doc = "Field `P5` writer - Port n Output Bit 5"] -pub type P5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P5_A, O>; -impl<'a, const O: u8> P5_W<'a, O> { +pub type P5_W<'a, REG> = crate::BitWriter<'a, REG, P5_A>; +impl<'a, REG> P5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P5_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 } } #[doc = "Field `P6` writer - Port n Output Bit 6"] -pub type P6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P6_A, O>; -impl<'a, const O: u8> P6_W<'a, O> { +pub type P6_W<'a, REG> = crate::BitWriter<'a, REG, P6_A>; +impl<'a, REG> P6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P6_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 } } #[doc = "Field `P7` writer - Port n Output Bit 7"] -pub type P7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P7_A, O>; -impl<'a, const O: u8> P7_W<'a, O> { +pub type P7_W<'a, REG> = crate::BitWriter<'a, REG, P7_A>; +impl<'a, REG> P7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P7_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 } } #[doc = "Field `P8` writer - Port n Output Bit 8"] -pub type P8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P8_A, O>; -impl<'a, const O: u8> P8_W<'a, O> { +pub type P8_W<'a, REG> = crate::BitWriter<'a, REG, P8_A>; +impl<'a, REG> P8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P8_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 } } #[doc = "Field `P9` writer - Port n Output Bit 9"] -pub type P9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P9_A, O>; -impl<'a, const O: u8> P9_W<'a, O> { +pub type P9_W<'a, REG> = crate::BitWriter<'a, REG, P9_A>; +impl<'a, REG> P9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P9_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 } } #[doc = "Field `P10` writer - Port n Output Bit 10"] -pub type P10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P10_A, O>; -impl<'a, const O: u8> P10_W<'a, O> { +pub type P10_W<'a, REG> = crate::BitWriter<'a, REG, P10_A>; +impl<'a, REG> P10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P10_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 } } #[doc = "Field `P11` writer - Port n Output Bit 11"] -pub type P11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P11_A, O>; -impl<'a, const O: u8> P11_W<'a, O> { +pub type P11_W<'a, REG> = crate::BitWriter<'a, REG, P11_A>; +impl<'a, REG> P11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P11_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 } } #[doc = "Field `P12` writer - Port n Output Bit 12"] -pub type P12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P12_A, O>; -impl<'a, const O: u8> P12_W<'a, O> { +pub type P12_W<'a, REG> = crate::BitWriter<'a, REG, P12_A>; +impl<'a, REG> P12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P12_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 } } #[doc = "Field `P13` writer - Port n Output Bit 13"] -pub type P13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P13_A, O>; -impl<'a, const O: u8> P13_W<'a, O> { +pub type P13_W<'a, REG> = crate::BitWriter<'a, REG, P13_A>; +impl<'a, REG> P13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P13_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 } } #[doc = "Field `P14` writer - Port n Output Bit 14"] -pub type P14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P14_A, O>; -impl<'a, const O: u8> P14_W<'a, O> { +pub type P14_W<'a, REG> = crate::BitWriter<'a, REG, P14_A>; +impl<'a, REG> P14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P14_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 } } #[doc = "Field `P15` writer - Port n Output Bit 15"] -pub type P15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P15_A, O>; -impl<'a, const O: u8> P15_W<'a, O> { +pub type P15_W<'a, REG> = crate::BitWriter<'a, REG, P15_A>; +impl<'a, REG> P15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P15_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Output Bit 0"] #[inline(always)] #[must_use] - pub fn p0(&mut self) -> P0_W<0> { - P0_W::new(self) + pub fn p0(&mut self) -> P0_W { + P0_W::new(self, 0) } #[doc = "Bit 1 - Port n Output Bit 1"] #[inline(always)] #[must_use] - pub fn p1(&mut self) -> P1_W<1> { - P1_W::new(self) + pub fn p1(&mut self) -> P1_W { + P1_W::new(self, 1) } #[doc = "Bit 2 - Port n Output Bit 2"] #[inline(always)] #[must_use] - pub fn p2(&mut self) -> P2_W<2> { - P2_W::new(self) + pub fn p2(&mut self) -> P2_W { + P2_W::new(self, 2) } #[doc = "Bit 3 - Port n Output Bit 3"] #[inline(always)] #[must_use] - pub fn p3(&mut self) -> P3_W<3> { - P3_W::new(self) + pub fn p3(&mut self) -> P3_W { + P3_W::new(self, 3) } #[doc = "Bit 4 - Port n Output Bit 4"] #[inline(always)] #[must_use] - pub fn p4(&mut self) -> P4_W<4> { - P4_W::new(self) + pub fn p4(&mut self) -> P4_W { + P4_W::new(self, 4) } #[doc = "Bit 5 - Port n Output Bit 5"] #[inline(always)] #[must_use] - pub fn p5(&mut self) -> P5_W<5> { - P5_W::new(self) + pub fn p5(&mut self) -> P5_W { + P5_W::new(self, 5) } #[doc = "Bit 6 - Port n Output Bit 6"] #[inline(always)] #[must_use] - pub fn p6(&mut self) -> P6_W<6> { - P6_W::new(self) + pub fn p6(&mut self) -> P6_W { + P6_W::new(self, 6) } #[doc = "Bit 7 - Port n Output Bit 7"] #[inline(always)] #[must_use] - pub fn p7(&mut self) -> P7_W<7> { - P7_W::new(self) + pub fn p7(&mut self) -> P7_W { + P7_W::new(self, 7) } #[doc = "Bit 8 - Port n Output Bit 8"] #[inline(always)] #[must_use] - pub fn p8(&mut self) -> P8_W<8> { - P8_W::new(self) + pub fn p8(&mut self) -> P8_W { + P8_W::new(self, 8) } #[doc = "Bit 9 - Port n Output Bit 9"] #[inline(always)] #[must_use] - pub fn p9(&mut self) -> P9_W<9> { - P9_W::new(self) + pub fn p9(&mut self) -> P9_W { + P9_W::new(self, 9) } #[doc = "Bit 10 - Port n Output Bit 10"] #[inline(always)] #[must_use] - pub fn p10(&mut self) -> P10_W<10> { - P10_W::new(self) + pub fn p10(&mut self) -> P10_W { + P10_W::new(self, 10) } #[doc = "Bit 11 - Port n Output Bit 11"] #[inline(always)] #[must_use] - pub fn p11(&mut self) -> P11_W<11> { - P11_W::new(self) + pub fn p11(&mut self) -> P11_W { + P11_W::new(self, 11) } #[doc = "Bit 12 - Port n Output Bit 12"] #[inline(always)] #[must_use] - pub fn p12(&mut self) -> P12_W<12> { - P12_W::new(self) + pub fn p12(&mut self) -> P12_W { + P12_W::new(self, 12) } #[doc = "Bit 13 - Port n Output Bit 13"] #[inline(always)] #[must_use] - pub fn p13(&mut self) -> P13_W<13> { - P13_W::new(self) + pub fn p13(&mut self) -> P13_W { + P13_W::new(self, 13) } #[doc = "Bit 14 - Port n Output Bit 14"] #[inline(always)] #[must_use] - pub fn p14(&mut self) -> P14_W<14> { - P14_W::new(self) + pub fn p14(&mut self) -> P14_W { + P14_W::new(self, 14) } #[doc = "Bit 15 - Port n Output Bit 15"] #[inline(always)] #[must_use] - pub fn p15(&mut self) -> P15_W<15> { - P15_W::new(self) + pub fn p15(&mut self) -> P15_W { + P15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`out::R`](R) reader structure"] +impl crate::Readable for OUT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`out::W`](W) writer structure"] impl crate::Writable for OUT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port15/pdisc.rs b/src/port15/pdisc.rs index 3c40ffa8..e378f6c5 100644 --- a/src/port15/pdisc.rs +++ b/src/port15/pdisc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] pub type PDIS0_R = crate::BitReader; #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PDIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS0_A { + pub const fn variant(&self) -> PDIS0_A { match self.bits { false => PDIS0_A::VALUE1, true => PDIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS0_A::VALUE2 } } #[doc = "Field `PDIS0` writer - Pad Disable for Port n Pin 0"] -pub type PDIS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS0_A, O>; -impl<'a, const O: u8> PDIS0_W<'a, O> { +pub type PDIS0_W<'a, REG> = crate::BitWriter<'a, REG, PDIS0_A>; +impl<'a, REG> PDIS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS0_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PDIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS1_A { + pub const fn variant(&self) -> PDIS1_A { match self.bits { false => PDIS1_A::VALUE1, true => PDIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS1_A::VALUE2 } } #[doc = "Field `PDIS1` writer - Pad Disable for Port n Pin 1"] -pub type PDIS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS1_A, O>; -impl<'a, const O: u8> PDIS1_W<'a, O> { +pub type PDIS1_W<'a, REG> = crate::BitWriter<'a, REG, PDIS1_A>; +impl<'a, REG> PDIS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS1_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PDIS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS2_A { + pub const fn variant(&self) -> PDIS2_A { match self.bits { false => PDIS2_A::VALUE1, true => PDIS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS2_A::VALUE2 } } #[doc = "Field `PDIS2` writer - Pad Disable for Port n Pin 2"] -pub type PDIS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS2_A, O>; -impl<'a, const O: u8> PDIS2_W<'a, O> { +pub type PDIS2_W<'a, REG> = crate::BitWriter<'a, REG, PDIS2_A>; +impl<'a, REG> PDIS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS2_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PDIS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS3_A { + pub const fn variant(&self) -> PDIS3_A { match self.bits { false => PDIS3_A::VALUE1, true => PDIS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS3_A::VALUE2 } } #[doc = "Field `PDIS3` writer - Pad Disable for Port n Pin 3"] -pub type PDIS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS3_A, O>; -impl<'a, const O: u8> PDIS3_W<'a, O> { +pub type PDIS3_W<'a, REG> = crate::BitWriter<'a, REG, PDIS3_A>; +impl<'a, REG> PDIS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS3_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PDIS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS4_A { + pub const fn variant(&self) -> PDIS4_A { match self.bits { false => PDIS4_A::VALUE1, true => PDIS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS4_A::VALUE2 } } #[doc = "Field `PDIS4` writer - Pad Disable for Port n Pin 4"] -pub type PDIS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS4_A, O>; -impl<'a, const O: u8> PDIS4_W<'a, O> { +pub type PDIS4_W<'a, REG> = crate::BitWriter<'a, REG, PDIS4_A>; +impl<'a, REG> PDIS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS4_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PDIS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS5_A { + pub const fn variant(&self) -> PDIS5_A { match self.bits { false => PDIS5_A::VALUE1, true => PDIS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS5_A::VALUE2 } } #[doc = "Field `PDIS5` writer - Pad Disable for Port n Pin 5"] -pub type PDIS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS5_A, O>; -impl<'a, const O: u8> PDIS5_W<'a, O> { +pub type PDIS5_W<'a, REG> = crate::BitWriter<'a, REG, PDIS5_A>; +impl<'a, REG> PDIS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS5_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PDIS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS6_A { + pub const fn variant(&self) -> PDIS6_A { match self.bits { false => PDIS6_A::VALUE1, true => PDIS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS6_A::VALUE2 } } #[doc = "Field `PDIS6` writer - Pad Disable for Port n Pin 6"] -pub type PDIS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS6_A, O>; -impl<'a, const O: u8> PDIS6_W<'a, O> { +pub type PDIS6_W<'a, REG> = crate::BitWriter<'a, REG, PDIS6_A>; +impl<'a, REG> PDIS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS6_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PDIS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS7_A { + pub const fn variant(&self) -> PDIS7_A { match self.bits { false => PDIS7_A::VALUE1, true => PDIS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS7_A::VALUE2 } } #[doc = "Field `PDIS7` writer - Pad Disable for Port n Pin 7"] -pub type PDIS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS7_A, O>; -impl<'a, const O: u8> PDIS7_W<'a, O> { +pub type PDIS7_W<'a, REG> = crate::BitWriter<'a, REG, PDIS7_A>; +impl<'a, REG> PDIS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS7_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PDIS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS8_A { + pub const fn variant(&self) -> PDIS8_A { match self.bits { false => PDIS8_A::VALUE1, true => PDIS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS8_A::VALUE2 } } #[doc = "Field `PDIS8` writer - Pad Disable for Port n Pin 8"] -pub type PDIS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS8_A, O>; -impl<'a, const O: u8> PDIS8_W<'a, O> { +pub type PDIS8_W<'a, REG> = crate::BitWriter<'a, REG, PDIS8_A>; +impl<'a, REG> PDIS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS8_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PDIS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS9_A { + pub const fn variant(&self) -> PDIS9_A { match self.bits { false => PDIS9_A::VALUE1, true => PDIS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS9_A::VALUE2 } } #[doc = "Field `PDIS9` writer - Pad Disable for Port n Pin 9"] -pub type PDIS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS9_A, O>; -impl<'a, const O: u8> PDIS9_W<'a, O> { +pub type PDIS9_W<'a, REG> = crate::BitWriter<'a, REG, PDIS9_A>; +impl<'a, REG> PDIS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS9_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PDIS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS10_A { + pub const fn variant(&self) -> PDIS10_A { match self.bits { false => PDIS10_A::VALUE1, true => PDIS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS10_A::VALUE2 } } #[doc = "Field `PDIS10` writer - Pad Disable for Port n Pin 10"] -pub type PDIS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS10_A, O>; -impl<'a, const O: u8> PDIS10_W<'a, O> { +pub type PDIS10_W<'a, REG> = crate::BitWriter<'a, REG, PDIS10_A>; +impl<'a, REG> PDIS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS10_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PDIS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS11_A { + pub const fn variant(&self) -> PDIS11_A { match self.bits { false => PDIS11_A::VALUE1, true => PDIS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS11_A::VALUE2 } } #[doc = "Field `PDIS11` writer - Pad Disable for Port n Pin 11"] -pub type PDIS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS11_A, O>; -impl<'a, const O: u8> PDIS11_W<'a, O> { +pub type PDIS11_W<'a, REG> = crate::BitWriter<'a, REG, PDIS11_A>; +impl<'a, REG> PDIS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS11_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PDIS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS12_A { + pub const fn variant(&self) -> PDIS12_A { match self.bits { false => PDIS12_A::VALUE1, true => PDIS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS12_A::VALUE2 } } #[doc = "Field `PDIS12` writer - Pad Disable for Port n Pin 12"] -pub type PDIS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS12_A, O>; -impl<'a, const O: u8> PDIS12_W<'a, O> { +pub type PDIS12_W<'a, REG> = crate::BitWriter<'a, REG, PDIS12_A>; +impl<'a, REG> PDIS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS12_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PDIS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS13_A { + pub const fn variant(&self) -> PDIS13_A { match self.bits { false => PDIS13_A::VALUE1, true => PDIS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS13_A::VALUE2 } } #[doc = "Field `PDIS13` writer - Pad Disable for Port n Pin 13"] -pub type PDIS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS13_A, O>; -impl<'a, const O: u8> PDIS13_W<'a, O> { +pub type PDIS13_W<'a, REG> = crate::BitWriter<'a, REG, PDIS13_A>; +impl<'a, REG> PDIS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS13_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PDIS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS14_A { + pub const fn variant(&self) -> PDIS14_A { match self.bits { false => PDIS14_A::VALUE1, true => PDIS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS14_A::VALUE2 } } #[doc = "Field `PDIS14` writer - Pad Disable for Port n Pin 14"] -pub type PDIS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS14_A, O>; -impl<'a, const O: u8> PDIS14_W<'a, O> { +pub type PDIS14_W<'a, REG> = crate::BitWriter<'a, REG, PDIS14_A>; +impl<'a, REG> PDIS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS14_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PDIS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS15_A { + pub const fn variant(&self) -> PDIS15_A { match self.bits { false => PDIS15_A::VALUE1, true => PDIS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS15_A::VALUE2 } } #[doc = "Field `PDIS15` writer - Pad Disable for Port n Pin 15"] -pub type PDIS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PDISC_SPEC, PDIS15_A, O>; -impl<'a, const O: u8> PDIS15_W<'a, O> { +pub type PDIS15_W<'a, REG> = crate::BitWriter<'a, REG, PDIS15_A>; +impl<'a, REG> PDIS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital Pad input is enabled. Analog and digital input path active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDIS15_A::VALUE1) } #[doc = "Digital Pad input is disabled. Analog input path active. (default)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDIS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Pad Disable for Port n Pin 0"] #[inline(always)] #[must_use] - pub fn pdis0(&mut self) -> PDIS0_W<0> { - PDIS0_W::new(self) + pub fn pdis0(&mut self) -> PDIS0_W { + PDIS0_W::new(self, 0) } #[doc = "Bit 1 - Pad Disable for Port n Pin 1"] #[inline(always)] #[must_use] - pub fn pdis1(&mut self) -> PDIS1_W<1> { - PDIS1_W::new(self) + pub fn pdis1(&mut self) -> PDIS1_W { + PDIS1_W::new(self, 1) } #[doc = "Bit 2 - Pad Disable for Port n Pin 2"] #[inline(always)] #[must_use] - pub fn pdis2(&mut self) -> PDIS2_W<2> { - PDIS2_W::new(self) + pub fn pdis2(&mut self) -> PDIS2_W { + PDIS2_W::new(self, 2) } #[doc = "Bit 3 - Pad Disable for Port n Pin 3"] #[inline(always)] #[must_use] - pub fn pdis3(&mut self) -> PDIS3_W<3> { - PDIS3_W::new(self) + pub fn pdis3(&mut self) -> PDIS3_W { + PDIS3_W::new(self, 3) } #[doc = "Bit 4 - Pad Disable for Port n Pin 4"] #[inline(always)] #[must_use] - pub fn pdis4(&mut self) -> PDIS4_W<4> { - PDIS4_W::new(self) + pub fn pdis4(&mut self) -> PDIS4_W { + PDIS4_W::new(self, 4) } #[doc = "Bit 5 - Pad Disable for Port n Pin 5"] #[inline(always)] #[must_use] - pub fn pdis5(&mut self) -> PDIS5_W<5> { - PDIS5_W::new(self) + pub fn pdis5(&mut self) -> PDIS5_W { + PDIS5_W::new(self, 5) } #[doc = "Bit 6 - Pad Disable for Port n Pin 6"] #[inline(always)] #[must_use] - pub fn pdis6(&mut self) -> PDIS6_W<6> { - PDIS6_W::new(self) + pub fn pdis6(&mut self) -> PDIS6_W { + PDIS6_W::new(self, 6) } #[doc = "Bit 7 - Pad Disable for Port n Pin 7"] #[inline(always)] #[must_use] - pub fn pdis7(&mut self) -> PDIS7_W<7> { - PDIS7_W::new(self) + pub fn pdis7(&mut self) -> PDIS7_W { + PDIS7_W::new(self, 7) } #[doc = "Bit 8 - Pad Disable for Port n Pin 8"] #[inline(always)] #[must_use] - pub fn pdis8(&mut self) -> PDIS8_W<8> { - PDIS8_W::new(self) + pub fn pdis8(&mut self) -> PDIS8_W { + PDIS8_W::new(self, 8) } #[doc = "Bit 9 - Pad Disable for Port n Pin 9"] #[inline(always)] #[must_use] - pub fn pdis9(&mut self) -> PDIS9_W<9> { - PDIS9_W::new(self) + pub fn pdis9(&mut self) -> PDIS9_W { + PDIS9_W::new(self, 9) } #[doc = "Bit 10 - Pad Disable for Port n Pin 10"] #[inline(always)] #[must_use] - pub fn pdis10(&mut self) -> PDIS10_W<10> { - PDIS10_W::new(self) + pub fn pdis10(&mut self) -> PDIS10_W { + PDIS10_W::new(self, 10) } #[doc = "Bit 11 - Pad Disable for Port n Pin 11"] #[inline(always)] #[must_use] - pub fn pdis11(&mut self) -> PDIS11_W<11> { - PDIS11_W::new(self) + pub fn pdis11(&mut self) -> PDIS11_W { + PDIS11_W::new(self, 11) } #[doc = "Bit 12 - Pad Disable for Port n Pin 12"] #[inline(always)] #[must_use] - pub fn pdis12(&mut self) -> PDIS12_W<12> { - PDIS12_W::new(self) + pub fn pdis12(&mut self) -> PDIS12_W { + PDIS12_W::new(self, 12) } #[doc = "Bit 13 - Pad Disable for Port n Pin 13"] #[inline(always)] #[must_use] - pub fn pdis13(&mut self) -> PDIS13_W<13> { - PDIS13_W::new(self) + pub fn pdis13(&mut self) -> PDIS13_W { + PDIS13_W::new(self, 13) } #[doc = "Bit 14 - Pad Disable for Port n Pin 14"] #[inline(always)] #[must_use] - pub fn pdis14(&mut self) -> PDIS14_W<14> { - PDIS14_W::new(self) + pub fn pdis14(&mut self) -> PDIS14_W { + PDIS14_W::new(self, 14) } #[doc = "Bit 15 - Pad Disable for Port n Pin 15"] #[inline(always)] #[must_use] - pub fn pdis15(&mut self) -> PDIS15_W<15> { - PDIS15_W::new(self) + pub fn pdis15(&mut self) -> PDIS15_W { + PDIS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdisc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdisc::R`](R) reader structure"] +impl crate::Readable for PDISC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdisc::W`](W) writer structure"] impl crate::Writable for PDISC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port15/pps.rs b/src/port15/pps.rs index b8a62dee..767e481d 100644 --- a/src/port15/pps.rs +++ b/src/port15/pps.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] pub type PPS0_R = crate::BitReader; #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PPS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS0_A { + pub const fn variant(&self) -> PPS0_A { match self.bits { false => PPS0_A::VALUE1, true => PPS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS0_A::VALUE2 } } #[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] -pub type PPS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS0_A, O>; -impl<'a, const O: u8> PPS0_W<'a, O> { +pub type PPS0_W<'a, REG> = crate::BitWriter<'a, REG, PPS0_A>; +impl<'a, REG> PPS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PPS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS1_A { + pub const fn variant(&self) -> PPS1_A { match self.bits { false => PPS1_A::VALUE1, true => PPS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS1_A::VALUE2 } } #[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] -pub type PPS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS1_A, O>; -impl<'a, const O: u8> PPS1_W<'a, O> { +pub type PPS1_W<'a, REG> = crate::BitWriter<'a, REG, PPS1_A>; +impl<'a, REG> PPS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PPS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS2_A { + pub const fn variant(&self) -> PPS2_A { match self.bits { false => PPS2_A::VALUE1, true => PPS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS2_A::VALUE2 } } #[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] -pub type PPS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS2_A, O>; -impl<'a, const O: u8> PPS2_W<'a, O> { +pub type PPS2_W<'a, REG> = crate::BitWriter<'a, REG, PPS2_A>; +impl<'a, REG> PPS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PPS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS3_A { + pub const fn variant(&self) -> PPS3_A { match self.bits { false => PPS3_A::VALUE1, true => PPS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS3_A::VALUE2 } } #[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] -pub type PPS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS3_A, O>; -impl<'a, const O: u8> PPS3_W<'a, O> { +pub type PPS3_W<'a, REG> = crate::BitWriter<'a, REG, PPS3_A>; +impl<'a, REG> PPS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PPS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS4_A { + pub const fn variant(&self) -> PPS4_A { match self.bits { false => PPS4_A::VALUE1, true => PPS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS4_A::VALUE2 } } #[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] -pub type PPS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS4_A, O>; -impl<'a, const O: u8> PPS4_W<'a, O> { +pub type PPS4_W<'a, REG> = crate::BitWriter<'a, REG, PPS4_A>; +impl<'a, REG> PPS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PPS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS5_A { + pub const fn variant(&self) -> PPS5_A { match self.bits { false => PPS5_A::VALUE1, true => PPS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS5_A::VALUE2 } } #[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] -pub type PPS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS5_A, O>; -impl<'a, const O: u8> PPS5_W<'a, O> { +pub type PPS5_W<'a, REG> = crate::BitWriter<'a, REG, PPS5_A>; +impl<'a, REG> PPS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS6_A { + pub const fn variant(&self) -> PPS6_A { match self.bits { false => PPS6_A::VALUE1, true => PPS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS6_A::VALUE2 } } #[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] -pub type PPS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS6_A, O>; -impl<'a, const O: u8> PPS6_W<'a, O> { +pub type PPS6_W<'a, REG> = crate::BitWriter<'a, REG, PPS6_A>; +impl<'a, REG> PPS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PPS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS7_A { + pub const fn variant(&self) -> PPS7_A { match self.bits { false => PPS7_A::VALUE1, true => PPS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS7_A::VALUE2 } } #[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] -pub type PPS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS7_A, O>; -impl<'a, const O: u8> PPS7_W<'a, O> { +pub type PPS7_W<'a, REG> = crate::BitWriter<'a, REG, PPS7_A>; +impl<'a, REG> PPS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PPS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS8_A { + pub const fn variant(&self) -> PPS8_A { match self.bits { false => PPS8_A::VALUE1, true => PPS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS8_A::VALUE2 } } #[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] -pub type PPS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS8_A, O>; -impl<'a, const O: u8> PPS8_W<'a, O> { +pub type PPS8_W<'a, REG> = crate::BitWriter<'a, REG, PPS8_A>; +impl<'a, REG> PPS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PPS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS9_A { + pub const fn variant(&self) -> PPS9_A { match self.bits { false => PPS9_A::VALUE1, true => PPS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS9_A::VALUE2 } } #[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] -pub type PPS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS9_A, O>; -impl<'a, const O: u8> PPS9_W<'a, O> { +pub type PPS9_W<'a, REG> = crate::BitWriter<'a, REG, PPS9_A>; +impl<'a, REG> PPS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PPS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS10_A { + pub const fn variant(&self) -> PPS10_A { match self.bits { false => PPS10_A::VALUE1, true => PPS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS10_A::VALUE2 } } #[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] -pub type PPS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS10_A, O>; -impl<'a, const O: u8> PPS10_W<'a, O> { +pub type PPS10_W<'a, REG> = crate::BitWriter<'a, REG, PPS10_A>; +impl<'a, REG> PPS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PPS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS11_A { + pub const fn variant(&self) -> PPS11_A { match self.bits { false => PPS11_A::VALUE1, true => PPS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS11_A::VALUE2 } } #[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] -pub type PPS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS11_A, O>; -impl<'a, const O: u8> PPS11_W<'a, O> { +pub type PPS11_W<'a, REG> = crate::BitWriter<'a, REG, PPS11_A>; +impl<'a, REG> PPS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PPS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS12_A { + pub const fn variant(&self) -> PPS12_A { match self.bits { false => PPS12_A::VALUE1, true => PPS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS12_A::VALUE2 } } #[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] -pub type PPS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS12_A, O>; -impl<'a, const O: u8> PPS12_W<'a, O> { +pub type PPS12_W<'a, REG> = crate::BitWriter<'a, REG, PPS12_A>; +impl<'a, REG> PPS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PPS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS13_A { + pub const fn variant(&self) -> PPS13_A { match self.bits { false => PPS13_A::VALUE1, true => PPS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS13_A::VALUE2 } } #[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] -pub type PPS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS13_A, O>; -impl<'a, const O: u8> PPS13_W<'a, O> { +pub type PPS13_W<'a, REG> = crate::BitWriter<'a, REG, PPS13_A>; +impl<'a, REG> PPS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PPS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS14_A { + pub const fn variant(&self) -> PPS14_A { match self.bits { false => PPS14_A::VALUE1, true => PPS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS14_A::VALUE2 } } #[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] -pub type PPS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS14_A, O>; -impl<'a, const O: u8> PPS14_W<'a, O> { +pub type PPS14_W<'a, REG> = crate::BitWriter<'a, REG, PPS14_A>; +impl<'a, REG> PPS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PPS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS15_A { + pub const fn variant(&self) -> PPS15_A { match self.bits { false => PPS15_A::VALUE1, true => PPS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS15_A::VALUE2 } } #[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] -pub type PPS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS15_A, O>; -impl<'a, const O: u8> PPS15_W<'a, O> { +pub type PPS15_W<'a, REG> = crate::BitWriter<'a, REG, PPS15_A>; +impl<'a, REG> PPS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Pin Power Save Bit 0"] #[inline(always)] #[must_use] - pub fn pps0(&mut self) -> PPS0_W<0> { - PPS0_W::new(self) + pub fn pps0(&mut self) -> PPS0_W { + PPS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Pin Power Save Bit 1"] #[inline(always)] #[must_use] - pub fn pps1(&mut self) -> PPS1_W<1> { - PPS1_W::new(self) + pub fn pps1(&mut self) -> PPS1_W { + PPS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Pin Power Save Bit 2"] #[inline(always)] #[must_use] - pub fn pps2(&mut self) -> PPS2_W<2> { - PPS2_W::new(self) + pub fn pps2(&mut self) -> PPS2_W { + PPS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Pin Power Save Bit 3"] #[inline(always)] #[must_use] - pub fn pps3(&mut self) -> PPS3_W<3> { - PPS3_W::new(self) + pub fn pps3(&mut self) -> PPS3_W { + PPS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Pin Power Save Bit 4"] #[inline(always)] #[must_use] - pub fn pps4(&mut self) -> PPS4_W<4> { - PPS4_W::new(self) + pub fn pps4(&mut self) -> PPS4_W { + PPS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Pin Power Save Bit 5"] #[inline(always)] #[must_use] - pub fn pps5(&mut self) -> PPS5_W<5> { - PPS5_W::new(self) + pub fn pps5(&mut self) -> PPS5_W { + PPS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Pin Power Save Bit 6"] #[inline(always)] #[must_use] - pub fn pps6(&mut self) -> PPS6_W<6> { - PPS6_W::new(self) + pub fn pps6(&mut self) -> PPS6_W { + PPS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Pin Power Save Bit 7"] #[inline(always)] #[must_use] - pub fn pps7(&mut self) -> PPS7_W<7> { - PPS7_W::new(self) + pub fn pps7(&mut self) -> PPS7_W { + PPS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Pin Power Save Bit 8"] #[inline(always)] #[must_use] - pub fn pps8(&mut self) -> PPS8_W<8> { - PPS8_W::new(self) + pub fn pps8(&mut self) -> PPS8_W { + PPS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Pin Power Save Bit 9"] #[inline(always)] #[must_use] - pub fn pps9(&mut self) -> PPS9_W<9> { - PPS9_W::new(self) + pub fn pps9(&mut self) -> PPS9_W { + PPS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Pin Power Save Bit 10"] #[inline(always)] #[must_use] - pub fn pps10(&mut self) -> PPS10_W<10> { - PPS10_W::new(self) + pub fn pps10(&mut self) -> PPS10_W { + PPS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Pin Power Save Bit 11"] #[inline(always)] #[must_use] - pub fn pps11(&mut self) -> PPS11_W<11> { - PPS11_W::new(self) + pub fn pps11(&mut self) -> PPS11_W { + PPS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Pin Power Save Bit 12"] #[inline(always)] #[must_use] - pub fn pps12(&mut self) -> PPS12_W<12> { - PPS12_W::new(self) + pub fn pps12(&mut self) -> PPS12_W { + PPS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Pin Power Save Bit 13"] #[inline(always)] #[must_use] - pub fn pps13(&mut self) -> PPS13_W<13> { - PPS13_W::new(self) + pub fn pps13(&mut self) -> PPS13_W { + PPS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Pin Power Save Bit 14"] #[inline(always)] #[must_use] - pub fn pps14(&mut self) -> PPS14_W<14> { - PPS14_W::new(self) + pub fn pps14(&mut self) -> PPS14_W { + PPS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Pin Power Save Bit 15"] #[inline(always)] #[must_use] - pub fn pps15(&mut self) -> PPS15_W<15> { - PPS15_W::new(self) + pub fn pps15(&mut self) -> PPS15_W { + PPS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 15 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"] +#[doc = "Port 15 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pps::R`](R) reader structure"] +impl crate::Readable for PPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps::W`](W) writer structure"] impl crate::Writable for PPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2.rs b/src/port2.rs index 996c2f42..69ed69a2 100644 --- a/src/port2.rs +++ b/src/port2.rs @@ -1,81 +1,143 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + out: OUT, + omr: OMR, + _reserved2: [u8; 0x08], + iocr0: IOCR0, + iocr4: IOCR4, + iocr8: IOCR8, + iocr12: IOCR12, + _reserved6: [u8; 0x04], + in_: IN, + _reserved7: [u8; 0x18], + pdr0: PDR0, + pdr1: PDR1, + _reserved9: [u8; 0x18], + pdisc: PDISC, + _reserved10: [u8; 0x0c], + pps: PPS, + hwsel: HWSEL, +} +impl RegisterBlock { #[doc = "0x00 - Port 2 Output Register"] - pub out: OUT, + #[inline(always)] + pub const fn out(&self) -> &OUT { + &self.out + } #[doc = "0x04 - Port 2 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn omr(&self) -> &OMR { + &self.omr + } #[doc = "0x10 - Port 2 Input/Output Control Register 0"] - pub iocr0: IOCR0, + #[inline(always)] + pub const fn iocr0(&self) -> &IOCR0 { + &self.iocr0 + } #[doc = "0x14 - Port 2 Input/Output Control Register 4"] - pub iocr4: IOCR4, + #[inline(always)] + pub const fn iocr4(&self) -> &IOCR4 { + &self.iocr4 + } #[doc = "0x18 - Port 2 Input/Output Control Register 8"] - pub iocr8: IOCR8, + #[inline(always)] + pub const fn iocr8(&self) -> &IOCR8 { + &self.iocr8 + } #[doc = "0x1c - Port 2 Input/Output Control Register 12"] - pub iocr12: IOCR12, - _reserved6: [u8; 0x04], + #[inline(always)] + pub const fn iocr12(&self) -> &IOCR12 { + &self.iocr12 + } #[doc = "0x24 - Port 2 Input Register"] - pub in_: IN, - _reserved7: [u8; 0x18], + #[inline(always)] + pub const fn in_(&self) -> &IN { + &self.in_ + } #[doc = "0x40 - Port 2 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, + #[inline(always)] + pub const fn pdr0(&self) -> &PDR0 { + &self.pdr0 + } #[doc = "0x44 - Port 2 Pad Driver Mode 1 Register"] - pub pdr1: PDR1, - _reserved9: [u8; 0x18], + #[inline(always)] + pub const fn pdr1(&self) -> &PDR1 { + &self.pdr1 + } #[doc = "0x60 - Port 2 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved10: [u8; 0x0c], + #[inline(always)] + pub const fn pdisc(&self) -> &PDISC { + &self.pdisc + } #[doc = "0x70 - Port 2 Pin Power Save Register"] - pub pps: PPS, + #[inline(always)] + pub const fn pps(&self) -> &PPS { + &self.pps + } #[doc = "0x74 - Port 2 Pin Hardware Select Register"] - pub hwsel: HWSEL, + #[inline(always)] + pub const fn hwsel(&self) -> &HWSEL { + &self.hwsel + } } -#[doc = "OUT (rw) register accessor: an alias for `Reg`"] +#[doc = "OUT (rw) register accessor: Port 2 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out`] +module"] pub type OUT = crate::Reg; #[doc = "Port 2 Output Register"] pub mod out; -#[doc = "OMR (w) register accessor: an alias for `Reg`"] +#[doc = "OMR (w) register accessor: Port 2 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@omr`] +module"] pub type OMR = crate::Reg; #[doc = "Port 2 Output Modification Register"] pub mod omr; -#[doc = "IOCR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR0 (rw) register accessor: Port 2 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr0`] +module"] pub type IOCR0 = crate::Reg; #[doc = "Port 2 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "IOCR4 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR4 (rw) register accessor: Port 2 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr4`] +module"] pub type IOCR4 = crate::Reg; #[doc = "Port 2 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "IOCR8 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR8 (rw) register accessor: Port 2 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr8`] +module"] pub type IOCR8 = crate::Reg; #[doc = "Port 2 Input/Output Control Register 8"] pub mod iocr8; -#[doc = "IOCR12 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR12 (rw) register accessor: Port 2 Input/Output Control Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr12::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr12::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr12`] +module"] pub type IOCR12 = crate::Reg; #[doc = "Port 2 Input/Output Control Register 12"] pub mod iocr12; -#[doc = "IN (r) register accessor: an alias for `Reg`"] +#[doc = "IN (r) register accessor: Port 2 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] pub type IN = crate::Reg; #[doc = "Port 2 Input Register"] pub mod in_; -#[doc = "PDR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR0 (rw) register accessor: Port 2 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr0`] +module"] pub type PDR0 = crate::Reg; #[doc = "Port 2 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "PDR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR1 (rw) register accessor: Port 2 Pad Driver Mode 1 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr1`] +module"] pub type PDR1 = crate::Reg; #[doc = "Port 2 Pad Driver Mode 1 Register"] pub mod pdr1; -#[doc = "PDISC (r) register accessor: an alias for `Reg`"] +#[doc = "PDISC (r) register accessor: Port 2 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdisc`] +module"] pub type PDISC = crate::Reg; #[doc = "Port 2 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "PPS (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS (rw) register accessor: Port 2 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps`] +module"] pub type PPS = crate::Reg; #[doc = "Port 2 Pin Power Save Register"] pub mod pps; -#[doc = "HWSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "HWSEL (rw) register accessor: Port 2 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hwsel`] +module"] 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 241633fa..37941995 100644 --- a/src/port2/hwsel.rs +++ b/src/port2/hwsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] -pub type HW0_R = crate::FieldReader; +pub type HW0_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW0_A { + type Ux = u8; +} impl HW0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW0_A::VALUE1), 1 => Some(HW0_A::VALUE2), @@ -64,43 +35,47 @@ impl HW0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW0_A::VALUE3 } } #[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] -pub type HW0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW0_A, 2, O>; -impl<'a, const O: u8> HW0_W<'a, O> { +pub type HW0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW0_A>; +impl<'a, REG> HW0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE3) } } #[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] -pub type HW1_R = crate::FieldReader; +pub type HW1_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 1\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW1_A { + type Ux = u8; +} impl HW1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW1_A::VALUE1), 1 => Some(HW1_A::VALUE2), @@ -129,43 +107,47 @@ impl HW1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW1_A::VALUE3 } } #[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] -pub type HW1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW1_A, 2, O>; -impl<'a, const O: u8> HW1_W<'a, O> { +pub type HW1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW1_A>; +impl<'a, REG> HW1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE3) } } #[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] -pub type HW2_R = crate::FieldReader; +pub type HW2_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW2_A { + type Ux = u8; +} impl HW2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW2_A::VALUE1), 1 => Some(HW2_A::VALUE2), @@ -194,43 +179,47 @@ impl HW2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW2_A::VALUE3 } } #[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] -pub type HW2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW2_A, 2, O>; -impl<'a, const O: u8> HW2_W<'a, O> { +pub type HW2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW2_A>; +impl<'a, REG> HW2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE3) } } #[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] -pub type HW3_R = crate::FieldReader; +pub type HW3_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW3_A { + type Ux = u8; +} impl HW3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW3_A::VALUE1), 1 => Some(HW3_A::VALUE2), @@ -259,43 +251,47 @@ impl HW3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW3_A::VALUE3 } } #[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] -pub type HW3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW3_A, 2, O>; -impl<'a, const O: u8> HW3_W<'a, O> { +pub type HW3_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW3_A>; +impl<'a, REG> HW3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE3) } } #[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] -pub type HW4_R = crate::FieldReader; +pub type HW4_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +309,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW4_A { + type Ux = u8; +} impl HW4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW4_A::VALUE1), 1 => Some(HW4_A::VALUE2), @@ -324,43 +323,47 @@ impl HW4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW4_A::VALUE3 } } #[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] -pub type HW4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW4_A, 2, O>; -impl<'a, const O: u8> HW4_W<'a, O> { +pub type HW4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW4_A>; +impl<'a, REG> HW4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE3) } } #[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] -pub type HW5_R = crate::FieldReader; +pub type HW5_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -378,10 +381,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW5_A { + type Ux = u8; +} impl HW5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW5_A::VALUE1), 1 => Some(HW5_A::VALUE2), @@ -389,43 +395,47 @@ impl HW5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW5_A::VALUE3 } } #[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] -pub type HW5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW5_A, 2, O>; -impl<'a, const O: u8> HW5_W<'a, O> { +pub type HW5_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW5_A>; +impl<'a, REG> HW5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE3) } } #[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] -pub type HW6_R = crate::FieldReader; +pub type HW6_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW6_A { + type Ux = u8; +} impl HW6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW6_A::VALUE1), 1 => Some(HW6_A::VALUE2), @@ -454,43 +467,47 @@ impl HW6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW6_A::VALUE3 } } #[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] -pub type HW6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW6_A, 2, O>; -impl<'a, const O: u8> HW6_W<'a, O> { +pub type HW6_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW6_A>; +impl<'a, REG> HW6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE3) } } #[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] -pub type HW7_R = crate::FieldReader; +pub type HW7_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW7_A { + type Ux = u8; +} impl HW7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW7_A::VALUE1), 1 => Some(HW7_A::VALUE2), @@ -519,43 +539,47 @@ impl HW7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW7_A::VALUE3 } } #[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] -pub type HW7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW7_A, 2, O>; -impl<'a, const O: u8> HW7_W<'a, O> { +pub type HW7_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW7_A>; +impl<'a, REG> HW7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE3) } } #[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] -pub type HW8_R = crate::FieldReader; +pub type HW8_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 8\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -573,10 +597,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW8_A { + type Ux = u8; +} impl HW8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW8_A::VALUE1), 1 => Some(HW8_A::VALUE2), @@ -584,43 +611,47 @@ impl HW8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW8_A::VALUE3 } } #[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] -pub type HW8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW8_A, 2, O>; -impl<'a, const O: u8> HW8_W<'a, O> { +pub type HW8_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW8_A>; +impl<'a, REG> HW8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE3) } } #[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] -pub type HW9_R = crate::FieldReader; +pub type HW9_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 9\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -638,10 +669,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW9_A { + type Ux = u8; +} impl HW9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW9_A::VALUE1), 1 => Some(HW9_A::VALUE2), @@ -649,43 +683,47 @@ impl HW9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW9_A::VALUE3 } } #[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] -pub type HW9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW9_A, 2, O>; -impl<'a, const O: u8> HW9_W<'a, O> { +pub type HW9_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW9_A>; +impl<'a, REG> HW9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE3) } } #[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] -pub type HW10_R = crate::FieldReader; +pub type HW10_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -703,10 +741,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW10_A { + type Ux = u8; +} impl HW10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW10_A::VALUE1), 1 => Some(HW10_A::VALUE2), @@ -714,43 +755,47 @@ impl HW10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW10_A::VALUE3 } } #[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] -pub type HW10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW10_A, 2, O>; -impl<'a, const O: u8> HW10_W<'a, O> { +pub type HW10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW10_A>; +impl<'a, REG> HW10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE3) } } #[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] -pub type HW11_R = crate::FieldReader; +pub type HW11_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -768,10 +813,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW11_A { + type Ux = u8; +} impl HW11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW11_A::VALUE1), 1 => Some(HW11_A::VALUE2), @@ -779,43 +827,47 @@ impl HW11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW11_A::VALUE3 } } #[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] -pub type HW11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW11_A, 2, O>; -impl<'a, const O: u8> HW11_W<'a, O> { +pub type HW11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW11_A>; +impl<'a, REG> HW11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE3) } } #[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] -pub type HW12_R = crate::FieldReader; +pub type HW12_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 12\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -833,10 +885,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW12_A { + type Ux = u8; +} impl HW12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW12_A::VALUE1), 1 => Some(HW12_A::VALUE2), @@ -844,43 +899,47 @@ impl HW12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW12_A::VALUE3 } } #[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] -pub type HW12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW12_A, 2, O>; -impl<'a, const O: u8> HW12_W<'a, O> { +pub type HW12_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW12_A>; +impl<'a, REG> HW12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE3) } } #[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] -pub type HW13_R = crate::FieldReader; +pub type HW13_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 13\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -898,10 +957,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW13_A { + type Ux = u8; +} impl HW13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW13_A::VALUE1), 1 => Some(HW13_A::VALUE2), @@ -909,43 +971,47 @@ impl HW13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW13_A::VALUE3 } } #[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] -pub type HW13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW13_A, 2, O>; -impl<'a, const O: u8> HW13_W<'a, O> { +pub type HW13_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW13_A>; +impl<'a, REG> HW13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE3) } } #[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] -pub type HW14_R = crate::FieldReader; +pub type HW14_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -963,10 +1029,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW14_A { + type Ux = u8; +} impl HW14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW14_A::VALUE1), 1 => Some(HW14_A::VALUE2), @@ -974,43 +1043,47 @@ impl HW14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW14_A::VALUE3 } } #[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] -pub type HW14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW14_A, 2, O>; -impl<'a, const O: u8> HW14_W<'a, O> { +pub type HW14_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW14_A>; +impl<'a, REG> HW14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE3) } } #[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] -pub type HW15_R = crate::FieldReader; +pub type HW15_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1028,10 +1101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW15_A { + type Ux = u8; +} impl HW15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW15_A::VALUE1), 1 => Some(HW15_A::VALUE2), @@ -1039,38 +1115,42 @@ impl HW15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW15_A::VALUE3 } } #[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] -pub type HW15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW15_A, 2, O>; -impl<'a, const O: u8> HW15_W<'a, O> { +pub type HW15_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW15_A>; +impl<'a, REG> HW15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE3) } } @@ -1160,118 +1240,119 @@ impl W { #[doc = "Bits 0:1 - Port n Pin Hardware Select Bit 0"] #[inline(always)] #[must_use] - pub fn hw0(&mut self) -> HW0_W<0> { - HW0_W::new(self) + pub fn hw0(&mut self) -> HW0_W { + HW0_W::new(self, 0) } #[doc = "Bits 2:3 - Port n Pin Hardware Select Bit 1"] #[inline(always)] #[must_use] - pub fn hw1(&mut self) -> HW1_W<2> { - HW1_W::new(self) + pub fn hw1(&mut self) -> HW1_W { + HW1_W::new(self, 2) } #[doc = "Bits 4:5 - Port n Pin Hardware Select Bit 2"] #[inline(always)] #[must_use] - pub fn hw2(&mut self) -> HW2_W<4> { - HW2_W::new(self) + pub fn hw2(&mut self) -> HW2_W { + HW2_W::new(self, 4) } #[doc = "Bits 6:7 - Port n Pin Hardware Select Bit 3"] #[inline(always)] #[must_use] - pub fn hw3(&mut self) -> HW3_W<6> { - HW3_W::new(self) + pub fn hw3(&mut self) -> HW3_W { + HW3_W::new(self, 6) } #[doc = "Bits 8:9 - Port n Pin Hardware Select Bit 4"] #[inline(always)] #[must_use] - pub fn hw4(&mut self) -> HW4_W<8> { - HW4_W::new(self) + pub fn hw4(&mut self) -> HW4_W { + HW4_W::new(self, 8) } #[doc = "Bits 10:11 - Port n Pin Hardware Select Bit 5"] #[inline(always)] #[must_use] - pub fn hw5(&mut self) -> HW5_W<10> { - HW5_W::new(self) + pub fn hw5(&mut self) -> HW5_W { + HW5_W::new(self, 10) } #[doc = "Bits 12:13 - Port n Pin Hardware Select Bit 6"] #[inline(always)] #[must_use] - pub fn hw6(&mut self) -> HW6_W<12> { - HW6_W::new(self) + pub fn hw6(&mut self) -> HW6_W { + HW6_W::new(self, 12) } #[doc = "Bits 14:15 - Port n Pin Hardware Select Bit 7"] #[inline(always)] #[must_use] - pub fn hw7(&mut self) -> HW7_W<14> { - HW7_W::new(self) + pub fn hw7(&mut self) -> HW7_W { + HW7_W::new(self, 14) } #[doc = "Bits 16:17 - Port n Pin Hardware Select Bit 8"] #[inline(always)] #[must_use] - pub fn hw8(&mut self) -> HW8_W<16> { - HW8_W::new(self) + pub fn hw8(&mut self) -> HW8_W { + HW8_W::new(self, 16) } #[doc = "Bits 18:19 - Port n Pin Hardware Select Bit 9"] #[inline(always)] #[must_use] - pub fn hw9(&mut self) -> HW9_W<18> { - HW9_W::new(self) + pub fn hw9(&mut self) -> HW9_W { + HW9_W::new(self, 18) } #[doc = "Bits 20:21 - Port n Pin Hardware Select Bit 10"] #[inline(always)] #[must_use] - pub fn hw10(&mut self) -> HW10_W<20> { - HW10_W::new(self) + pub fn hw10(&mut self) -> HW10_W { + HW10_W::new(self, 20) } #[doc = "Bits 22:23 - Port n Pin Hardware Select Bit 11"] #[inline(always)] #[must_use] - pub fn hw11(&mut self) -> HW11_W<22> { - HW11_W::new(self) + pub fn hw11(&mut self) -> HW11_W { + HW11_W::new(self, 22) } #[doc = "Bits 24:25 - Port n Pin Hardware Select Bit 12"] #[inline(always)] #[must_use] - pub fn hw12(&mut self) -> HW12_W<24> { - HW12_W::new(self) + pub fn hw12(&mut self) -> HW12_W { + HW12_W::new(self, 24) } #[doc = "Bits 26:27 - Port n Pin Hardware Select Bit 13"] #[inline(always)] #[must_use] - pub fn hw13(&mut self) -> HW13_W<26> { - HW13_W::new(self) + pub fn hw13(&mut self) -> HW13_W { + HW13_W::new(self, 26) } #[doc = "Bits 28:29 - Port n Pin Hardware Select Bit 14"] #[inline(always)] #[must_use] - pub fn hw14(&mut self) -> HW14_W<28> { - HW14_W::new(self) + pub fn hw14(&mut self) -> HW14_W { + HW14_W::new(self, 28) } #[doc = "Bits 30:31 - Port n Pin Hardware Select Bit 15"] #[inline(always)] #[must_use] - pub fn hw15(&mut self) -> HW15_W<30> { - HW15_W::new(self) + pub fn hw15(&mut self) -> HW15_W { + HW15_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hwsel::R`](R) reader structure"] +impl crate::Readable for HWSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hwsel::W`](W) writer structure"] impl crate::Writable for HWSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/in_.rs b/src/port2/in_.rs index f9e2694f..3c3942cf 100644 --- a/src/port2/in_.rs +++ b/src/port2/in_.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `P0` reader - Port n Input Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { P15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 2 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`in_::R`](R) reader structure"] +impl crate::Readable for IN_SPEC {} #[doc = "`reset()` method sets IN to value 0"] impl crate::Resettable for IN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port2/iocr0.rs b/src/port2/iocr0.rs index fdd3da6e..f0dba2f5 100644 --- a/src/port2/iocr0.rs +++ b/src/port2/iocr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] -pub type PC0_R = crate::FieldReader; +pub type PC0_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC0_A { + type Ux = u8; +} impl PC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC0_A::VALUE1), 1 => Some(PC0_A::VALUE2), @@ -109,193 +80,197 @@ impl PC0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC0_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC0_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC0_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC0_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC0_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC0_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC0_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC0_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC0_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC0_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC0_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC0_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC0_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC0_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC0_A::VALUE18 } } #[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] -pub type PC0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC0_A, 5, O>; -impl<'a, const O: u8> PC0_W<'a, O> { +pub type PC0_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC0_A>; +impl<'a, REG> PC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE18) } } #[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] -pub type PC1_R = crate::FieldReader; +pub type PC1_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC1_A { + type Ux = u8; +} impl PC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC1_A::VALUE1), 1 => Some(PC1_A::VALUE2), @@ -369,193 +347,197 @@ impl PC1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC1_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC1_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC1_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC1_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC1_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC1_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC1_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC1_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC1_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC1_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC1_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC1_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC1_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC1_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC1_A::VALUE18 } } #[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] -pub type PC1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC1_A, 5, O>; -impl<'a, const O: u8> PC1_W<'a, O> { +pub type PC1_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC1_A>; +impl<'a, REG> PC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE18) } } #[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] -pub type PC2_R = crate::FieldReader; +pub type PC2_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC2_A { + type Ux = u8; +} impl PC2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC2_A::VALUE1), 1 => Some(PC2_A::VALUE2), @@ -629,193 +614,197 @@ impl PC2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC2_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC2_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC2_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC2_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC2_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC2_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC2_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC2_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC2_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC2_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC2_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC2_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC2_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC2_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC2_A::VALUE18 } } #[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] -pub type PC2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC2_A, 5, O>; -impl<'a, const O: u8> PC2_W<'a, O> { +pub type PC2_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC2_A>; +impl<'a, REG> PC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE18) } } #[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] -pub type PC3_R = crate::FieldReader; +pub type PC3_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC3_A { + type Ux = u8; +} impl PC3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC3_A::VALUE1), 1 => Some(PC3_A::VALUE2), @@ -889,188 +881,192 @@ impl PC3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC3_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC3_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC3_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC3_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC3_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC3_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC3_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC3_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC3_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC3_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC3_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC3_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC3_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC3_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC3_A::VALUE18 } } #[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] -pub type PC3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC3_A, 5, O>; -impl<'a, const O: u8> PC3_W<'a, O> { +pub type PC3_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC3_A>; +impl<'a, REG> PC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc0(&mut self) -> PC0_W<3> { - PC0_W::new(self) + pub fn pc0(&mut self) -> PC0_W { + PC0_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc1(&mut self) -> PC1_W<11> { - PC1_W::new(self) + pub fn pc1(&mut self) -> PC1_W { + PC1_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc2(&mut self) -> PC2_W<19> { - PC2_W::new(self) + pub fn pc2(&mut self) -> PC2_W { + PC2_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc3(&mut self) -> PC3_W<27> { - PC3_W::new(self) + pub fn pc3(&mut self) -> PC3_W { + PC3_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr0::R`](R) reader structure"] +impl crate::Readable for IOCR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr0::W`](W) writer structure"] impl crate::Writable for IOCR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/iocr12.rs b/src/port2/iocr12.rs index 997638b1..7914ac58 100644 --- a/src/port2/iocr12.rs +++ b/src/port2/iocr12.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC12` reader - Port Control for Port n Pin 12 to 15"] -pub type PC12_R = crate::FieldReader; +pub type PC12_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC12_A { + type Ux = u8; +} impl PC12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC12_A::VALUE1), 1 => Some(PC12_A::VALUE2), @@ -109,193 +80,197 @@ impl PC12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC12_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC12_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC12_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC12_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC12_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC12_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC12_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC12_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC12_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC12_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC12_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC12_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC12_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC12_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC12_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC12_A::VALUE18 } } #[doc = "Field `PC12` writer - Port Control for Port n Pin 12 to 15"] -pub type PC12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC12_A, 5, O>; -impl<'a, const O: u8> PC12_W<'a, O> { +pub type PC12_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC12_A>; +impl<'a, REG> PC12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC12_A::VALUE18) } } #[doc = "Field `PC13` reader - Port Control for Port n Pin 12 to 15"] -pub type PC13_R = crate::FieldReader; +pub type PC13_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC13_A { + type Ux = u8; +} impl PC13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC13_A::VALUE1), 1 => Some(PC13_A::VALUE2), @@ -369,193 +347,197 @@ impl PC13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC13_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC13_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC13_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC13_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC13_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC13_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC13_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC13_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC13_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC13_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC13_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC13_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC13_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC13_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC13_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC13_A::VALUE18 } } #[doc = "Field `PC13` writer - Port Control for Port n Pin 12 to 15"] -pub type PC13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC13_A, 5, O>; -impl<'a, const O: u8> PC13_W<'a, O> { +pub type PC13_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC13_A>; +impl<'a, REG> PC13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC13_A::VALUE18) } } #[doc = "Field `PC14` reader - Port Control for Port n Pin 12 to 15"] -pub type PC14_R = crate::FieldReader; +pub type PC14_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC14_A { + type Ux = u8; +} impl PC14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC14_A::VALUE1), 1 => Some(PC14_A::VALUE2), @@ -629,193 +614,197 @@ impl PC14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC14_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC14_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC14_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC14_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC14_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC14_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC14_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC14_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC14_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC14_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC14_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC14_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC14_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC14_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC14_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC14_A::VALUE18 } } #[doc = "Field `PC14` writer - Port Control for Port n Pin 12 to 15"] -pub type PC14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC14_A, 5, O>; -impl<'a, const O: u8> PC14_W<'a, O> { +pub type PC14_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC14_A>; +impl<'a, REG> PC14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC14_A::VALUE18) } } #[doc = "Field `PC15` reader - Port Control for Port n Pin 12 to 15"] -pub type PC15_R = crate::FieldReader; +pub type PC15_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 12 to 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC15_A { + type Ux = u8; +} impl PC15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC15_A::VALUE1), 1 => Some(PC15_A::VALUE2), @@ -889,188 +881,192 @@ impl PC15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC15_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC15_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC15_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC15_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC15_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC15_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC15_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC15_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC15_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC15_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC15_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC15_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC15_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC15_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC15_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC15_A::VALUE18 } } #[doc = "Field `PC15` writer - Port Control for Port n Pin 12 to 15"] -pub type PC15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR12_SPEC, u8, PC15_A, 5, O>; -impl<'a, const O: u8> PC15_W<'a, O> { +pub type PC15_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC15_A>; +impl<'a, REG> PC15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC15_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc12(&mut self) -> PC12_W<3> { - PC12_W::new(self) + pub fn pc12(&mut self) -> PC12_W { + PC12_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc13(&mut self) -> PC13_W<11> { - PC13_W::new(self) + pub fn pc13(&mut self) -> PC13_W { + PC13_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc14(&mut self) -> PC14_W<19> { - PC14_W::new(self) + pub fn pc14(&mut self) -> PC14_W { + PC14_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 12 to 15"] #[inline(always)] #[must_use] - pub fn pc15(&mut self) -> PC15_W<27> { - PC15_W::new(self) + pub fn pc15(&mut self) -> PC15_W { + PC15_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Input/Output Control Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr12::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr12::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr12::R`](R) reader structure"] +impl crate::Readable for IOCR12_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr12::W`](W) writer structure"] impl crate::Writable for IOCR12_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/iocr4.rs b/src/port2/iocr4.rs index b6ec0fd8..795c56f2 100644 --- a/src/port2/iocr4.rs +++ b/src/port2/iocr4.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] -pub type PC4_R = crate::FieldReader; +pub type PC4_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC4_A { + type Ux = u8; +} impl PC4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC4_A::VALUE1), 1 => Some(PC4_A::VALUE2), @@ -109,193 +80,197 @@ impl PC4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC4_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC4_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC4_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC4_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC4_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC4_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC4_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC4_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC4_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC4_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC4_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC4_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC4_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC4_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC4_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC4_A::VALUE18 } } #[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] -pub type PC4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC4_A, 5, O>; -impl<'a, const O: u8> PC4_W<'a, O> { +pub type PC4_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC4_A>; +impl<'a, REG> PC4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE18) } } #[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] -pub type PC5_R = crate::FieldReader; +pub type PC5_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC5_A { + type Ux = u8; +} impl PC5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC5_A::VALUE1), 1 => Some(PC5_A::VALUE2), @@ -369,193 +347,197 @@ impl PC5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC5_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC5_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC5_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC5_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC5_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC5_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC5_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC5_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC5_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC5_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC5_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC5_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC5_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC5_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC5_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC5_A::VALUE18 } } #[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] -pub type PC5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC5_A, 5, O>; -impl<'a, const O: u8> PC5_W<'a, O> { +pub type PC5_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC5_A>; +impl<'a, REG> PC5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE18) } } #[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] -pub type PC6_R = crate::FieldReader; +pub type PC6_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC6_A { + type Ux = u8; +} impl PC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC6_A::VALUE1), 1 => Some(PC6_A::VALUE2), @@ -629,193 +614,197 @@ impl PC6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC6_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC6_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC6_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC6_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC6_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC6_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC6_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC6_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC6_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC6_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC6_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC6_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC6_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC6_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC6_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC6_A::VALUE18 } } #[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] -pub type PC6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC6_A, 5, O>; -impl<'a, const O: u8> PC6_W<'a, O> { +pub type PC6_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC6_A>; +impl<'a, REG> PC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE18) } } #[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] -pub type PC7_R = crate::FieldReader; +pub type PC7_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC7_A { + type Ux = u8; +} impl PC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC7_A::VALUE1), 1 => Some(PC7_A::VALUE2), @@ -889,188 +881,192 @@ impl PC7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC7_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC7_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC7_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC7_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC7_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC7_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC7_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC7_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC7_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC7_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC7_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC7_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC7_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC7_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC7_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC7_A::VALUE18 } } #[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] -pub type PC7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC7_A, 5, O>; -impl<'a, const O: u8> PC7_W<'a, O> { +pub type PC7_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC7_A>; +impl<'a, REG> PC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc4(&mut self) -> PC4_W<3> { - PC4_W::new(self) + pub fn pc4(&mut self) -> PC4_W { + PC4_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc5(&mut self) -> PC5_W<11> { - PC5_W::new(self) + pub fn pc5(&mut self) -> PC5_W { + PC5_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc6(&mut self) -> PC6_W<19> { - PC6_W::new(self) + pub fn pc6(&mut self) -> PC6_W { + PC6_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc7(&mut self) -> PC7_W<27> { - PC7_W::new(self) + pub fn pc7(&mut self) -> PC7_W { + PC7_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr4::R`](R) reader structure"] +impl crate::Readable for IOCR4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr4::W`](W) writer structure"] impl crate::Writable for IOCR4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/iocr8.rs b/src/port2/iocr8.rs index 1d435b91..9b51fdae 100644 --- a/src/port2/iocr8.rs +++ b/src/port2/iocr8.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC8` reader - Port Control for Port n Pin 8 to 11"] -pub type PC8_R = crate::FieldReader; +pub type PC8_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC8_A { + type Ux = u8; +} impl PC8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC8_A::VALUE1), 1 => Some(PC8_A::VALUE2), @@ -109,193 +80,197 @@ impl PC8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC8_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC8_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC8_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC8_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC8_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC8_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC8_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC8_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC8_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC8_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC8_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC8_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC8_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC8_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC8_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC8_A::VALUE18 } } #[doc = "Field `PC8` writer - Port Control for Port n Pin 8 to 11"] -pub type PC8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC8_A, 5, O>; -impl<'a, const O: u8> PC8_W<'a, O> { +pub type PC8_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC8_A>; +impl<'a, REG> PC8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC8_A::VALUE18) } } #[doc = "Field `PC9` reader - Port Control for Port n Pin 8 to 11"] -pub type PC9_R = crate::FieldReader; +pub type PC9_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC9_A { + type Ux = u8; +} impl PC9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC9_A::VALUE1), 1 => Some(PC9_A::VALUE2), @@ -369,193 +347,197 @@ impl PC9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC9_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC9_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC9_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC9_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC9_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC9_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC9_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC9_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC9_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC9_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC9_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC9_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC9_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC9_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC9_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC9_A::VALUE18 } } #[doc = "Field `PC9` writer - Port Control for Port n Pin 8 to 11"] -pub type PC9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC9_A, 5, O>; -impl<'a, const O: u8> PC9_W<'a, O> { +pub type PC9_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC9_A>; +impl<'a, REG> PC9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC9_A::VALUE18) } } #[doc = "Field `PC10` reader - Port Control for Port n Pin 8 to 11"] -pub type PC10_R = crate::FieldReader; +pub type PC10_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC10_A { + type Ux = u8; +} impl PC10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC10_A::VALUE1), 1 => Some(PC10_A::VALUE2), @@ -629,193 +614,197 @@ impl PC10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC10_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC10_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC10_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC10_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC10_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC10_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC10_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC10_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC10_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC10_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC10_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC10_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC10_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC10_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC10_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC10_A::VALUE18 } } #[doc = "Field `PC10` writer - Port Control for Port n Pin 8 to 11"] -pub type PC10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC10_A, 5, O>; -impl<'a, const O: u8> PC10_W<'a, O> { +pub type PC10_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC10_A>; +impl<'a, REG> PC10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC10_A::VALUE18) } } #[doc = "Field `PC11` reader - Port Control for Port n Pin 8 to 11"] -pub type PC11_R = crate::FieldReader; +pub type PC11_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 8 to 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC11_A { + type Ux = u8; +} impl PC11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC11_A::VALUE1), 1 => Some(PC11_A::VALUE2), @@ -889,188 +881,192 @@ impl PC11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC11_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC11_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC11_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC11_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC11_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC11_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC11_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC11_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC11_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC11_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC11_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC11_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC11_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC11_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC11_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC11_A::VALUE18 } } #[doc = "Field `PC11` writer - Port Control for Port n Pin 8 to 11"] -pub type PC11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR8_SPEC, u8, PC11_A, 5, O>; -impl<'a, const O: u8> PC11_W<'a, O> { +pub type PC11_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC11_A>; +impl<'a, REG> PC11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC11_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc8(&mut self) -> PC8_W<3> { - PC8_W::new(self) + pub fn pc8(&mut self) -> PC8_W { + PC8_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc9(&mut self) -> PC9_W<11> { - PC9_W::new(self) + pub fn pc9(&mut self) -> PC9_W { + PC9_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc10(&mut self) -> PC10_W<19> { - PC10_W::new(self) + pub fn pc10(&mut self) -> PC10_W { + PC10_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 8 to 11"] #[inline(always)] #[must_use] - pub fn pc11(&mut self) -> PC11_W<27> { - PC11_W::new(self) + pub fn pc11(&mut self) -> PC11_W { + PC11_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Input/Output Control Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr8::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr8::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr8::R`](R) reader structure"] +impl crate::Readable for IOCR8_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr8::W`](W) writer structure"] impl crate::Writable for IOCR8_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/omr.rs b/src/port2/omr.rs index 3ef410e3..42199495 100644 --- a/src/port2/omr.rs +++ b/src/port2/omr.rs @@ -1,296 +1,280 @@ #[doc = "Register `OMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PS0` writer - Port n Set Bit 0"] -pub type PS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1` writer - Port n Set Bit 1"] -pub type PS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2` writer - Port n Set Bit 2"] -pub type PS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS3` writer - Port n Set Bit 3"] -pub type PS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS4` writer - Port n Set Bit 4"] -pub type PS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS5` writer - Port n Set Bit 5"] -pub type PS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS6` writer - Port n Set Bit 6"] -pub type PS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS7` writer - Port n Set Bit 7"] -pub type PS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS8` writer - Port n Set Bit 8"] -pub type PS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS9` writer - Port n Set Bit 9"] -pub type PS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS10` writer - Port n Set Bit 10"] -pub type PS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS11` writer - Port n Set Bit 11"] -pub type PS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS12` writer - Port n Set Bit 12"] -pub type PS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS13` writer - Port n Set Bit 13"] -pub type PS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS14` writer - Port n Set Bit 14"] -pub type PS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS15` writer - Port n Set Bit 15"] -pub type PS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR0` writer - Port n Reset Bit 0"] -pub type PR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR1` writer - Port n Reset Bit 1"] -pub type PR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR2` writer - Port n Reset Bit 2"] -pub type PR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR3` writer - Port n Reset Bit 3"] -pub type PR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR4` writer - Port n Reset Bit 4"] -pub type PR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR5` writer - Port n Reset Bit 5"] -pub type PR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR6` writer - Port n Reset Bit 6"] -pub type PR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR7` writer - Port n Reset Bit 7"] -pub type PR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR8` writer - Port n Reset Bit 8"] -pub type PR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR9` writer - Port n Reset Bit 9"] -pub type PR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR10` writer - Port n Reset Bit 10"] -pub type PR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR11` writer - Port n Reset Bit 11"] -pub type PR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR12` writer - Port n Reset Bit 12"] -pub type PR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR13` writer - Port n Reset Bit 13"] -pub type PR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR14` writer - Port n Reset Bit 14"] -pub type PR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR15` writer - Port n Reset Bit 15"] -pub type PR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR15_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Port n Set Bit 0"] #[inline(always)] #[must_use] - pub fn ps0(&mut self) -> PS0_W<0> { - PS0_W::new(self) + pub fn ps0(&mut self) -> PS0_W { + PS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Set Bit 1"] #[inline(always)] #[must_use] - pub fn ps1(&mut self) -> PS1_W<1> { - PS1_W::new(self) + pub fn ps1(&mut self) -> PS1_W { + PS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Set Bit 2"] #[inline(always)] #[must_use] - pub fn ps2(&mut self) -> PS2_W<2> { - PS2_W::new(self) + pub fn ps2(&mut self) -> PS2_W { + PS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Set Bit 3"] #[inline(always)] #[must_use] - pub fn ps3(&mut self) -> PS3_W<3> { - PS3_W::new(self) + pub fn ps3(&mut self) -> PS3_W { + PS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Set Bit 4"] #[inline(always)] #[must_use] - pub fn ps4(&mut self) -> PS4_W<4> { - PS4_W::new(self) + pub fn ps4(&mut self) -> PS4_W { + PS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Set Bit 5"] #[inline(always)] #[must_use] - pub fn ps5(&mut self) -> PS5_W<5> { - PS5_W::new(self) + pub fn ps5(&mut self) -> PS5_W { + PS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Set Bit 6"] #[inline(always)] #[must_use] - pub fn ps6(&mut self) -> PS6_W<6> { - PS6_W::new(self) + pub fn ps6(&mut self) -> PS6_W { + PS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Set Bit 7"] #[inline(always)] #[must_use] - pub fn ps7(&mut self) -> PS7_W<7> { - PS7_W::new(self) + pub fn ps7(&mut self) -> PS7_W { + PS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Set Bit 8"] #[inline(always)] #[must_use] - pub fn ps8(&mut self) -> PS8_W<8> { - PS8_W::new(self) + pub fn ps8(&mut self) -> PS8_W { + PS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Set Bit 9"] #[inline(always)] #[must_use] - pub fn ps9(&mut self) -> PS9_W<9> { - PS9_W::new(self) + pub fn ps9(&mut self) -> PS9_W { + PS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Set Bit 10"] #[inline(always)] #[must_use] - pub fn ps10(&mut self) -> PS10_W<10> { - PS10_W::new(self) + pub fn ps10(&mut self) -> PS10_W { + PS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Set Bit 11"] #[inline(always)] #[must_use] - pub fn ps11(&mut self) -> PS11_W<11> { - PS11_W::new(self) + pub fn ps11(&mut self) -> PS11_W { + PS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Set Bit 12"] #[inline(always)] #[must_use] - pub fn ps12(&mut self) -> PS12_W<12> { - PS12_W::new(self) + pub fn ps12(&mut self) -> PS12_W { + PS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Set Bit 13"] #[inline(always)] #[must_use] - pub fn ps13(&mut self) -> PS13_W<13> { - PS13_W::new(self) + pub fn ps13(&mut self) -> PS13_W { + PS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Set Bit 14"] #[inline(always)] #[must_use] - pub fn ps14(&mut self) -> PS14_W<14> { - PS14_W::new(self) + pub fn ps14(&mut self) -> PS14_W { + PS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Set Bit 15"] #[inline(always)] #[must_use] - pub fn ps15(&mut self) -> PS15_W<15> { - PS15_W::new(self) + pub fn ps15(&mut self) -> PS15_W { + PS15_W::new(self, 15) } #[doc = "Bit 16 - Port n Reset Bit 0"] #[inline(always)] #[must_use] - pub fn pr0(&mut self) -> PR0_W<16> { - PR0_W::new(self) + pub fn pr0(&mut self) -> PR0_W { + PR0_W::new(self, 16) } #[doc = "Bit 17 - Port n Reset Bit 1"] #[inline(always)] #[must_use] - pub fn pr1(&mut self) -> PR1_W<17> { - PR1_W::new(self) + pub fn pr1(&mut self) -> PR1_W { + PR1_W::new(self, 17) } #[doc = "Bit 18 - Port n Reset Bit 2"] #[inline(always)] #[must_use] - pub fn pr2(&mut self) -> PR2_W<18> { - PR2_W::new(self) + pub fn pr2(&mut self) -> PR2_W { + PR2_W::new(self, 18) } #[doc = "Bit 19 - Port n Reset Bit 3"] #[inline(always)] #[must_use] - pub fn pr3(&mut self) -> PR3_W<19> { - PR3_W::new(self) + pub fn pr3(&mut self) -> PR3_W { + PR3_W::new(self, 19) } #[doc = "Bit 20 - Port n Reset Bit 4"] #[inline(always)] #[must_use] - pub fn pr4(&mut self) -> PR4_W<20> { - PR4_W::new(self) + pub fn pr4(&mut self) -> PR4_W { + PR4_W::new(self, 20) } #[doc = "Bit 21 - Port n Reset Bit 5"] #[inline(always)] #[must_use] - pub fn pr5(&mut self) -> PR5_W<21> { - PR5_W::new(self) + pub fn pr5(&mut self) -> PR5_W { + PR5_W::new(self, 21) } #[doc = "Bit 22 - Port n Reset Bit 6"] #[inline(always)] #[must_use] - pub fn pr6(&mut self) -> PR6_W<22> { - PR6_W::new(self) + pub fn pr6(&mut self) -> PR6_W { + PR6_W::new(self, 22) } #[doc = "Bit 23 - Port n Reset Bit 7"] #[inline(always)] #[must_use] - pub fn pr7(&mut self) -> PR7_W<23> { - PR7_W::new(self) + pub fn pr7(&mut self) -> PR7_W { + PR7_W::new(self, 23) } #[doc = "Bit 24 - Port n Reset Bit 8"] #[inline(always)] #[must_use] - pub fn pr8(&mut self) -> PR8_W<24> { - PR8_W::new(self) + pub fn pr8(&mut self) -> PR8_W { + PR8_W::new(self, 24) } #[doc = "Bit 25 - Port n Reset Bit 9"] #[inline(always)] #[must_use] - pub fn pr9(&mut self) -> PR9_W<25> { - PR9_W::new(self) + pub fn pr9(&mut self) -> PR9_W { + PR9_W::new(self, 25) } #[doc = "Bit 26 - Port n Reset Bit 10"] #[inline(always)] #[must_use] - pub fn pr10(&mut self) -> PR10_W<26> { - PR10_W::new(self) + pub fn pr10(&mut self) -> PR10_W { + PR10_W::new(self, 26) } #[doc = "Bit 27 - Port n Reset Bit 11"] #[inline(always)] #[must_use] - pub fn pr11(&mut self) -> PR11_W<27> { - PR11_W::new(self) + pub fn pr11(&mut self) -> PR11_W { + PR11_W::new(self, 27) } #[doc = "Bit 28 - Port n Reset Bit 12"] #[inline(always)] #[must_use] - pub fn pr12(&mut self) -> PR12_W<28> { - PR12_W::new(self) + pub fn pr12(&mut self) -> PR12_W { + PR12_W::new(self, 28) } #[doc = "Bit 29 - Port n Reset Bit 13"] #[inline(always)] #[must_use] - pub fn pr13(&mut self) -> PR13_W<29> { - PR13_W::new(self) + pub fn pr13(&mut self) -> PR13_W { + PR13_W::new(self, 29) } #[doc = "Bit 30 - Port n Reset Bit 14"] #[inline(always)] #[must_use] - pub fn pr14(&mut self) -> PR14_W<30> { - PR14_W::new(self) + pub fn pr14(&mut self) -> PR14_W { + PR14_W::new(self, 30) } #[doc = "Bit 31 - Port n Reset Bit 15"] #[inline(always)] #[must_use] - pub fn pr15(&mut self) -> PR15_W<31> { - PR15_W::new(self) + pub fn pr15(&mut self) -> PR15_W { + PR15_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OMR_SPEC; impl crate::RegisterSpec for OMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`omr::W`](W) writer structure"] impl crate::Writable for OMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/out.rs b/src/port2/out.rs index df962e54..fee78289 100644 --- a/src/port2/out.rs +++ b/src/port2/out.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `P0` reader - Port n Output Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 } } #[doc = "Field `P0` writer - Port n Output Bit 0"] -pub type P0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P0_A, O>; -impl<'a, const O: u8> P0_W<'a, O> { +pub type P0_W<'a, REG> = crate::BitWriter<'a, REG, P0_A>; +impl<'a, REG> P0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P0_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 } } #[doc = "Field `P1` writer - Port n Output Bit 1"] -pub type P1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P1_A, O>; -impl<'a, const O: u8> P1_W<'a, O> { +pub type P1_W<'a, REG> = crate::BitWriter<'a, REG, P1_A>; +impl<'a, REG> P1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P1_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 } } #[doc = "Field `P2` writer - Port n Output Bit 2"] -pub type P2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P2_A, O>; -impl<'a, const O: u8> P2_W<'a, O> { +pub type P2_W<'a, REG> = crate::BitWriter<'a, REG, P2_A>; +impl<'a, REG> P2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P2_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 } } #[doc = "Field `P3` writer - Port n Output Bit 3"] -pub type P3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P3_A, O>; -impl<'a, const O: u8> P3_W<'a, O> { +pub type P3_W<'a, REG> = crate::BitWriter<'a, REG, P3_A>; +impl<'a, REG> P3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P3_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 } } #[doc = "Field `P4` writer - Port n Output Bit 4"] -pub type P4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P4_A, O>; -impl<'a, const O: u8> P4_W<'a, O> { +pub type P4_W<'a, REG> = crate::BitWriter<'a, REG, P4_A>; +impl<'a, REG> P4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P4_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 } } #[doc = "Field `P5` writer - Port n Output Bit 5"] -pub type P5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P5_A, O>; -impl<'a, const O: u8> P5_W<'a, O> { +pub type P5_W<'a, REG> = crate::BitWriter<'a, REG, P5_A>; +impl<'a, REG> P5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P5_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 } } #[doc = "Field `P6` writer - Port n Output Bit 6"] -pub type P6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P6_A, O>; -impl<'a, const O: u8> P6_W<'a, O> { +pub type P6_W<'a, REG> = crate::BitWriter<'a, REG, P6_A>; +impl<'a, REG> P6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P6_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 } } #[doc = "Field `P7` writer - Port n Output Bit 7"] -pub type P7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P7_A, O>; -impl<'a, const O: u8> P7_W<'a, O> { +pub type P7_W<'a, REG> = crate::BitWriter<'a, REG, P7_A>; +impl<'a, REG> P7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P7_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 } } #[doc = "Field `P8` writer - Port n Output Bit 8"] -pub type P8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P8_A, O>; -impl<'a, const O: u8> P8_W<'a, O> { +pub type P8_W<'a, REG> = crate::BitWriter<'a, REG, P8_A>; +impl<'a, REG> P8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P8_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 } } #[doc = "Field `P9` writer - Port n Output Bit 9"] -pub type P9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P9_A, O>; -impl<'a, const O: u8> P9_W<'a, O> { +pub type P9_W<'a, REG> = crate::BitWriter<'a, REG, P9_A>; +impl<'a, REG> P9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P9_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 } } #[doc = "Field `P10` writer - Port n Output Bit 10"] -pub type P10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P10_A, O>; -impl<'a, const O: u8> P10_W<'a, O> { +pub type P10_W<'a, REG> = crate::BitWriter<'a, REG, P10_A>; +impl<'a, REG> P10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P10_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 } } #[doc = "Field `P11` writer - Port n Output Bit 11"] -pub type P11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P11_A, O>; -impl<'a, const O: u8> P11_W<'a, O> { +pub type P11_W<'a, REG> = crate::BitWriter<'a, REG, P11_A>; +impl<'a, REG> P11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P11_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 } } #[doc = "Field `P12` writer - Port n Output Bit 12"] -pub type P12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P12_A, O>; -impl<'a, const O: u8> P12_W<'a, O> { +pub type P12_W<'a, REG> = crate::BitWriter<'a, REG, P12_A>; +impl<'a, REG> P12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P12_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 } } #[doc = "Field `P13` writer - Port n Output Bit 13"] -pub type P13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P13_A, O>; -impl<'a, const O: u8> P13_W<'a, O> { +pub type P13_W<'a, REG> = crate::BitWriter<'a, REG, P13_A>; +impl<'a, REG> P13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P13_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 } } #[doc = "Field `P14` writer - Port n Output Bit 14"] -pub type P14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P14_A, O>; -impl<'a, const O: u8> P14_W<'a, O> { +pub type P14_W<'a, REG> = crate::BitWriter<'a, REG, P14_A>; +impl<'a, REG> P14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P14_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 } } #[doc = "Field `P15` writer - Port n Output Bit 15"] -pub type P15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P15_A, O>; -impl<'a, const O: u8> P15_W<'a, O> { +pub type P15_W<'a, REG> = crate::BitWriter<'a, REG, P15_A>; +impl<'a, REG> P15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P15_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Output Bit 0"] #[inline(always)] #[must_use] - pub fn p0(&mut self) -> P0_W<0> { - P0_W::new(self) + pub fn p0(&mut self) -> P0_W { + P0_W::new(self, 0) } #[doc = "Bit 1 - Port n Output Bit 1"] #[inline(always)] #[must_use] - pub fn p1(&mut self) -> P1_W<1> { - P1_W::new(self) + pub fn p1(&mut self) -> P1_W { + P1_W::new(self, 1) } #[doc = "Bit 2 - Port n Output Bit 2"] #[inline(always)] #[must_use] - pub fn p2(&mut self) -> P2_W<2> { - P2_W::new(self) + pub fn p2(&mut self) -> P2_W { + P2_W::new(self, 2) } #[doc = "Bit 3 - Port n Output Bit 3"] #[inline(always)] #[must_use] - pub fn p3(&mut self) -> P3_W<3> { - P3_W::new(self) + pub fn p3(&mut self) -> P3_W { + P3_W::new(self, 3) } #[doc = "Bit 4 - Port n Output Bit 4"] #[inline(always)] #[must_use] - pub fn p4(&mut self) -> P4_W<4> { - P4_W::new(self) + pub fn p4(&mut self) -> P4_W { + P4_W::new(self, 4) } #[doc = "Bit 5 - Port n Output Bit 5"] #[inline(always)] #[must_use] - pub fn p5(&mut self) -> P5_W<5> { - P5_W::new(self) + pub fn p5(&mut self) -> P5_W { + P5_W::new(self, 5) } #[doc = "Bit 6 - Port n Output Bit 6"] #[inline(always)] #[must_use] - pub fn p6(&mut self) -> P6_W<6> { - P6_W::new(self) + pub fn p6(&mut self) -> P6_W { + P6_W::new(self, 6) } #[doc = "Bit 7 - Port n Output Bit 7"] #[inline(always)] #[must_use] - pub fn p7(&mut self) -> P7_W<7> { - P7_W::new(self) + pub fn p7(&mut self) -> P7_W { + P7_W::new(self, 7) } #[doc = "Bit 8 - Port n Output Bit 8"] #[inline(always)] #[must_use] - pub fn p8(&mut self) -> P8_W<8> { - P8_W::new(self) + pub fn p8(&mut self) -> P8_W { + P8_W::new(self, 8) } #[doc = "Bit 9 - Port n Output Bit 9"] #[inline(always)] #[must_use] - pub fn p9(&mut self) -> P9_W<9> { - P9_W::new(self) + pub fn p9(&mut self) -> P9_W { + P9_W::new(self, 9) } #[doc = "Bit 10 - Port n Output Bit 10"] #[inline(always)] #[must_use] - pub fn p10(&mut self) -> P10_W<10> { - P10_W::new(self) + pub fn p10(&mut self) -> P10_W { + P10_W::new(self, 10) } #[doc = "Bit 11 - Port n Output Bit 11"] #[inline(always)] #[must_use] - pub fn p11(&mut self) -> P11_W<11> { - P11_W::new(self) + pub fn p11(&mut self) -> P11_W { + P11_W::new(self, 11) } #[doc = "Bit 12 - Port n Output Bit 12"] #[inline(always)] #[must_use] - pub fn p12(&mut self) -> P12_W<12> { - P12_W::new(self) + pub fn p12(&mut self) -> P12_W { + P12_W::new(self, 12) } #[doc = "Bit 13 - Port n Output Bit 13"] #[inline(always)] #[must_use] - pub fn p13(&mut self) -> P13_W<13> { - P13_W::new(self) + pub fn p13(&mut self) -> P13_W { + P13_W::new(self, 13) } #[doc = "Bit 14 - Port n Output Bit 14"] #[inline(always)] #[must_use] - pub fn p14(&mut self) -> P14_W<14> { - P14_W::new(self) + pub fn p14(&mut self) -> P14_W { + P14_W::new(self, 14) } #[doc = "Bit 15 - Port n Output Bit 15"] #[inline(always)] #[must_use] - pub fn p15(&mut self) -> P15_W<15> { - P15_W::new(self) + pub fn p15(&mut self) -> P15_W { + P15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`out::R`](R) reader structure"] +impl crate::Readable for OUT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`out::W`](W) writer structure"] impl crate::Writable for OUT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/pdisc.rs b/src/port2/pdisc.rs index 2af8bded..4e1413c6 100644 --- a/src/port2/pdisc.rs +++ b/src/port2/pdisc.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] pub type PDIS0_R = crate::BitReader; #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl PDIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS0_A { + pub const fn variant(&self) -> PDIS0_A { match self.bits { false => PDIS0_A::VALUE1, true => PDIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl PDIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS1_A { + pub const fn variant(&self) -> PDIS1_A { match self.bits { false => PDIS1_A::VALUE1, true => PDIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl PDIS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS2_A { + pub const fn variant(&self) -> PDIS2_A { match self.bits { false => PDIS2_A::VALUE1, true => PDIS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl PDIS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS3_A { + pub const fn variant(&self) -> PDIS3_A { match self.bits { false => PDIS3_A::VALUE1, true => PDIS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl PDIS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS4_A { + pub const fn variant(&self) -> PDIS4_A { match self.bits { false => PDIS4_A::VALUE1, true => PDIS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PDIS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS5_A { + pub const fn variant(&self) -> PDIS5_A { match self.bits { false => PDIS5_A::VALUE1, true => PDIS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl PDIS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS6_A { + pub const fn variant(&self) -> PDIS6_A { match self.bits { false => PDIS6_A::VALUE1, true => PDIS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl PDIS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS7_A { + pub const fn variant(&self) -> PDIS7_A { match self.bits { false => PDIS7_A::VALUE1, true => PDIS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PDIS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS8_A { + pub const fn variant(&self) -> PDIS8_A { match self.bits { false => PDIS8_A::VALUE1, true => PDIS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl PDIS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS9_A { + pub const fn variant(&self) -> PDIS9_A { match self.bits { false => PDIS9_A::VALUE1, true => PDIS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl PDIS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS10_A { + pub const fn variant(&self) -> PDIS10_A { match self.bits { false => PDIS10_A::VALUE1, true => PDIS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl PDIS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS11_A { + pub const fn variant(&self) -> PDIS11_A { match self.bits { false => PDIS11_A::VALUE1, true => PDIS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl PDIS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS12_A { + pub const fn variant(&self) -> PDIS12_A { match self.bits { false => PDIS12_A::VALUE1, true => PDIS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl PDIS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS13_A { + pub const fn variant(&self) -> PDIS13_A { match self.bits { false => PDIS13_A::VALUE1, true => PDIS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl PDIS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS14_A { + pub const fn variant(&self) -> PDIS14_A { match self.bits { false => PDIS14_A::VALUE1, true => PDIS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl PDIS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS15_A { + pub const fn variant(&self) -> PDIS15_A { match self.bits { false => PDIS15_A::VALUE1, true => PDIS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 2 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pdisc::R`](R) reader structure"] +impl crate::Readable for PDISC_SPEC {} #[doc = "`reset()` method sets PDISC to value 0"] impl crate::Resettable for PDISC_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port2/pdr0.rs b/src/port2/pdr0.rs index 9231cc80..58edd866 100644 --- a/src/port2/pdr0.rs +++ b/src/port2/pdr0.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] -pub type PD0_R = crate::FieldReader; +pub type PD0_R = crate::FieldReader; #[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] -pub type PD0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] -pub type PD1_R = crate::FieldReader; +pub type PD1_R = crate::FieldReader; #[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] -pub type PD1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] -pub type PD2_R = crate::FieldReader; +pub type PD2_R = crate::FieldReader; #[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] -pub type PD2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] -pub type PD3_R = crate::FieldReader; +pub type PD3_R = crate::FieldReader; #[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] -pub type PD3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD3_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] -pub type PD4_R = crate::FieldReader; +pub type PD4_R = crate::FieldReader; #[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] -pub type PD4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD4_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] -pub type PD5_R = crate::FieldReader; +pub type PD5_R = crate::FieldReader; #[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] -pub type PD5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD5_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] -pub type PD6_R = crate::FieldReader; +pub type PD6_R = crate::FieldReader; #[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] -pub type PD6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD6_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] -pub type PD7_R = crate::FieldReader; +pub type PD7_R = crate::FieldReader; #[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] -pub type PD7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD7_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] #[must_use] - pub fn pd0(&mut self) -> PD0_W<0> { - PD0_W::new(self) + pub fn pd0(&mut self) -> PD0_W { + PD0_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.1"] #[inline(always)] #[must_use] - pub fn pd1(&mut self) -> PD1_W<4> { - PD1_W::new(self) + pub fn pd1(&mut self) -> PD1_W { + PD1_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.2"] #[inline(always)] #[must_use] - pub fn pd2(&mut self) -> PD2_W<8> { - PD2_W::new(self) + pub fn pd2(&mut self) -> PD2_W { + PD2_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.3"] #[inline(always)] #[must_use] - pub fn pd3(&mut self) -> PD3_W<12> { - PD3_W::new(self) + pub fn pd3(&mut self) -> PD3_W { + PD3_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.4"] #[inline(always)] #[must_use] - pub fn pd4(&mut self) -> PD4_W<16> { - PD4_W::new(self) + pub fn pd4(&mut self) -> PD4_W { + PD4_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.5"] #[inline(always)] #[must_use] - pub fn pd5(&mut self) -> PD5_W<20> { - PD5_W::new(self) + pub fn pd5(&mut self) -> PD5_W { + PD5_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.6"] #[inline(always)] #[must_use] - pub fn pd6(&mut self) -> PD6_W<24> { - PD6_W::new(self) + pub fn pd6(&mut self) -> PD6_W { + PD6_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.7"] #[inline(always)] #[must_use] - pub fn pd7(&mut self) -> PD7_W<28> { - PD7_W::new(self) + pub fn pd7(&mut self) -> PD7_W { + PD7_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr0::R`](R) reader structure"] +impl crate::Readable for PDR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr0::W`](W) writer structure"] impl crate::Writable for PDR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/pdr1.rs b/src/port2/pdr1.rs index 85178d36..069087be 100644 --- a/src/port2/pdr1.rs +++ b/src/port2/pdr1.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD8` reader - Pad Driver Mode for Pn.8"] -pub type PD8_R = crate::FieldReader; +pub type PD8_R = crate::FieldReader; #[doc = "Field `PD8` writer - Pad Driver Mode for Pn.8"] -pub type PD8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD8_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD9` reader - Pad Driver Mode for Pn.9"] -pub type PD9_R = crate::FieldReader; +pub type PD9_R = crate::FieldReader; #[doc = "Field `PD9` writer - Pad Driver Mode for Pn.9"] -pub type PD9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD9_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD10` reader - Pad Driver Mode for Pn.10"] -pub type PD10_R = crate::FieldReader; +pub type PD10_R = crate::FieldReader; #[doc = "Field `PD10` writer - Pad Driver Mode for Pn.10"] -pub type PD10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD10_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD11` reader - Pad Driver Mode for Pn.11"] -pub type PD11_R = crate::FieldReader; +pub type PD11_R = crate::FieldReader; #[doc = "Field `PD11` writer - Pad Driver Mode for Pn.11"] -pub type PD11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD11_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD12` reader - Pad Driver Mode for Pn.12"] -pub type PD12_R = crate::FieldReader; +pub type PD12_R = crate::FieldReader; #[doc = "Field `PD12` writer - Pad Driver Mode for Pn.12"] -pub type PD12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD12_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD13` reader - Pad Driver Mode for Pn.13"] -pub type PD13_R = crate::FieldReader; +pub type PD13_R = crate::FieldReader; #[doc = "Field `PD13` writer - Pad Driver Mode for Pn.13"] -pub type PD13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD13_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD14` reader - Pad Driver Mode for Pn.14"] -pub type PD14_R = crate::FieldReader; +pub type PD14_R = crate::FieldReader; #[doc = "Field `PD14` writer - Pad Driver Mode for Pn.14"] -pub type PD14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD14_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD15` reader - Pad Driver Mode for Pn.15"] -pub type PD15_R = crate::FieldReader; +pub type PD15_R = crate::FieldReader; #[doc = "Field `PD15` writer - Pad Driver Mode for Pn.15"] -pub type PD15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR1_SPEC, u8, u8, 3, O>; +pub type PD15_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.8"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.8"] #[inline(always)] #[must_use] - pub fn pd8(&mut self) -> PD8_W<0> { - PD8_W::new(self) + pub fn pd8(&mut self) -> PD8_W { + PD8_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.9"] #[inline(always)] #[must_use] - pub fn pd9(&mut self) -> PD9_W<4> { - PD9_W::new(self) + pub fn pd9(&mut self) -> PD9_W { + PD9_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.10"] #[inline(always)] #[must_use] - pub fn pd10(&mut self) -> PD10_W<8> { - PD10_W::new(self) + pub fn pd10(&mut self) -> PD10_W { + PD10_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.11"] #[inline(always)] #[must_use] - pub fn pd11(&mut self) -> PD11_W<12> { - PD11_W::new(self) + pub fn pd11(&mut self) -> PD11_W { + PD11_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.12"] #[inline(always)] #[must_use] - pub fn pd12(&mut self) -> PD12_W<16> { - PD12_W::new(self) + pub fn pd12(&mut self) -> PD12_W { + PD12_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.13"] #[inline(always)] #[must_use] - pub fn pd13(&mut self) -> PD13_W<20> { - PD13_W::new(self) + pub fn pd13(&mut self) -> PD13_W { + PD13_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.14"] #[inline(always)] #[must_use] - pub fn pd14(&mut self) -> PD14_W<24> { - PD14_W::new(self) + pub fn pd14(&mut self) -> PD14_W { + PD14_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.15"] #[inline(always)] #[must_use] - pub fn pd15(&mut self) -> PD15_W<28> { - PD15_W::new(self) + pub fn pd15(&mut self) -> PD15_W { + PD15_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Pad Driver Mode 1 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr1::R`](R) reader structure"] +impl crate::Readable for PDR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr1::W`](W) writer structure"] impl crate::Writable for PDR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port2/pps.rs b/src/port2/pps.rs index dadb0773..f577fe70 100644 --- a/src/port2/pps.rs +++ b/src/port2/pps.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] pub type PPS0_R = crate::BitReader; #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PPS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS0_A { + pub const fn variant(&self) -> PPS0_A { match self.bits { false => PPS0_A::VALUE1, true => PPS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS0_A::VALUE2 } } #[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] -pub type PPS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS0_A, O>; -impl<'a, const O: u8> PPS0_W<'a, O> { +pub type PPS0_W<'a, REG> = crate::BitWriter<'a, REG, PPS0_A>; +impl<'a, REG> PPS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PPS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS1_A { + pub const fn variant(&self) -> PPS1_A { match self.bits { false => PPS1_A::VALUE1, true => PPS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS1_A::VALUE2 } } #[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] -pub type PPS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS1_A, O>; -impl<'a, const O: u8> PPS1_W<'a, O> { +pub type PPS1_W<'a, REG> = crate::BitWriter<'a, REG, PPS1_A>; +impl<'a, REG> PPS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PPS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS2_A { + pub const fn variant(&self) -> PPS2_A { match self.bits { false => PPS2_A::VALUE1, true => PPS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS2_A::VALUE2 } } #[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] -pub type PPS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS2_A, O>; -impl<'a, const O: u8> PPS2_W<'a, O> { +pub type PPS2_W<'a, REG> = crate::BitWriter<'a, REG, PPS2_A>; +impl<'a, REG> PPS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PPS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS3_A { + pub const fn variant(&self) -> PPS3_A { match self.bits { false => PPS3_A::VALUE1, true => PPS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS3_A::VALUE2 } } #[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] -pub type PPS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS3_A, O>; -impl<'a, const O: u8> PPS3_W<'a, O> { +pub type PPS3_W<'a, REG> = crate::BitWriter<'a, REG, PPS3_A>; +impl<'a, REG> PPS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PPS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS4_A { + pub const fn variant(&self) -> PPS4_A { match self.bits { false => PPS4_A::VALUE1, true => PPS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS4_A::VALUE2 } } #[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] -pub type PPS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS4_A, O>; -impl<'a, const O: u8> PPS4_W<'a, O> { +pub type PPS4_W<'a, REG> = crate::BitWriter<'a, REG, PPS4_A>; +impl<'a, REG> PPS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PPS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS5_A { + pub const fn variant(&self) -> PPS5_A { match self.bits { false => PPS5_A::VALUE1, true => PPS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS5_A::VALUE2 } } #[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] -pub type PPS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS5_A, O>; -impl<'a, const O: u8> PPS5_W<'a, O> { +pub type PPS5_W<'a, REG> = crate::BitWriter<'a, REG, PPS5_A>; +impl<'a, REG> PPS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS6_A { + pub const fn variant(&self) -> PPS6_A { match self.bits { false => PPS6_A::VALUE1, true => PPS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS6_A::VALUE2 } } #[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] -pub type PPS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS6_A, O>; -impl<'a, const O: u8> PPS6_W<'a, O> { +pub type PPS6_W<'a, REG> = crate::BitWriter<'a, REG, PPS6_A>; +impl<'a, REG> PPS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PPS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS7_A { + pub const fn variant(&self) -> PPS7_A { match self.bits { false => PPS7_A::VALUE1, true => PPS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS7_A::VALUE2 } } #[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] -pub type PPS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS7_A, O>; -impl<'a, const O: u8> PPS7_W<'a, O> { +pub type PPS7_W<'a, REG> = crate::BitWriter<'a, REG, PPS7_A>; +impl<'a, REG> PPS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PPS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS8_A { + pub const fn variant(&self) -> PPS8_A { match self.bits { false => PPS8_A::VALUE1, true => PPS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS8_A::VALUE2 } } #[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] -pub type PPS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS8_A, O>; -impl<'a, const O: u8> PPS8_W<'a, O> { +pub type PPS8_W<'a, REG> = crate::BitWriter<'a, REG, PPS8_A>; +impl<'a, REG> PPS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PPS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS9_A { + pub const fn variant(&self) -> PPS9_A { match self.bits { false => PPS9_A::VALUE1, true => PPS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS9_A::VALUE2 } } #[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] -pub type PPS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS9_A, O>; -impl<'a, const O: u8> PPS9_W<'a, O> { +pub type PPS9_W<'a, REG> = crate::BitWriter<'a, REG, PPS9_A>; +impl<'a, REG> PPS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PPS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS10_A { + pub const fn variant(&self) -> PPS10_A { match self.bits { false => PPS10_A::VALUE1, true => PPS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS10_A::VALUE2 } } #[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] -pub type PPS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS10_A, O>; -impl<'a, const O: u8> PPS10_W<'a, O> { +pub type PPS10_W<'a, REG> = crate::BitWriter<'a, REG, PPS10_A>; +impl<'a, REG> PPS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PPS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS11_A { + pub const fn variant(&self) -> PPS11_A { match self.bits { false => PPS11_A::VALUE1, true => PPS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS11_A::VALUE2 } } #[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] -pub type PPS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS11_A, O>; -impl<'a, const O: u8> PPS11_W<'a, O> { +pub type PPS11_W<'a, REG> = crate::BitWriter<'a, REG, PPS11_A>; +impl<'a, REG> PPS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PPS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS12_A { + pub const fn variant(&self) -> PPS12_A { match self.bits { false => PPS12_A::VALUE1, true => PPS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS12_A::VALUE2 } } #[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] -pub type PPS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS12_A, O>; -impl<'a, const O: u8> PPS12_W<'a, O> { +pub type PPS12_W<'a, REG> = crate::BitWriter<'a, REG, PPS12_A>; +impl<'a, REG> PPS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PPS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS13_A { + pub const fn variant(&self) -> PPS13_A { match self.bits { false => PPS13_A::VALUE1, true => PPS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS13_A::VALUE2 } } #[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] -pub type PPS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS13_A, O>; -impl<'a, const O: u8> PPS13_W<'a, O> { +pub type PPS13_W<'a, REG> = crate::BitWriter<'a, REG, PPS13_A>; +impl<'a, REG> PPS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PPS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS14_A { + pub const fn variant(&self) -> PPS14_A { match self.bits { false => PPS14_A::VALUE1, true => PPS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS14_A::VALUE2 } } #[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] -pub type PPS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS14_A, O>; -impl<'a, const O: u8> PPS14_W<'a, O> { +pub type PPS14_W<'a, REG> = crate::BitWriter<'a, REG, PPS14_A>; +impl<'a, REG> PPS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PPS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS15_A { + pub const fn variant(&self) -> PPS15_A { match self.bits { false => PPS15_A::VALUE1, true => PPS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS15_A::VALUE2 } } #[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] -pub type PPS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS15_A, O>; -impl<'a, const O: u8> PPS15_W<'a, O> { +pub type PPS15_W<'a, REG> = crate::BitWriter<'a, REG, PPS15_A>; +impl<'a, REG> PPS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Pin Power Save Bit 0"] #[inline(always)] #[must_use] - pub fn pps0(&mut self) -> PPS0_W<0> { - PPS0_W::new(self) + pub fn pps0(&mut self) -> PPS0_W { + PPS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Pin Power Save Bit 1"] #[inline(always)] #[must_use] - pub fn pps1(&mut self) -> PPS1_W<1> { - PPS1_W::new(self) + pub fn pps1(&mut self) -> PPS1_W { + PPS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Pin Power Save Bit 2"] #[inline(always)] #[must_use] - pub fn pps2(&mut self) -> PPS2_W<2> { - PPS2_W::new(self) + pub fn pps2(&mut self) -> PPS2_W { + PPS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Pin Power Save Bit 3"] #[inline(always)] #[must_use] - pub fn pps3(&mut self) -> PPS3_W<3> { - PPS3_W::new(self) + pub fn pps3(&mut self) -> PPS3_W { + PPS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Pin Power Save Bit 4"] #[inline(always)] #[must_use] - pub fn pps4(&mut self) -> PPS4_W<4> { - PPS4_W::new(self) + pub fn pps4(&mut self) -> PPS4_W { + PPS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Pin Power Save Bit 5"] #[inline(always)] #[must_use] - pub fn pps5(&mut self) -> PPS5_W<5> { - PPS5_W::new(self) + pub fn pps5(&mut self) -> PPS5_W { + PPS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Pin Power Save Bit 6"] #[inline(always)] #[must_use] - pub fn pps6(&mut self) -> PPS6_W<6> { - PPS6_W::new(self) + pub fn pps6(&mut self) -> PPS6_W { + PPS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Pin Power Save Bit 7"] #[inline(always)] #[must_use] - pub fn pps7(&mut self) -> PPS7_W<7> { - PPS7_W::new(self) + pub fn pps7(&mut self) -> PPS7_W { + PPS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Pin Power Save Bit 8"] #[inline(always)] #[must_use] - pub fn pps8(&mut self) -> PPS8_W<8> { - PPS8_W::new(self) + pub fn pps8(&mut self) -> PPS8_W { + PPS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Pin Power Save Bit 9"] #[inline(always)] #[must_use] - pub fn pps9(&mut self) -> PPS9_W<9> { - PPS9_W::new(self) + pub fn pps9(&mut self) -> PPS9_W { + PPS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Pin Power Save Bit 10"] #[inline(always)] #[must_use] - pub fn pps10(&mut self) -> PPS10_W<10> { - PPS10_W::new(self) + pub fn pps10(&mut self) -> PPS10_W { + PPS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Pin Power Save Bit 11"] #[inline(always)] #[must_use] - pub fn pps11(&mut self) -> PPS11_W<11> { - PPS11_W::new(self) + pub fn pps11(&mut self) -> PPS11_W { + PPS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Pin Power Save Bit 12"] #[inline(always)] #[must_use] - pub fn pps12(&mut self) -> PPS12_W<12> { - PPS12_W::new(self) + pub fn pps12(&mut self) -> PPS12_W { + PPS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Pin Power Save Bit 13"] #[inline(always)] #[must_use] - pub fn pps13(&mut self) -> PPS13_W<13> { - PPS13_W::new(self) + pub fn pps13(&mut self) -> PPS13_W { + PPS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Pin Power Save Bit 14"] #[inline(always)] #[must_use] - pub fn pps14(&mut self) -> PPS14_W<14> { - PPS14_W::new(self) + pub fn pps14(&mut self) -> PPS14_W { + PPS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Pin Power Save Bit 15"] #[inline(always)] #[must_use] - pub fn pps15(&mut self) -> PPS15_W<15> { - PPS15_W::new(self) + pub fn pps15(&mut self) -> PPS15_W { + PPS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 2 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pps::R`](R) reader structure"] +impl crate::Readable for PPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps::W`](W) writer structure"] impl crate::Writable for PPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port3.rs b/src/port3.rs index 63c4f8ee..e56a92fd 100644 --- a/src/port3.rs +++ b/src/port3.rs @@ -1,63 +1,110 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + out: OUT, + omr: OMR, + _reserved2: [u8; 0x08], + iocr0: IOCR0, + iocr4: IOCR4, + _reserved4: [u8; 0x0c], + in_: IN, + _reserved5: [u8; 0x18], + pdr0: PDR0, + _reserved6: [u8; 0x1c], + pdisc: PDISC, + _reserved7: [u8; 0x0c], + pps: PPS, + hwsel: HWSEL, +} +impl RegisterBlock { #[doc = "0x00 - Port 3 Output Register"] - pub out: OUT, + #[inline(always)] + pub const fn out(&self) -> &OUT { + &self.out + } #[doc = "0x04 - Port 3 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn omr(&self) -> &OMR { + &self.omr + } #[doc = "0x10 - Port 3 Input/Output Control Register 0"] - pub iocr0: IOCR0, + #[inline(always)] + pub const fn iocr0(&self) -> &IOCR0 { + &self.iocr0 + } #[doc = "0x14 - Port 3 Input/Output Control Register 4"] - pub iocr4: IOCR4, - _reserved4: [u8; 0x0c], + #[inline(always)] + pub const fn iocr4(&self) -> &IOCR4 { + &self.iocr4 + } #[doc = "0x24 - Port 3 Input Register"] - pub in_: IN, - _reserved5: [u8; 0x18], + #[inline(always)] + pub const fn in_(&self) -> &IN { + &self.in_ + } #[doc = "0x40 - Port 3 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, - _reserved6: [u8; 0x1c], + #[inline(always)] + pub const fn pdr0(&self) -> &PDR0 { + &self.pdr0 + } #[doc = "0x60 - Port 3 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved7: [u8; 0x0c], + #[inline(always)] + pub const fn pdisc(&self) -> &PDISC { + &self.pdisc + } #[doc = "0x70 - Port 3 Pin Power Save Register"] - pub pps: PPS, + #[inline(always)] + pub const fn pps(&self) -> &PPS { + &self.pps + } #[doc = "0x74 - Port 3 Pin Hardware Select Register"] - pub hwsel: HWSEL, + #[inline(always)] + pub const fn hwsel(&self) -> &HWSEL { + &self.hwsel + } } -#[doc = "OUT (rw) register accessor: an alias for `Reg`"] +#[doc = "OUT (rw) register accessor: Port 3 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out`] +module"] pub type OUT = crate::Reg; #[doc = "Port 3 Output Register"] pub mod out; -#[doc = "OMR (w) register accessor: an alias for `Reg`"] +#[doc = "OMR (w) register accessor: Port 3 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@omr`] +module"] pub type OMR = crate::Reg; #[doc = "Port 3 Output Modification Register"] pub mod omr; -#[doc = "IOCR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR0 (rw) register accessor: Port 3 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr0`] +module"] pub type IOCR0 = crate::Reg; #[doc = "Port 3 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "IOCR4 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR4 (rw) register accessor: Port 3 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr4`] +module"] pub type IOCR4 = crate::Reg; #[doc = "Port 3 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "IN (r) register accessor: an alias for `Reg`"] +#[doc = "IN (r) register accessor: Port 3 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] pub type IN = crate::Reg; #[doc = "Port 3 Input Register"] pub mod in_; -#[doc = "PDR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR0 (rw) register accessor: Port 3 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr0`] +module"] pub type PDR0 = crate::Reg; #[doc = "Port 3 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "PDISC (r) register accessor: an alias for `Reg`"] +#[doc = "PDISC (r) register accessor: Port 3 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdisc`] +module"] pub type PDISC = crate::Reg; #[doc = "Port 3 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "PPS (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS (rw) register accessor: Port 3 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps`] +module"] pub type PPS = crate::Reg; #[doc = "Port 3 Pin Power Save Register"] pub mod pps; -#[doc = "HWSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "HWSEL (rw) register accessor: Port 3 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hwsel`] +module"] 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 e3660d66..0c96371d 100644 --- a/src/port3/hwsel.rs +++ b/src/port3/hwsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] -pub type HW0_R = crate::FieldReader; +pub type HW0_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW0_A { + type Ux = u8; +} impl HW0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW0_A::VALUE1), 1 => Some(HW0_A::VALUE2), @@ -64,43 +35,47 @@ impl HW0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW0_A::VALUE3 } } #[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] -pub type HW0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW0_A, 2, O>; -impl<'a, const O: u8> HW0_W<'a, O> { +pub type HW0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW0_A>; +impl<'a, REG> HW0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE3) } } #[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] -pub type HW1_R = crate::FieldReader; +pub type HW1_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW1_A { + type Ux = u8; +} impl HW1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW1_A::VALUE1), 1 => Some(HW1_A::VALUE2), @@ -129,43 +107,47 @@ impl HW1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW1_A::VALUE3 } } #[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] -pub type HW1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW1_A, 2, O>; -impl<'a, const O: u8> HW1_W<'a, O> { +pub type HW1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW1_A>; +impl<'a, REG> HW1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE3) } } #[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] -pub type HW2_R = crate::FieldReader; +pub type HW2_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW2_A { + type Ux = u8; +} impl HW2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW2_A::VALUE1), 1 => Some(HW2_A::VALUE2), @@ -194,43 +179,47 @@ impl HW2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW2_A::VALUE3 } } #[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] -pub type HW2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW2_A, 2, O>; -impl<'a, const O: u8> HW2_W<'a, O> { +pub type HW2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW2_A>; +impl<'a, REG> HW2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE3) } } #[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] -pub type HW3_R = crate::FieldReader; +pub type HW3_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW3_A { + type Ux = u8; +} impl HW3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW3_A::VALUE1), 1 => Some(HW3_A::VALUE2), @@ -259,43 +251,47 @@ impl HW3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW3_A::VALUE3 } } #[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] -pub type HW3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW3_A, 2, O>; -impl<'a, const O: u8> HW3_W<'a, O> { +pub type HW3_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW3_A>; +impl<'a, REG> HW3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE3) } } #[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] -pub type HW4_R = crate::FieldReader; +pub type HW4_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +309,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW4_A { + type Ux = u8; +} impl HW4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW4_A::VALUE1), 1 => Some(HW4_A::VALUE2), @@ -324,43 +323,47 @@ impl HW4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW4_A::VALUE3 } } #[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] -pub type HW4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW4_A, 2, O>; -impl<'a, const O: u8> HW4_W<'a, O> { +pub type HW4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW4_A>; +impl<'a, REG> HW4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE3) } } #[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] -pub type HW5_R = crate::FieldReader; +pub type HW5_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -378,10 +381,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW5_A { + type Ux = u8; +} impl HW5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW5_A::VALUE1), 1 => Some(HW5_A::VALUE2), @@ -389,43 +395,47 @@ impl HW5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW5_A::VALUE3 } } #[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] -pub type HW5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW5_A, 2, O>; -impl<'a, const O: u8> HW5_W<'a, O> { +pub type HW5_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW5_A>; +impl<'a, REG> HW5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE3) } } #[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] -pub type HW6_R = crate::FieldReader; +pub type HW6_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW6_A { + type Ux = u8; +} impl HW6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW6_A::VALUE1), 1 => Some(HW6_A::VALUE2), @@ -454,43 +467,47 @@ impl HW6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW6_A::VALUE3 } } #[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] -pub type HW6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW6_A, 2, O>; -impl<'a, const O: u8> HW6_W<'a, O> { +pub type HW6_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW6_A>; +impl<'a, REG> HW6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE3) } } #[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] -pub type HW7_R = crate::FieldReader; +pub type HW7_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW7_A { + type Ux = u8; +} impl HW7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW7_A::VALUE1), 1 => Some(HW7_A::VALUE2), @@ -519,43 +539,47 @@ impl HW7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW7_A::VALUE3 } } #[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] -pub type HW7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW7_A, 2, O>; -impl<'a, const O: u8> HW7_W<'a, O> { +pub type HW7_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW7_A>; +impl<'a, REG> HW7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE3) } } #[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] -pub type HW8_R = crate::FieldReader; +pub type HW8_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 8\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -573,10 +597,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW8_A { + type Ux = u8; +} impl HW8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW8_A::VALUE1), 1 => Some(HW8_A::VALUE2), @@ -584,43 +611,47 @@ impl HW8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW8_A::VALUE3 } } #[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] -pub type HW8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW8_A, 2, O>; -impl<'a, const O: u8> HW8_W<'a, O> { +pub type HW8_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW8_A>; +impl<'a, REG> HW8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE3) } } #[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] -pub type HW9_R = crate::FieldReader; +pub type HW9_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 9\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -638,10 +669,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW9_A { + type Ux = u8; +} impl HW9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW9_A::VALUE1), 1 => Some(HW9_A::VALUE2), @@ -649,43 +683,47 @@ impl HW9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW9_A::VALUE3 } } #[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] -pub type HW9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW9_A, 2, O>; -impl<'a, const O: u8> HW9_W<'a, O> { +pub type HW9_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW9_A>; +impl<'a, REG> HW9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE3) } } #[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] -pub type HW10_R = crate::FieldReader; +pub type HW10_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -703,10 +741,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW10_A { + type Ux = u8; +} impl HW10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW10_A::VALUE1), 1 => Some(HW10_A::VALUE2), @@ -714,43 +755,47 @@ impl HW10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW10_A::VALUE3 } } #[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] -pub type HW10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW10_A, 2, O>; -impl<'a, const O: u8> HW10_W<'a, O> { +pub type HW10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW10_A>; +impl<'a, REG> HW10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE3) } } #[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] -pub type HW11_R = crate::FieldReader; +pub type HW11_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -768,10 +813,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW11_A { + type Ux = u8; +} impl HW11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW11_A::VALUE1), 1 => Some(HW11_A::VALUE2), @@ -779,43 +827,47 @@ impl HW11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW11_A::VALUE3 } } #[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] -pub type HW11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW11_A, 2, O>; -impl<'a, const O: u8> HW11_W<'a, O> { +pub type HW11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW11_A>; +impl<'a, REG> HW11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE3) } } #[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] -pub type HW12_R = crate::FieldReader; +pub type HW12_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 12\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -833,10 +885,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW12_A { + type Ux = u8; +} impl HW12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW12_A::VALUE1), 1 => Some(HW12_A::VALUE2), @@ -844,43 +899,47 @@ impl HW12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW12_A::VALUE3 } } #[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] -pub type HW12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW12_A, 2, O>; -impl<'a, const O: u8> HW12_W<'a, O> { +pub type HW12_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW12_A>; +impl<'a, REG> HW12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE3) } } #[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] -pub type HW13_R = crate::FieldReader; +pub type HW13_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 13\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -898,10 +957,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW13_A { + type Ux = u8; +} impl HW13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW13_A::VALUE1), 1 => Some(HW13_A::VALUE2), @@ -909,43 +971,47 @@ impl HW13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW13_A::VALUE3 } } #[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] -pub type HW13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW13_A, 2, O>; -impl<'a, const O: u8> HW13_W<'a, O> { +pub type HW13_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW13_A>; +impl<'a, REG> HW13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE3) } } #[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] -pub type HW14_R = crate::FieldReader; +pub type HW14_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -963,10 +1029,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW14_A { + type Ux = u8; +} impl HW14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW14_A::VALUE1), 1 => Some(HW14_A::VALUE2), @@ -974,43 +1043,47 @@ impl HW14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW14_A::VALUE3 } } #[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] -pub type HW14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW14_A, 2, O>; -impl<'a, const O: u8> HW14_W<'a, O> { +pub type HW14_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW14_A>; +impl<'a, REG> HW14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE3) } } #[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] -pub type HW15_R = crate::FieldReader; +pub type HW15_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1028,10 +1101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW15_A { + type Ux = u8; +} impl HW15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW15_A::VALUE1), 1 => Some(HW15_A::VALUE2), @@ -1039,38 +1115,42 @@ impl HW15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW15_A::VALUE3 } } #[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] -pub type HW15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW15_A, 2, O>; -impl<'a, const O: u8> HW15_W<'a, O> { +pub type HW15_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW15_A>; +impl<'a, REG> HW15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE3) } } @@ -1160,118 +1240,119 @@ impl W { #[doc = "Bits 0:1 - Port n Pin Hardware Select Bit 0"] #[inline(always)] #[must_use] - pub fn hw0(&mut self) -> HW0_W<0> { - HW0_W::new(self) + pub fn hw0(&mut self) -> HW0_W { + HW0_W::new(self, 0) } #[doc = "Bits 2:3 - Port n Pin Hardware Select Bit 1"] #[inline(always)] #[must_use] - pub fn hw1(&mut self) -> HW1_W<2> { - HW1_W::new(self) + pub fn hw1(&mut self) -> HW1_W { + HW1_W::new(self, 2) } #[doc = "Bits 4:5 - Port n Pin Hardware Select Bit 2"] #[inline(always)] #[must_use] - pub fn hw2(&mut self) -> HW2_W<4> { - HW2_W::new(self) + pub fn hw2(&mut self) -> HW2_W { + HW2_W::new(self, 4) } #[doc = "Bits 6:7 - Port n Pin Hardware Select Bit 3"] #[inline(always)] #[must_use] - pub fn hw3(&mut self) -> HW3_W<6> { - HW3_W::new(self) + pub fn hw3(&mut self) -> HW3_W { + HW3_W::new(self, 6) } #[doc = "Bits 8:9 - Port n Pin Hardware Select Bit 4"] #[inline(always)] #[must_use] - pub fn hw4(&mut self) -> HW4_W<8> { - HW4_W::new(self) + pub fn hw4(&mut self) -> HW4_W { + HW4_W::new(self, 8) } #[doc = "Bits 10:11 - Port n Pin Hardware Select Bit 5"] #[inline(always)] #[must_use] - pub fn hw5(&mut self) -> HW5_W<10> { - HW5_W::new(self) + pub fn hw5(&mut self) -> HW5_W { + HW5_W::new(self, 10) } #[doc = "Bits 12:13 - Port n Pin Hardware Select Bit 6"] #[inline(always)] #[must_use] - pub fn hw6(&mut self) -> HW6_W<12> { - HW6_W::new(self) + pub fn hw6(&mut self) -> HW6_W { + HW6_W::new(self, 12) } #[doc = "Bits 14:15 - Port n Pin Hardware Select Bit 7"] #[inline(always)] #[must_use] - pub fn hw7(&mut self) -> HW7_W<14> { - HW7_W::new(self) + pub fn hw7(&mut self) -> HW7_W { + HW7_W::new(self, 14) } #[doc = "Bits 16:17 - Port n Pin Hardware Select Bit 8"] #[inline(always)] #[must_use] - pub fn hw8(&mut self) -> HW8_W<16> { - HW8_W::new(self) + pub fn hw8(&mut self) -> HW8_W { + HW8_W::new(self, 16) } #[doc = "Bits 18:19 - Port n Pin Hardware Select Bit 9"] #[inline(always)] #[must_use] - pub fn hw9(&mut self) -> HW9_W<18> { - HW9_W::new(self) + pub fn hw9(&mut self) -> HW9_W { + HW9_W::new(self, 18) } #[doc = "Bits 20:21 - Port n Pin Hardware Select Bit 10"] #[inline(always)] #[must_use] - pub fn hw10(&mut self) -> HW10_W<20> { - HW10_W::new(self) + pub fn hw10(&mut self) -> HW10_W { + HW10_W::new(self, 20) } #[doc = "Bits 22:23 - Port n Pin Hardware Select Bit 11"] #[inline(always)] #[must_use] - pub fn hw11(&mut self) -> HW11_W<22> { - HW11_W::new(self) + pub fn hw11(&mut self) -> HW11_W { + HW11_W::new(self, 22) } #[doc = "Bits 24:25 - Port n Pin Hardware Select Bit 12"] #[inline(always)] #[must_use] - pub fn hw12(&mut self) -> HW12_W<24> { - HW12_W::new(self) + pub fn hw12(&mut self) -> HW12_W { + HW12_W::new(self, 24) } #[doc = "Bits 26:27 - Port n Pin Hardware Select Bit 13"] #[inline(always)] #[must_use] - pub fn hw13(&mut self) -> HW13_W<26> { - HW13_W::new(self) + pub fn hw13(&mut self) -> HW13_W { + HW13_W::new(self, 26) } #[doc = "Bits 28:29 - Port n Pin Hardware Select Bit 14"] #[inline(always)] #[must_use] - pub fn hw14(&mut self) -> HW14_W<28> { - HW14_W::new(self) + pub fn hw14(&mut self) -> HW14_W { + HW14_W::new(self, 28) } #[doc = "Bits 30:31 - Port n Pin Hardware Select Bit 15"] #[inline(always)] #[must_use] - pub fn hw15(&mut self) -> HW15_W<30> { - HW15_W::new(self) + pub fn hw15(&mut self) -> HW15_W { + HW15_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 3 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hwsel::R`](R) reader structure"] +impl crate::Readable for HWSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hwsel::W`](W) writer structure"] impl crate::Writable for HWSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port3/in_.rs b/src/port3/in_.rs index 2beab7d5..e12027fc 100644 --- a/src/port3/in_.rs +++ b/src/port3/in_.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `P0` reader - Port n Input Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { P15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 3 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`in_::R`](R) reader structure"] +impl crate::Readable for IN_SPEC {} #[doc = "`reset()` method sets IN to value 0"] impl crate::Resettable for IN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port3/iocr0.rs b/src/port3/iocr0.rs index fb62d11a..e9fcf63c 100644 --- a/src/port3/iocr0.rs +++ b/src/port3/iocr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] -pub type PC0_R = crate::FieldReader; +pub type PC0_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC0_A { + type Ux = u8; +} impl PC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC0_A::VALUE1), 1 => Some(PC0_A::VALUE2), @@ -109,193 +80,197 @@ impl PC0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC0_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC0_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC0_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC0_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC0_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC0_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC0_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC0_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC0_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC0_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC0_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC0_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC0_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC0_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC0_A::VALUE18 } } #[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] -pub type PC0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC0_A, 5, O>; -impl<'a, const O: u8> PC0_W<'a, O> { +pub type PC0_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC0_A>; +impl<'a, REG> PC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE18) } } #[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] -pub type PC1_R = crate::FieldReader; +pub type PC1_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC1_A { + type Ux = u8; +} impl PC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC1_A::VALUE1), 1 => Some(PC1_A::VALUE2), @@ -369,193 +347,197 @@ impl PC1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC1_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC1_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC1_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC1_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC1_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC1_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC1_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC1_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC1_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC1_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC1_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC1_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC1_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC1_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC1_A::VALUE18 } } #[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] -pub type PC1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC1_A, 5, O>; -impl<'a, const O: u8> PC1_W<'a, O> { +pub type PC1_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC1_A>; +impl<'a, REG> PC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE18) } } #[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] -pub type PC2_R = crate::FieldReader; +pub type PC2_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC2_A { + type Ux = u8; +} impl PC2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC2_A::VALUE1), 1 => Some(PC2_A::VALUE2), @@ -629,193 +614,197 @@ impl PC2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC2_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC2_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC2_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC2_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC2_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC2_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC2_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC2_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC2_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC2_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC2_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC2_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC2_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC2_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC2_A::VALUE18 } } #[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] -pub type PC2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC2_A, 5, O>; -impl<'a, const O: u8> PC2_W<'a, O> { +pub type PC2_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC2_A>; +impl<'a, REG> PC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE18) } } #[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] -pub type PC3_R = crate::FieldReader; +pub type PC3_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC3_A { + type Ux = u8; +} impl PC3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC3_A::VALUE1), 1 => Some(PC3_A::VALUE2), @@ -889,188 +881,192 @@ impl PC3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC3_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC3_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC3_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC3_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC3_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC3_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC3_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC3_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC3_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC3_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC3_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC3_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC3_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC3_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC3_A::VALUE18 } } #[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] -pub type PC3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC3_A, 5, O>; -impl<'a, const O: u8> PC3_W<'a, O> { +pub type PC3_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC3_A>; +impl<'a, REG> PC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc0(&mut self) -> PC0_W<3> { - PC0_W::new(self) + pub fn pc0(&mut self) -> PC0_W { + PC0_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc1(&mut self) -> PC1_W<11> { - PC1_W::new(self) + pub fn pc1(&mut self) -> PC1_W { + PC1_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc2(&mut self) -> PC2_W<19> { - PC2_W::new(self) + pub fn pc2(&mut self) -> PC2_W { + PC2_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc3(&mut self) -> PC3_W<27> { - PC3_W::new(self) + pub fn pc3(&mut self) -> PC3_W { + PC3_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 3 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr0::R`](R) reader structure"] +impl crate::Readable for IOCR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr0::W`](W) writer structure"] impl crate::Writable for IOCR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port3/iocr4.rs b/src/port3/iocr4.rs index a1bf35a5..c4ea26fb 100644 --- a/src/port3/iocr4.rs +++ b/src/port3/iocr4.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] -pub type PC4_R = crate::FieldReader; +pub type PC4_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC4_A { + type Ux = u8; +} impl PC4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC4_A::VALUE1), 1 => Some(PC4_A::VALUE2), @@ -109,193 +80,197 @@ impl PC4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC4_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC4_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC4_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC4_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC4_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC4_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC4_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC4_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC4_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC4_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC4_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC4_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC4_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC4_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC4_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC4_A::VALUE18 } } #[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] -pub type PC4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC4_A, 5, O>; -impl<'a, const O: u8> PC4_W<'a, O> { +pub type PC4_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC4_A>; +impl<'a, REG> PC4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE18) } } #[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] -pub type PC5_R = crate::FieldReader; +pub type PC5_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC5_A { + type Ux = u8; +} impl PC5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC5_A::VALUE1), 1 => Some(PC5_A::VALUE2), @@ -369,193 +347,197 @@ impl PC5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC5_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC5_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC5_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC5_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC5_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC5_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC5_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC5_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC5_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC5_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC5_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC5_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC5_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC5_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC5_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC5_A::VALUE18 } } #[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] -pub type PC5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC5_A, 5, O>; -impl<'a, const O: u8> PC5_W<'a, O> { +pub type PC5_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC5_A>; +impl<'a, REG> PC5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE18) } } #[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] -pub type PC6_R = crate::FieldReader; +pub type PC6_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC6_A { + type Ux = u8; +} impl PC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC6_A::VALUE1), 1 => Some(PC6_A::VALUE2), @@ -629,193 +614,197 @@ impl PC6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC6_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC6_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC6_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC6_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC6_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC6_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC6_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC6_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC6_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC6_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC6_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC6_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC6_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC6_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC6_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC6_A::VALUE18 } } #[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] -pub type PC6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC6_A, 5, O>; -impl<'a, const O: u8> PC6_W<'a, O> { +pub type PC6_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC6_A>; +impl<'a, REG> PC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE18) } } #[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] -pub type PC7_R = crate::FieldReader; +pub type PC7_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC7_A { + type Ux = u8; +} impl PC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC7_A::VALUE1), 1 => Some(PC7_A::VALUE2), @@ -889,188 +881,192 @@ impl PC7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC7_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC7_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC7_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC7_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC7_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC7_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC7_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC7_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC7_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC7_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC7_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC7_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC7_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC7_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC7_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC7_A::VALUE18 } } #[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] -pub type PC7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC7_A, 5, O>; -impl<'a, const O: u8> PC7_W<'a, O> { +pub type PC7_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC7_A>; +impl<'a, REG> PC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc4(&mut self) -> PC4_W<3> { - PC4_W::new(self) + pub fn pc4(&mut self) -> PC4_W { + PC4_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc5(&mut self) -> PC5_W<11> { - PC5_W::new(self) + pub fn pc5(&mut self) -> PC5_W { + PC5_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc6(&mut self) -> PC6_W<19> { - PC6_W::new(self) + pub fn pc6(&mut self) -> PC6_W { + PC6_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc7(&mut self) -> PC7_W<27> { - PC7_W::new(self) + pub fn pc7(&mut self) -> PC7_W { + PC7_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 3 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"] +#[doc = "Port 3 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr4::R`](R) reader structure"] +impl crate::Readable for IOCR4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr4::W`](W) writer structure"] impl crate::Writable for IOCR4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port3/omr.rs b/src/port3/omr.rs index f99d1f69..97ca6352 100644 --- a/src/port3/omr.rs +++ b/src/port3/omr.rs @@ -1,296 +1,280 @@ #[doc = "Register `OMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PS0` writer - Port n Set Bit 0"] -pub type PS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1` writer - Port n Set Bit 1"] -pub type PS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2` writer - Port n Set Bit 2"] -pub type PS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS3` writer - Port n Set Bit 3"] -pub type PS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS4` writer - Port n Set Bit 4"] -pub type PS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS5` writer - Port n Set Bit 5"] -pub type PS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS6` writer - Port n Set Bit 6"] -pub type PS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS7` writer - Port n Set Bit 7"] -pub type PS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS8` writer - Port n Set Bit 8"] -pub type PS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS9` writer - Port n Set Bit 9"] -pub type PS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS10` writer - Port n Set Bit 10"] -pub type PS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS11` writer - Port n Set Bit 11"] -pub type PS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS12` writer - Port n Set Bit 12"] -pub type PS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS13` writer - Port n Set Bit 13"] -pub type PS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS14` writer - Port n Set Bit 14"] -pub type PS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS15` writer - Port n Set Bit 15"] -pub type PS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR0` writer - Port n Reset Bit 0"] -pub type PR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR1` writer - Port n Reset Bit 1"] -pub type PR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR2` writer - Port n Reset Bit 2"] -pub type PR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR3` writer - Port n Reset Bit 3"] -pub type PR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR4` writer - Port n Reset Bit 4"] -pub type PR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR5` writer - Port n Reset Bit 5"] -pub type PR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR6` writer - Port n Reset Bit 6"] -pub type PR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR7` writer - Port n Reset Bit 7"] -pub type PR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR8` writer - Port n Reset Bit 8"] -pub type PR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR9` writer - Port n Reset Bit 9"] -pub type PR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR10` writer - Port n Reset Bit 10"] -pub type PR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR11` writer - Port n Reset Bit 11"] -pub type PR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR12` writer - Port n Reset Bit 12"] -pub type PR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR13` writer - Port n Reset Bit 13"] -pub type PR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR14` writer - Port n Reset Bit 14"] -pub type PR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR15` writer - Port n Reset Bit 15"] -pub type PR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR15_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Port n Set Bit 0"] #[inline(always)] #[must_use] - pub fn ps0(&mut self) -> PS0_W<0> { - PS0_W::new(self) + pub fn ps0(&mut self) -> PS0_W { + PS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Set Bit 1"] #[inline(always)] #[must_use] - pub fn ps1(&mut self) -> PS1_W<1> { - PS1_W::new(self) + pub fn ps1(&mut self) -> PS1_W { + PS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Set Bit 2"] #[inline(always)] #[must_use] - pub fn ps2(&mut self) -> PS2_W<2> { - PS2_W::new(self) + pub fn ps2(&mut self) -> PS2_W { + PS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Set Bit 3"] #[inline(always)] #[must_use] - pub fn ps3(&mut self) -> PS3_W<3> { - PS3_W::new(self) + pub fn ps3(&mut self) -> PS3_W { + PS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Set Bit 4"] #[inline(always)] #[must_use] - pub fn ps4(&mut self) -> PS4_W<4> { - PS4_W::new(self) + pub fn ps4(&mut self) -> PS4_W { + PS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Set Bit 5"] #[inline(always)] #[must_use] - pub fn ps5(&mut self) -> PS5_W<5> { - PS5_W::new(self) + pub fn ps5(&mut self) -> PS5_W { + PS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Set Bit 6"] #[inline(always)] #[must_use] - pub fn ps6(&mut self) -> PS6_W<6> { - PS6_W::new(self) + pub fn ps6(&mut self) -> PS6_W { + PS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Set Bit 7"] #[inline(always)] #[must_use] - pub fn ps7(&mut self) -> PS7_W<7> { - PS7_W::new(self) + pub fn ps7(&mut self) -> PS7_W { + PS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Set Bit 8"] #[inline(always)] #[must_use] - pub fn ps8(&mut self) -> PS8_W<8> { - PS8_W::new(self) + pub fn ps8(&mut self) -> PS8_W { + PS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Set Bit 9"] #[inline(always)] #[must_use] - pub fn ps9(&mut self) -> PS9_W<9> { - PS9_W::new(self) + pub fn ps9(&mut self) -> PS9_W { + PS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Set Bit 10"] #[inline(always)] #[must_use] - pub fn ps10(&mut self) -> PS10_W<10> { - PS10_W::new(self) + pub fn ps10(&mut self) -> PS10_W { + PS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Set Bit 11"] #[inline(always)] #[must_use] - pub fn ps11(&mut self) -> PS11_W<11> { - PS11_W::new(self) + pub fn ps11(&mut self) -> PS11_W { + PS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Set Bit 12"] #[inline(always)] #[must_use] - pub fn ps12(&mut self) -> PS12_W<12> { - PS12_W::new(self) + pub fn ps12(&mut self) -> PS12_W { + PS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Set Bit 13"] #[inline(always)] #[must_use] - pub fn ps13(&mut self) -> PS13_W<13> { - PS13_W::new(self) + pub fn ps13(&mut self) -> PS13_W { + PS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Set Bit 14"] #[inline(always)] #[must_use] - pub fn ps14(&mut self) -> PS14_W<14> { - PS14_W::new(self) + pub fn ps14(&mut self) -> PS14_W { + PS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Set Bit 15"] #[inline(always)] #[must_use] - pub fn ps15(&mut self) -> PS15_W<15> { - PS15_W::new(self) + pub fn ps15(&mut self) -> PS15_W { + PS15_W::new(self, 15) } #[doc = "Bit 16 - Port n Reset Bit 0"] #[inline(always)] #[must_use] - pub fn pr0(&mut self) -> PR0_W<16> { - PR0_W::new(self) + pub fn pr0(&mut self) -> PR0_W { + PR0_W::new(self, 16) } #[doc = "Bit 17 - Port n Reset Bit 1"] #[inline(always)] #[must_use] - pub fn pr1(&mut self) -> PR1_W<17> { - PR1_W::new(self) + pub fn pr1(&mut self) -> PR1_W { + PR1_W::new(self, 17) } #[doc = "Bit 18 - Port n Reset Bit 2"] #[inline(always)] #[must_use] - pub fn pr2(&mut self) -> PR2_W<18> { - PR2_W::new(self) + pub fn pr2(&mut self) -> PR2_W { + PR2_W::new(self, 18) } #[doc = "Bit 19 - Port n Reset Bit 3"] #[inline(always)] #[must_use] - pub fn pr3(&mut self) -> PR3_W<19> { - PR3_W::new(self) + pub fn pr3(&mut self) -> PR3_W { + PR3_W::new(self, 19) } #[doc = "Bit 20 - Port n Reset Bit 4"] #[inline(always)] #[must_use] - pub fn pr4(&mut self) -> PR4_W<20> { - PR4_W::new(self) + pub fn pr4(&mut self) -> PR4_W { + PR4_W::new(self, 20) } #[doc = "Bit 21 - Port n Reset Bit 5"] #[inline(always)] #[must_use] - pub fn pr5(&mut self) -> PR5_W<21> { - PR5_W::new(self) + pub fn pr5(&mut self) -> PR5_W { + PR5_W::new(self, 21) } #[doc = "Bit 22 - Port n Reset Bit 6"] #[inline(always)] #[must_use] - pub fn pr6(&mut self) -> PR6_W<22> { - PR6_W::new(self) + pub fn pr6(&mut self) -> PR6_W { + PR6_W::new(self, 22) } #[doc = "Bit 23 - Port n Reset Bit 7"] #[inline(always)] #[must_use] - pub fn pr7(&mut self) -> PR7_W<23> { - PR7_W::new(self) + pub fn pr7(&mut self) -> PR7_W { + PR7_W::new(self, 23) } #[doc = "Bit 24 - Port n Reset Bit 8"] #[inline(always)] #[must_use] - pub fn pr8(&mut self) -> PR8_W<24> { - PR8_W::new(self) + pub fn pr8(&mut self) -> PR8_W { + PR8_W::new(self, 24) } #[doc = "Bit 25 - Port n Reset Bit 9"] #[inline(always)] #[must_use] - pub fn pr9(&mut self) -> PR9_W<25> { - PR9_W::new(self) + pub fn pr9(&mut self) -> PR9_W { + PR9_W::new(self, 25) } #[doc = "Bit 26 - Port n Reset Bit 10"] #[inline(always)] #[must_use] - pub fn pr10(&mut self) -> PR10_W<26> { - PR10_W::new(self) + pub fn pr10(&mut self) -> PR10_W { + PR10_W::new(self, 26) } #[doc = "Bit 27 - Port n Reset Bit 11"] #[inline(always)] #[must_use] - pub fn pr11(&mut self) -> PR11_W<27> { - PR11_W::new(self) + pub fn pr11(&mut self) -> PR11_W { + PR11_W::new(self, 27) } #[doc = "Bit 28 - Port n Reset Bit 12"] #[inline(always)] #[must_use] - pub fn pr12(&mut self) -> PR12_W<28> { - PR12_W::new(self) + pub fn pr12(&mut self) -> PR12_W { + PR12_W::new(self, 28) } #[doc = "Bit 29 - Port n Reset Bit 13"] #[inline(always)] #[must_use] - pub fn pr13(&mut self) -> PR13_W<29> { - PR13_W::new(self) + pub fn pr13(&mut self) -> PR13_W { + PR13_W::new(self, 29) } #[doc = "Bit 30 - Port n Reset Bit 14"] #[inline(always)] #[must_use] - pub fn pr14(&mut self) -> PR14_W<30> { - PR14_W::new(self) + pub fn pr14(&mut self) -> PR14_W { + PR14_W::new(self, 30) } #[doc = "Bit 31 - Port n Reset Bit 15"] #[inline(always)] #[must_use] - pub fn pr15(&mut self) -> PR15_W<31> { - PR15_W::new(self) + pub fn pr15(&mut self) -> PR15_W { + PR15_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 3 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OMR_SPEC; impl crate::RegisterSpec for OMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`omr::W`](W) writer structure"] impl crate::Writable for OMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port3/out.rs b/src/port3/out.rs index c2abd19d..0b90fed5 100644 --- a/src/port3/out.rs +++ b/src/port3/out.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `P0` reader - Port n Output Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 } } #[doc = "Field `P0` writer - Port n Output Bit 0"] -pub type P0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P0_A, O>; -impl<'a, const O: u8> P0_W<'a, O> { +pub type P0_W<'a, REG> = crate::BitWriter<'a, REG, P0_A>; +impl<'a, REG> P0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P0_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 } } #[doc = "Field `P1` writer - Port n Output Bit 1"] -pub type P1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P1_A, O>; -impl<'a, const O: u8> P1_W<'a, O> { +pub type P1_W<'a, REG> = crate::BitWriter<'a, REG, P1_A>; +impl<'a, REG> P1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P1_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 } } #[doc = "Field `P2` writer - Port n Output Bit 2"] -pub type P2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P2_A, O>; -impl<'a, const O: u8> P2_W<'a, O> { +pub type P2_W<'a, REG> = crate::BitWriter<'a, REG, P2_A>; +impl<'a, REG> P2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P2_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 } } #[doc = "Field `P3` writer - Port n Output Bit 3"] -pub type P3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P3_A, O>; -impl<'a, const O: u8> P3_W<'a, O> { +pub type P3_W<'a, REG> = crate::BitWriter<'a, REG, P3_A>; +impl<'a, REG> P3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P3_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 } } #[doc = "Field `P4` writer - Port n Output Bit 4"] -pub type P4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P4_A, O>; -impl<'a, const O: u8> P4_W<'a, O> { +pub type P4_W<'a, REG> = crate::BitWriter<'a, REG, P4_A>; +impl<'a, REG> P4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P4_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 } } #[doc = "Field `P5` writer - Port n Output Bit 5"] -pub type P5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P5_A, O>; -impl<'a, const O: u8> P5_W<'a, O> { +pub type P5_W<'a, REG> = crate::BitWriter<'a, REG, P5_A>; +impl<'a, REG> P5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P5_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 } } #[doc = "Field `P6` writer - Port n Output Bit 6"] -pub type P6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P6_A, O>; -impl<'a, const O: u8> P6_W<'a, O> { +pub type P6_W<'a, REG> = crate::BitWriter<'a, REG, P6_A>; +impl<'a, REG> P6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P6_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 } } #[doc = "Field `P7` writer - Port n Output Bit 7"] -pub type P7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P7_A, O>; -impl<'a, const O: u8> P7_W<'a, O> { +pub type P7_W<'a, REG> = crate::BitWriter<'a, REG, P7_A>; +impl<'a, REG> P7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P7_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 } } #[doc = "Field `P8` writer - Port n Output Bit 8"] -pub type P8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P8_A, O>; -impl<'a, const O: u8> P8_W<'a, O> { +pub type P8_W<'a, REG> = crate::BitWriter<'a, REG, P8_A>; +impl<'a, REG> P8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P8_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 } } #[doc = "Field `P9` writer - Port n Output Bit 9"] -pub type P9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P9_A, O>; -impl<'a, const O: u8> P9_W<'a, O> { +pub type P9_W<'a, REG> = crate::BitWriter<'a, REG, P9_A>; +impl<'a, REG> P9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P9_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 } } #[doc = "Field `P10` writer - Port n Output Bit 10"] -pub type P10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P10_A, O>; -impl<'a, const O: u8> P10_W<'a, O> { +pub type P10_W<'a, REG> = crate::BitWriter<'a, REG, P10_A>; +impl<'a, REG> P10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P10_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 } } #[doc = "Field `P11` writer - Port n Output Bit 11"] -pub type P11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P11_A, O>; -impl<'a, const O: u8> P11_W<'a, O> { +pub type P11_W<'a, REG> = crate::BitWriter<'a, REG, P11_A>; +impl<'a, REG> P11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P11_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 } } #[doc = "Field `P12` writer - Port n Output Bit 12"] -pub type P12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P12_A, O>; -impl<'a, const O: u8> P12_W<'a, O> { +pub type P12_W<'a, REG> = crate::BitWriter<'a, REG, P12_A>; +impl<'a, REG> P12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P12_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 } } #[doc = "Field `P13` writer - Port n Output Bit 13"] -pub type P13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P13_A, O>; -impl<'a, const O: u8> P13_W<'a, O> { +pub type P13_W<'a, REG> = crate::BitWriter<'a, REG, P13_A>; +impl<'a, REG> P13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P13_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 } } #[doc = "Field `P14` writer - Port n Output Bit 14"] -pub type P14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P14_A, O>; -impl<'a, const O: u8> P14_W<'a, O> { +pub type P14_W<'a, REG> = crate::BitWriter<'a, REG, P14_A>; +impl<'a, REG> P14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P14_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 } } #[doc = "Field `P15` writer - Port n Output Bit 15"] -pub type P15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P15_A, O>; -impl<'a, const O: u8> P15_W<'a, O> { +pub type P15_W<'a, REG> = crate::BitWriter<'a, REG, P15_A>; +impl<'a, REG> P15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P15_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Output Bit 0"] #[inline(always)] #[must_use] - pub fn p0(&mut self) -> P0_W<0> { - P0_W::new(self) + pub fn p0(&mut self) -> P0_W { + P0_W::new(self, 0) } #[doc = "Bit 1 - Port n Output Bit 1"] #[inline(always)] #[must_use] - pub fn p1(&mut self) -> P1_W<1> { - P1_W::new(self) + pub fn p1(&mut self) -> P1_W { + P1_W::new(self, 1) } #[doc = "Bit 2 - Port n Output Bit 2"] #[inline(always)] #[must_use] - pub fn p2(&mut self) -> P2_W<2> { - P2_W::new(self) + pub fn p2(&mut self) -> P2_W { + P2_W::new(self, 2) } #[doc = "Bit 3 - Port n Output Bit 3"] #[inline(always)] #[must_use] - pub fn p3(&mut self) -> P3_W<3> { - P3_W::new(self) + pub fn p3(&mut self) -> P3_W { + P3_W::new(self, 3) } #[doc = "Bit 4 - Port n Output Bit 4"] #[inline(always)] #[must_use] - pub fn p4(&mut self) -> P4_W<4> { - P4_W::new(self) + pub fn p4(&mut self) -> P4_W { + P4_W::new(self, 4) } #[doc = "Bit 5 - Port n Output Bit 5"] #[inline(always)] #[must_use] - pub fn p5(&mut self) -> P5_W<5> { - P5_W::new(self) + pub fn p5(&mut self) -> P5_W { + P5_W::new(self, 5) } #[doc = "Bit 6 - Port n Output Bit 6"] #[inline(always)] #[must_use] - pub fn p6(&mut self) -> P6_W<6> { - P6_W::new(self) + pub fn p6(&mut self) -> P6_W { + P6_W::new(self, 6) } #[doc = "Bit 7 - Port n Output Bit 7"] #[inline(always)] #[must_use] - pub fn p7(&mut self) -> P7_W<7> { - P7_W::new(self) + pub fn p7(&mut self) -> P7_W { + P7_W::new(self, 7) } #[doc = "Bit 8 - Port n Output Bit 8"] #[inline(always)] #[must_use] - pub fn p8(&mut self) -> P8_W<8> { - P8_W::new(self) + pub fn p8(&mut self) -> P8_W { + P8_W::new(self, 8) } #[doc = "Bit 9 - Port n Output Bit 9"] #[inline(always)] #[must_use] - pub fn p9(&mut self) -> P9_W<9> { - P9_W::new(self) + pub fn p9(&mut self) -> P9_W { + P9_W::new(self, 9) } #[doc = "Bit 10 - Port n Output Bit 10"] #[inline(always)] #[must_use] - pub fn p10(&mut self) -> P10_W<10> { - P10_W::new(self) + pub fn p10(&mut self) -> P10_W { + P10_W::new(self, 10) } #[doc = "Bit 11 - Port n Output Bit 11"] #[inline(always)] #[must_use] - pub fn p11(&mut self) -> P11_W<11> { - P11_W::new(self) + pub fn p11(&mut self) -> P11_W { + P11_W::new(self, 11) } #[doc = "Bit 12 - Port n Output Bit 12"] #[inline(always)] #[must_use] - pub fn p12(&mut self) -> P12_W<12> { - P12_W::new(self) + pub fn p12(&mut self) -> P12_W { + P12_W::new(self, 12) } #[doc = "Bit 13 - Port n Output Bit 13"] #[inline(always)] #[must_use] - pub fn p13(&mut self) -> P13_W<13> { - P13_W::new(self) + pub fn p13(&mut self) -> P13_W { + P13_W::new(self, 13) } #[doc = "Bit 14 - Port n Output Bit 14"] #[inline(always)] #[must_use] - pub fn p14(&mut self) -> P14_W<14> { - P14_W::new(self) + pub fn p14(&mut self) -> P14_W { + P14_W::new(self, 14) } #[doc = "Bit 15 - Port n Output Bit 15"] #[inline(always)] #[must_use] - pub fn p15(&mut self) -> P15_W<15> { - P15_W::new(self) + pub fn p15(&mut self) -> P15_W { + P15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 3 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`out::R`](R) reader structure"] +impl crate::Readable for OUT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`out::W`](W) writer structure"] impl crate::Writable for OUT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port3/pdisc.rs b/src/port3/pdisc.rs index 65f253b0..34d7e897 100644 --- a/src/port3/pdisc.rs +++ b/src/port3/pdisc.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] pub type PDIS0_R = crate::BitReader; #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl PDIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS0_A { + pub const fn variant(&self) -> PDIS0_A { match self.bits { false => PDIS0_A::VALUE1, true => PDIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl PDIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS1_A { + pub const fn variant(&self) -> PDIS1_A { match self.bits { false => PDIS1_A::VALUE1, true => PDIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl PDIS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS2_A { + pub const fn variant(&self) -> PDIS2_A { match self.bits { false => PDIS2_A::VALUE1, true => PDIS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl PDIS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS3_A { + pub const fn variant(&self) -> PDIS3_A { match self.bits { false => PDIS3_A::VALUE1, true => PDIS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl PDIS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS4_A { + pub const fn variant(&self) -> PDIS4_A { match self.bits { false => PDIS4_A::VALUE1, true => PDIS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PDIS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS5_A { + pub const fn variant(&self) -> PDIS5_A { match self.bits { false => PDIS5_A::VALUE1, true => PDIS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl PDIS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS6_A { + pub const fn variant(&self) -> PDIS6_A { match self.bits { false => PDIS6_A::VALUE1, true => PDIS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl PDIS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS7_A { + pub const fn variant(&self) -> PDIS7_A { match self.bits { false => PDIS7_A::VALUE1, true => PDIS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PDIS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS8_A { + pub const fn variant(&self) -> PDIS8_A { match self.bits { false => PDIS8_A::VALUE1, true => PDIS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl PDIS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS9_A { + pub const fn variant(&self) -> PDIS9_A { match self.bits { false => PDIS9_A::VALUE1, true => PDIS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl PDIS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS10_A { + pub const fn variant(&self) -> PDIS10_A { match self.bits { false => PDIS10_A::VALUE1, true => PDIS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl PDIS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS11_A { + pub const fn variant(&self) -> PDIS11_A { match self.bits { false => PDIS11_A::VALUE1, true => PDIS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl PDIS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS12_A { + pub const fn variant(&self) -> PDIS12_A { match self.bits { false => PDIS12_A::VALUE1, true => PDIS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl PDIS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS13_A { + pub const fn variant(&self) -> PDIS13_A { match self.bits { false => PDIS13_A::VALUE1, true => PDIS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl PDIS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS14_A { + pub const fn variant(&self) -> PDIS14_A { match self.bits { false => PDIS14_A::VALUE1, true => PDIS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl PDIS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS15_A { + pub const fn variant(&self) -> PDIS15_A { match self.bits { false => PDIS15_A::VALUE1, true => PDIS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Port 3 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pdisc::R`](R) reader structure"] +impl crate::Readable for PDISC_SPEC {} #[doc = "`reset()` method sets PDISC to value 0"] impl crate::Resettable for PDISC_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port3/pdr0.rs b/src/port3/pdr0.rs index 012c595e..06486514 100644 --- a/src/port3/pdr0.rs +++ b/src/port3/pdr0.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] -pub type PD0_R = crate::FieldReader; +pub type PD0_R = crate::FieldReader; #[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] -pub type PD0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] -pub type PD1_R = crate::FieldReader; +pub type PD1_R = crate::FieldReader; #[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] -pub type PD1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] -pub type PD2_R = crate::FieldReader; +pub type PD2_R = crate::FieldReader; #[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] -pub type PD2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] -pub type PD3_R = crate::FieldReader; +pub type PD3_R = crate::FieldReader; #[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] -pub type PD3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD3_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] -pub type PD4_R = crate::FieldReader; +pub type PD4_R = crate::FieldReader; #[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] -pub type PD4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD4_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] -pub type PD5_R = crate::FieldReader; +pub type PD5_R = crate::FieldReader; #[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] -pub type PD5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD5_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] -pub type PD6_R = crate::FieldReader; +pub type PD6_R = crate::FieldReader; #[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] -pub type PD6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD6_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] -pub type PD7_R = crate::FieldReader; +pub type PD7_R = crate::FieldReader; #[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] -pub type PD7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD7_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] #[must_use] - pub fn pd0(&mut self) -> PD0_W<0> { - PD0_W::new(self) + pub fn pd0(&mut self) -> PD0_W { + PD0_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.1"] #[inline(always)] #[must_use] - pub fn pd1(&mut self) -> PD1_W<4> { - PD1_W::new(self) + pub fn pd1(&mut self) -> PD1_W { + PD1_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.2"] #[inline(always)] #[must_use] - pub fn pd2(&mut self) -> PD2_W<8> { - PD2_W::new(self) + pub fn pd2(&mut self) -> PD2_W { + PD2_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.3"] #[inline(always)] #[must_use] - pub fn pd3(&mut self) -> PD3_W<12> { - PD3_W::new(self) + pub fn pd3(&mut self) -> PD3_W { + PD3_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.4"] #[inline(always)] #[must_use] - pub fn pd4(&mut self) -> PD4_W<16> { - PD4_W::new(self) + pub fn pd4(&mut self) -> PD4_W { + PD4_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.5"] #[inline(always)] #[must_use] - pub fn pd5(&mut self) -> PD5_W<20> { - PD5_W::new(self) + pub fn pd5(&mut self) -> PD5_W { + PD5_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.6"] #[inline(always)] #[must_use] - pub fn pd6(&mut self) -> PD6_W<24> { - PD6_W::new(self) + pub fn pd6(&mut self) -> PD6_W { + PD6_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.7"] #[inline(always)] #[must_use] - pub fn pd7(&mut self) -> PD7_W<28> { - PD7_W::new(self) + pub fn pd7(&mut self) -> PD7_W { + PD7_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 3 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr0::R`](R) reader structure"] +impl crate::Readable for PDR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr0::W`](W) writer structure"] impl crate::Writable for PDR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port3/pps.rs b/src/port3/pps.rs index 163ab25f..6c0f4038 100644 --- a/src/port3/pps.rs +++ b/src/port3/pps.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] pub type PPS0_R = crate::BitReader; #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PPS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS0_A { + pub const fn variant(&self) -> PPS0_A { match self.bits { false => PPS0_A::VALUE1, true => PPS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS0_A::VALUE2 } } #[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] -pub type PPS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS0_A, O>; -impl<'a, const O: u8> PPS0_W<'a, O> { +pub type PPS0_W<'a, REG> = crate::BitWriter<'a, REG, PPS0_A>; +impl<'a, REG> PPS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PPS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS1_A { + pub const fn variant(&self) -> PPS1_A { match self.bits { false => PPS1_A::VALUE1, true => PPS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS1_A::VALUE2 } } #[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] -pub type PPS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS1_A, O>; -impl<'a, const O: u8> PPS1_W<'a, O> { +pub type PPS1_W<'a, REG> = crate::BitWriter<'a, REG, PPS1_A>; +impl<'a, REG> PPS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PPS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS2_A { + pub const fn variant(&self) -> PPS2_A { match self.bits { false => PPS2_A::VALUE1, true => PPS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS2_A::VALUE2 } } #[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] -pub type PPS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS2_A, O>; -impl<'a, const O: u8> PPS2_W<'a, O> { +pub type PPS2_W<'a, REG> = crate::BitWriter<'a, REG, PPS2_A>; +impl<'a, REG> PPS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PPS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS3_A { + pub const fn variant(&self) -> PPS3_A { match self.bits { false => PPS3_A::VALUE1, true => PPS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS3_A::VALUE2 } } #[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] -pub type PPS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS3_A, O>; -impl<'a, const O: u8> PPS3_W<'a, O> { +pub type PPS3_W<'a, REG> = crate::BitWriter<'a, REG, PPS3_A>; +impl<'a, REG> PPS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PPS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS4_A { + pub const fn variant(&self) -> PPS4_A { match self.bits { false => PPS4_A::VALUE1, true => PPS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS4_A::VALUE2 } } #[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] -pub type PPS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS4_A, O>; -impl<'a, const O: u8> PPS4_W<'a, O> { +pub type PPS4_W<'a, REG> = crate::BitWriter<'a, REG, PPS4_A>; +impl<'a, REG> PPS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PPS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS5_A { + pub const fn variant(&self) -> PPS5_A { match self.bits { false => PPS5_A::VALUE1, true => PPS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS5_A::VALUE2 } } #[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] -pub type PPS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS5_A, O>; -impl<'a, const O: u8> PPS5_W<'a, O> { +pub type PPS5_W<'a, REG> = crate::BitWriter<'a, REG, PPS5_A>; +impl<'a, REG> PPS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS6_A { + pub const fn variant(&self) -> PPS6_A { match self.bits { false => PPS6_A::VALUE1, true => PPS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS6_A::VALUE2 } } #[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] -pub type PPS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS6_A, O>; -impl<'a, const O: u8> PPS6_W<'a, O> { +pub type PPS6_W<'a, REG> = crate::BitWriter<'a, REG, PPS6_A>; +impl<'a, REG> PPS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PPS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS7_A { + pub const fn variant(&self) -> PPS7_A { match self.bits { false => PPS7_A::VALUE1, true => PPS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS7_A::VALUE2 } } #[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] -pub type PPS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS7_A, O>; -impl<'a, const O: u8> PPS7_W<'a, O> { +pub type PPS7_W<'a, REG> = crate::BitWriter<'a, REG, PPS7_A>; +impl<'a, REG> PPS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PPS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS8_A { + pub const fn variant(&self) -> PPS8_A { match self.bits { false => PPS8_A::VALUE1, true => PPS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS8_A::VALUE2 } } #[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] -pub type PPS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS8_A, O>; -impl<'a, const O: u8> PPS8_W<'a, O> { +pub type PPS8_W<'a, REG> = crate::BitWriter<'a, REG, PPS8_A>; +impl<'a, REG> PPS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PPS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS9_A { + pub const fn variant(&self) -> PPS9_A { match self.bits { false => PPS9_A::VALUE1, true => PPS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS9_A::VALUE2 } } #[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] -pub type PPS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS9_A, O>; -impl<'a, const O: u8> PPS9_W<'a, O> { +pub type PPS9_W<'a, REG> = crate::BitWriter<'a, REG, PPS9_A>; +impl<'a, REG> PPS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PPS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS10_A { + pub const fn variant(&self) -> PPS10_A { match self.bits { false => PPS10_A::VALUE1, true => PPS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS10_A::VALUE2 } } #[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] -pub type PPS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS10_A, O>; -impl<'a, const O: u8> PPS10_W<'a, O> { +pub type PPS10_W<'a, REG> = crate::BitWriter<'a, REG, PPS10_A>; +impl<'a, REG> PPS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PPS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS11_A { + pub const fn variant(&self) -> PPS11_A { match self.bits { false => PPS11_A::VALUE1, true => PPS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS11_A::VALUE2 } } #[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] -pub type PPS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS11_A, O>; -impl<'a, const O: u8> PPS11_W<'a, O> { +pub type PPS11_W<'a, REG> = crate::BitWriter<'a, REG, PPS11_A>; +impl<'a, REG> PPS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PPS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS12_A { + pub const fn variant(&self) -> PPS12_A { match self.bits { false => PPS12_A::VALUE1, true => PPS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS12_A::VALUE2 } } #[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] -pub type PPS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS12_A, O>; -impl<'a, const O: u8> PPS12_W<'a, O> { +pub type PPS12_W<'a, REG> = crate::BitWriter<'a, REG, PPS12_A>; +impl<'a, REG> PPS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PPS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS13_A { + pub const fn variant(&self) -> PPS13_A { match self.bits { false => PPS13_A::VALUE1, true => PPS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS13_A::VALUE2 } } #[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] -pub type PPS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS13_A, O>; -impl<'a, const O: u8> PPS13_W<'a, O> { +pub type PPS13_W<'a, REG> = crate::BitWriter<'a, REG, PPS13_A>; +impl<'a, REG> PPS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PPS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS14_A { + pub const fn variant(&self) -> PPS14_A { match self.bits { false => PPS14_A::VALUE1, true => PPS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS14_A::VALUE2 } } #[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] -pub type PPS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS14_A, O>; -impl<'a, const O: u8> PPS14_W<'a, O> { +pub type PPS14_W<'a, REG> = crate::BitWriter<'a, REG, PPS14_A>; +impl<'a, REG> PPS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PPS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS15_A { + pub const fn variant(&self) -> PPS15_A { match self.bits { false => PPS15_A::VALUE1, true => PPS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS15_A::VALUE2 } } #[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] -pub type PPS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS15_A, O>; -impl<'a, const O: u8> PPS15_W<'a, O> { +pub type PPS15_W<'a, REG> = crate::BitWriter<'a, REG, PPS15_A>; +impl<'a, REG> PPS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Pin Power Save Bit 0"] #[inline(always)] #[must_use] - pub fn pps0(&mut self) -> PPS0_W<0> { - PPS0_W::new(self) + pub fn pps0(&mut self) -> PPS0_W { + PPS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Pin Power Save Bit 1"] #[inline(always)] #[must_use] - pub fn pps1(&mut self) -> PPS1_W<1> { - PPS1_W::new(self) + pub fn pps1(&mut self) -> PPS1_W { + PPS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Pin Power Save Bit 2"] #[inline(always)] #[must_use] - pub fn pps2(&mut self) -> PPS2_W<2> { - PPS2_W::new(self) + pub fn pps2(&mut self) -> PPS2_W { + PPS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Pin Power Save Bit 3"] #[inline(always)] #[must_use] - pub fn pps3(&mut self) -> PPS3_W<3> { - PPS3_W::new(self) + pub fn pps3(&mut self) -> PPS3_W { + PPS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Pin Power Save Bit 4"] #[inline(always)] #[must_use] - pub fn pps4(&mut self) -> PPS4_W<4> { - PPS4_W::new(self) + pub fn pps4(&mut self) -> PPS4_W { + PPS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Pin Power Save Bit 5"] #[inline(always)] #[must_use] - pub fn pps5(&mut self) -> PPS5_W<5> { - PPS5_W::new(self) + pub fn pps5(&mut self) -> PPS5_W { + PPS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Pin Power Save Bit 6"] #[inline(always)] #[must_use] - pub fn pps6(&mut self) -> PPS6_W<6> { - PPS6_W::new(self) + pub fn pps6(&mut self) -> PPS6_W { + PPS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Pin Power Save Bit 7"] #[inline(always)] #[must_use] - pub fn pps7(&mut self) -> PPS7_W<7> { - PPS7_W::new(self) + pub fn pps7(&mut self) -> PPS7_W { + PPS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Pin Power Save Bit 8"] #[inline(always)] #[must_use] - pub fn pps8(&mut self) -> PPS8_W<8> { - PPS8_W::new(self) + pub fn pps8(&mut self) -> PPS8_W { + PPS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Pin Power Save Bit 9"] #[inline(always)] #[must_use] - pub fn pps9(&mut self) -> PPS9_W<9> { - PPS9_W::new(self) + pub fn pps9(&mut self) -> PPS9_W { + PPS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Pin Power Save Bit 10"] #[inline(always)] #[must_use] - pub fn pps10(&mut self) -> PPS10_W<10> { - PPS10_W::new(self) + pub fn pps10(&mut self) -> PPS10_W { + PPS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Pin Power Save Bit 11"] #[inline(always)] #[must_use] - pub fn pps11(&mut self) -> PPS11_W<11> { - PPS11_W::new(self) + pub fn pps11(&mut self) -> PPS11_W { + PPS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Pin Power Save Bit 12"] #[inline(always)] #[must_use] - pub fn pps12(&mut self) -> PPS12_W<12> { - PPS12_W::new(self) + pub fn pps12(&mut self) -> PPS12_W { + PPS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Pin Power Save Bit 13"] #[inline(always)] #[must_use] - pub fn pps13(&mut self) -> PPS13_W<13> { - PPS13_W::new(self) + pub fn pps13(&mut self) -> PPS13_W { + PPS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Pin Power Save Bit 14"] #[inline(always)] #[must_use] - pub fn pps14(&mut self) -> PPS14_W<14> { - PPS14_W::new(self) + pub fn pps14(&mut self) -> PPS14_W { + PPS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Pin Power Save Bit 15"] #[inline(always)] #[must_use] - pub fn pps15(&mut self) -> PPS15_W<15> { - PPS15_W::new(self) + pub fn pps15(&mut self) -> PPS15_W { + PPS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Port 3 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pps::R`](R) reader structure"] +impl crate::Readable for PPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps::W`](W) writer structure"] impl crate::Writable for PPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port4.rs b/src/port4.rs index a605b491..16ab25fc 100644 --- a/src/port4.rs +++ b/src/port4.rs @@ -1,57 +1,99 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + out: OUT, + omr: OMR, + _reserved2: [u8; 0x08], + iocr0: IOCR0, + _reserved3: [u8; 0x10], + in_: IN, + _reserved4: [u8; 0x18], + pdr0: PDR0, + _reserved5: [u8; 0x1c], + pdisc: PDISC, + _reserved6: [u8; 0x0c], + pps: PPS, + hwsel: HWSEL, +} +impl RegisterBlock { #[doc = "0x00 - Port 4 Output Register"] - pub out: OUT, + #[inline(always)] + pub const fn out(&self) -> &OUT { + &self.out + } #[doc = "0x04 - Port 4 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn omr(&self) -> &OMR { + &self.omr + } #[doc = "0x10 - Port 4 Input/Output Control Register 0"] - pub iocr0: IOCR0, - _reserved3: [u8; 0x10], + #[inline(always)] + pub const fn iocr0(&self) -> &IOCR0 { + &self.iocr0 + } #[doc = "0x24 - Port 4 Input Register"] - pub in_: IN, - _reserved4: [u8; 0x18], + #[inline(always)] + pub const fn in_(&self) -> &IN { + &self.in_ + } #[doc = "0x40 - Port 4 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, - _reserved5: [u8; 0x1c], + #[inline(always)] + pub const fn pdr0(&self) -> &PDR0 { + &self.pdr0 + } #[doc = "0x60 - Port 4 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved6: [u8; 0x0c], + #[inline(always)] + pub const fn pdisc(&self) -> &PDISC { + &self.pdisc + } #[doc = "0x70 - Port 4 Pin Power Save Register"] - pub pps: PPS, + #[inline(always)] + pub const fn pps(&self) -> &PPS { + &self.pps + } #[doc = "0x74 - Port 4 Pin Hardware Select Register"] - pub hwsel: HWSEL, + #[inline(always)] + pub const fn hwsel(&self) -> &HWSEL { + &self.hwsel + } } -#[doc = "OUT (rw) register accessor: an alias for `Reg`"] +#[doc = "OUT (rw) register accessor: Port 4 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out`] +module"] pub type OUT = crate::Reg; #[doc = "Port 4 Output Register"] pub mod out; -#[doc = "OMR (w) register accessor: an alias for `Reg`"] +#[doc = "OMR (w) register accessor: Port 4 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@omr`] +module"] pub type OMR = crate::Reg; #[doc = "Port 4 Output Modification Register"] pub mod omr; -#[doc = "IOCR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR0 (rw) register accessor: Port 4 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr0`] +module"] pub type IOCR0 = crate::Reg; #[doc = "Port 4 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "IN (r) register accessor: an alias for `Reg`"] +#[doc = "IN (r) register accessor: Port 4 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] pub type IN = crate::Reg; #[doc = "Port 4 Input Register"] pub mod in_; -#[doc = "PDR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR0 (rw) register accessor: Port 4 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr0`] +module"] pub type PDR0 = crate::Reg; #[doc = "Port 4 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "PDISC (r) register accessor: an alias for `Reg`"] +#[doc = "PDISC (r) register accessor: Port 4 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdisc`] +module"] pub type PDISC = crate::Reg; #[doc = "Port 4 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "PPS (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS (rw) register accessor: Port 4 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps`] +module"] pub type PPS = crate::Reg; #[doc = "Port 4 Pin Power Save Register"] pub mod pps; -#[doc = "HWSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "HWSEL (rw) register accessor: Port 4 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hwsel`] +module"] pub type HWSEL = crate::Reg; #[doc = "Port 4 Pin Hardware Select Register"] pub mod hwsel; diff --git a/src/port4/hwsel.rs b/src/port4/hwsel.rs index 3bdf41ee..c03d14f9 100644 --- a/src/port4/hwsel.rs +++ b/src/port4/hwsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] -pub type HW0_R = crate::FieldReader; +pub type HW0_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW0_A { + type Ux = u8; +} impl HW0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW0_A::VALUE1), 1 => Some(HW0_A::VALUE2), @@ -64,43 +35,47 @@ impl HW0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW0_A::VALUE3 } } #[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] -pub type HW0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW0_A, 2, O>; -impl<'a, const O: u8> HW0_W<'a, O> { +pub type HW0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW0_A>; +impl<'a, REG> HW0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE3) } } #[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] -pub type HW1_R = crate::FieldReader; +pub type HW1_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW1_A { + type Ux = u8; +} impl HW1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW1_A::VALUE1), 1 => Some(HW1_A::VALUE2), @@ -129,43 +107,47 @@ impl HW1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW1_A::VALUE3 } } #[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] -pub type HW1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW1_A, 2, O>; -impl<'a, const O: u8> HW1_W<'a, O> { +pub type HW1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW1_A>; +impl<'a, REG> HW1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE3) } } #[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] -pub type HW2_R = crate::FieldReader; +pub type HW2_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW2_A { + type Ux = u8; +} impl HW2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW2_A::VALUE1), 1 => Some(HW2_A::VALUE2), @@ -194,43 +179,47 @@ impl HW2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW2_A::VALUE3 } } #[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] -pub type HW2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW2_A, 2, O>; -impl<'a, const O: u8> HW2_W<'a, O> { +pub type HW2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW2_A>; +impl<'a, REG> HW2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE3) } } #[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] -pub type HW3_R = crate::FieldReader; +pub type HW3_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW3_A { + type Ux = u8; +} impl HW3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW3_A::VALUE1), 1 => Some(HW3_A::VALUE2), @@ -259,43 +251,47 @@ impl HW3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW3_A::VALUE3 } } #[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] -pub type HW3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW3_A, 2, O>; -impl<'a, const O: u8> HW3_W<'a, O> { +pub type HW3_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW3_A>; +impl<'a, REG> HW3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE3) } } #[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] -pub type HW4_R = crate::FieldReader; +pub type HW4_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +309,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW4_A { + type Ux = u8; +} impl HW4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW4_A::VALUE1), 1 => Some(HW4_A::VALUE2), @@ -324,43 +323,47 @@ impl HW4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW4_A::VALUE3 } } #[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] -pub type HW4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW4_A, 2, O>; -impl<'a, const O: u8> HW4_W<'a, O> { +pub type HW4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW4_A>; +impl<'a, REG> HW4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE3) } } #[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] -pub type HW5_R = crate::FieldReader; +pub type HW5_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -378,10 +381,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW5_A { + type Ux = u8; +} impl HW5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW5_A::VALUE1), 1 => Some(HW5_A::VALUE2), @@ -389,43 +395,47 @@ impl HW5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW5_A::VALUE3 } } #[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] -pub type HW5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW5_A, 2, O>; -impl<'a, const O: u8> HW5_W<'a, O> { +pub type HW5_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW5_A>; +impl<'a, REG> HW5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE3) } } #[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] -pub type HW6_R = crate::FieldReader; +pub type HW6_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW6_A { + type Ux = u8; +} impl HW6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW6_A::VALUE1), 1 => Some(HW6_A::VALUE2), @@ -454,43 +467,47 @@ impl HW6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW6_A::VALUE3 } } #[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] -pub type HW6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW6_A, 2, O>; -impl<'a, const O: u8> HW6_W<'a, O> { +pub type HW6_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW6_A>; +impl<'a, REG> HW6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE3) } } #[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] -pub type HW7_R = crate::FieldReader; +pub type HW7_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW7_A { + type Ux = u8; +} impl HW7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW7_A::VALUE1), 1 => Some(HW7_A::VALUE2), @@ -519,43 +539,47 @@ impl HW7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW7_A::VALUE3 } } #[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] -pub type HW7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW7_A, 2, O>; -impl<'a, const O: u8> HW7_W<'a, O> { +pub type HW7_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW7_A>; +impl<'a, REG> HW7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE3) } } #[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] -pub type HW8_R = crate::FieldReader; +pub type HW8_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 8\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -573,10 +597,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW8_A { + type Ux = u8; +} impl HW8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW8_A::VALUE1), 1 => Some(HW8_A::VALUE2), @@ -584,43 +611,47 @@ impl HW8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW8_A::VALUE3 } } #[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] -pub type HW8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW8_A, 2, O>; -impl<'a, const O: u8> HW8_W<'a, O> { +pub type HW8_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW8_A>; +impl<'a, REG> HW8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE3) } } #[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] -pub type HW9_R = crate::FieldReader; +pub type HW9_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 9\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -638,10 +669,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW9_A { + type Ux = u8; +} impl HW9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW9_A::VALUE1), 1 => Some(HW9_A::VALUE2), @@ -649,43 +683,47 @@ impl HW9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW9_A::VALUE3 } } #[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] -pub type HW9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW9_A, 2, O>; -impl<'a, const O: u8> HW9_W<'a, O> { +pub type HW9_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW9_A>; +impl<'a, REG> HW9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE3) } } #[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] -pub type HW10_R = crate::FieldReader; +pub type HW10_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -703,10 +741,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW10_A { + type Ux = u8; +} impl HW10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW10_A::VALUE1), 1 => Some(HW10_A::VALUE2), @@ -714,43 +755,47 @@ impl HW10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW10_A::VALUE3 } } #[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] -pub type HW10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW10_A, 2, O>; -impl<'a, const O: u8> HW10_W<'a, O> { +pub type HW10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW10_A>; +impl<'a, REG> HW10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE3) } } #[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] -pub type HW11_R = crate::FieldReader; +pub type HW11_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -768,10 +813,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW11_A { + type Ux = u8; +} impl HW11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW11_A::VALUE1), 1 => Some(HW11_A::VALUE2), @@ -779,43 +827,47 @@ impl HW11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW11_A::VALUE3 } } #[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] -pub type HW11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW11_A, 2, O>; -impl<'a, const O: u8> HW11_W<'a, O> { +pub type HW11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW11_A>; +impl<'a, REG> HW11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE3) } } #[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] -pub type HW12_R = crate::FieldReader; +pub type HW12_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 12\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -833,10 +885,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW12_A { + type Ux = u8; +} impl HW12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW12_A::VALUE1), 1 => Some(HW12_A::VALUE2), @@ -844,43 +899,47 @@ impl HW12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW12_A::VALUE3 } } #[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] -pub type HW12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW12_A, 2, O>; -impl<'a, const O: u8> HW12_W<'a, O> { +pub type HW12_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW12_A>; +impl<'a, REG> HW12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE3) } } #[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] -pub type HW13_R = crate::FieldReader; +pub type HW13_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 13\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -898,10 +957,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW13_A { + type Ux = u8; +} impl HW13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW13_A::VALUE1), 1 => Some(HW13_A::VALUE2), @@ -909,43 +971,47 @@ impl HW13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW13_A::VALUE3 } } #[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] -pub type HW13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW13_A, 2, O>; -impl<'a, const O: u8> HW13_W<'a, O> { +pub type HW13_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW13_A>; +impl<'a, REG> HW13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE3) } } #[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] -pub type HW14_R = crate::FieldReader; +pub type HW14_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -963,10 +1029,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW14_A { + type Ux = u8; +} impl HW14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW14_A::VALUE1), 1 => Some(HW14_A::VALUE2), @@ -974,43 +1043,47 @@ impl HW14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW14_A::VALUE3 } } #[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] -pub type HW14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW14_A, 2, O>; -impl<'a, const O: u8> HW14_W<'a, O> { +pub type HW14_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW14_A>; +impl<'a, REG> HW14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE3) } } #[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] -pub type HW15_R = crate::FieldReader; +pub type HW15_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1028,10 +1101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW15_A { + type Ux = u8; +} impl HW15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW15_A::VALUE1), 1 => Some(HW15_A::VALUE2), @@ -1039,38 +1115,42 @@ impl HW15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW15_A::VALUE3 } } #[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] -pub type HW15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW15_A, 2, O>; -impl<'a, const O: u8> HW15_W<'a, O> { +pub type HW15_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW15_A>; +impl<'a, REG> HW15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE3) } } @@ -1160,118 +1240,119 @@ impl W { #[doc = "Bits 0:1 - Port n Pin Hardware Select Bit 0"] #[inline(always)] #[must_use] - pub fn hw0(&mut self) -> HW0_W<0> { - HW0_W::new(self) + pub fn hw0(&mut self) -> HW0_W { + HW0_W::new(self, 0) } #[doc = "Bits 2:3 - Port n Pin Hardware Select Bit 1"] #[inline(always)] #[must_use] - pub fn hw1(&mut self) -> HW1_W<2> { - HW1_W::new(self) + pub fn hw1(&mut self) -> HW1_W { + HW1_W::new(self, 2) } #[doc = "Bits 4:5 - Port n Pin Hardware Select Bit 2"] #[inline(always)] #[must_use] - pub fn hw2(&mut self) -> HW2_W<4> { - HW2_W::new(self) + pub fn hw2(&mut self) -> HW2_W { + HW2_W::new(self, 4) } #[doc = "Bits 6:7 - Port n Pin Hardware Select Bit 3"] #[inline(always)] #[must_use] - pub fn hw3(&mut self) -> HW3_W<6> { - HW3_W::new(self) + pub fn hw3(&mut self) -> HW3_W { + HW3_W::new(self, 6) } #[doc = "Bits 8:9 - Port n Pin Hardware Select Bit 4"] #[inline(always)] #[must_use] - pub fn hw4(&mut self) -> HW4_W<8> { - HW4_W::new(self) + pub fn hw4(&mut self) -> HW4_W { + HW4_W::new(self, 8) } #[doc = "Bits 10:11 - Port n Pin Hardware Select Bit 5"] #[inline(always)] #[must_use] - pub fn hw5(&mut self) -> HW5_W<10> { - HW5_W::new(self) + pub fn hw5(&mut self) -> HW5_W { + HW5_W::new(self, 10) } #[doc = "Bits 12:13 - Port n Pin Hardware Select Bit 6"] #[inline(always)] #[must_use] - pub fn hw6(&mut self) -> HW6_W<12> { - HW6_W::new(self) + pub fn hw6(&mut self) -> HW6_W { + HW6_W::new(self, 12) } #[doc = "Bits 14:15 - Port n Pin Hardware Select Bit 7"] #[inline(always)] #[must_use] - pub fn hw7(&mut self) -> HW7_W<14> { - HW7_W::new(self) + pub fn hw7(&mut self) -> HW7_W { + HW7_W::new(self, 14) } #[doc = "Bits 16:17 - Port n Pin Hardware Select Bit 8"] #[inline(always)] #[must_use] - pub fn hw8(&mut self) -> HW8_W<16> { - HW8_W::new(self) + pub fn hw8(&mut self) -> HW8_W { + HW8_W::new(self, 16) } #[doc = "Bits 18:19 - Port n Pin Hardware Select Bit 9"] #[inline(always)] #[must_use] - pub fn hw9(&mut self) -> HW9_W<18> { - HW9_W::new(self) + pub fn hw9(&mut self) -> HW9_W { + HW9_W::new(self, 18) } #[doc = "Bits 20:21 - Port n Pin Hardware Select Bit 10"] #[inline(always)] #[must_use] - pub fn hw10(&mut self) -> HW10_W<20> { - HW10_W::new(self) + pub fn hw10(&mut self) -> HW10_W { + HW10_W::new(self, 20) } #[doc = "Bits 22:23 - Port n Pin Hardware Select Bit 11"] #[inline(always)] #[must_use] - pub fn hw11(&mut self) -> HW11_W<22> { - HW11_W::new(self) + pub fn hw11(&mut self) -> HW11_W { + HW11_W::new(self, 22) } #[doc = "Bits 24:25 - Port n Pin Hardware Select Bit 12"] #[inline(always)] #[must_use] - pub fn hw12(&mut self) -> HW12_W<24> { - HW12_W::new(self) + pub fn hw12(&mut self) -> HW12_W { + HW12_W::new(self, 24) } #[doc = "Bits 26:27 - Port n Pin Hardware Select Bit 13"] #[inline(always)] #[must_use] - pub fn hw13(&mut self) -> HW13_W<26> { - HW13_W::new(self) + pub fn hw13(&mut self) -> HW13_W { + HW13_W::new(self, 26) } #[doc = "Bits 28:29 - Port n Pin Hardware Select Bit 14"] #[inline(always)] #[must_use] - pub fn hw14(&mut self) -> HW14_W<28> { - HW14_W::new(self) + pub fn hw14(&mut self) -> HW14_W { + HW14_W::new(self, 28) } #[doc = "Bits 30:31 - Port n Pin Hardware Select Bit 15"] #[inline(always)] #[must_use] - pub fn hw15(&mut self) -> HW15_W<30> { - HW15_W::new(self) + pub fn hw15(&mut self) -> HW15_W { + HW15_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 4 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"] +#[doc = "Port 4 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hwsel::R`](R) reader structure"] +impl crate::Readable for HWSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hwsel::W`](W) writer structure"] impl crate::Writable for HWSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port4/in_.rs b/src/port4/in_.rs index 03c89ffa..1e775de1 100644 --- a/src/port4/in_.rs +++ b/src/port4/in_.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `P0` reader - Port n Input Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { P15_R::new(((self.bits >> 15) & 1) != 0) } } -#[doc = "Port 4 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"] +#[doc = "Port 4 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`in_::R`](R) reader structure"] +impl crate::Readable for IN_SPEC {} #[doc = "`reset()` method sets IN to value 0"] impl crate::Resettable for IN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port4/iocr0.rs b/src/port4/iocr0.rs index f1acbb21..edaf5752 100644 --- a/src/port4/iocr0.rs +++ b/src/port4/iocr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] -pub type PC0_R = crate::FieldReader; +pub type PC0_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC0_A { + type Ux = u8; +} impl PC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC0_A::VALUE1), 1 => Some(PC0_A::VALUE2), @@ -109,193 +80,197 @@ impl PC0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC0_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC0_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC0_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC0_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC0_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC0_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC0_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC0_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC0_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC0_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC0_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC0_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC0_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC0_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC0_A::VALUE18 } } #[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] -pub type PC0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC0_A, 5, O>; -impl<'a, const O: u8> PC0_W<'a, O> { +pub type PC0_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC0_A>; +impl<'a, REG> PC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE18) } } #[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] -pub type PC1_R = crate::FieldReader; +pub type PC1_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC1_A { + type Ux = u8; +} impl PC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC1_A::VALUE1), 1 => Some(PC1_A::VALUE2), @@ -369,193 +347,197 @@ impl PC1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC1_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC1_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC1_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC1_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC1_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC1_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC1_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC1_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC1_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC1_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC1_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC1_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC1_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC1_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC1_A::VALUE18 } } #[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] -pub type PC1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC1_A, 5, O>; -impl<'a, const O: u8> PC1_W<'a, O> { +pub type PC1_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC1_A>; +impl<'a, REG> PC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE18) } } #[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] -pub type PC2_R = crate::FieldReader; +pub type PC2_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC2_A { + type Ux = u8; +} impl PC2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC2_A::VALUE1), 1 => Some(PC2_A::VALUE2), @@ -629,193 +614,197 @@ impl PC2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC2_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC2_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC2_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC2_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC2_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC2_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC2_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC2_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC2_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC2_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC2_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC2_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC2_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC2_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC2_A::VALUE18 } } #[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] -pub type PC2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC2_A, 5, O>; -impl<'a, const O: u8> PC2_W<'a, O> { +pub type PC2_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC2_A>; +impl<'a, REG> PC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE18) } } #[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] -pub type PC3_R = crate::FieldReader; +pub type PC3_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC3_A { + type Ux = u8; +} impl PC3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC3_A::VALUE1), 1 => Some(PC3_A::VALUE2), @@ -889,188 +881,192 @@ impl PC3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC3_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC3_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC3_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC3_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC3_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC3_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC3_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC3_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC3_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC3_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC3_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC3_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC3_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC3_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC3_A::VALUE18 } } #[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] -pub type PC3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC3_A, 5, O>; -impl<'a, const O: u8> PC3_W<'a, O> { +pub type PC3_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC3_A>; +impl<'a, REG> PC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc0(&mut self) -> PC0_W<3> { - PC0_W::new(self) + pub fn pc0(&mut self) -> PC0_W { + PC0_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc1(&mut self) -> PC1_W<11> { - PC1_W::new(self) + pub fn pc1(&mut self) -> PC1_W { + PC1_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc2(&mut self) -> PC2_W<19> { - PC2_W::new(self) + pub fn pc2(&mut self) -> PC2_W { + PC2_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc3(&mut self) -> PC3_W<27> { - PC3_W::new(self) + pub fn pc3(&mut self) -> PC3_W { + PC3_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 4 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"] +#[doc = "Port 4 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr0::R`](R) reader structure"] +impl crate::Readable for IOCR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr0::W`](W) writer structure"] impl crate::Writable for IOCR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port4/omr.rs b/src/port4/omr.rs index 4244341b..63ddea18 100644 --- a/src/port4/omr.rs +++ b/src/port4/omr.rs @@ -1,296 +1,280 @@ #[doc = "Register `OMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PS0` writer - Port n Set Bit 0"] -pub type PS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1` writer - Port n Set Bit 1"] -pub type PS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2` writer - Port n Set Bit 2"] -pub type PS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS3` writer - Port n Set Bit 3"] -pub type PS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS4` writer - Port n Set Bit 4"] -pub type PS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS5` writer - Port n Set Bit 5"] -pub type PS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS6` writer - Port n Set Bit 6"] -pub type PS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS7` writer - Port n Set Bit 7"] -pub type PS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS8` writer - Port n Set Bit 8"] -pub type PS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS9` writer - Port n Set Bit 9"] -pub type PS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS10` writer - Port n Set Bit 10"] -pub type PS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS11` writer - Port n Set Bit 11"] -pub type PS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS12` writer - Port n Set Bit 12"] -pub type PS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS13` writer - Port n Set Bit 13"] -pub type PS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS14` writer - Port n Set Bit 14"] -pub type PS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS15` writer - Port n Set Bit 15"] -pub type PS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR0` writer - Port n Reset Bit 0"] -pub type PR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR1` writer - Port n Reset Bit 1"] -pub type PR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR2` writer - Port n Reset Bit 2"] -pub type PR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR3` writer - Port n Reset Bit 3"] -pub type PR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR4` writer - Port n Reset Bit 4"] -pub type PR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR5` writer - Port n Reset Bit 5"] -pub type PR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR6` writer - Port n Reset Bit 6"] -pub type PR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR7` writer - Port n Reset Bit 7"] -pub type PR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR8` writer - Port n Reset Bit 8"] -pub type PR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR9` writer - Port n Reset Bit 9"] -pub type PR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR10` writer - Port n Reset Bit 10"] -pub type PR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR11` writer - Port n Reset Bit 11"] -pub type PR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR12` writer - Port n Reset Bit 12"] -pub type PR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR13` writer - Port n Reset Bit 13"] -pub type PR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR14` writer - Port n Reset Bit 14"] -pub type PR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR15` writer - Port n Reset Bit 15"] -pub type PR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR15_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Port n Set Bit 0"] #[inline(always)] #[must_use] - pub fn ps0(&mut self) -> PS0_W<0> { - PS0_W::new(self) + pub fn ps0(&mut self) -> PS0_W { + PS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Set Bit 1"] #[inline(always)] #[must_use] - pub fn ps1(&mut self) -> PS1_W<1> { - PS1_W::new(self) + pub fn ps1(&mut self) -> PS1_W { + PS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Set Bit 2"] #[inline(always)] #[must_use] - pub fn ps2(&mut self) -> PS2_W<2> { - PS2_W::new(self) + pub fn ps2(&mut self) -> PS2_W { + PS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Set Bit 3"] #[inline(always)] #[must_use] - pub fn ps3(&mut self) -> PS3_W<3> { - PS3_W::new(self) + pub fn ps3(&mut self) -> PS3_W { + PS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Set Bit 4"] #[inline(always)] #[must_use] - pub fn ps4(&mut self) -> PS4_W<4> { - PS4_W::new(self) + pub fn ps4(&mut self) -> PS4_W { + PS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Set Bit 5"] #[inline(always)] #[must_use] - pub fn ps5(&mut self) -> PS5_W<5> { - PS5_W::new(self) + pub fn ps5(&mut self) -> PS5_W { + PS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Set Bit 6"] #[inline(always)] #[must_use] - pub fn ps6(&mut self) -> PS6_W<6> { - PS6_W::new(self) + pub fn ps6(&mut self) -> PS6_W { + PS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Set Bit 7"] #[inline(always)] #[must_use] - pub fn ps7(&mut self) -> PS7_W<7> { - PS7_W::new(self) + pub fn ps7(&mut self) -> PS7_W { + PS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Set Bit 8"] #[inline(always)] #[must_use] - pub fn ps8(&mut self) -> PS8_W<8> { - PS8_W::new(self) + pub fn ps8(&mut self) -> PS8_W { + PS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Set Bit 9"] #[inline(always)] #[must_use] - pub fn ps9(&mut self) -> PS9_W<9> { - PS9_W::new(self) + pub fn ps9(&mut self) -> PS9_W { + PS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Set Bit 10"] #[inline(always)] #[must_use] - pub fn ps10(&mut self) -> PS10_W<10> { - PS10_W::new(self) + pub fn ps10(&mut self) -> PS10_W { + PS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Set Bit 11"] #[inline(always)] #[must_use] - pub fn ps11(&mut self) -> PS11_W<11> { - PS11_W::new(self) + pub fn ps11(&mut self) -> PS11_W { + PS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Set Bit 12"] #[inline(always)] #[must_use] - pub fn ps12(&mut self) -> PS12_W<12> { - PS12_W::new(self) + pub fn ps12(&mut self) -> PS12_W { + PS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Set Bit 13"] #[inline(always)] #[must_use] - pub fn ps13(&mut self) -> PS13_W<13> { - PS13_W::new(self) + pub fn ps13(&mut self) -> PS13_W { + PS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Set Bit 14"] #[inline(always)] #[must_use] - pub fn ps14(&mut self) -> PS14_W<14> { - PS14_W::new(self) + pub fn ps14(&mut self) -> PS14_W { + PS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Set Bit 15"] #[inline(always)] #[must_use] - pub fn ps15(&mut self) -> PS15_W<15> { - PS15_W::new(self) + pub fn ps15(&mut self) -> PS15_W { + PS15_W::new(self, 15) } #[doc = "Bit 16 - Port n Reset Bit 0"] #[inline(always)] #[must_use] - pub fn pr0(&mut self) -> PR0_W<16> { - PR0_W::new(self) + pub fn pr0(&mut self) -> PR0_W { + PR0_W::new(self, 16) } #[doc = "Bit 17 - Port n Reset Bit 1"] #[inline(always)] #[must_use] - pub fn pr1(&mut self) -> PR1_W<17> { - PR1_W::new(self) + pub fn pr1(&mut self) -> PR1_W { + PR1_W::new(self, 17) } #[doc = "Bit 18 - Port n Reset Bit 2"] #[inline(always)] #[must_use] - pub fn pr2(&mut self) -> PR2_W<18> { - PR2_W::new(self) + pub fn pr2(&mut self) -> PR2_W { + PR2_W::new(self, 18) } #[doc = "Bit 19 - Port n Reset Bit 3"] #[inline(always)] #[must_use] - pub fn pr3(&mut self) -> PR3_W<19> { - PR3_W::new(self) + pub fn pr3(&mut self) -> PR3_W { + PR3_W::new(self, 19) } #[doc = "Bit 20 - Port n Reset Bit 4"] #[inline(always)] #[must_use] - pub fn pr4(&mut self) -> PR4_W<20> { - PR4_W::new(self) + pub fn pr4(&mut self) -> PR4_W { + PR4_W::new(self, 20) } #[doc = "Bit 21 - Port n Reset Bit 5"] #[inline(always)] #[must_use] - pub fn pr5(&mut self) -> PR5_W<21> { - PR5_W::new(self) + pub fn pr5(&mut self) -> PR5_W { + PR5_W::new(self, 21) } #[doc = "Bit 22 - Port n Reset Bit 6"] #[inline(always)] #[must_use] - pub fn pr6(&mut self) -> PR6_W<22> { - PR6_W::new(self) + pub fn pr6(&mut self) -> PR6_W { + PR6_W::new(self, 22) } #[doc = "Bit 23 - Port n Reset Bit 7"] #[inline(always)] #[must_use] - pub fn pr7(&mut self) -> PR7_W<23> { - PR7_W::new(self) + pub fn pr7(&mut self) -> PR7_W { + PR7_W::new(self, 23) } #[doc = "Bit 24 - Port n Reset Bit 8"] #[inline(always)] #[must_use] - pub fn pr8(&mut self) -> PR8_W<24> { - PR8_W::new(self) + pub fn pr8(&mut self) -> PR8_W { + PR8_W::new(self, 24) } #[doc = "Bit 25 - Port n Reset Bit 9"] #[inline(always)] #[must_use] - pub fn pr9(&mut self) -> PR9_W<25> { - PR9_W::new(self) + pub fn pr9(&mut self) -> PR9_W { + PR9_W::new(self, 25) } #[doc = "Bit 26 - Port n Reset Bit 10"] #[inline(always)] #[must_use] - pub fn pr10(&mut self) -> PR10_W<26> { - PR10_W::new(self) + pub fn pr10(&mut self) -> PR10_W { + PR10_W::new(self, 26) } #[doc = "Bit 27 - Port n Reset Bit 11"] #[inline(always)] #[must_use] - pub fn pr11(&mut self) -> PR11_W<27> { - PR11_W::new(self) + pub fn pr11(&mut self) -> PR11_W { + PR11_W::new(self, 27) } #[doc = "Bit 28 - Port n Reset Bit 12"] #[inline(always)] #[must_use] - pub fn pr12(&mut self) -> PR12_W<28> { - PR12_W::new(self) + pub fn pr12(&mut self) -> PR12_W { + PR12_W::new(self, 28) } #[doc = "Bit 29 - Port n Reset Bit 13"] #[inline(always)] #[must_use] - pub fn pr13(&mut self) -> PR13_W<29> { - PR13_W::new(self) + pub fn pr13(&mut self) -> PR13_W { + PR13_W::new(self, 29) } #[doc = "Bit 30 - Port n Reset Bit 14"] #[inline(always)] #[must_use] - pub fn pr14(&mut self) -> PR14_W<30> { - PR14_W::new(self) + pub fn pr14(&mut self) -> PR14_W { + PR14_W::new(self, 30) } #[doc = "Bit 31 - Port n Reset Bit 15"] #[inline(always)] #[must_use] - pub fn pr15(&mut self) -> PR15_W<31> { - PR15_W::new(self) + pub fn pr15(&mut self) -> PR15_W { + PR15_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 4 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"] +#[doc = "Port 4 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OMR_SPEC; impl crate::RegisterSpec for OMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`omr::W`](W) writer structure"] impl crate::Writable for OMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port4/out.rs b/src/port4/out.rs index 7cbb6b9b..993938a3 100644 --- a/src/port4/out.rs +++ b/src/port4/out.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `P0` reader - Port n Output Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 } } #[doc = "Field `P0` writer - Port n Output Bit 0"] -pub type P0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P0_A, O>; -impl<'a, const O: u8> P0_W<'a, O> { +pub type P0_W<'a, REG> = crate::BitWriter<'a, REG, P0_A>; +impl<'a, REG> P0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P0_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 } } #[doc = "Field `P1` writer - Port n Output Bit 1"] -pub type P1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P1_A, O>; -impl<'a, const O: u8> P1_W<'a, O> { +pub type P1_W<'a, REG> = crate::BitWriter<'a, REG, P1_A>; +impl<'a, REG> P1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P1_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 } } #[doc = "Field `P2` writer - Port n Output Bit 2"] -pub type P2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P2_A, O>; -impl<'a, const O: u8> P2_W<'a, O> { +pub type P2_W<'a, REG> = crate::BitWriter<'a, REG, P2_A>; +impl<'a, REG> P2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P2_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 } } #[doc = "Field `P3` writer - Port n Output Bit 3"] -pub type P3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P3_A, O>; -impl<'a, const O: u8> P3_W<'a, O> { +pub type P3_W<'a, REG> = crate::BitWriter<'a, REG, P3_A>; +impl<'a, REG> P3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P3_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 } } #[doc = "Field `P4` writer - Port n Output Bit 4"] -pub type P4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P4_A, O>; -impl<'a, const O: u8> P4_W<'a, O> { +pub type P4_W<'a, REG> = crate::BitWriter<'a, REG, P4_A>; +impl<'a, REG> P4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P4_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 } } #[doc = "Field `P5` writer - Port n Output Bit 5"] -pub type P5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P5_A, O>; -impl<'a, const O: u8> P5_W<'a, O> { +pub type P5_W<'a, REG> = crate::BitWriter<'a, REG, P5_A>; +impl<'a, REG> P5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P5_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 } } #[doc = "Field `P6` writer - Port n Output Bit 6"] -pub type P6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P6_A, O>; -impl<'a, const O: u8> P6_W<'a, O> { +pub type P6_W<'a, REG> = crate::BitWriter<'a, REG, P6_A>; +impl<'a, REG> P6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P6_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 } } #[doc = "Field `P7` writer - Port n Output Bit 7"] -pub type P7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P7_A, O>; -impl<'a, const O: u8> P7_W<'a, O> { +pub type P7_W<'a, REG> = crate::BitWriter<'a, REG, P7_A>; +impl<'a, REG> P7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P7_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 } } #[doc = "Field `P8` writer - Port n Output Bit 8"] -pub type P8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P8_A, O>; -impl<'a, const O: u8> P8_W<'a, O> { +pub type P8_W<'a, REG> = crate::BitWriter<'a, REG, P8_A>; +impl<'a, REG> P8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P8_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 } } #[doc = "Field `P9` writer - Port n Output Bit 9"] -pub type P9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P9_A, O>; -impl<'a, const O: u8> P9_W<'a, O> { +pub type P9_W<'a, REG> = crate::BitWriter<'a, REG, P9_A>; +impl<'a, REG> P9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P9_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 } } #[doc = "Field `P10` writer - Port n Output Bit 10"] -pub type P10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P10_A, O>; -impl<'a, const O: u8> P10_W<'a, O> { +pub type P10_W<'a, REG> = crate::BitWriter<'a, REG, P10_A>; +impl<'a, REG> P10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P10_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 } } #[doc = "Field `P11` writer - Port n Output Bit 11"] -pub type P11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P11_A, O>; -impl<'a, const O: u8> P11_W<'a, O> { +pub type P11_W<'a, REG> = crate::BitWriter<'a, REG, P11_A>; +impl<'a, REG> P11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P11_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 } } #[doc = "Field `P12` writer - Port n Output Bit 12"] -pub type P12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P12_A, O>; -impl<'a, const O: u8> P12_W<'a, O> { +pub type P12_W<'a, REG> = crate::BitWriter<'a, REG, P12_A>; +impl<'a, REG> P12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P12_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 } } #[doc = "Field `P13` writer - Port n Output Bit 13"] -pub type P13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P13_A, O>; -impl<'a, const O: u8> P13_W<'a, O> { +pub type P13_W<'a, REG> = crate::BitWriter<'a, REG, P13_A>; +impl<'a, REG> P13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P13_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 } } #[doc = "Field `P14` writer - Port n Output Bit 14"] -pub type P14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P14_A, O>; -impl<'a, const O: u8> P14_W<'a, O> { +pub type P14_W<'a, REG> = crate::BitWriter<'a, REG, P14_A>; +impl<'a, REG> P14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P14_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 } } #[doc = "Field `P15` writer - Port n Output Bit 15"] -pub type P15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P15_A, O>; -impl<'a, const O: u8> P15_W<'a, O> { +pub type P15_W<'a, REG> = crate::BitWriter<'a, REG, P15_A>; +impl<'a, REG> P15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P15_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Output Bit 0"] #[inline(always)] #[must_use] - pub fn p0(&mut self) -> P0_W<0> { - P0_W::new(self) + pub fn p0(&mut self) -> P0_W { + P0_W::new(self, 0) } #[doc = "Bit 1 - Port n Output Bit 1"] #[inline(always)] #[must_use] - pub fn p1(&mut self) -> P1_W<1> { - P1_W::new(self) + pub fn p1(&mut self) -> P1_W { + P1_W::new(self, 1) } #[doc = "Bit 2 - Port n Output Bit 2"] #[inline(always)] #[must_use] - pub fn p2(&mut self) -> P2_W<2> { - P2_W::new(self) + pub fn p2(&mut self) -> P2_W { + P2_W::new(self, 2) } #[doc = "Bit 3 - Port n Output Bit 3"] #[inline(always)] #[must_use] - pub fn p3(&mut self) -> P3_W<3> { - P3_W::new(self) + pub fn p3(&mut self) -> P3_W { + P3_W::new(self, 3) } #[doc = "Bit 4 - Port n Output Bit 4"] #[inline(always)] #[must_use] - pub fn p4(&mut self) -> P4_W<4> { - P4_W::new(self) + pub fn p4(&mut self) -> P4_W { + P4_W::new(self, 4) } #[doc = "Bit 5 - Port n Output Bit 5"] #[inline(always)] #[must_use] - pub fn p5(&mut self) -> P5_W<5> { - P5_W::new(self) + pub fn p5(&mut self) -> P5_W { + P5_W::new(self, 5) } #[doc = "Bit 6 - Port n Output Bit 6"] #[inline(always)] #[must_use] - pub fn p6(&mut self) -> P6_W<6> { - P6_W::new(self) + pub fn p6(&mut self) -> P6_W { + P6_W::new(self, 6) } #[doc = "Bit 7 - Port n Output Bit 7"] #[inline(always)] #[must_use] - pub fn p7(&mut self) -> P7_W<7> { - P7_W::new(self) + pub fn p7(&mut self) -> P7_W { + P7_W::new(self, 7) } #[doc = "Bit 8 - Port n Output Bit 8"] #[inline(always)] #[must_use] - pub fn p8(&mut self) -> P8_W<8> { - P8_W::new(self) + pub fn p8(&mut self) -> P8_W { + P8_W::new(self, 8) } #[doc = "Bit 9 - Port n Output Bit 9"] #[inline(always)] #[must_use] - pub fn p9(&mut self) -> P9_W<9> { - P9_W::new(self) + pub fn p9(&mut self) -> P9_W { + P9_W::new(self, 9) } #[doc = "Bit 10 - Port n Output Bit 10"] #[inline(always)] #[must_use] - pub fn p10(&mut self) -> P10_W<10> { - P10_W::new(self) + pub fn p10(&mut self) -> P10_W { + P10_W::new(self, 10) } #[doc = "Bit 11 - Port n Output Bit 11"] #[inline(always)] #[must_use] - pub fn p11(&mut self) -> P11_W<11> { - P11_W::new(self) + pub fn p11(&mut self) -> P11_W { + P11_W::new(self, 11) } #[doc = "Bit 12 - Port n Output Bit 12"] #[inline(always)] #[must_use] - pub fn p12(&mut self) -> P12_W<12> { - P12_W::new(self) + pub fn p12(&mut self) -> P12_W { + P12_W::new(self, 12) } #[doc = "Bit 13 - Port n Output Bit 13"] #[inline(always)] #[must_use] - pub fn p13(&mut self) -> P13_W<13> { - P13_W::new(self) + pub fn p13(&mut self) -> P13_W { + P13_W::new(self, 13) } #[doc = "Bit 14 - Port n Output Bit 14"] #[inline(always)] #[must_use] - pub fn p14(&mut self) -> P14_W<14> { - P14_W::new(self) + pub fn p14(&mut self) -> P14_W { + P14_W::new(self, 14) } #[doc = "Bit 15 - Port n Output Bit 15"] #[inline(always)] #[must_use] - pub fn p15(&mut self) -> P15_W<15> { - P15_W::new(self) + pub fn p15(&mut self) -> P15_W { + P15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 4 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"] +#[doc = "Port 4 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`out::R`](R) reader structure"] +impl crate::Readable for OUT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`out::W`](W) writer structure"] impl crate::Writable for OUT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port4/pdisc.rs b/src/port4/pdisc.rs index a3fc3fb6..cf90bfc5 100644 --- a/src/port4/pdisc.rs +++ b/src/port4/pdisc.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] pub type PDIS0_R = crate::BitReader; #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl PDIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS0_A { + pub const fn variant(&self) -> PDIS0_A { match self.bits { false => PDIS0_A::VALUE1, true => PDIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl PDIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS1_A { + pub const fn variant(&self) -> PDIS1_A { match self.bits { false => PDIS1_A::VALUE1, true => PDIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl PDIS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS2_A { + pub const fn variant(&self) -> PDIS2_A { match self.bits { false => PDIS2_A::VALUE1, true => PDIS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl PDIS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS3_A { + pub const fn variant(&self) -> PDIS3_A { match self.bits { false => PDIS3_A::VALUE1, true => PDIS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl PDIS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS4_A { + pub const fn variant(&self) -> PDIS4_A { match self.bits { false => PDIS4_A::VALUE1, true => PDIS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PDIS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS5_A { + pub const fn variant(&self) -> PDIS5_A { match self.bits { false => PDIS5_A::VALUE1, true => PDIS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl PDIS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS6_A { + pub const fn variant(&self) -> PDIS6_A { match self.bits { false => PDIS6_A::VALUE1, true => PDIS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl PDIS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS7_A { + pub const fn variant(&self) -> PDIS7_A { match self.bits { false => PDIS7_A::VALUE1, true => PDIS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PDIS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS8_A { + pub const fn variant(&self) -> PDIS8_A { match self.bits { false => PDIS8_A::VALUE1, true => PDIS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl PDIS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS9_A { + pub const fn variant(&self) -> PDIS9_A { match self.bits { false => PDIS9_A::VALUE1, true => PDIS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl PDIS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS10_A { + pub const fn variant(&self) -> PDIS10_A { match self.bits { false => PDIS10_A::VALUE1, true => PDIS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl PDIS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS11_A { + pub const fn variant(&self) -> PDIS11_A { match self.bits { false => PDIS11_A::VALUE1, true => PDIS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl PDIS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS12_A { + pub const fn variant(&self) -> PDIS12_A { match self.bits { false => PDIS12_A::VALUE1, true => PDIS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl PDIS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS13_A { + pub const fn variant(&self) -> PDIS13_A { match self.bits { false => PDIS13_A::VALUE1, true => PDIS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl PDIS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS14_A { + pub const fn variant(&self) -> PDIS14_A { match self.bits { false => PDIS14_A::VALUE1, true => PDIS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl PDIS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS15_A { + pub const fn variant(&self) -> PDIS15_A { match self.bits { false => PDIS15_A::VALUE1, true => PDIS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 1) != 0) } } -#[doc = "Port 4 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"] +#[doc = "Port 4 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pdisc::R`](R) reader structure"] +impl crate::Readable for PDISC_SPEC {} #[doc = "`reset()` method sets PDISC to value 0"] impl crate::Resettable for PDISC_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port4/pdr0.rs b/src/port4/pdr0.rs index 3284b912..4029f71f 100644 --- a/src/port4/pdr0.rs +++ b/src/port4/pdr0.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] -pub type PD0_R = crate::FieldReader; +pub type PD0_R = crate::FieldReader; #[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] -pub type PD0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] -pub type PD1_R = crate::FieldReader; +pub type PD1_R = crate::FieldReader; #[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] -pub type PD1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] -pub type PD2_R = crate::FieldReader; +pub type PD2_R = crate::FieldReader; #[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] -pub type PD2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] -pub type PD3_R = crate::FieldReader; +pub type PD3_R = crate::FieldReader; #[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] -pub type PD3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD3_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] -pub type PD4_R = crate::FieldReader; +pub type PD4_R = crate::FieldReader; #[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] -pub type PD4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD4_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] -pub type PD5_R = crate::FieldReader; +pub type PD5_R = crate::FieldReader; #[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] -pub type PD5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD5_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] -pub type PD6_R = crate::FieldReader; +pub type PD6_R = crate::FieldReader; #[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] -pub type PD6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD6_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] -pub type PD7_R = crate::FieldReader; +pub type PD7_R = crate::FieldReader; #[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] -pub type PD7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD7_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] #[must_use] - pub fn pd0(&mut self) -> PD0_W<0> { - PD0_W::new(self) + pub fn pd0(&mut self) -> PD0_W { + PD0_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.1"] #[inline(always)] #[must_use] - pub fn pd1(&mut self) -> PD1_W<4> { - PD1_W::new(self) + pub fn pd1(&mut self) -> PD1_W { + PD1_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.2"] #[inline(always)] #[must_use] - pub fn pd2(&mut self) -> PD2_W<8> { - PD2_W::new(self) + pub fn pd2(&mut self) -> PD2_W { + PD2_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.3"] #[inline(always)] #[must_use] - pub fn pd3(&mut self) -> PD3_W<12> { - PD3_W::new(self) + pub fn pd3(&mut self) -> PD3_W { + PD3_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.4"] #[inline(always)] #[must_use] - pub fn pd4(&mut self) -> PD4_W<16> { - PD4_W::new(self) + pub fn pd4(&mut self) -> PD4_W { + PD4_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.5"] #[inline(always)] #[must_use] - pub fn pd5(&mut self) -> PD5_W<20> { - PD5_W::new(self) + pub fn pd5(&mut self) -> PD5_W { + PD5_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.6"] #[inline(always)] #[must_use] - pub fn pd6(&mut self) -> PD6_W<24> { - PD6_W::new(self) + pub fn pd6(&mut self) -> PD6_W { + PD6_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.7"] #[inline(always)] #[must_use] - pub fn pd7(&mut self) -> PD7_W<28> { - PD7_W::new(self) + pub fn pd7(&mut self) -> PD7_W { + PD7_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 4 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"] +#[doc = "Port 4 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr0::R`](R) reader structure"] +impl crate::Readable for PDR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr0::W`](W) writer structure"] impl crate::Writable for PDR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port4/pps.rs b/src/port4/pps.rs index 165a529c..b6ade4de 100644 --- a/src/port4/pps.rs +++ b/src/port4/pps.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] pub type PPS0_R = crate::BitReader; #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PPS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS0_A { + pub const fn variant(&self) -> PPS0_A { match self.bits { false => PPS0_A::VALUE1, true => PPS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS0_A::VALUE2 } } #[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] -pub type PPS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS0_A, O>; -impl<'a, const O: u8> PPS0_W<'a, O> { +pub type PPS0_W<'a, REG> = crate::BitWriter<'a, REG, PPS0_A>; +impl<'a, REG> PPS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PPS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS1_A { + pub const fn variant(&self) -> PPS1_A { match self.bits { false => PPS1_A::VALUE1, true => PPS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS1_A::VALUE2 } } #[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] -pub type PPS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS1_A, O>; -impl<'a, const O: u8> PPS1_W<'a, O> { +pub type PPS1_W<'a, REG> = crate::BitWriter<'a, REG, PPS1_A>; +impl<'a, REG> PPS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PPS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS2_A { + pub const fn variant(&self) -> PPS2_A { match self.bits { false => PPS2_A::VALUE1, true => PPS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS2_A::VALUE2 } } #[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] -pub type PPS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS2_A, O>; -impl<'a, const O: u8> PPS2_W<'a, O> { +pub type PPS2_W<'a, REG> = crate::BitWriter<'a, REG, PPS2_A>; +impl<'a, REG> PPS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PPS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS3_A { + pub const fn variant(&self) -> PPS3_A { match self.bits { false => PPS3_A::VALUE1, true => PPS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS3_A::VALUE2 } } #[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] -pub type PPS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS3_A, O>; -impl<'a, const O: u8> PPS3_W<'a, O> { +pub type PPS3_W<'a, REG> = crate::BitWriter<'a, REG, PPS3_A>; +impl<'a, REG> PPS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PPS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS4_A { + pub const fn variant(&self) -> PPS4_A { match self.bits { false => PPS4_A::VALUE1, true => PPS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS4_A::VALUE2 } } #[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] -pub type PPS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS4_A, O>; -impl<'a, const O: u8> PPS4_W<'a, O> { +pub type PPS4_W<'a, REG> = crate::BitWriter<'a, REG, PPS4_A>; +impl<'a, REG> PPS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PPS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS5_A { + pub const fn variant(&self) -> PPS5_A { match self.bits { false => PPS5_A::VALUE1, true => PPS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS5_A::VALUE2 } } #[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] -pub type PPS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS5_A, O>; -impl<'a, const O: u8> PPS5_W<'a, O> { +pub type PPS5_W<'a, REG> = crate::BitWriter<'a, REG, PPS5_A>; +impl<'a, REG> PPS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS6_A { + pub const fn variant(&self) -> PPS6_A { match self.bits { false => PPS6_A::VALUE1, true => PPS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS6_A::VALUE2 } } #[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] -pub type PPS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS6_A, O>; -impl<'a, const O: u8> PPS6_W<'a, O> { +pub type PPS6_W<'a, REG> = crate::BitWriter<'a, REG, PPS6_A>; +impl<'a, REG> PPS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PPS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS7_A { + pub const fn variant(&self) -> PPS7_A { match self.bits { false => PPS7_A::VALUE1, true => PPS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS7_A::VALUE2 } } #[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] -pub type PPS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS7_A, O>; -impl<'a, const O: u8> PPS7_W<'a, O> { +pub type PPS7_W<'a, REG> = crate::BitWriter<'a, REG, PPS7_A>; +impl<'a, REG> PPS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PPS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS8_A { + pub const fn variant(&self) -> PPS8_A { match self.bits { false => PPS8_A::VALUE1, true => PPS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS8_A::VALUE2 } } #[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] -pub type PPS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS8_A, O>; -impl<'a, const O: u8> PPS8_W<'a, O> { +pub type PPS8_W<'a, REG> = crate::BitWriter<'a, REG, PPS8_A>; +impl<'a, REG> PPS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PPS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS9_A { + pub const fn variant(&self) -> PPS9_A { match self.bits { false => PPS9_A::VALUE1, true => PPS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS9_A::VALUE2 } } #[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] -pub type PPS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS9_A, O>; -impl<'a, const O: u8> PPS9_W<'a, O> { +pub type PPS9_W<'a, REG> = crate::BitWriter<'a, REG, PPS9_A>; +impl<'a, REG> PPS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PPS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS10_A { + pub const fn variant(&self) -> PPS10_A { match self.bits { false => PPS10_A::VALUE1, true => PPS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS10_A::VALUE2 } } #[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] -pub type PPS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS10_A, O>; -impl<'a, const O: u8> PPS10_W<'a, O> { +pub type PPS10_W<'a, REG> = crate::BitWriter<'a, REG, PPS10_A>; +impl<'a, REG> PPS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PPS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS11_A { + pub const fn variant(&self) -> PPS11_A { match self.bits { false => PPS11_A::VALUE1, true => PPS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS11_A::VALUE2 } } #[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] -pub type PPS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS11_A, O>; -impl<'a, const O: u8> PPS11_W<'a, O> { +pub type PPS11_W<'a, REG> = crate::BitWriter<'a, REG, PPS11_A>; +impl<'a, REG> PPS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PPS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS12_A { + pub const fn variant(&self) -> PPS12_A { match self.bits { false => PPS12_A::VALUE1, true => PPS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS12_A::VALUE2 } } #[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] -pub type PPS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS12_A, O>; -impl<'a, const O: u8> PPS12_W<'a, O> { +pub type PPS12_W<'a, REG> = crate::BitWriter<'a, REG, PPS12_A>; +impl<'a, REG> PPS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PPS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS13_A { + pub const fn variant(&self) -> PPS13_A { match self.bits { false => PPS13_A::VALUE1, true => PPS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS13_A::VALUE2 } } #[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] -pub type PPS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS13_A, O>; -impl<'a, const O: u8> PPS13_W<'a, O> { +pub type PPS13_W<'a, REG> = crate::BitWriter<'a, REG, PPS13_A>; +impl<'a, REG> PPS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PPS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS14_A { + pub const fn variant(&self) -> PPS14_A { match self.bits { false => PPS14_A::VALUE1, true => PPS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS14_A::VALUE2 } } #[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] -pub type PPS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS14_A, O>; -impl<'a, const O: u8> PPS14_W<'a, O> { +pub type PPS14_W<'a, REG> = crate::BitWriter<'a, REG, PPS14_A>; +impl<'a, REG> PPS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PPS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS15_A { + pub const fn variant(&self) -> PPS15_A { match self.bits { false => PPS15_A::VALUE1, true => PPS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS15_A::VALUE2 } } #[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] -pub type PPS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS15_A, O>; -impl<'a, const O: u8> PPS15_W<'a, O> { +pub type PPS15_W<'a, REG> = crate::BitWriter<'a, REG, PPS15_A>; +impl<'a, REG> PPS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Pin Power Save Bit 0"] #[inline(always)] #[must_use] - pub fn pps0(&mut self) -> PPS0_W<0> { - PPS0_W::new(self) + pub fn pps0(&mut self) -> PPS0_W { + PPS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Pin Power Save Bit 1"] #[inline(always)] #[must_use] - pub fn pps1(&mut self) -> PPS1_W<1> { - PPS1_W::new(self) + pub fn pps1(&mut self) -> PPS1_W { + PPS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Pin Power Save Bit 2"] #[inline(always)] #[must_use] - pub fn pps2(&mut self) -> PPS2_W<2> { - PPS2_W::new(self) + pub fn pps2(&mut self) -> PPS2_W { + PPS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Pin Power Save Bit 3"] #[inline(always)] #[must_use] - pub fn pps3(&mut self) -> PPS3_W<3> { - PPS3_W::new(self) + pub fn pps3(&mut self) -> PPS3_W { + PPS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Pin Power Save Bit 4"] #[inline(always)] #[must_use] - pub fn pps4(&mut self) -> PPS4_W<4> { - PPS4_W::new(self) + pub fn pps4(&mut self) -> PPS4_W { + PPS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Pin Power Save Bit 5"] #[inline(always)] #[must_use] - pub fn pps5(&mut self) -> PPS5_W<5> { - PPS5_W::new(self) + pub fn pps5(&mut self) -> PPS5_W { + PPS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Pin Power Save Bit 6"] #[inline(always)] #[must_use] - pub fn pps6(&mut self) -> PPS6_W<6> { - PPS6_W::new(self) + pub fn pps6(&mut self) -> PPS6_W { + PPS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Pin Power Save Bit 7"] #[inline(always)] #[must_use] - pub fn pps7(&mut self) -> PPS7_W<7> { - PPS7_W::new(self) + pub fn pps7(&mut self) -> PPS7_W { + PPS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Pin Power Save Bit 8"] #[inline(always)] #[must_use] - pub fn pps8(&mut self) -> PPS8_W<8> { - PPS8_W::new(self) + pub fn pps8(&mut self) -> PPS8_W { + PPS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Pin Power Save Bit 9"] #[inline(always)] #[must_use] - pub fn pps9(&mut self) -> PPS9_W<9> { - PPS9_W::new(self) + pub fn pps9(&mut self) -> PPS9_W { + PPS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Pin Power Save Bit 10"] #[inline(always)] #[must_use] - pub fn pps10(&mut self) -> PPS10_W<10> { - PPS10_W::new(self) + pub fn pps10(&mut self) -> PPS10_W { + PPS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Pin Power Save Bit 11"] #[inline(always)] #[must_use] - pub fn pps11(&mut self) -> PPS11_W<11> { - PPS11_W::new(self) + pub fn pps11(&mut self) -> PPS11_W { + PPS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Pin Power Save Bit 12"] #[inline(always)] #[must_use] - pub fn pps12(&mut self) -> PPS12_W<12> { - PPS12_W::new(self) + pub fn pps12(&mut self) -> PPS12_W { + PPS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Pin Power Save Bit 13"] #[inline(always)] #[must_use] - pub fn pps13(&mut self) -> PPS13_W<13> { - PPS13_W::new(self) + pub fn pps13(&mut self) -> PPS13_W { + PPS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Pin Power Save Bit 14"] #[inline(always)] #[must_use] - pub fn pps14(&mut self) -> PPS14_W<14> { - PPS14_W::new(self) + pub fn pps14(&mut self) -> PPS14_W { + PPS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Pin Power Save Bit 15"] #[inline(always)] #[must_use] - pub fn pps15(&mut self) -> PPS15_W<15> { - PPS15_W::new(self) + pub fn pps15(&mut self) -> PPS15_W { + PPS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 4 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"] +#[doc = "Port 4 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pps::R`](R) reader structure"] +impl crate::Readable for PPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps::W`](W) writer structure"] impl crate::Writable for PPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port5.rs b/src/port5.rs index c58fc9b1..b04aaf05 100644 --- a/src/port5.rs +++ b/src/port5.rs @@ -1,63 +1,110 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + out: OUT, + omr: OMR, + _reserved2: [u8; 0x08], + iocr0: IOCR0, + iocr4: IOCR4, + _reserved4: [u8; 0x0c], + in_: IN, + _reserved5: [u8; 0x18], + pdr0: PDR0, + _reserved6: [u8; 0x1c], + pdisc: PDISC, + _reserved7: [u8; 0x0c], + pps: PPS, + hwsel: HWSEL, +} +impl RegisterBlock { #[doc = "0x00 - Port 5 Output Register"] - pub out: OUT, + #[inline(always)] + pub const fn out(&self) -> &OUT { + &self.out + } #[doc = "0x04 - Port 5 Output Modification Register"] - pub omr: OMR, - _reserved2: [u8; 0x08], + #[inline(always)] + pub const fn omr(&self) -> &OMR { + &self.omr + } #[doc = "0x10 - Port 5 Input/Output Control Register 0"] - pub iocr0: IOCR0, + #[inline(always)] + pub const fn iocr0(&self) -> &IOCR0 { + &self.iocr0 + } #[doc = "0x14 - Port 5 Input/Output Control Register 4"] - pub iocr4: IOCR4, - _reserved4: [u8; 0x0c], + #[inline(always)] + pub const fn iocr4(&self) -> &IOCR4 { + &self.iocr4 + } #[doc = "0x24 - Port 5 Input Register"] - pub in_: IN, - _reserved5: [u8; 0x18], + #[inline(always)] + pub const fn in_(&self) -> &IN { + &self.in_ + } #[doc = "0x40 - Port 5 Pad Driver Mode 0 Register"] - pub pdr0: PDR0, - _reserved6: [u8; 0x1c], + #[inline(always)] + pub const fn pdr0(&self) -> &PDR0 { + &self.pdr0 + } #[doc = "0x60 - Port 5 Pin Function Decision Control Register"] - pub pdisc: PDISC, - _reserved7: [u8; 0x0c], + #[inline(always)] + pub const fn pdisc(&self) -> &PDISC { + &self.pdisc + } #[doc = "0x70 - Port 5 Pin Power Save Register"] - pub pps: PPS, + #[inline(always)] + pub const fn pps(&self) -> &PPS { + &self.pps + } #[doc = "0x74 - Port 5 Pin Hardware Select Register"] - pub hwsel: HWSEL, + #[inline(always)] + pub const fn hwsel(&self) -> &HWSEL { + &self.hwsel + } } -#[doc = "OUT (rw) register accessor: an alias for `Reg`"] +#[doc = "OUT (rw) register accessor: Port 5 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@out`] +module"] pub type OUT = crate::Reg; #[doc = "Port 5 Output Register"] pub mod out; -#[doc = "OMR (w) register accessor: an alias for `Reg`"] +#[doc = "OMR (w) register accessor: Port 5 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@omr`] +module"] pub type OMR = crate::Reg; #[doc = "Port 5 Output Modification Register"] pub mod omr; -#[doc = "IOCR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR0 (rw) register accessor: Port 5 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr0`] +module"] pub type IOCR0 = crate::Reg; #[doc = "Port 5 Input/Output Control Register 0"] pub mod iocr0; -#[doc = "IOCR4 (rw) register accessor: an alias for `Reg`"] +#[doc = "IOCR4 (rw) register accessor: Port 5 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iocr4`] +module"] pub type IOCR4 = crate::Reg; #[doc = "Port 5 Input/Output Control Register 4"] pub mod iocr4; -#[doc = "IN (r) register accessor: an alias for `Reg`"] +#[doc = "IN (r) register accessor: Port 5 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] pub type IN = crate::Reg; #[doc = "Port 5 Input Register"] pub mod in_; -#[doc = "PDR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "PDR0 (rw) register accessor: Port 5 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdr0`] +module"] pub type PDR0 = crate::Reg; #[doc = "Port 5 Pad Driver Mode 0 Register"] pub mod pdr0; -#[doc = "PDISC (r) register accessor: an alias for `Reg`"] +#[doc = "PDISC (r) register accessor: Port 5 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdisc`] +module"] pub type PDISC = crate::Reg; #[doc = "Port 5 Pin Function Decision Control Register"] pub mod pdisc; -#[doc = "PPS (rw) register accessor: an alias for `Reg`"] +#[doc = "PPS (rw) register accessor: Port 5 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pps`] +module"] pub type PPS = crate::Reg; #[doc = "Port 5 Pin Power Save Register"] pub mod pps; -#[doc = "HWSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "HWSEL (rw) register accessor: Port 5 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hwsel`] +module"] pub type HWSEL = crate::Reg; #[doc = "Port 5 Pin Hardware Select Register"] pub mod hwsel; diff --git a/src/port5/hwsel.rs b/src/port5/hwsel.rs index 56604eb7..35d8013c 100644 --- a/src/port5/hwsel.rs +++ b/src/port5/hwsel.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HW0` reader - Port n Pin Hardware Select Bit 0"] -pub type HW0_R = crate::FieldReader; +pub type HW0_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW0_A { + type Ux = u8; +} impl HW0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW0_A::VALUE1), 1 => Some(HW0_A::VALUE2), @@ -64,43 +35,47 @@ impl HW0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW0_A::VALUE3 } } #[doc = "Field `HW0` writer - Port n Pin Hardware Select Bit 0"] -pub type HW0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW0_A, 2, O>; -impl<'a, const O: u8> HW0_W<'a, O> { +pub type HW0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW0_A>; +impl<'a, REG> HW0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW0_A::VALUE3) } } #[doc = "Field `HW1` reader - Port n Pin Hardware Select Bit 1"] -pub type HW1_R = crate::FieldReader; +pub type HW1_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW1_A { + type Ux = u8; +} impl HW1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW1_A::VALUE1), 1 => Some(HW1_A::VALUE2), @@ -129,43 +107,47 @@ impl HW1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW1_A::VALUE3 } } #[doc = "Field `HW1` writer - Port n Pin Hardware Select Bit 1"] -pub type HW1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW1_A, 2, O>; -impl<'a, const O: u8> HW1_W<'a, O> { +pub type HW1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW1_A>; +impl<'a, REG> HW1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW1_A::VALUE3) } } #[doc = "Field `HW2` reader - Port n Pin Hardware Select Bit 2"] -pub type HW2_R = crate::FieldReader; +pub type HW2_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +165,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW2_A { + type Ux = u8; +} impl HW2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW2_A::VALUE1), 1 => Some(HW2_A::VALUE2), @@ -194,43 +179,47 @@ impl HW2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW2_A::VALUE3 } } #[doc = "Field `HW2` writer - Port n Pin Hardware Select Bit 2"] -pub type HW2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW2_A, 2, O>; -impl<'a, const O: u8> HW2_W<'a, O> { +pub type HW2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW2_A>; +impl<'a, REG> HW2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW2_A::VALUE3) } } #[doc = "Field `HW3` reader - Port n Pin Hardware Select Bit 3"] -pub type HW3_R = crate::FieldReader; +pub type HW3_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -248,10 +237,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW3_A { + type Ux = u8; +} impl HW3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW3_A::VALUE1), 1 => Some(HW3_A::VALUE2), @@ -259,43 +251,47 @@ impl HW3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW3_A::VALUE3 } } #[doc = "Field `HW3` writer - Port n Pin Hardware Select Bit 3"] -pub type HW3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW3_A, 2, O>; -impl<'a, const O: u8> HW3_W<'a, O> { +pub type HW3_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW3_A>; +impl<'a, REG> HW3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW3_A::VALUE3) } } #[doc = "Field `HW4` reader - Port n Pin Hardware Select Bit 4"] -pub type HW4_R = crate::FieldReader; +pub type HW4_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 4\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -313,10 +309,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW4_A { + type Ux = u8; +} impl HW4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW4_A::VALUE1), 1 => Some(HW4_A::VALUE2), @@ -324,43 +323,47 @@ impl HW4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW4_A::VALUE3 } } #[doc = "Field `HW4` writer - Port n Pin Hardware Select Bit 4"] -pub type HW4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW4_A, 2, O>; -impl<'a, const O: u8> HW4_W<'a, O> { +pub type HW4_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW4_A>; +impl<'a, REG> HW4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW4_A::VALUE3) } } #[doc = "Field `HW5` reader - Port n Pin Hardware Select Bit 5"] -pub type HW5_R = crate::FieldReader; +pub type HW5_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 5\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -378,10 +381,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW5_A { + type Ux = u8; +} impl HW5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW5_A::VALUE1), 1 => Some(HW5_A::VALUE2), @@ -389,43 +395,47 @@ impl HW5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW5_A::VALUE3 } } #[doc = "Field `HW5` writer - Port n Pin Hardware Select Bit 5"] -pub type HW5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW5_A, 2, O>; -impl<'a, const O: u8> HW5_W<'a, O> { +pub type HW5_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW5_A>; +impl<'a, REG> HW5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW5_A::VALUE3) } } #[doc = "Field `HW6` reader - Port n Pin Hardware Select Bit 6"] -pub type HW6_R = crate::FieldReader; +pub type HW6_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 6\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -443,10 +453,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW6_A { + type Ux = u8; +} impl HW6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW6_A::VALUE1), 1 => Some(HW6_A::VALUE2), @@ -454,43 +467,47 @@ impl HW6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW6_A::VALUE3 } } #[doc = "Field `HW6` writer - Port n Pin Hardware Select Bit 6"] -pub type HW6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW6_A, 2, O>; -impl<'a, const O: u8> HW6_W<'a, O> { +pub type HW6_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW6_A>; +impl<'a, REG> HW6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW6_A::VALUE3) } } #[doc = "Field `HW7` reader - Port n Pin Hardware Select Bit 7"] -pub type HW7_R = crate::FieldReader; +pub type HW7_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -508,10 +525,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW7_A { + type Ux = u8; +} impl HW7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW7_A::VALUE1), 1 => Some(HW7_A::VALUE2), @@ -519,43 +539,47 @@ impl HW7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW7_A::VALUE3 } } #[doc = "Field `HW7` writer - Port n Pin Hardware Select Bit 7"] -pub type HW7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW7_A, 2, O>; -impl<'a, const O: u8> HW7_W<'a, O> { +pub type HW7_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW7_A>; +impl<'a, REG> HW7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW7_A::VALUE3) } } #[doc = "Field `HW8` reader - Port n Pin Hardware Select Bit 8"] -pub type HW8_R = crate::FieldReader; +pub type HW8_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 8\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -573,10 +597,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW8_A { + type Ux = u8; +} impl HW8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW8_A::VALUE1), 1 => Some(HW8_A::VALUE2), @@ -584,43 +611,47 @@ impl HW8_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW8_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW8_A::VALUE3 } } #[doc = "Field `HW8` writer - Port n Pin Hardware Select Bit 8"] -pub type HW8_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW8_A, 2, O>; -impl<'a, const O: u8> HW8_W<'a, O> { +pub type HW8_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW8_A>; +impl<'a, REG> HW8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW8_A::VALUE3) } } #[doc = "Field `HW9` reader - Port n Pin Hardware Select Bit 9"] -pub type HW9_R = crate::FieldReader; +pub type HW9_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 9\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -638,10 +669,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW9_A { + type Ux = u8; +} impl HW9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW9_A::VALUE1), 1 => Some(HW9_A::VALUE2), @@ -649,43 +683,47 @@ impl HW9_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW9_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW9_A::VALUE3 } } #[doc = "Field `HW9` writer - Port n Pin Hardware Select Bit 9"] -pub type HW9_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW9_A, 2, O>; -impl<'a, const O: u8> HW9_W<'a, O> { +pub type HW9_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW9_A>; +impl<'a, REG> HW9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW9_A::VALUE3) } } #[doc = "Field `HW10` reader - Port n Pin Hardware Select Bit 10"] -pub type HW10_R = crate::FieldReader; +pub type HW10_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -703,10 +741,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW10_A { + type Ux = u8; +} impl HW10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW10_A::VALUE1), 1 => Some(HW10_A::VALUE2), @@ -714,43 +755,47 @@ impl HW10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW10_A::VALUE3 } } #[doc = "Field `HW10` writer - Port n Pin Hardware Select Bit 10"] -pub type HW10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW10_A, 2, O>; -impl<'a, const O: u8> HW10_W<'a, O> { +pub type HW10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW10_A>; +impl<'a, REG> HW10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW10_A::VALUE3) } } #[doc = "Field `HW11` reader - Port n Pin Hardware Select Bit 11"] -pub type HW11_R = crate::FieldReader; +pub type HW11_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -768,10 +813,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW11_A { + type Ux = u8; +} impl HW11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW11_A::VALUE1), 1 => Some(HW11_A::VALUE2), @@ -779,43 +827,47 @@ impl HW11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW11_A::VALUE3 } } #[doc = "Field `HW11` writer - Port n Pin Hardware Select Bit 11"] -pub type HW11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW11_A, 2, O>; -impl<'a, const O: u8> HW11_W<'a, O> { +pub type HW11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW11_A>; +impl<'a, REG> HW11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW11_A::VALUE3) } } #[doc = "Field `HW12` reader - Port n Pin Hardware Select Bit 12"] -pub type HW12_R = crate::FieldReader; +pub type HW12_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 12\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -833,10 +885,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW12_A { + type Ux = u8; +} impl HW12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW12_A::VALUE1), 1 => Some(HW12_A::VALUE2), @@ -844,43 +899,47 @@ impl HW12_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW12_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW12_A::VALUE3 } } #[doc = "Field `HW12` writer - Port n Pin Hardware Select Bit 12"] -pub type HW12_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW12_A, 2, O>; -impl<'a, const O: u8> HW12_W<'a, O> { +pub type HW12_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW12_A>; +impl<'a, REG> HW12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW12_A::VALUE3) } } #[doc = "Field `HW13` reader - Port n Pin Hardware Select Bit 13"] -pub type HW13_R = crate::FieldReader; +pub type HW13_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 13\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -898,10 +957,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW13_A { + type Ux = u8; +} impl HW13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW13_A::VALUE1), 1 => Some(HW13_A::VALUE2), @@ -909,43 +971,47 @@ impl HW13_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW13_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW13_A::VALUE3 } } #[doc = "Field `HW13` writer - Port n Pin Hardware Select Bit 13"] -pub type HW13_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW13_A, 2, O>; -impl<'a, const O: u8> HW13_W<'a, O> { +pub type HW13_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW13_A>; +impl<'a, REG> HW13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW13_A::VALUE3) } } #[doc = "Field `HW14` reader - Port n Pin Hardware Select Bit 14"] -pub type HW14_R = crate::FieldReader; +pub type HW14_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 14\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -963,10 +1029,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW14_A { + type Ux = u8; +} impl HW14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW14_A::VALUE1), 1 => Some(HW14_A::VALUE2), @@ -974,43 +1043,47 @@ impl HW14_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW14_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW14_A::VALUE3 } } #[doc = "Field `HW14` writer - Port n Pin Hardware Select Bit 14"] -pub type HW14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW14_A, 2, O>; -impl<'a, const O: u8> HW14_W<'a, O> { +pub type HW14_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW14_A>; +impl<'a, REG> HW14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW14_A::VALUE3) } } #[doc = "Field `HW15` reader - Port n Pin Hardware Select Bit 15"] -pub type HW15_R = crate::FieldReader; +pub type HW15_R = crate::FieldReader; #[doc = "Port n Pin Hardware Select Bit 15\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1028,10 +1101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HW15_A { + type Ux = u8; +} impl HW15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HW15_A::VALUE1), 1 => Some(HW15_A::VALUE2), @@ -1039,38 +1115,42 @@ impl HW15_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control only."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HW15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HW0 control path can override the software configuration."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HW15_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "HW1 control path can override the software configuration."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HW15_A::VALUE3 } } #[doc = "Field `HW15` writer - Port n Pin Hardware Select Bit 15"] -pub type HW15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HWSEL_SPEC, u8, HW15_A, 2, O>; -impl<'a, const O: u8> HW15_W<'a, O> { +pub type HW15_W<'a, REG> = crate::FieldWriter<'a, REG, 2, HW15_A>; +impl<'a, REG> HW15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control only."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE1) } #[doc = "HW0 control path can override the software configuration."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE2) } #[doc = "HW1 control path can override the software configuration."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HW15_A::VALUE3) } } @@ -1160,118 +1240,119 @@ impl W { #[doc = "Bits 0:1 - Port n Pin Hardware Select Bit 0"] #[inline(always)] #[must_use] - pub fn hw0(&mut self) -> HW0_W<0> { - HW0_W::new(self) + pub fn hw0(&mut self) -> HW0_W { + HW0_W::new(self, 0) } #[doc = "Bits 2:3 - Port n Pin Hardware Select Bit 1"] #[inline(always)] #[must_use] - pub fn hw1(&mut self) -> HW1_W<2> { - HW1_W::new(self) + pub fn hw1(&mut self) -> HW1_W { + HW1_W::new(self, 2) } #[doc = "Bits 4:5 - Port n Pin Hardware Select Bit 2"] #[inline(always)] #[must_use] - pub fn hw2(&mut self) -> HW2_W<4> { - HW2_W::new(self) + pub fn hw2(&mut self) -> HW2_W { + HW2_W::new(self, 4) } #[doc = "Bits 6:7 - Port n Pin Hardware Select Bit 3"] #[inline(always)] #[must_use] - pub fn hw3(&mut self) -> HW3_W<6> { - HW3_W::new(self) + pub fn hw3(&mut self) -> HW3_W { + HW3_W::new(self, 6) } #[doc = "Bits 8:9 - Port n Pin Hardware Select Bit 4"] #[inline(always)] #[must_use] - pub fn hw4(&mut self) -> HW4_W<8> { - HW4_W::new(self) + pub fn hw4(&mut self) -> HW4_W { + HW4_W::new(self, 8) } #[doc = "Bits 10:11 - Port n Pin Hardware Select Bit 5"] #[inline(always)] #[must_use] - pub fn hw5(&mut self) -> HW5_W<10> { - HW5_W::new(self) + pub fn hw5(&mut self) -> HW5_W { + HW5_W::new(self, 10) } #[doc = "Bits 12:13 - Port n Pin Hardware Select Bit 6"] #[inline(always)] #[must_use] - pub fn hw6(&mut self) -> HW6_W<12> { - HW6_W::new(self) + pub fn hw6(&mut self) -> HW6_W { + HW6_W::new(self, 12) } #[doc = "Bits 14:15 - Port n Pin Hardware Select Bit 7"] #[inline(always)] #[must_use] - pub fn hw7(&mut self) -> HW7_W<14> { - HW7_W::new(self) + pub fn hw7(&mut self) -> HW7_W { + HW7_W::new(self, 14) } #[doc = "Bits 16:17 - Port n Pin Hardware Select Bit 8"] #[inline(always)] #[must_use] - pub fn hw8(&mut self) -> HW8_W<16> { - HW8_W::new(self) + pub fn hw8(&mut self) -> HW8_W { + HW8_W::new(self, 16) } #[doc = "Bits 18:19 - Port n Pin Hardware Select Bit 9"] #[inline(always)] #[must_use] - pub fn hw9(&mut self) -> HW9_W<18> { - HW9_W::new(self) + pub fn hw9(&mut self) -> HW9_W { + HW9_W::new(self, 18) } #[doc = "Bits 20:21 - Port n Pin Hardware Select Bit 10"] #[inline(always)] #[must_use] - pub fn hw10(&mut self) -> HW10_W<20> { - HW10_W::new(self) + pub fn hw10(&mut self) -> HW10_W { + HW10_W::new(self, 20) } #[doc = "Bits 22:23 - Port n Pin Hardware Select Bit 11"] #[inline(always)] #[must_use] - pub fn hw11(&mut self) -> HW11_W<22> { - HW11_W::new(self) + pub fn hw11(&mut self) -> HW11_W { + HW11_W::new(self, 22) } #[doc = "Bits 24:25 - Port n Pin Hardware Select Bit 12"] #[inline(always)] #[must_use] - pub fn hw12(&mut self) -> HW12_W<24> { - HW12_W::new(self) + pub fn hw12(&mut self) -> HW12_W { + HW12_W::new(self, 24) } #[doc = "Bits 26:27 - Port n Pin Hardware Select Bit 13"] #[inline(always)] #[must_use] - pub fn hw13(&mut self) -> HW13_W<26> { - HW13_W::new(self) + pub fn hw13(&mut self) -> HW13_W { + HW13_W::new(self, 26) } #[doc = "Bits 28:29 - Port n Pin Hardware Select Bit 14"] #[inline(always)] #[must_use] - pub fn hw14(&mut self) -> HW14_W<28> { - HW14_W::new(self) + pub fn hw14(&mut self) -> HW14_W { + HW14_W::new(self, 28) } #[doc = "Bits 30:31 - Port n Pin Hardware Select Bit 15"] #[inline(always)] #[must_use] - pub fn hw15(&mut self) -> HW15_W<30> { - HW15_W::new(self) + pub fn hw15(&mut self) -> HW15_W { + HW15_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Pin Hardware Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hwsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hwsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hwsel::R`](R) reader structure"] +impl crate::Readable for HWSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hwsel::W`](W) writer structure"] impl crate::Writable for HWSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port5/in_.rs b/src/port5/in_.rs index 552ce213..2a9a7dfa 100644 --- a/src/port5/in_.rs +++ b/src/port5/in_.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `P0` reader - Port n Input Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Input Bit 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { P15_R::new(((self.bits >> 15) & 1) != 0) } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Input Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`in_::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`in_::R`](R) reader structure"] +impl crate::Readable for IN_SPEC {} #[doc = "`reset()` method sets IN to value 0"] impl crate::Resettable for IN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port5/iocr0.rs b/src/port5/iocr0.rs index dabd72a8..251e3924 100644 --- a/src/port5/iocr0.rs +++ b/src/port5/iocr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC0` reader - Port Control for Port n Pin 0 to 3"] -pub type PC0_R = crate::FieldReader; +pub type PC0_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC0_A { + type Ux = u8; +} impl PC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC0_A::VALUE1), 1 => Some(PC0_A::VALUE2), @@ -109,193 +80,197 @@ impl PC0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC0_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC0_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC0_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC0_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC0_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC0_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC0_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC0_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC0_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC0_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC0_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC0_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC0_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC0_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC0_A::VALUE18 } } #[doc = "Field `PC0` writer - Port Control for Port n Pin 0 to 3"] -pub type PC0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC0_A, 5, O>; -impl<'a, const O: u8> PC0_W<'a, O> { +pub type PC0_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC0_A>; +impl<'a, REG> PC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC0_A::VALUE18) } } #[doc = "Field `PC1` reader - Port Control for Port n Pin 0 to 3"] -pub type PC1_R = crate::FieldReader; +pub type PC1_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC1_A { + type Ux = u8; +} impl PC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC1_A::VALUE1), 1 => Some(PC1_A::VALUE2), @@ -369,193 +347,197 @@ impl PC1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC1_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC1_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC1_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC1_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC1_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC1_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC1_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC1_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC1_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC1_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC1_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC1_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC1_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC1_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC1_A::VALUE18 } } #[doc = "Field `PC1` writer - Port Control for Port n Pin 0 to 3"] -pub type PC1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC1_A, 5, O>; -impl<'a, const O: u8> PC1_W<'a, O> { +pub type PC1_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC1_A>; +impl<'a, REG> PC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC1_A::VALUE18) } } #[doc = "Field `PC2` reader - Port Control for Port n Pin 0 to 3"] -pub type PC2_R = crate::FieldReader; +pub type PC2_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC2_A { + type Ux = u8; +} impl PC2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC2_A::VALUE1), 1 => Some(PC2_A::VALUE2), @@ -629,193 +614,197 @@ impl PC2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC2_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC2_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC2_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC2_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC2_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC2_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC2_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC2_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC2_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC2_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC2_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC2_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC2_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC2_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC2_A::VALUE18 } } #[doc = "Field `PC2` writer - Port Control for Port n Pin 0 to 3"] -pub type PC2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC2_A, 5, O>; -impl<'a, const O: u8> PC2_W<'a, O> { +pub type PC2_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC2_A>; +impl<'a, REG> PC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC2_A::VALUE18) } } #[doc = "Field `PC3` reader - Port Control for Port n Pin 0 to 3"] -pub type PC3_R = crate::FieldReader; +pub type PC3_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 0 to 3\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC3_A { + type Ux = u8; +} impl PC3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC3_A::VALUE1), 1 => Some(PC3_A::VALUE2), @@ -889,188 +881,192 @@ impl PC3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC3_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC3_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC3_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC3_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC3_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC3_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC3_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC3_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC3_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC3_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC3_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC3_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC3_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC3_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC3_A::VALUE18 } } #[doc = "Field `PC3` writer - Port Control for Port n Pin 0 to 3"] -pub type PC3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR0_SPEC, u8, PC3_A, 5, O>; -impl<'a, const O: u8> PC3_W<'a, O> { +pub type PC3_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC3_A>; +impl<'a, REG> PC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC3_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc0(&mut self) -> PC0_W<3> { - PC0_W::new(self) + pub fn pc0(&mut self) -> PC0_W { + PC0_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc1(&mut self) -> PC1_W<11> { - PC1_W::new(self) + pub fn pc1(&mut self) -> PC1_W { + PC1_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc2(&mut self) -> PC2_W<19> { - PC2_W::new(self) + pub fn pc2(&mut self) -> PC2_W { + PC2_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 0 to 3"] #[inline(always)] #[must_use] - pub fn pc3(&mut self) -> PC3_W<27> { - PC3_W::new(self) + pub fn pc3(&mut self) -> PC3_W { + PC3_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Input/Output Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr0::R`](R) reader structure"] +impl crate::Readable for IOCR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr0::W`](W) writer structure"] impl crate::Writable for IOCR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port5/iocr4.rs b/src/port5/iocr4.rs index c5a9a995..8a70d376 100644 --- a/src/port5/iocr4.rs +++ b/src/port5/iocr4.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PC4` reader - Port Control for Port n Pin 4 to 7"] -pub type PC4_R = crate::FieldReader; +pub type PC4_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -83,10 +51,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC4_A { + type Ux = u8; +} impl PC4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC4_A::VALUE1), 1 => Some(PC4_A::VALUE2), @@ -109,193 +80,197 @@ impl PC4_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC4_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC4_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC4_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC4_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC4_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC4_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC4_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC4_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC4_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC4_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC4_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC4_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC4_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC4_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC4_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC4_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC4_A::VALUE18 } } #[doc = "Field `PC4` writer - Port Control for Port n Pin 4 to 7"] -pub type PC4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC4_A, 5, O>; -impl<'a, const O: u8> PC4_W<'a, O> { +pub type PC4_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC4_A>; +impl<'a, REG> PC4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC4_A::VALUE18) } } #[doc = "Field `PC5` reader - Port Control for Port n Pin 4 to 7"] -pub type PC5_R = crate::FieldReader; +pub type PC5_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -343,10 +318,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC5_A { + type Ux = u8; +} impl PC5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC5_A::VALUE1), 1 => Some(PC5_A::VALUE2), @@ -369,193 +347,197 @@ impl PC5_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC5_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC5_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC5_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC5_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC5_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC5_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC5_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC5_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC5_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC5_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC5_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC5_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC5_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC5_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC5_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC5_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC5_A::VALUE18 } } #[doc = "Field `PC5` writer - Port Control for Port n Pin 4 to 7"] -pub type PC5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC5_A, 5, O>; -impl<'a, const O: u8> PC5_W<'a, O> { +pub type PC5_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC5_A>; +impl<'a, REG> PC5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC5_A::VALUE18) } } #[doc = "Field `PC6` reader - Port Control for Port n Pin 4 to 7"] -pub type PC6_R = crate::FieldReader; +pub type PC6_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -603,10 +585,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC6_A { + type Ux = u8; +} impl PC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC6_A::VALUE1), 1 => Some(PC6_A::VALUE2), @@ -629,193 +614,197 @@ impl PC6_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC6_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC6_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC6_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC6_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC6_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC6_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC6_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC6_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC6_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC6_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC6_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC6_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC6_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC6_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC6_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC6_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC6_A::VALUE18 } } #[doc = "Field `PC6` writer - Port Control for Port n Pin 4 to 7"] -pub type PC6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC6_A, 5, O>; -impl<'a, const O: u8> PC6_W<'a, O> { +pub type PC6_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC6_A>; +impl<'a, REG> PC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC6_A::VALUE18) } } #[doc = "Field `PC7` reader - Port Control for Port n Pin 4 to 7"] -pub type PC7_R = crate::FieldReader; +pub type PC7_R = crate::FieldReader; #[doc = "Port Control for Port n Pin 4 to 7\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -863,10 +852,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PC7_A { + type Ux = u8; +} impl PC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PC7_A::VALUE1), 1 => Some(PC7_A::VALUE2), @@ -889,188 +881,192 @@ impl PC7_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Input - No internal pull device active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input - Internal pull-down device active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PC7_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Input - Internal pull-up device active"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PC7_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PC7_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Input inverted - No internal pull device active"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PC7_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == PC7_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == PC7_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == PC7_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == PC7_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == PC7_A::VALUE10 } - #[doc = "Checks if the value of the field is `VALUE11`"] + #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] pub fn is_value11(&self) -> bool { *self == PC7_A::VALUE11 } - #[doc = "Checks if the value of the field is `VALUE12`"] + #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] pub fn is_value12(&self) -> bool { *self == PC7_A::VALUE12 } - #[doc = "Checks if the value of the field is `VALUE13`"] + #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] pub fn is_value13(&self) -> bool { *self == PC7_A::VALUE13 } - #[doc = "Checks if the value of the field is `VALUE14`"] + #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] pub fn is_value14(&self) -> bool { *self == PC7_A::VALUE14 } - #[doc = "Checks if the value of the field is `VALUE15`"] + #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] pub fn is_value15(&self) -> bool { *self == PC7_A::VALUE15 } - #[doc = "Checks if the value of the field is `VALUE16`"] + #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] pub fn is_value16(&self) -> bool { *self == PC7_A::VALUE16 } - #[doc = "Checks if the value of the field is `VALUE17`"] + #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] pub fn is_value17(&self) -> bool { *self == PC7_A::VALUE17 } - #[doc = "Checks if the value of the field is `VALUE18`"] + #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] pub fn is_value18(&self) -> bool { *self == PC7_A::VALUE18 } } #[doc = "Field `PC7` writer - Port Control for Port n Pin 4 to 7"] -pub type PC7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IOCR4_SPEC, u8, PC7_A, 5, O>; -impl<'a, const O: u8> PC7_W<'a, O> { +pub type PC7_W<'a, REG> = crate::FieldWriter<'a, REG, 5, PC7_A>; +impl<'a, REG> PC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Input - No internal pull device active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE1) } #[doc = "Input - Internal pull-down device active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE2) } #[doc = "Input - Internal pull-up device active"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE3) } #[doc = "Input - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE4) } #[doc = "Input inverted - No internal pull device active"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE5) } #[doc = "Input inverted - Internal pull-down device active"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE6) } #[doc = "Input inverted - Internal pull-up device active"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE7) } #[doc = "Input inverted - No internal pull device, Pn_OUTx = input value"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE8) } #[doc = "Output Push-Pull - General-purpose output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE9) } #[doc = "Output Push-Pull - Alternate output function 1"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE10) } #[doc = "Output Push-Pull - Alternate output function 2"] #[inline(always)] - pub fn value11(self) -> &'a mut W { + pub fn value11(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE11) } #[doc = "Output Push-Pull - Alternate output function 3"] #[inline(always)] - pub fn value12(self) -> &'a mut W { + pub fn value12(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE12) } #[doc = "Output Push-Pull - Alternate output function 4"] #[inline(always)] - pub fn value13(self) -> &'a mut W { + pub fn value13(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE13) } #[doc = "Output Open Drain - General-purpose output"] #[inline(always)] - pub fn value14(self) -> &'a mut W { + pub fn value14(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE14) } #[doc = "Output Open Drain - Alternate output function 1"] #[inline(always)] - pub fn value15(self) -> &'a mut W { + pub fn value15(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE15) } #[doc = "Output Open Drain - Alternate output function 2"] #[inline(always)] - pub fn value16(self) -> &'a mut W { + pub fn value16(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE16) } #[doc = "Output Open Drain - Alternate output function 3"] #[inline(always)] - pub fn value17(self) -> &'a mut W { + pub fn value17(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE17) } #[doc = "Output Open Drain - Alternate output function 4"] #[inline(always)] - pub fn value18(self) -> &'a mut W { + pub fn value18(self) -> &'a mut crate::W { self.variant(PC7_A::VALUE18) } } @@ -1100,46 +1096,47 @@ impl W { #[doc = "Bits 3:7 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc4(&mut self) -> PC4_W<3> { - PC4_W::new(self) + pub fn pc4(&mut self) -> PC4_W { + PC4_W::new(self, 3) } #[doc = "Bits 11:15 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc5(&mut self) -> PC5_W<11> { - PC5_W::new(self) + pub fn pc5(&mut self) -> PC5_W { + PC5_W::new(self, 11) } #[doc = "Bits 19:23 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc6(&mut self) -> PC6_W<19> { - PC6_W::new(self) + pub fn pc6(&mut self) -> PC6_W { + PC6_W::new(self, 19) } #[doc = "Bits 27:31 - Port Control for Port n Pin 4 to 7"] #[inline(always)] #[must_use] - pub fn pc7(&mut self) -> PC7_W<27> { - PC7_W::new(self) + pub fn pc7(&mut self) -> PC7_W { + PC7_W::new(self, 27) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Input/Output Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iocr4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iocr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iocr4::R`](R) reader structure"] +impl crate::Readable for IOCR4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iocr4::W`](W) writer structure"] impl crate::Writable for IOCR4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port5/omr.rs b/src/port5/omr.rs index d5f00639..55ec681b 100644 --- a/src/port5/omr.rs +++ b/src/port5/omr.rs @@ -1,296 +1,280 @@ #[doc = "Register `OMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PS0` writer - Port n Set Bit 0"] -pub type PS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS1` writer - Port n Set Bit 1"] -pub type PS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS2` writer - Port n Set Bit 2"] -pub type PS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS3` writer - Port n Set Bit 3"] -pub type PS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS4` writer - Port n Set Bit 4"] -pub type PS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS5` writer - Port n Set Bit 5"] -pub type PS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS6` writer - Port n Set Bit 6"] -pub type PS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS7` writer - Port n Set Bit 7"] -pub type PS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS8` writer - Port n Set Bit 8"] -pub type PS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS9` writer - Port n Set Bit 9"] -pub type PS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS10` writer - Port n Set Bit 10"] -pub type PS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS11` writer - Port n Set Bit 11"] -pub type PS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS12` writer - Port n Set Bit 12"] -pub type PS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS13` writer - Port n Set Bit 13"] -pub type PS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS14` writer - Port n Set Bit 14"] -pub type PS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PS15` writer - Port n Set Bit 15"] -pub type PS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PS15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR0` writer - Port n Reset Bit 0"] -pub type PR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR1` writer - Port n Reset Bit 1"] -pub type PR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR2` writer - Port n Reset Bit 2"] -pub type PR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR3` writer - Port n Reset Bit 3"] -pub type PR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR4` writer - Port n Reset Bit 4"] -pub type PR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR5` writer - Port n Reset Bit 5"] -pub type PR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR6` writer - Port n Reset Bit 6"] -pub type PR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR7` writer - Port n Reset Bit 7"] -pub type PR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR8` writer - Port n Reset Bit 8"] -pub type PR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR9` writer - Port n Reset Bit 9"] -pub type PR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR10` writer - Port n Reset Bit 10"] -pub type PR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR11` writer - Port n Reset Bit 11"] -pub type PR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR12` writer - Port n Reset Bit 12"] -pub type PR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR13` writer - Port n Reset Bit 13"] -pub type PR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR14` writer - Port n Reset Bit 14"] -pub type PR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PR15` writer - Port n Reset Bit 15"] -pub type PR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OMR_SPEC, bool, O>; +pub type PR15_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Port n Set Bit 0"] #[inline(always)] #[must_use] - pub fn ps0(&mut self) -> PS0_W<0> { - PS0_W::new(self) + pub fn ps0(&mut self) -> PS0_W { + PS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Set Bit 1"] #[inline(always)] #[must_use] - pub fn ps1(&mut self) -> PS1_W<1> { - PS1_W::new(self) + pub fn ps1(&mut self) -> PS1_W { + PS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Set Bit 2"] #[inline(always)] #[must_use] - pub fn ps2(&mut self) -> PS2_W<2> { - PS2_W::new(self) + pub fn ps2(&mut self) -> PS2_W { + PS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Set Bit 3"] #[inline(always)] #[must_use] - pub fn ps3(&mut self) -> PS3_W<3> { - PS3_W::new(self) + pub fn ps3(&mut self) -> PS3_W { + PS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Set Bit 4"] #[inline(always)] #[must_use] - pub fn ps4(&mut self) -> PS4_W<4> { - PS4_W::new(self) + pub fn ps4(&mut self) -> PS4_W { + PS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Set Bit 5"] #[inline(always)] #[must_use] - pub fn ps5(&mut self) -> PS5_W<5> { - PS5_W::new(self) + pub fn ps5(&mut self) -> PS5_W { + PS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Set Bit 6"] #[inline(always)] #[must_use] - pub fn ps6(&mut self) -> PS6_W<6> { - PS6_W::new(self) + pub fn ps6(&mut self) -> PS6_W { + PS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Set Bit 7"] #[inline(always)] #[must_use] - pub fn ps7(&mut self) -> PS7_W<7> { - PS7_W::new(self) + pub fn ps7(&mut self) -> PS7_W { + PS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Set Bit 8"] #[inline(always)] #[must_use] - pub fn ps8(&mut self) -> PS8_W<8> { - PS8_W::new(self) + pub fn ps8(&mut self) -> PS8_W { + PS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Set Bit 9"] #[inline(always)] #[must_use] - pub fn ps9(&mut self) -> PS9_W<9> { - PS9_W::new(self) + pub fn ps9(&mut self) -> PS9_W { + PS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Set Bit 10"] #[inline(always)] #[must_use] - pub fn ps10(&mut self) -> PS10_W<10> { - PS10_W::new(self) + pub fn ps10(&mut self) -> PS10_W { + PS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Set Bit 11"] #[inline(always)] #[must_use] - pub fn ps11(&mut self) -> PS11_W<11> { - PS11_W::new(self) + pub fn ps11(&mut self) -> PS11_W { + PS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Set Bit 12"] #[inline(always)] #[must_use] - pub fn ps12(&mut self) -> PS12_W<12> { - PS12_W::new(self) + pub fn ps12(&mut self) -> PS12_W { + PS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Set Bit 13"] #[inline(always)] #[must_use] - pub fn ps13(&mut self) -> PS13_W<13> { - PS13_W::new(self) + pub fn ps13(&mut self) -> PS13_W { + PS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Set Bit 14"] #[inline(always)] #[must_use] - pub fn ps14(&mut self) -> PS14_W<14> { - PS14_W::new(self) + pub fn ps14(&mut self) -> PS14_W { + PS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Set Bit 15"] #[inline(always)] #[must_use] - pub fn ps15(&mut self) -> PS15_W<15> { - PS15_W::new(self) + pub fn ps15(&mut self) -> PS15_W { + PS15_W::new(self, 15) } #[doc = "Bit 16 - Port n Reset Bit 0"] #[inline(always)] #[must_use] - pub fn pr0(&mut self) -> PR0_W<16> { - PR0_W::new(self) + pub fn pr0(&mut self) -> PR0_W { + PR0_W::new(self, 16) } #[doc = "Bit 17 - Port n Reset Bit 1"] #[inline(always)] #[must_use] - pub fn pr1(&mut self) -> PR1_W<17> { - PR1_W::new(self) + pub fn pr1(&mut self) -> PR1_W { + PR1_W::new(self, 17) } #[doc = "Bit 18 - Port n Reset Bit 2"] #[inline(always)] #[must_use] - pub fn pr2(&mut self) -> PR2_W<18> { - PR2_W::new(self) + pub fn pr2(&mut self) -> PR2_W { + PR2_W::new(self, 18) } #[doc = "Bit 19 - Port n Reset Bit 3"] #[inline(always)] #[must_use] - pub fn pr3(&mut self) -> PR3_W<19> { - PR3_W::new(self) + pub fn pr3(&mut self) -> PR3_W { + PR3_W::new(self, 19) } #[doc = "Bit 20 - Port n Reset Bit 4"] #[inline(always)] #[must_use] - pub fn pr4(&mut self) -> PR4_W<20> { - PR4_W::new(self) + pub fn pr4(&mut self) -> PR4_W { + PR4_W::new(self, 20) } #[doc = "Bit 21 - Port n Reset Bit 5"] #[inline(always)] #[must_use] - pub fn pr5(&mut self) -> PR5_W<21> { - PR5_W::new(self) + pub fn pr5(&mut self) -> PR5_W { + PR5_W::new(self, 21) } #[doc = "Bit 22 - Port n Reset Bit 6"] #[inline(always)] #[must_use] - pub fn pr6(&mut self) -> PR6_W<22> { - PR6_W::new(self) + pub fn pr6(&mut self) -> PR6_W { + PR6_W::new(self, 22) } #[doc = "Bit 23 - Port n Reset Bit 7"] #[inline(always)] #[must_use] - pub fn pr7(&mut self) -> PR7_W<23> { - PR7_W::new(self) + pub fn pr7(&mut self) -> PR7_W { + PR7_W::new(self, 23) } #[doc = "Bit 24 - Port n Reset Bit 8"] #[inline(always)] #[must_use] - pub fn pr8(&mut self) -> PR8_W<24> { - PR8_W::new(self) + pub fn pr8(&mut self) -> PR8_W { + PR8_W::new(self, 24) } #[doc = "Bit 25 - Port n Reset Bit 9"] #[inline(always)] #[must_use] - pub fn pr9(&mut self) -> PR9_W<25> { - PR9_W::new(self) + pub fn pr9(&mut self) -> PR9_W { + PR9_W::new(self, 25) } #[doc = "Bit 26 - Port n Reset Bit 10"] #[inline(always)] #[must_use] - pub fn pr10(&mut self) -> PR10_W<26> { - PR10_W::new(self) + pub fn pr10(&mut self) -> PR10_W { + PR10_W::new(self, 26) } #[doc = "Bit 27 - Port n Reset Bit 11"] #[inline(always)] #[must_use] - pub fn pr11(&mut self) -> PR11_W<27> { - PR11_W::new(self) + pub fn pr11(&mut self) -> PR11_W { + PR11_W::new(self, 27) } #[doc = "Bit 28 - Port n Reset Bit 12"] #[inline(always)] #[must_use] - pub fn pr12(&mut self) -> PR12_W<28> { - PR12_W::new(self) + pub fn pr12(&mut self) -> PR12_W { + PR12_W::new(self, 28) } #[doc = "Bit 29 - Port n Reset Bit 13"] #[inline(always)] #[must_use] - pub fn pr13(&mut self) -> PR13_W<29> { - PR13_W::new(self) + pub fn pr13(&mut self) -> PR13_W { + PR13_W::new(self, 29) } #[doc = "Bit 30 - Port n Reset Bit 14"] #[inline(always)] #[must_use] - pub fn pr14(&mut self) -> PR14_W<30> { - PR14_W::new(self) + pub fn pr14(&mut self) -> PR14_W { + PR14_W::new(self, 30) } #[doc = "Bit 31 - Port n Reset Bit 15"] #[inline(always)] #[must_use] - pub fn pr15(&mut self) -> PR15_W<31> { - PR15_W::new(self) + pub fn pr15(&mut self) -> PR15_W { + PR15_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Output Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`omr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct OMR_SPEC; impl crate::RegisterSpec for OMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [omr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`omr::W`](W) writer structure"] impl crate::Writable for OMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port5/out.rs b/src/port5/out.rs index 0acd41fe..cb70485a 100644 --- a/src/port5/out.rs +++ b/src/port5/out.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `P0` reader - Port n Output Bit 0"] pub type P0_R = crate::BitReader; #[doc = "Port n Output Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl P0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P0_A { + pub const fn variant(&self) -> P0_A { match self.bits { false => P0_A::VALUE1, true => P0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P0_A::VALUE2 } } #[doc = "Field `P0` writer - Port n Output Bit 0"] -pub type P0_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P0_A, O>; -impl<'a, const O: u8> P0_W<'a, O> { +pub type P0_W<'a, REG> = crate::BitWriter<'a, REG, P0_A>; +impl<'a, REG> P0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P0_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl P1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P1_A { + pub const fn variant(&self) -> P1_A { match self.bits { false => P1_A::VALUE1, true => P1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P1_A::VALUE2 } } #[doc = "Field `P1` writer - Port n Output Bit 1"] -pub type P1_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P1_A, O>; -impl<'a, const O: u8> P1_W<'a, O> { +pub type P1_W<'a, REG> = crate::BitWriter<'a, REG, P1_A>; +impl<'a, REG> P1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P1_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl P2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P2_A { + pub const fn variant(&self) -> P2_A { match self.bits { false => P2_A::VALUE1, true => P2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P2_A::VALUE2 } } #[doc = "Field `P2` writer - Port n Output Bit 2"] -pub type P2_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P2_A, O>; -impl<'a, const O: u8> P2_W<'a, O> { +pub type P2_W<'a, REG> = crate::BitWriter<'a, REG, P2_A>; +impl<'a, REG> P2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P2_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl P3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P3_A { + pub const fn variant(&self) -> P3_A { match self.bits { false => P3_A::VALUE1, true => P3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P3_A::VALUE2 } } #[doc = "Field `P3` writer - Port n Output Bit 3"] -pub type P3_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P3_A, O>; -impl<'a, const O: u8> P3_W<'a, O> { +pub type P3_W<'a, REG> = crate::BitWriter<'a, REG, P3_A>; +impl<'a, REG> P3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P3_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl P4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P4_A { + pub const fn variant(&self) -> P4_A { match self.bits { false => P4_A::VALUE1, true => P4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P4_A::VALUE2 } } #[doc = "Field `P4` writer - Port n Output Bit 4"] -pub type P4_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P4_A, O>; -impl<'a, const O: u8> P4_W<'a, O> { +pub type P4_W<'a, REG> = crate::BitWriter<'a, REG, P4_A>; +impl<'a, REG> P4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P4_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl P5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P5_A { + pub const fn variant(&self) -> P5_A { match self.bits { false => P5_A::VALUE1, true => P5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P5_A::VALUE2 } } #[doc = "Field `P5` writer - Port n Output Bit 5"] -pub type P5_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P5_A, O>; -impl<'a, const O: u8> P5_W<'a, O> { +pub type P5_W<'a, REG> = crate::BitWriter<'a, REG, P5_A>; +impl<'a, REG> P5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P5_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl P6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P6_A { + pub const fn variant(&self) -> P6_A { match self.bits { false => P6_A::VALUE1, true => P6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P6_A::VALUE2 } } #[doc = "Field `P6` writer - Port n Output Bit 6"] -pub type P6_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P6_A, O>; -impl<'a, const O: u8> P6_W<'a, O> { +pub type P6_W<'a, REG> = crate::BitWriter<'a, REG, P6_A>; +impl<'a, REG> P6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P6_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl P7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P7_A { + pub const fn variant(&self) -> P7_A { match self.bits { false => P7_A::VALUE1, true => P7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P7_A::VALUE2 } } #[doc = "Field `P7` writer - Port n Output Bit 7"] -pub type P7_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P7_A, O>; -impl<'a, const O: u8> P7_W<'a, O> { +pub type P7_W<'a, REG> = crate::BitWriter<'a, REG, P7_A>; +impl<'a, REG> P7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P7_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl P8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P8_A { + pub const fn variant(&self) -> P8_A { match self.bits { false => P8_A::VALUE1, true => P8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P8_A::VALUE2 } } #[doc = "Field `P8` writer - Port n Output Bit 8"] -pub type P8_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P8_A, O>; -impl<'a, const O: u8> P8_W<'a, O> { +pub type P8_W<'a, REG> = crate::BitWriter<'a, REG, P8_A>; +impl<'a, REG> P8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P8_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl P9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P9_A { + pub const fn variant(&self) -> P9_A { match self.bits { false => P9_A::VALUE1, true => P9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P9_A::VALUE2 } } #[doc = "Field `P9` writer - Port n Output Bit 9"] -pub type P9_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P9_A, O>; -impl<'a, const O: u8> P9_W<'a, O> { +pub type P9_W<'a, REG> = crate::BitWriter<'a, REG, P9_A>; +impl<'a, REG> P9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P9_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl P10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P10_A { + pub const fn variant(&self) -> P10_A { match self.bits { false => P10_A::VALUE1, true => P10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P10_A::VALUE2 } } #[doc = "Field `P10` writer - Port n Output Bit 10"] -pub type P10_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P10_A, O>; -impl<'a, const O: u8> P10_W<'a, O> { +pub type P10_W<'a, REG> = crate::BitWriter<'a, REG, P10_A>; +impl<'a, REG> P10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P10_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl P11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P11_A { + pub const fn variant(&self) -> P11_A { match self.bits { false => P11_A::VALUE1, true => P11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P11_A::VALUE2 } } #[doc = "Field `P11` writer - Port n Output Bit 11"] -pub type P11_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P11_A, O>; -impl<'a, const O: u8> P11_W<'a, O> { +pub type P11_W<'a, REG> = crate::BitWriter<'a, REG, P11_A>; +impl<'a, REG> P11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P11_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl P12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P12_A { + pub const fn variant(&self) -> P12_A { match self.bits { false => P12_A::VALUE1, true => P12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P12_A::VALUE2 } } #[doc = "Field `P12` writer - Port n Output Bit 12"] -pub type P12_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P12_A, O>; -impl<'a, const O: u8> P12_W<'a, O> { +pub type P12_W<'a, REG> = crate::BitWriter<'a, REG, P12_A>; +impl<'a, REG> P12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P12_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl P13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P13_A { + pub const fn variant(&self) -> P13_A { match self.bits { false => P13_A::VALUE1, true => P13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P13_A::VALUE2 } } #[doc = "Field `P13` writer - Port n Output Bit 13"] -pub type P13_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P13_A, O>; -impl<'a, const O: u8> P13_W<'a, O> { +pub type P13_W<'a, REG> = crate::BitWriter<'a, REG, P13_A>; +impl<'a, REG> P13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P13_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl P14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P14_A { + pub const fn variant(&self) -> P14_A { match self.bits { false => P14_A::VALUE1, true => P14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P14_A::VALUE2 } } #[doc = "Field `P14` writer - Port n Output Bit 14"] -pub type P14_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P14_A, O>; -impl<'a, const O: u8> P14_W<'a, O> { +pub type P14_W<'a, REG> = crate::BitWriter<'a, REG, P14_A>; +impl<'a, REG> P14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P14_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl P15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> P15_A { + pub const fn variant(&self) -> P15_A { match self.bits { false => P15_A::VALUE1, true => P15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The output level of Pn.x is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == P15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The output level of Pn.x is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == P15_A::VALUE2 } } #[doc = "Field `P15` writer - Port n Output Bit 15"] -pub type P15_W<'a, const O: u8> = crate::BitWriter<'a, u32, OUT_SPEC, P15_A, O>; -impl<'a, const O: u8> P15_W<'a, O> { +pub type P15_W<'a, REG> = crate::BitWriter<'a, REG, P15_A>; +impl<'a, REG> P15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The output level of Pn.x is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(P15_A::VALUE1) } #[doc = "The output level of Pn.x is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(P15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Output Bit 0"] #[inline(always)] #[must_use] - pub fn p0(&mut self) -> P0_W<0> { - P0_W::new(self) + pub fn p0(&mut self) -> P0_W { + P0_W::new(self, 0) } #[doc = "Bit 1 - Port n Output Bit 1"] #[inline(always)] #[must_use] - pub fn p1(&mut self) -> P1_W<1> { - P1_W::new(self) + pub fn p1(&mut self) -> P1_W { + P1_W::new(self, 1) } #[doc = "Bit 2 - Port n Output Bit 2"] #[inline(always)] #[must_use] - pub fn p2(&mut self) -> P2_W<2> { - P2_W::new(self) + pub fn p2(&mut self) -> P2_W { + P2_W::new(self, 2) } #[doc = "Bit 3 - Port n Output Bit 3"] #[inline(always)] #[must_use] - pub fn p3(&mut self) -> P3_W<3> { - P3_W::new(self) + pub fn p3(&mut self) -> P3_W { + P3_W::new(self, 3) } #[doc = "Bit 4 - Port n Output Bit 4"] #[inline(always)] #[must_use] - pub fn p4(&mut self) -> P4_W<4> { - P4_W::new(self) + pub fn p4(&mut self) -> P4_W { + P4_W::new(self, 4) } #[doc = "Bit 5 - Port n Output Bit 5"] #[inline(always)] #[must_use] - pub fn p5(&mut self) -> P5_W<5> { - P5_W::new(self) + pub fn p5(&mut self) -> P5_W { + P5_W::new(self, 5) } #[doc = "Bit 6 - Port n Output Bit 6"] #[inline(always)] #[must_use] - pub fn p6(&mut self) -> P6_W<6> { - P6_W::new(self) + pub fn p6(&mut self) -> P6_W { + P6_W::new(self, 6) } #[doc = "Bit 7 - Port n Output Bit 7"] #[inline(always)] #[must_use] - pub fn p7(&mut self) -> P7_W<7> { - P7_W::new(self) + pub fn p7(&mut self) -> P7_W { + P7_W::new(self, 7) } #[doc = "Bit 8 - Port n Output Bit 8"] #[inline(always)] #[must_use] - pub fn p8(&mut self) -> P8_W<8> { - P8_W::new(self) + pub fn p8(&mut self) -> P8_W { + P8_W::new(self, 8) } #[doc = "Bit 9 - Port n Output Bit 9"] #[inline(always)] #[must_use] - pub fn p9(&mut self) -> P9_W<9> { - P9_W::new(self) + pub fn p9(&mut self) -> P9_W { + P9_W::new(self, 9) } #[doc = "Bit 10 - Port n Output Bit 10"] #[inline(always)] #[must_use] - pub fn p10(&mut self) -> P10_W<10> { - P10_W::new(self) + pub fn p10(&mut self) -> P10_W { + P10_W::new(self, 10) } #[doc = "Bit 11 - Port n Output Bit 11"] #[inline(always)] #[must_use] - pub fn p11(&mut self) -> P11_W<11> { - P11_W::new(self) + pub fn p11(&mut self) -> P11_W { + P11_W::new(self, 11) } #[doc = "Bit 12 - Port n Output Bit 12"] #[inline(always)] #[must_use] - pub fn p12(&mut self) -> P12_W<12> { - P12_W::new(self) + pub fn p12(&mut self) -> P12_W { + P12_W::new(self, 12) } #[doc = "Bit 13 - Port n Output Bit 13"] #[inline(always)] #[must_use] - pub fn p13(&mut self) -> P13_W<13> { - P13_W::new(self) + pub fn p13(&mut self) -> P13_W { + P13_W::new(self, 13) } #[doc = "Bit 14 - Port n Output Bit 14"] #[inline(always)] #[must_use] - pub fn p14(&mut self) -> P14_W<14> { - P14_W::new(self) + pub fn p14(&mut self) -> P14_W { + P14_W::new(self, 14) } #[doc = "Bit 15 - Port n Output Bit 15"] #[inline(always)] #[must_use] - pub fn p15(&mut self) -> P15_W<15> { - P15_W::new(self) + pub fn p15(&mut self) -> P15_W { + P15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`out::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`out::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`out::R`](R) reader structure"] +impl crate::Readable for OUT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`out::W`](W) writer structure"] impl crate::Writable for OUT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port5/pdisc.rs b/src/port5/pdisc.rs index bcf0e538..61968a9b 100644 --- a/src/port5/pdisc.rs +++ b/src/port5/pdisc.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PDIS0` reader - Pad Disable for Port n Pin 0"] pub type PDIS0_R = crate::BitReader; #[doc = "Pad Disable for Port n Pin 0\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl PDIS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS0_A { + pub const fn variant(&self) -> PDIS0_A { match self.bits { false => PDIS0_A::VALUE1, true => PDIS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS0_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl PDIS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS1_A { + pub const fn variant(&self) -> PDIS1_A { match self.bits { false => PDIS1_A::VALUE1, true => PDIS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS1_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl PDIS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS2_A { + pub const fn variant(&self) -> PDIS2_A { match self.bits { false => PDIS2_A::VALUE1, true => PDIS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS2_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl PDIS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS3_A { + pub const fn variant(&self) -> PDIS3_A { match self.bits { false => PDIS3_A::VALUE1, true => PDIS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS3_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl PDIS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS4_A { + pub const fn variant(&self) -> PDIS4_A { match self.bits { false => PDIS4_A::VALUE1, true => PDIS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS4_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PDIS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS5_A { + pub const fn variant(&self) -> PDIS5_A { match self.bits { false => PDIS5_A::VALUE1, true => PDIS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS5_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl PDIS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS6_A { + pub const fn variant(&self) -> PDIS6_A { match self.bits { false => PDIS6_A::VALUE1, true => PDIS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS6_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl PDIS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS7_A { + pub const fn variant(&self) -> PDIS7_A { match self.bits { false => PDIS7_A::VALUE1, true => PDIS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS7_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PDIS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS8_A { + pub const fn variant(&self) -> PDIS8_A { match self.bits { false => PDIS8_A::VALUE1, true => PDIS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS8_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl PDIS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS9_A { + pub const fn variant(&self) -> PDIS9_A { match self.bits { false => PDIS9_A::VALUE1, true => PDIS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS9_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl PDIS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS10_A { + pub const fn variant(&self) -> PDIS10_A { match self.bits { false => PDIS10_A::VALUE1, true => PDIS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS10_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl PDIS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS11_A { + pub const fn variant(&self) -> PDIS11_A { match self.bits { false => PDIS11_A::VALUE1, true => PDIS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS11_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl PDIS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS12_A { + pub const fn variant(&self) -> PDIS12_A { match self.bits { false => PDIS12_A::VALUE1, true => PDIS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS12_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl PDIS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS13_A { + pub const fn variant(&self) -> PDIS13_A { match self.bits { false => PDIS13_A::VALUE1, true => PDIS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS13_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl PDIS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS14_A { + pub const fn variant(&self) -> PDIS14_A { match self.bits { false => PDIS14_A::VALUE1, true => PDIS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS14_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl PDIS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDIS15_A { + pub const fn variant(&self) -> PDIS15_A { match self.bits { false => PDIS15_A::VALUE1, true => PDIS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pad Pn.x is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDIS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pad Pn.x is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDIS15_A::VALUE2 @@ -671,15 +658,13 @@ impl R { PDIS15_R::new(((self.bits >> 15) & 1) != 0) } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Pin Function Decision Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdisc::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pdisc::R`](R) reader structure"] +impl crate::Readable for PDISC_SPEC {} #[doc = "`reset()` method sets PDISC to value 0"] impl crate::Resettable for PDISC_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/port5/pdr0.rs b/src/port5/pdr0.rs index 7aa55787..9887252b 100644 --- a/src/port5/pdr0.rs +++ b/src/port5/pdr0.rs @@ -1,71 +1,39 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PD0` reader - Pad Driver Mode for Pn.0"] -pub type PD0_R = crate::FieldReader; +pub type PD0_R = crate::FieldReader; #[doc = "Field `PD0` writer - Pad Driver Mode for Pn.0"] -pub type PD0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD0_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD1` reader - Pad Driver Mode for Pn.1"] -pub type PD1_R = crate::FieldReader; +pub type PD1_R = crate::FieldReader; #[doc = "Field `PD1` writer - Pad Driver Mode for Pn.1"] -pub type PD1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD2` reader - Pad Driver Mode for Pn.2"] -pub type PD2_R = crate::FieldReader; +pub type PD2_R = crate::FieldReader; #[doc = "Field `PD2` writer - Pad Driver Mode for Pn.2"] -pub type PD2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD2_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD3` reader - Pad Driver Mode for Pn.3"] -pub type PD3_R = crate::FieldReader; +pub type PD3_R = crate::FieldReader; #[doc = "Field `PD3` writer - Pad Driver Mode for Pn.3"] -pub type PD3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD3_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD4` reader - Pad Driver Mode for Pn.4"] -pub type PD4_R = crate::FieldReader; +pub type PD4_R = crate::FieldReader; #[doc = "Field `PD4` writer - Pad Driver Mode for Pn.4"] -pub type PD4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD4_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD5` reader - Pad Driver Mode for Pn.5"] -pub type PD5_R = crate::FieldReader; +pub type PD5_R = crate::FieldReader; #[doc = "Field `PD5` writer - Pad Driver Mode for Pn.5"] -pub type PD5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD5_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD6` reader - Pad Driver Mode for Pn.6"] -pub type PD6_R = crate::FieldReader; +pub type PD6_R = crate::FieldReader; #[doc = "Field `PD6` writer - Pad Driver Mode for Pn.6"] -pub type PD6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD6_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PD7` reader - Pad Driver Mode for Pn.7"] -pub type PD7_R = crate::FieldReader; +pub type PD7_R = crate::FieldReader; #[doc = "Field `PD7` writer - Pad Driver Mode for Pn.7"] -pub type PD7_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PDR0_SPEC, u8, u8, 3, O>; +pub type PD7_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] @@ -112,70 +80,71 @@ impl W { #[doc = "Bits 0:2 - Pad Driver Mode for Pn.0"] #[inline(always)] #[must_use] - pub fn pd0(&mut self) -> PD0_W<0> { - PD0_W::new(self) + pub fn pd0(&mut self) -> PD0_W { + PD0_W::new(self, 0) } #[doc = "Bits 4:6 - Pad Driver Mode for Pn.1"] #[inline(always)] #[must_use] - pub fn pd1(&mut self) -> PD1_W<4> { - PD1_W::new(self) + pub fn pd1(&mut self) -> PD1_W { + PD1_W::new(self, 4) } #[doc = "Bits 8:10 - Pad Driver Mode for Pn.2"] #[inline(always)] #[must_use] - pub fn pd2(&mut self) -> PD2_W<8> { - PD2_W::new(self) + pub fn pd2(&mut self) -> PD2_W { + PD2_W::new(self, 8) } #[doc = "Bits 12:14 - Pad Driver Mode for Pn.3"] #[inline(always)] #[must_use] - pub fn pd3(&mut self) -> PD3_W<12> { - PD3_W::new(self) + pub fn pd3(&mut self) -> PD3_W { + PD3_W::new(self, 12) } #[doc = "Bits 16:18 - Pad Driver Mode for Pn.4"] #[inline(always)] #[must_use] - pub fn pd4(&mut self) -> PD4_W<16> { - PD4_W::new(self) + pub fn pd4(&mut self) -> PD4_W { + PD4_W::new(self, 16) } #[doc = "Bits 20:22 - Pad Driver Mode for Pn.5"] #[inline(always)] #[must_use] - pub fn pd5(&mut self) -> PD5_W<20> { - PD5_W::new(self) + pub fn pd5(&mut self) -> PD5_W { + PD5_W::new(self, 20) } #[doc = "Bits 24:26 - Pad Driver Mode for Pn.6"] #[inline(always)] #[must_use] - pub fn pd6(&mut self) -> PD6_W<24> { - PD6_W::new(self) + pub fn pd6(&mut self) -> PD6_W { + PD6_W::new(self, 24) } #[doc = "Bits 28:30 - Pad Driver Mode for Pn.7"] #[inline(always)] #[must_use] - pub fn pd7(&mut self) -> PD7_W<28> { - PD7_W::new(self) + pub fn pd7(&mut self) -> PD7_W { + PD7_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Pad Driver Mode 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pdr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pdr0::R`](R) reader structure"] +impl crate::Readable for PDR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pdr0::W`](W) writer structure"] impl crate::Writable for PDR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/port5/pps.rs b/src/port5/pps.rs index 1d3e9cb0..3df0167c 100644 --- a/src/port5/pps.rs +++ b/src/port5/pps.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PPS0` reader - Port n Pin Power Save Bit 0"] pub type PPS0_R = crate::BitReader; #[doc = "Port n Pin Power Save Bit 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PPS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS0_A { + pub const fn variant(&self) -> PPS0_A { match self.bits { false => PPS0_A::VALUE1, true => PPS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS0_A::VALUE2 } } #[doc = "Field `PPS0` writer - Port n Pin Power Save Bit 0"] -pub type PPS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS0_A, O>; -impl<'a, const O: u8> PPS0_W<'a, O> { +pub type PPS0_W<'a, REG> = crate::BitWriter<'a, REG, PPS0_A>; +impl<'a, REG> PPS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PPS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS1_A { + pub const fn variant(&self) -> PPS1_A { match self.bits { false => PPS1_A::VALUE1, true => PPS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS1_A::VALUE2 } } #[doc = "Field `PPS1` writer - Port n Pin Power Save Bit 1"] -pub type PPS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS1_A, O>; -impl<'a, const O: u8> PPS1_W<'a, O> { +pub type PPS1_W<'a, REG> = crate::BitWriter<'a, REG, PPS1_A>; +impl<'a, REG> PPS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PPS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS2_A { + pub const fn variant(&self) -> PPS2_A { match self.bits { false => PPS2_A::VALUE1, true => PPS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS2_A::VALUE2 } } #[doc = "Field `PPS2` writer - Port n Pin Power Save Bit 2"] -pub type PPS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS2_A, O>; -impl<'a, const O: u8> PPS2_W<'a, O> { +pub type PPS2_W<'a, REG> = crate::BitWriter<'a, REG, PPS2_A>; +impl<'a, REG> PPS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PPS3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS3_A { + pub const fn variant(&self) -> PPS3_A { match self.bits { false => PPS3_A::VALUE1, true => PPS3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS3_A::VALUE2 } } #[doc = "Field `PPS3` writer - Port n Pin Power Save Bit 3"] -pub type PPS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS3_A, O>; -impl<'a, const O: u8> PPS3_W<'a, O> { +pub type PPS3_W<'a, REG> = crate::BitWriter<'a, REG, PPS3_A>; +impl<'a, REG> PPS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PPS4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS4_A { + pub const fn variant(&self) -> PPS4_A { match self.bits { false => PPS4_A::VALUE1, true => PPS4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS4_A::VALUE2 } } #[doc = "Field `PPS4` writer - Port n Pin Power Save Bit 4"] -pub type PPS4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS4_A, O>; -impl<'a, const O: u8> PPS4_W<'a, O> { +pub type PPS4_W<'a, REG> = crate::BitWriter<'a, REG, PPS4_A>; +impl<'a, REG> PPS4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PPS5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS5_A { + pub const fn variant(&self) -> PPS5_A { match self.bits { false => PPS5_A::VALUE1, true => PPS5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS5_A::VALUE2 } } #[doc = "Field `PPS5` writer - Port n Pin Power Save Bit 5"] -pub type PPS5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS5_A, O>; -impl<'a, const O: u8> PPS5_W<'a, O> { +pub type PPS5_W<'a, REG> = crate::BitWriter<'a, REG, PPS5_A>; +impl<'a, REG> PPS5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPS6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS6_A { + pub const fn variant(&self) -> PPS6_A { match self.bits { false => PPS6_A::VALUE1, true => PPS6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS6_A::VALUE2 } } #[doc = "Field `PPS6` writer - Port n Pin Power Save Bit 6"] -pub type PPS6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS6_A, O>; -impl<'a, const O: u8> PPS6_W<'a, O> { +pub type PPS6_W<'a, REG> = crate::BitWriter<'a, REG, PPS6_A>; +impl<'a, REG> PPS6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PPS7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS7_A { + pub const fn variant(&self) -> PPS7_A { match self.bits { false => PPS7_A::VALUE1, true => PPS7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS7_A::VALUE2 } } #[doc = "Field `PPS7` writer - Port n Pin Power Save Bit 7"] -pub type PPS7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS7_A, O>; -impl<'a, const O: u8> PPS7_W<'a, O> { +pub type PPS7_W<'a, REG> = crate::BitWriter<'a, REG, PPS7_A>; +impl<'a, REG> PPS7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PPS8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS8_A { + pub const fn variant(&self) -> PPS8_A { match self.bits { false => PPS8_A::VALUE1, true => PPS8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS8_A::VALUE2 } } #[doc = "Field `PPS8` writer - Port n Pin Power Save Bit 8"] -pub type PPS8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS8_A, O>; -impl<'a, const O: u8> PPS8_W<'a, O> { +pub type PPS8_W<'a, REG> = crate::BitWriter<'a, REG, PPS8_A>; +impl<'a, REG> PPS8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PPS9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS9_A { + pub const fn variant(&self) -> PPS9_A { match self.bits { false => PPS9_A::VALUE1, true => PPS9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS9_A::VALUE2 } } #[doc = "Field `PPS9` writer - Port n Pin Power Save Bit 9"] -pub type PPS9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS9_A, O>; -impl<'a, const O: u8> PPS9_W<'a, O> { +pub type PPS9_W<'a, REG> = crate::BitWriter<'a, REG, PPS9_A>; +impl<'a, REG> PPS9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl PPS10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS10_A { + pub const fn variant(&self) -> PPS10_A { match self.bits { false => PPS10_A::VALUE1, true => PPS10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS10_A::VALUE2 } } #[doc = "Field `PPS10` writer - Port n Pin Power Save Bit 10"] -pub type PPS10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS10_A, O>; -impl<'a, const O: u8> PPS10_W<'a, O> { +pub type PPS10_W<'a, REG> = crate::BitWriter<'a, REG, PPS10_A>; +impl<'a, REG> PPS10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl PPS11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS11_A { + pub const fn variant(&self) -> PPS11_A { match self.bits { false => PPS11_A::VALUE1, true => PPS11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS11_A::VALUE2 } } #[doc = "Field `PPS11` writer - Port n Pin Power Save Bit 11"] -pub type PPS11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS11_A, O>; -impl<'a, const O: u8> PPS11_W<'a, O> { +pub type PPS11_W<'a, REG> = crate::BitWriter<'a, REG, PPS11_A>; +impl<'a, REG> PPS11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl PPS12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS12_A { + pub const fn variant(&self) -> PPS12_A { match self.bits { false => PPS12_A::VALUE1, true => PPS12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS12_A::VALUE2 } } #[doc = "Field `PPS12` writer - Port n Pin Power Save Bit 12"] -pub type PPS12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS12_A, O>; -impl<'a, const O: u8> PPS12_W<'a, O> { +pub type PPS12_W<'a, REG> = crate::BitWriter<'a, REG, PPS12_A>; +impl<'a, REG> PPS12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl PPS13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS13_A { + pub const fn variant(&self) -> PPS13_A { match self.bits { false => PPS13_A::VALUE1, true => PPS13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS13_A::VALUE2 } } #[doc = "Field `PPS13` writer - Port n Pin Power Save Bit 13"] -pub type PPS13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS13_A, O>; -impl<'a, const O: u8> PPS13_W<'a, O> { +pub type PPS13_W<'a, REG> = crate::BitWriter<'a, REG, PPS13_A>; +impl<'a, REG> PPS13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl PPS14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS14_A { + pub const fn variant(&self) -> PPS14_A { match self.bits { false => PPS14_A::VALUE1, true => PPS14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS14_A::VALUE2 } } #[doc = "Field `PPS14` writer - Port n Pin Power Save Bit 14"] -pub type PPS14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS14_A, O>; -impl<'a, const O: u8> PPS14_W<'a, O> { +pub type PPS14_W<'a, REG> = crate::BitWriter<'a, REG, PPS14_A>; +impl<'a, REG> PPS14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl PPS15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPS15_A { + pub const fn variant(&self) -> PPS15_A { match self.bits { false => PPS15_A::VALUE1, true => PPS15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPS15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPS15_A::VALUE2 } } #[doc = "Field `PPS15` writer - Port n Pin Power Save Bit 15"] -pub type PPS15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PPS_SPEC, PPS15_A, O>; -impl<'a, const O: u8> PPS15_W<'a, O> { +pub type PPS15_W<'a, REG> = crate::BitWriter<'a, REG, PPS15_A>; +impl<'a, REG> PPS15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Pin Power Save of Pn.x is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE1) } #[doc = "Pin Power Save of Pn.x is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPS15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Port n Pin Power Save Bit 0"] #[inline(always)] #[must_use] - pub fn pps0(&mut self) -> PPS0_W<0> { - PPS0_W::new(self) + pub fn pps0(&mut self) -> PPS0_W { + PPS0_W::new(self, 0) } #[doc = "Bit 1 - Port n Pin Power Save Bit 1"] #[inline(always)] #[must_use] - pub fn pps1(&mut self) -> PPS1_W<1> { - PPS1_W::new(self) + pub fn pps1(&mut self) -> PPS1_W { + PPS1_W::new(self, 1) } #[doc = "Bit 2 - Port n Pin Power Save Bit 2"] #[inline(always)] #[must_use] - pub fn pps2(&mut self) -> PPS2_W<2> { - PPS2_W::new(self) + pub fn pps2(&mut self) -> PPS2_W { + PPS2_W::new(self, 2) } #[doc = "Bit 3 - Port n Pin Power Save Bit 3"] #[inline(always)] #[must_use] - pub fn pps3(&mut self) -> PPS3_W<3> { - PPS3_W::new(self) + pub fn pps3(&mut self) -> PPS3_W { + PPS3_W::new(self, 3) } #[doc = "Bit 4 - Port n Pin Power Save Bit 4"] #[inline(always)] #[must_use] - pub fn pps4(&mut self) -> PPS4_W<4> { - PPS4_W::new(self) + pub fn pps4(&mut self) -> PPS4_W { + PPS4_W::new(self, 4) } #[doc = "Bit 5 - Port n Pin Power Save Bit 5"] #[inline(always)] #[must_use] - pub fn pps5(&mut self) -> PPS5_W<5> { - PPS5_W::new(self) + pub fn pps5(&mut self) -> PPS5_W { + PPS5_W::new(self, 5) } #[doc = "Bit 6 - Port n Pin Power Save Bit 6"] #[inline(always)] #[must_use] - pub fn pps6(&mut self) -> PPS6_W<6> { - PPS6_W::new(self) + pub fn pps6(&mut self) -> PPS6_W { + PPS6_W::new(self, 6) } #[doc = "Bit 7 - Port n Pin Power Save Bit 7"] #[inline(always)] #[must_use] - pub fn pps7(&mut self) -> PPS7_W<7> { - PPS7_W::new(self) + pub fn pps7(&mut self) -> PPS7_W { + PPS7_W::new(self, 7) } #[doc = "Bit 8 - Port n Pin Power Save Bit 8"] #[inline(always)] #[must_use] - pub fn pps8(&mut self) -> PPS8_W<8> { - PPS8_W::new(self) + pub fn pps8(&mut self) -> PPS8_W { + PPS8_W::new(self, 8) } #[doc = "Bit 9 - Port n Pin Power Save Bit 9"] #[inline(always)] #[must_use] - pub fn pps9(&mut self) -> PPS9_W<9> { - PPS9_W::new(self) + pub fn pps9(&mut self) -> PPS9_W { + PPS9_W::new(self, 9) } #[doc = "Bit 10 - Port n Pin Power Save Bit 10"] #[inline(always)] #[must_use] - pub fn pps10(&mut self) -> PPS10_W<10> { - PPS10_W::new(self) + pub fn pps10(&mut self) -> PPS10_W { + PPS10_W::new(self, 10) } #[doc = "Bit 11 - Port n Pin Power Save Bit 11"] #[inline(always)] #[must_use] - pub fn pps11(&mut self) -> PPS11_W<11> { - PPS11_W::new(self) + pub fn pps11(&mut self) -> PPS11_W { + PPS11_W::new(self, 11) } #[doc = "Bit 12 - Port n Pin Power Save Bit 12"] #[inline(always)] #[must_use] - pub fn pps12(&mut self) -> PPS12_W<12> { - PPS12_W::new(self) + pub fn pps12(&mut self) -> PPS12_W { + PPS12_W::new(self, 12) } #[doc = "Bit 13 - Port n Pin Power Save Bit 13"] #[inline(always)] #[must_use] - pub fn pps13(&mut self) -> PPS13_W<13> { - PPS13_W::new(self) + pub fn pps13(&mut self) -> PPS13_W { + PPS13_W::new(self, 13) } #[doc = "Bit 14 - Port n Pin Power Save Bit 14"] #[inline(always)] #[must_use] - pub fn pps14(&mut self) -> PPS14_W<14> { - PPS14_W::new(self) + pub fn pps14(&mut self) -> PPS14_W { + PPS14_W::new(self, 14) } #[doc = "Bit 15 - Port n Pin Power Save Bit 15"] #[inline(always)] #[must_use] - pub fn pps15(&mut self) -> PPS15_W<15> { - PPS15_W::new(self) + pub fn pps15(&mut self) -> PPS15_W { + PPS15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Port 5 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"] +#[doc = "Port 5 Pin Power Save Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pps::R`](R) reader structure"] +impl crate::Readable for PPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pps::W`](W) writer structure"] impl crate::Writable for PPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0.rs b/src/posif0.rs index a3cc270f..9eba8af4 100644 --- a/src/posif0.rs +++ b/src/posif0.rs @@ -1,124 +1,221 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + pconf: PCONF, + psus: PSUS, + pruns: PRUNS, + prunc: PRUNC, + prun: PRUN, + _reserved5: [u8; 0x0c], + midr: MIDR, + _reserved6: [u8; 0x0c], + halp: HALP, + halps: HALPS, + _reserved8: [u8; 0x08], + mcm: MCM, + mcsm: MCSM, + mcms: MCMS, + mcmc: MCMC, + mcmf: MCMF, + _reserved13: [u8; 0x0c], + qdc: QDC, + _reserved14: [u8; 0x0c], + pflg: PFLG, + pflge: PFLGE, + spflg: SPFLG, + rpflg: RPFLG, + _reserved18: [u8; 0x80], + pdbg: PDBG, +} +impl RegisterBlock { #[doc = "0x00 - Service Request Processing configuration"] - pub pconf: PCONF, + #[inline(always)] + pub const fn pconf(&self) -> &PCONF { + &self.pconf + } #[doc = "0x04 - Service Request Processing Suspend Config"] - pub psus: PSUS, + #[inline(always)] + pub const fn psus(&self) -> &PSUS { + &self.psus + } #[doc = "0x08 - Service Request Processing Run Bit Set"] - pub pruns: PRUNS, + #[inline(always)] + pub const fn pruns(&self) -> &PRUNS { + &self.pruns + } #[doc = "0x0c - Service Request Processing Run Bit Clear"] - pub prunc: PRUNC, + #[inline(always)] + pub const fn prunc(&self) -> &PRUNC { + &self.prunc + } #[doc = "0x10 - Service Request Processing Run Bit Status"] - pub prun: PRUN, - _reserved5: [u8; 0x0c], + #[inline(always)] + pub const fn prun(&self) -> &PRUN { + &self.prun + } #[doc = "0x20 - Module Identification register"] - pub midr: MIDR, - _reserved6: [u8; 0x0c], + #[inline(always)] + pub const fn midr(&self) -> &MIDR { + &self.midr + } #[doc = "0x30 - Hall Sensor Patterns"] - pub halp: HALP, + #[inline(always)] + pub const fn halp(&self) -> &HALP { + &self.halp + } #[doc = "0x34 - Hall Sensor Shadow Patterns"] - pub halps: HALPS, - _reserved8: [u8; 0x08], + #[inline(always)] + pub const fn halps(&self) -> &HALPS { + &self.halps + } #[doc = "0x40 - Multi-Channel Pattern"] - pub mcm: MCM, + #[inline(always)] + pub const fn mcm(&self) -> &MCM { + &self.mcm + } #[doc = "0x44 - Multi-Channel Shadow Pattern"] - pub mcsm: MCSM, + #[inline(always)] + pub const fn mcsm(&self) -> &MCSM { + &self.mcsm + } #[doc = "0x48 - Multi-Channel Pattern Control set"] - pub mcms: MCMS, + #[inline(always)] + pub const fn mcms(&self) -> &MCMS { + &self.mcms + } #[doc = "0x4c - Multi-Channel Pattern Control clear"] - pub mcmc: MCMC, + #[inline(always)] + pub const fn mcmc(&self) -> &MCMC { + &self.mcmc + } #[doc = "0x50 - Multi-Channel Pattern Control flag"] - pub mcmf: MCMF, - _reserved13: [u8; 0x0c], + #[inline(always)] + pub const fn mcmf(&self) -> &MCMF { + &self.mcmf + } #[doc = "0x60 - Quadrature Decoder Control"] - pub qdc: QDC, - _reserved14: [u8; 0x0c], + #[inline(always)] + pub const fn qdc(&self) -> &QDC { + &self.qdc + } #[doc = "0x70 - Service Request Processing Interrupt Flags"] - pub pflg: PFLG, + #[inline(always)] + pub const fn pflg(&self) -> &PFLG { + &self.pflg + } #[doc = "0x74 - Service Request Processing Interrupt Enable"] - pub pflge: PFLGE, + #[inline(always)] + pub const fn pflge(&self) -> &PFLGE { + &self.pflge + } #[doc = "0x78 - Service Request Processing Interrupt Set"] - pub spflg: SPFLG, + #[inline(always)] + pub const fn spflg(&self) -> &SPFLG { + &self.spflg + } #[doc = "0x7c - Service Request Processing Interrupt Clear"] - pub rpflg: RPFLG, - _reserved18: [u8; 0x80], + #[inline(always)] + pub const fn rpflg(&self) -> &RPFLG { + &self.rpflg + } #[doc = "0x100 - POSIF Debug register"] - pub pdbg: PDBG, + #[inline(always)] + pub const fn pdbg(&self) -> &PDBG { + &self.pdbg + } } -#[doc = "PCONF (rw) register accessor: an alias for `Reg`"] +#[doc = "PCONF (rw) register accessor: Service Request Processing configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pconf::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pconf::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pconf`] +module"] pub type PCONF = crate::Reg; #[doc = "Service Request Processing configuration"] pub mod pconf; -#[doc = "PSUS (rw) register accessor: an alias for `Reg`"] +#[doc = "PSUS (rw) register accessor: Service Request Processing Suspend Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psus::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psus::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psus`] +module"] pub type PSUS = crate::Reg; #[doc = "Service Request Processing Suspend Config"] pub mod psus; -#[doc = "PRUNS (w) register accessor: an alias for `Reg`"] +#[doc = "PRUNS (w) register accessor: Service Request Processing Run Bit Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pruns::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pruns`] +module"] pub type PRUNS = crate::Reg; #[doc = "Service Request Processing Run Bit Set"] pub mod pruns; -#[doc = "PRUNC (w) register accessor: an alias for `Reg`"] +#[doc = "PRUNC (w) register accessor: Service Request Processing Run Bit Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prunc::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prunc`] +module"] pub type PRUNC = crate::Reg; #[doc = "Service Request Processing Run Bit Clear"] pub mod prunc; -#[doc = "PRUN (r) register accessor: an alias for `Reg`"] +#[doc = "PRUN (r) register accessor: Service Request Processing Run Bit Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prun::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prun`] +module"] pub type PRUN = crate::Reg; #[doc = "Service Request Processing Run Bit Status"] pub mod prun; -#[doc = "MIDR (r) register accessor: an alias for `Reg`"] +#[doc = "MIDR (r) register accessor: Module Identification register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`midr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@midr`] +module"] pub type MIDR = crate::Reg; #[doc = "Module Identification register"] pub mod midr; -#[doc = "HALP (r) register accessor: an alias for `Reg`"] +#[doc = "HALP (r) register accessor: Hall Sensor Patterns\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`halp::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@halp`] +module"] pub type HALP = crate::Reg; #[doc = "Hall Sensor Patterns"] pub mod halp; -#[doc = "HALPS (rw) register accessor: an alias for `Reg`"] +#[doc = "HALPS (rw) register accessor: Hall Sensor Shadow Patterns\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`halps::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`halps::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@halps`] +module"] pub type HALPS = crate::Reg; #[doc = "Hall Sensor Shadow Patterns"] pub mod halps; -#[doc = "MCM (r) register accessor: an alias for `Reg`"] +#[doc = "MCM (r) register accessor: Multi-Channel Pattern\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcm::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mcm`] +module"] pub type MCM = crate::Reg; #[doc = "Multi-Channel Pattern"] pub mod mcm; -#[doc = "MCSM (rw) register accessor: an alias for `Reg`"] +#[doc = "MCSM (rw) register accessor: Multi-Channel Shadow Pattern\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcsm::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcsm::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mcsm`] +module"] pub type MCSM = crate::Reg; #[doc = "Multi-Channel Shadow Pattern"] pub mod mcsm; -#[doc = "MCMS (w) register accessor: an alias for `Reg`"] +#[doc = "MCMS (w) register accessor: Multi-Channel Pattern Control set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcms::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mcms`] +module"] pub type MCMS = crate::Reg; #[doc = "Multi-Channel Pattern Control set"] pub mod mcms; -#[doc = "MCMC (w) register accessor: an alias for `Reg`"] +#[doc = "MCMC (w) register accessor: Multi-Channel Pattern Control clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcmc::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mcmc`] +module"] pub type MCMC = crate::Reg; #[doc = "Multi-Channel Pattern Control clear"] pub mod mcmc; -#[doc = "MCMF (r) register accessor: an alias for `Reg`"] +#[doc = "MCMF (r) register accessor: Multi-Channel Pattern Control flag\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcmf::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mcmf`] +module"] pub type MCMF = crate::Reg; #[doc = "Multi-Channel Pattern Control flag"] pub mod mcmf; -#[doc = "QDC (rw) register accessor: an alias for `Reg`"] +#[doc = "QDC (rw) register accessor: Quadrature Decoder Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qdc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`qdc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@qdc`] +module"] pub type QDC = crate::Reg; #[doc = "Quadrature Decoder Control"] pub mod qdc; -#[doc = "PFLG (r) register accessor: an alias for `Reg`"] +#[doc = "PFLG (r) register accessor: Service Request Processing Interrupt Flags\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pflg::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pflg`] +module"] pub type PFLG = crate::Reg; #[doc = "Service Request Processing Interrupt Flags"] pub mod pflg; -#[doc = "PFLGE (rw) register accessor: an alias for `Reg`"] +#[doc = "PFLGE (rw) register accessor: Service Request Processing Interrupt Enable\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pflge::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pflge::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pflge`] +module"] pub type PFLGE = crate::Reg; #[doc = "Service Request Processing Interrupt Enable"] pub mod pflge; -#[doc = "SPFLG (w) register accessor: an alias for `Reg`"] +#[doc = "SPFLG (w) register accessor: Service Request Processing Interrupt Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`spflg::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@spflg`] +module"] pub type SPFLG = crate::Reg; #[doc = "Service Request Processing Interrupt Set"] pub mod spflg; -#[doc = "RPFLG (w) register accessor: an alias for `Reg`"] +#[doc = "RPFLG (w) register accessor: Service Request Processing Interrupt Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rpflg::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rpflg`] +module"] pub type RPFLG = crate::Reg; #[doc = "Service Request Processing Interrupt Clear"] pub mod rpflg; -#[doc = "PDBG (r) register accessor: an alias for `Reg`"] +#[doc = "PDBG (r) register accessor: POSIF Debug register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdbg::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pdbg`] +module"] 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 42a212cb..a0dc5382 100644 --- a/src/posif0/halp.rs +++ b/src/posif0/halp.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `HCP` reader - Hall Current Pattern"] -pub type HCP_R = crate::FieldReader; +pub type HCP_R = crate::FieldReader; #[doc = "Field `HEP` reader - Hall Expected Pattern"] -pub type HEP_R = crate::FieldReader; +pub type HEP_R = crate::FieldReader; impl R { #[doc = "Bits 0:2 - Hall Current Pattern"] #[inline(always)] @@ -29,15 +16,13 @@ impl R { HEP_R::new(((self.bits >> 3) & 7) 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"] +#[doc = "Hall Sensor Patterns\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`halp::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`halp::R`](R) reader structure"] +impl crate::Readable for HALP_SPEC {} #[doc = "`reset()` method sets HALP to value 0"] impl crate::Resettable for HALP_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/posif0/halps.rs b/src/posif0/halps.rs index f135ce4b..ac768ede 100644 --- a/src/posif0/halps.rs +++ b/src/posif0/halps.rs @@ -1,47 +1,15 @@ #[doc = "Register `HALPS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HCPS` reader - Shadow Hall Current Pattern"] -pub type HCPS_R = crate::FieldReader; +pub type HCPS_R = crate::FieldReader; #[doc = "Field `HCPS` writer - Shadow Hall Current Pattern"] -pub type HCPS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HALPS_SPEC, u8, u8, 3, O>; +pub type HCPS_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `HEPS` reader - Shadow Hall expected Pattern"] -pub type HEPS_R = crate::FieldReader; +pub type HEPS_R = crate::FieldReader; #[doc = "Field `HEPS` writer - Shadow Hall expected Pattern"] -pub type HEPS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HALPS_SPEC, u8, u8, 3, O>; +pub type HEPS_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Shadow Hall Current Pattern"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:2 - Shadow Hall Current Pattern"] #[inline(always)] #[must_use] - pub fn hcps(&mut self) -> HCPS_W<0> { - HCPS_W::new(self) + pub fn hcps(&mut self) -> HCPS_W { + HCPS_W::new(self, 0) } #[doc = "Bits 3:5 - Shadow Hall expected Pattern"] #[inline(always)] #[must_use] - pub fn heps(&mut self) -> HEPS_W<3> { - HEPS_W::new(self) + pub fn heps(&mut self) -> HEPS_W { + HEPS_W::new(self, 3) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Hall Sensor Shadow Patterns\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`halps::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`halps::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`halps::R`](R) reader structure"] +impl crate::Readable for HALPS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`halps::W`](W) writer structure"] impl crate::Writable for HALPS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/mcm.rs b/src/posif0/mcm.rs index 43809795..1f288e3b 100644 --- a/src/posif0/mcm.rs +++ b/src/posif0/mcm.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MCMP` reader - Multi-Channel Pattern"] -pub type MCMP_R = crate::FieldReader; +pub type MCMP_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Multi-Channel Pattern"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Multi-Channel Pattern\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcm::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`mcm::R`](R) reader structure"] +impl crate::Readable for MCM_SPEC {} #[doc = "`reset()` method sets MCM to value 0"] impl crate::Resettable for MCM_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/posif0/mcmc.rs b/src/posif0/mcmc.rs index 48aa737e..64d82b21 100644 --- a/src/posif0/mcmc.rs +++ b/src/posif0/mcmc.rs @@ -1,56 +1,40 @@ #[doc = "Register `MCMC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `MNPC` writer - Multi-Channel Pattern Update Enable Clear"] -pub type MNPC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCMC_SPEC, bool, O>; +pub type MNPC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MPC` writer - Multi-Channel Pattern clear"] -pub type MPC_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCMC_SPEC, bool, O>; +pub type MPC_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Multi-Channel Pattern Update Enable Clear"] #[inline(always)] #[must_use] - pub fn mnpc(&mut self) -> MNPC_W<0> { - MNPC_W::new(self) + pub fn mnpc(&mut self) -> MNPC_W { + MNPC_W::new(self, 0) } #[doc = "Bit 1 - Multi-Channel Pattern clear"] #[inline(always)] #[must_use] - pub fn mpc(&mut self) -> MPC_W<1> { - MPC_W::new(self) + pub fn mpc(&mut self) -> MPC_W { + MPC_W::new(self, 1) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Multi-Channel Pattern Control clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcmc::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MCMC_SPEC; impl crate::RegisterSpec for MCMC_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [mcmc::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`mcmc::W`](W) writer structure"] impl crate::Writable for MCMC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/mcmf.rs b/src/posif0/mcmf.rs index e0494a2e..152cb6c4 100644 --- a/src/posif0/mcmf.rs +++ b/src/posif0/mcmf.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MSS` reader - Multi-Channel Pattern update status"] pub type MSS_R = crate::BitReader; #[doc = "Multi-Channel Pattern update status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl MSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSS_A { + pub const fn variant(&self) -> MSS_A { match self.bits { false => MSS_A::VALUE1, true => MSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Update of the Multi-Channel pattern is set"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update of the Multi-Channel pattern is not set"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSS_A::VALUE2 @@ -56,15 +43,13 @@ impl R { MSS_R::new((self.bits & 1) != 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"] +#[doc = "Multi-Channel Pattern Control flag\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcmf::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`mcmf::R`](R) reader structure"] +impl crate::Readable for MCMF_SPEC {} #[doc = "`reset()` method sets MCMF to value 0"] impl crate::Resettable for MCMF_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/posif0/mcms.rs b/src/posif0/mcms.rs index 43a6ad54..bea319cd 100644 --- a/src/posif0/mcms.rs +++ b/src/posif0/mcms.rs @@ -1,64 +1,48 @@ #[doc = "Register `MCMS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `MNPS` writer - Multi-Channel Pattern Update Enable Set"] -pub type MNPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCMS_SPEC, bool, O>; +pub type MNPS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STHR` writer - Hall Pattern Shadow Transfer Request"] -pub type STHR_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCMS_SPEC, bool, O>; +pub type STHR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STMR` writer - Multi-Channel Shadow Transfer Request"] -pub type STMR_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCMS_SPEC, bool, O>; +pub type STMR_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Multi-Channel Pattern Update Enable Set"] #[inline(always)] #[must_use] - pub fn mnps(&mut self) -> MNPS_W<0> { - MNPS_W::new(self) + pub fn mnps(&mut self) -> MNPS_W { + MNPS_W::new(self, 0) } #[doc = "Bit 1 - Hall Pattern Shadow Transfer Request"] #[inline(always)] #[must_use] - pub fn sthr(&mut self) -> STHR_W<1> { - STHR_W::new(self) + pub fn sthr(&mut self) -> STHR_W { + STHR_W::new(self, 1) } #[doc = "Bit 2 - Multi-Channel Shadow Transfer Request"] #[inline(always)] #[must_use] - pub fn stmr(&mut self) -> STMR_W<2> { - STMR_W::new(self) + pub fn stmr(&mut self) -> STMR_W { + STMR_W::new(self, 2) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Multi-Channel Pattern Control set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcms::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MCMS_SPEC; impl crate::RegisterSpec for MCMS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [mcms::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`mcms::W`](W) writer structure"] impl crate::Writable for MCMS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/mcsm.rs b/src/posif0/mcsm.rs index 1af31069..d6818c60 100644 --- a/src/posif0/mcsm.rs +++ b/src/posif0/mcsm.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MCMPS` reader - Shadow Multi-Channel Pattern"] -pub type MCMPS_R = crate::FieldReader; +pub type MCMPS_R = crate::FieldReader; #[doc = "Field `MCMPS` writer - Shadow Multi-Channel Pattern"] -pub type MCMPS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MCSM_SPEC, u16, u16, 16, O>; +pub type MCMPS_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Shadow Multi-Channel Pattern"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Shadow Multi-Channel Pattern"] #[inline(always)] #[must_use] - pub fn mcmps(&mut self) -> MCMPS_W<0> { - MCMPS_W::new(self) + pub fn mcmps(&mut self) -> MCMPS_W { + MCMPS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Multi-Channel Shadow Pattern\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mcsm::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mcsm::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mcsm::R`](R) reader structure"] +impl crate::Readable for MCSM_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mcsm::W`](W) writer structure"] impl crate::Writable for MCSM_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/midr.rs b/src/posif0/midr.rs index 3fd2486a..6d7b48b2 100644 --- a/src/posif0/midr.rs +++ b/src/posif0/midr.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MODR` reader - Module Revision"] -pub type MODR_R = crate::FieldReader; +pub type MODR_R = crate::FieldReader; #[doc = "Field `MODT` reader - Module Type"] -pub type MODT_R = crate::FieldReader; +pub type MODT_R = crate::FieldReader; #[doc = "Field `MODN` reader - Module Number"] -pub type MODN_R = crate::FieldReader; +pub type MODN_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`midr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`midr::R`](R) reader structure"] +impl crate::Readable for MIDR_SPEC {} #[doc = "`reset()` method sets MIDR to value 0x00a8_c000"] impl crate::Resettable for MIDR_SPEC { const RESET_VALUE: Self::Ux = 0x00a8_c000; diff --git a/src/posif0/pconf.rs b/src/posif0/pconf.rs index 22112439..7571c503 100644 --- a/src/posif0/pconf.rs +++ b/src/posif0/pconf.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `FSEL` reader - Function Selector"] -pub type FSEL_R = crate::FieldReader; +pub type FSEL_R = crate::FieldReader; #[doc = "Function Selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for FSEL_A { + type Ux = u8; +} impl FSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FSEL_A { + pub const fn variant(&self) -> FSEL_A { match self.bits { 0 => FSEL_A::VALUE1, 1 => FSEL_A::VALUE2, @@ -67,48 +38,52 @@ impl FSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Hall Sensor Mode enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature Decoder Mode enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "stand-alone Multi-Channel Mode enabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == FSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Quadrature Decoder and stand-alone Multi-Channel Mode enabled"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == FSEL_A::VALUE4 } } #[doc = "Field `FSEL` writer - Function Selector"] -pub type FSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCONF_SPEC, u8, FSEL_A, 2, O>; -impl<'a, const O: u8> FSEL_W<'a, O> { +pub type FSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, FSEL_A>; +impl<'a, REG> FSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Hall Sensor Mode enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FSEL_A::VALUE1) } #[doc = "Quadrature Decoder Mode enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FSEL_A::VALUE2) } #[doc = "stand-alone Multi-Channel Mode enabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(FSEL_A::VALUE3) } #[doc = "Quadrature Decoder and stand-alone Multi-Channel Mode enabled"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(FSEL_A::VALUE4) } } @@ -131,41 +106,44 @@ impl From for bool { impl QDCM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> QDCM_A { + pub const fn variant(&self) -> QDCM_A { match self.bits { false => QDCM_A::VALUE1, true => QDCM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Position encoder is in Quadrature Mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == QDCM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Position encoder is in Direction Count Mode."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == QDCM_A::VALUE2 } } #[doc = "Field `QDCM` writer - Position Decoder Mode selection"] -pub type QDCM_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCONF_SPEC, QDCM_A, O>; -impl<'a, const O: u8> QDCM_W<'a, O> { +pub type QDCM_W<'a, REG> = crate::BitWriter<'a, REG, QDCM_A>; +impl<'a, REG> QDCM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Position encoder is in Quadrature Mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(QDCM_A::VALUE1) } #[doc = "Position encoder is in Direction Count Mode."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(QDCM_A::VALUE2) } } #[doc = "Field `HIDG` reader - Idle generation enable"] -pub type HIDG_R = crate::BitReader; +pub type HIDG_R = crate::BitReader; #[doc = "Field `HIDG` writer - Idle generation enable"] -pub type HIDG_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCONF_SPEC, bool, O>; +pub type HIDG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MCUE` reader - Multi-Channel Pattern SW update enable"] pub type MCUE_R = crate::BitReader; #[doc = "Multi-Channel Pattern SW update enable\n\nValue on reset: 0"] @@ -185,39 +163,42 @@ impl From for bool { impl MCUE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCUE_A { + pub const fn variant(&self) -> MCUE_A { match self.bits { false => MCUE_A::VALUE1, true => MCUE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Multi-Channel pattern update is controlled via HW"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCUE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Multi-Channel pattern update is controlled via SW"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCUE_A::VALUE2 } } #[doc = "Field `MCUE` writer - Multi-Channel Pattern SW update enable"] -pub type MCUE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCONF_SPEC, MCUE_A, O>; -impl<'a, const O: u8> MCUE_W<'a, O> { +pub type MCUE_W<'a, REG> = crate::BitWriter<'a, REG, MCUE_A>; +impl<'a, REG> MCUE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Multi-Channel pattern update is controlled via HW"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCUE_A::VALUE1) } #[doc = "Multi-Channel pattern update is controlled via SW"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCUE_A::VALUE2) } } #[doc = "Field `INSEL0` reader - PhaseA/Hal input 1 selector"] -pub type INSEL0_R = crate::FieldReader; +pub type INSEL0_R = crate::FieldReader; #[doc = "PhaseA/Hal input 1 selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -237,10 +218,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for INSEL0_A { + type Ux = u8; +} impl INSEL0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSEL0_A { + pub const fn variant(&self) -> INSEL0_A { match self.bits { 0 => INSEL0_A::VALUE1, 1 => INSEL0_A::VALUE2, @@ -249,53 +233,57 @@ impl INSEL0_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "POSIFx.IN0A"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSEL0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "POSIFx.IN0B"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSEL0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "POSIFx.IN0C"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == INSEL0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "POSIFx.IN0D"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == INSEL0_A::VALUE4 } } #[doc = "Field `INSEL0` writer - PhaseA/Hal input 1 selector"] -pub type INSEL0_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCONF_SPEC, u8, INSEL0_A, 2, O>; -impl<'a, const O: u8> INSEL0_W<'a, O> { +pub type INSEL0_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, INSEL0_A>; +impl<'a, REG> INSEL0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "POSIFx.IN0A"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSEL0_A::VALUE1) } #[doc = "POSIFx.IN0B"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSEL0_A::VALUE2) } #[doc = "POSIFx.IN0C"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(INSEL0_A::VALUE3) } #[doc = "POSIFx.IN0D"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(INSEL0_A::VALUE4) } } #[doc = "Field `INSEL1` reader - PhaseB/Hall input 2 selector"] -pub type INSEL1_R = crate::FieldReader; +pub type INSEL1_R = crate::FieldReader; #[doc = "PhaseB/Hall input 2 selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -315,10 +303,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for INSEL1_A { + type Ux = u8; +} impl INSEL1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSEL1_A { + pub const fn variant(&self) -> INSEL1_A { match self.bits { 0 => INSEL1_A::VALUE1, 1 => INSEL1_A::VALUE2, @@ -327,53 +318,57 @@ impl INSEL1_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "POSIFx.IN1A"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSEL1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "POSIFx.IN1B"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSEL1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "POSIFx.IN1C"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == INSEL1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "POSIFx.IN1D"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == INSEL1_A::VALUE4 } } #[doc = "Field `INSEL1` writer - PhaseB/Hall input 2 selector"] -pub type INSEL1_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCONF_SPEC, u8, INSEL1_A, 2, O>; -impl<'a, const O: u8> INSEL1_W<'a, O> { +pub type INSEL1_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, INSEL1_A>; +impl<'a, REG> INSEL1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "POSIFx.IN1A"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSEL1_A::VALUE1) } #[doc = "POSIFx.IN1B"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSEL1_A::VALUE2) } #[doc = "POSIFx.IN1C"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(INSEL1_A::VALUE3) } #[doc = "POSIFx.IN1D"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(INSEL1_A::VALUE4) } } #[doc = "Field `INSEL2` reader - Index/Hall input 3 selector"] -pub type INSEL2_R = crate::FieldReader; +pub type INSEL2_R = crate::FieldReader; #[doc = "Index/Hall input 3 selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -393,10 +388,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for INSEL2_A { + type Ux = u8; +} impl INSEL2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSEL2_A { + pub const fn variant(&self) -> INSEL2_A { match self.bits { 0 => INSEL2_A::VALUE1, 1 => INSEL2_A::VALUE2, @@ -405,48 +403,52 @@ impl INSEL2_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "POSIFx.IN2A"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSEL2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "POSIFx.IN2B"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSEL2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "POSIFx.IN2C"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == INSEL2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "POSIFx.IN2D"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == INSEL2_A::VALUE4 } } #[doc = "Field `INSEL2` writer - Index/Hall input 3 selector"] -pub type INSEL2_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCONF_SPEC, u8, INSEL2_A, 2, O>; -impl<'a, const O: u8> INSEL2_W<'a, O> { +pub type INSEL2_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, INSEL2_A>; +impl<'a, REG> INSEL2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "POSIFx.IN2A"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSEL2_A::VALUE1) } #[doc = "POSIFx.IN2B"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSEL2_A::VALUE2) } #[doc = "POSIFx.IN2C"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(INSEL2_A::VALUE3) } #[doc = "POSIFx.IN2D"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(INSEL2_A::VALUE4) } } @@ -469,34 +471,37 @@ impl From for bool { impl DSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEL_A { + pub const fn variant(&self) -> DSEL_A { match self.bits { false => DSEL_A::VALUE1, true => DSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "POSIFx.HSDA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "POSIFx.HSDB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEL_A::VALUE2 } } #[doc = "Field `DSEL` writer - Delay Pin selector"] -pub type DSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCONF_SPEC, DSEL_A, O>; -impl<'a, const O: u8> DSEL_W<'a, O> { +pub type DSEL_W<'a, REG> = crate::BitWriter<'a, REG, DSEL_A>; +impl<'a, REG> DSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "POSIFx.HSDA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE1) } #[doc = "POSIFx.HSDB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE2) } } @@ -519,39 +524,42 @@ impl From for bool { impl SPES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SPES_A { + pub const fn variant(&self) -> SPES_A { match self.bits { false => SPES_A::VALUE1, true => SPES_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Rising edge"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SPES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Falling edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SPES_A::VALUE2 } } #[doc = "Field `SPES` writer - Edge selector for the sampling trigger"] -pub type SPES_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCONF_SPEC, SPES_A, O>; -impl<'a, const O: u8> SPES_W<'a, O> { +pub type SPES_W<'a, REG> = crate::BitWriter<'a, REG, SPES_A>; +impl<'a, REG> SPES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Rising edge"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SPES_A::VALUE1) } #[doc = "Falling edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SPES_A::VALUE2) } } #[doc = "Field `MSETS` reader - Pattern update signal select"] -pub type MSETS_R = crate::FieldReader; +pub type MSETS_R = crate::FieldReader; #[doc = "Pattern update signal select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -579,10 +587,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MSETS_A { + type Ux = u8; +} impl MSETS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSETS_A { + pub const fn variant(&self) -> MSETS_A { match self.bits { 0 => MSETS_A::VALUE1, 1 => MSETS_A::VALUE2, @@ -595,88 +606,92 @@ impl MSETS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "POSIFx.MSETA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSETS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "POSIFx.MSETB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSETS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "POSIFx.MSETC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MSETS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "POSIFx.MSETD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MSETS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "POSIFx.MSETE"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == MSETS_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "POSIFx.MSETF"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == MSETS_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "POSIFx.MSETG"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == MSETS_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "POSIFx.MSETH"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == MSETS_A::VALUE8 } } #[doc = "Field `MSETS` writer - Pattern update signal select"] -pub type MSETS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCONF_SPEC, u8, MSETS_A, 3, O>; -impl<'a, const O: u8> MSETS_W<'a, O> { +pub type MSETS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, MSETS_A>; +impl<'a, REG> MSETS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "POSIFx.MSETA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSETS_A::VALUE1) } #[doc = "POSIFx.MSETB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSETS_A::VALUE2) } #[doc = "POSIFx.MSETC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MSETS_A::VALUE3) } #[doc = "POSIFx.MSETD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MSETS_A::VALUE4) } #[doc = "POSIFx.MSETE"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(MSETS_A::VALUE5) } #[doc = "POSIFx.MSETF"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(MSETS_A::VALUE6) } #[doc = "POSIFx.MSETG"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(MSETS_A::VALUE7) } #[doc = "POSIFx.MSETH"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(MSETS_A::VALUE8) } } @@ -699,39 +714,42 @@ impl From for bool { impl MSES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSES_A { + pub const fn variant(&self) -> MSES_A { match self.bits { false => MSES_A::VALUE1, true => MSES_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The signal used to enable a pattern update is active on the rising edge"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The signal used to enable a pattern update is active on the falling edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSES_A::VALUE2 } } #[doc = "Field `MSES` writer - Multi-Channel pattern update trigger edge"] -pub type MSES_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCONF_SPEC, MSES_A, O>; -impl<'a, const O: u8> MSES_W<'a, O> { +pub type MSES_W<'a, REG> = crate::BitWriter<'a, REG, MSES_A>; +impl<'a, REG> MSES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The signal used to enable a pattern update is active on the rising edge"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSES_A::VALUE1) } #[doc = "The signal used to enable a pattern update is active on the falling edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSES_A::VALUE2) } } #[doc = "Field `MSYNS` reader - PWM synchronization signal selector"] -pub type MSYNS_R = crate::FieldReader; +pub type MSYNS_R = crate::FieldReader; #[doc = "PWM synchronization signal selector\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -751,10 +769,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MSYNS_A { + type Ux = u8; +} impl MSYNS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSYNS_A { + pub const fn variant(&self) -> MSYNS_A { match self.bits { 0 => MSYNS_A::VALUE1, 1 => MSYNS_A::VALUE2, @@ -763,53 +784,57 @@ impl MSYNS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "POSIFx.MSYNCA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSYNS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "POSIFx.MSYNCB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSYNS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "POSIFx.MSYNCC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MSYNS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "POSIFx.MSYNCD"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MSYNS_A::VALUE4 } } #[doc = "Field `MSYNS` writer - PWM synchronization signal selector"] -pub type MSYNS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCONF_SPEC, u8, MSYNS_A, 2, O>; -impl<'a, const O: u8> MSYNS_W<'a, O> { +pub type MSYNS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, MSYNS_A>; +impl<'a, REG> MSYNS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "POSIFx.MSYNCA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSYNS_A::VALUE1) } #[doc = "POSIFx.MSYNCB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSYNS_A::VALUE2) } #[doc = "POSIFx.MSYNCC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MSYNS_A::VALUE3) } #[doc = "POSIFx.MSYNCD"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MSYNS_A::VALUE4) } } #[doc = "Field `EWIS` reader - Wrong Hall Event selection"] -pub type EWIS_R = crate::FieldReader; +pub type EWIS_R = crate::FieldReader; #[doc = "Wrong Hall Event selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -829,10 +854,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EWIS_A { + type Ux = u8; +} impl EWIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EWIS_A { + pub const fn variant(&self) -> EWIS_A { match self.bits { 0 => EWIS_A::VALUE1, 1 => EWIS_A::VALUE2, @@ -841,48 +869,52 @@ impl EWIS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "POSIFx.EWHEA"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EWIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "POSIFx.EWHEB"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EWIS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "POSIFx.EWHEC"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EWIS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "POSIFx.EWHED"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EWIS_A::VALUE4 } } #[doc = "Field `EWIS` writer - Wrong Hall Event selection"] -pub type EWIS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCONF_SPEC, u8, EWIS_A, 2, O>; -impl<'a, const O: u8> EWIS_W<'a, O> { +pub type EWIS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EWIS_A>; +impl<'a, REG> EWIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "POSIFx.EWHEA"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EWIS_A::VALUE1) } #[doc = "POSIFx.EWHEB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EWIS_A::VALUE2) } #[doc = "POSIFx.EWHEC"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EWIS_A::VALUE3) } #[doc = "POSIFx.EWHED"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EWIS_A::VALUE4) } } @@ -905,34 +937,37 @@ impl From for bool { impl EWIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EWIE_A { + pub const fn variant(&self) -> EWIE_A { match self.bits { false => EWIE_A::VALUE1, true => EWIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External wrong hall event emulation signal, POSIFx.EWHE\\[D...A\\], is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EWIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External wrong hall event emulation signal, POSIFx.EWHE\\[D...A\\], is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EWIE_A::VALUE2 } } #[doc = "Field `EWIE` writer - External Wrong Hall Event enable"] -pub type EWIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCONF_SPEC, EWIE_A, O>; -impl<'a, const O: u8> EWIE_W<'a, O> { +pub type EWIE_W<'a, REG> = crate::BitWriter<'a, REG, EWIE_A>; +impl<'a, REG> EWIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External wrong hall event emulation signal, POSIFx.EWHE\\[D...A\\], is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EWIE_A::VALUE1) } #[doc = "External wrong hall event emulation signal, POSIFx.EWHE\\[D...A\\], is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EWIE_A::VALUE2) } } @@ -957,41 +992,46 @@ impl From for bool { impl EWIL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EWIL_A { + pub const fn variant(&self) -> EWIL_A { match self.bits { false => EWIL_A::VALUE1, true => EWIL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "POSIFx.EWHE\\[D...A\\] +signal is active HIGH"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EWIL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "POSIFx.EWHE\\[D...A\\] +signal is active LOW"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EWIL_A::VALUE2 } } #[doc = "Field `EWIL` writer - External Wrong Hall Event active level"] -pub type EWIL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCONF_SPEC, EWIL_A, O>; -impl<'a, const O: u8> EWIL_W<'a, O> { +pub type EWIL_W<'a, REG> = crate::BitWriter<'a, REG, EWIL_A>; +impl<'a, REG> EWIL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "POSIFx.EWHE\\[D...A\\] signal is active HIGH"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EWIL_A::VALUE1) } #[doc = "POSIFx.EWHE\\[D...A\\] signal is active LOW"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EWIL_A::VALUE2) } } #[doc = "Field `LPC` reader - Low Pass Filters Configuration"] -pub type LPC_R = crate::FieldReader; +pub type LPC_R = crate::FieldReader; #[doc = "Low Pass Filters Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -1019,10 +1059,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for LPC_A { + type Ux = u8; +} impl LPC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPC_A { + pub const fn variant(&self) -> LPC_A { match self.bits { 0 => LPC_A::VALUE1, 1 => LPC_A::VALUE2, @@ -1035,88 +1078,92 @@ impl LPC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Low pass filter disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Low pass of 1 clock cycle"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Low pass of 2 clock cycles"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == LPC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Low pass of 4 clock cycles"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == LPC_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Low pass of 8 clock cycles"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == LPC_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Low pass of 16 clock cycles"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == LPC_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Low pass of 32 clock cycles"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == LPC_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Low pass of 64 clock cycles"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == LPC_A::VALUE8 } } #[doc = "Field `LPC` writer - Low Pass Filters Configuration"] -pub type LPC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCONF_SPEC, u8, LPC_A, 3, O>; -impl<'a, const O: u8> LPC_W<'a, O> { +pub type LPC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, LPC_A>; +impl<'a, REG> LPC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Low pass filter disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPC_A::VALUE1) } #[doc = "Low pass of 1 clock cycle"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPC_A::VALUE2) } #[doc = "Low pass of 2 clock cycles"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(LPC_A::VALUE3) } #[doc = "Low pass of 4 clock cycles"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(LPC_A::VALUE4) } #[doc = "Low pass of 8 clock cycles"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(LPC_A::VALUE5) } #[doc = "Low pass of 16 clock cycles"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(LPC_A::VALUE6) } #[doc = "Low pass of 32 clock cycles"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(LPC_A::VALUE7) } #[doc = "Low pass of 64 clock cycles"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(LPC_A::VALUE8) } } @@ -1206,118 +1253,119 @@ impl W { #[doc = "Bits 0:1 - Function Selector"] #[inline(always)] #[must_use] - pub fn fsel(&mut self) -> FSEL_W<0> { - FSEL_W::new(self) + pub fn fsel(&mut self) -> FSEL_W { + FSEL_W::new(self, 0) } #[doc = "Bit 2 - Position Decoder Mode selection"] #[inline(always)] #[must_use] - pub fn qdcm(&mut self) -> QDCM_W<2> { - QDCM_W::new(self) + pub fn qdcm(&mut self) -> QDCM_W { + QDCM_W::new(self, 2) } #[doc = "Bit 4 - Idle generation enable"] #[inline(always)] #[must_use] - pub fn hidg(&mut self) -> HIDG_W<4> { - HIDG_W::new(self) + pub fn hidg(&mut self) -> HIDG_W { + HIDG_W::new(self, 4) } #[doc = "Bit 5 - Multi-Channel Pattern SW update enable"] #[inline(always)] #[must_use] - pub fn mcue(&mut self) -> MCUE_W<5> { - MCUE_W::new(self) + pub fn mcue(&mut self) -> MCUE_W { + MCUE_W::new(self, 5) } #[doc = "Bits 8:9 - PhaseA/Hal input 1 selector"] #[inline(always)] #[must_use] - pub fn insel0(&mut self) -> INSEL0_W<8> { - INSEL0_W::new(self) + pub fn insel0(&mut self) -> INSEL0_W { + INSEL0_W::new(self, 8) } #[doc = "Bits 10:11 - PhaseB/Hall input 2 selector"] #[inline(always)] #[must_use] - pub fn insel1(&mut self) -> INSEL1_W<10> { - INSEL1_W::new(self) + pub fn insel1(&mut self) -> INSEL1_W { + INSEL1_W::new(self, 10) } #[doc = "Bits 12:13 - Index/Hall input 3 selector"] #[inline(always)] #[must_use] - pub fn insel2(&mut self) -> INSEL2_W<12> { - INSEL2_W::new(self) + pub fn insel2(&mut self) -> INSEL2_W { + INSEL2_W::new(self, 12) } #[doc = "Bit 16 - Delay Pin selector"] #[inline(always)] #[must_use] - pub fn dsel(&mut self) -> DSEL_W<16> { - DSEL_W::new(self) + pub fn dsel(&mut self) -> DSEL_W { + DSEL_W::new(self, 16) } #[doc = "Bit 17 - Edge selector for the sampling trigger"] #[inline(always)] #[must_use] - pub fn spes(&mut self) -> SPES_W<17> { - SPES_W::new(self) + pub fn spes(&mut self) -> SPES_W { + SPES_W::new(self, 17) } #[doc = "Bits 18:20 - Pattern update signal select"] #[inline(always)] #[must_use] - pub fn msets(&mut self) -> MSETS_W<18> { - MSETS_W::new(self) + pub fn msets(&mut self) -> MSETS_W { + MSETS_W::new(self, 18) } #[doc = "Bit 21 - Multi-Channel pattern update trigger edge"] #[inline(always)] #[must_use] - pub fn mses(&mut self) -> MSES_W<21> { - MSES_W::new(self) + pub fn mses(&mut self) -> MSES_W { + MSES_W::new(self, 21) } #[doc = "Bits 22:23 - PWM synchronization signal selector"] #[inline(always)] #[must_use] - pub fn msyns(&mut self) -> MSYNS_W<22> { - MSYNS_W::new(self) + pub fn msyns(&mut self) -> MSYNS_W { + MSYNS_W::new(self, 22) } #[doc = "Bits 24:25 - Wrong Hall Event selection"] #[inline(always)] #[must_use] - pub fn ewis(&mut self) -> EWIS_W<24> { - EWIS_W::new(self) + pub fn ewis(&mut self) -> EWIS_W { + EWIS_W::new(self, 24) } #[doc = "Bit 26 - External Wrong Hall Event enable"] #[inline(always)] #[must_use] - pub fn ewie(&mut self) -> EWIE_W<26> { - EWIE_W::new(self) + pub fn ewie(&mut self) -> EWIE_W { + EWIE_W::new(self, 26) } #[doc = "Bit 27 - External Wrong Hall Event active level"] #[inline(always)] #[must_use] - pub fn ewil(&mut self) -> EWIL_W<27> { - EWIL_W::new(self) + pub fn ewil(&mut self) -> EWIL_W { + EWIL_W::new(self, 27) } #[doc = "Bits 28:30 - Low Pass Filters Configuration"] #[inline(always)] #[must_use] - pub fn lpc(&mut self) -> LPC_W<28> { - LPC_W::new(self) + pub fn lpc(&mut self) -> LPC_W { + LPC_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Processing configuration\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pconf::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pconf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pconf::R`](R) reader structure"] +impl crate::Readable for PCONF_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pconf::W`](W) writer structure"] impl crate::Writable for PCONF_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/pdbg.rs b/src/posif0/pdbg.rs index 51da1980..30c869fe 100644 --- a/src/posif0/pdbg.rs +++ b/src/posif0/pdbg.rs @@ -1,32 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `QCSV` reader - Quadrature Decoder Current state"] -pub type QCSV_R = crate::FieldReader; +pub type QCSV_R = crate::FieldReader; #[doc = "Field `QPSV` reader - Quadrature Decoder Previous state"] -pub type QPSV_R = crate::FieldReader; +pub type QPSV_R = crate::FieldReader; #[doc = "Field `IVAL` reader - Current Index Value"] -pub type IVAL_R = crate::BitReader; +pub type IVAL_R = crate::BitReader; #[doc = "Field `HSP` reader - Hall Current Sampled Pattern"] -pub type HSP_R = crate::FieldReader; +pub type HSP_R = crate::FieldReader; #[doc = "Field `LPP0` reader - Actual count of the Low Pass Filter for POSI0"] -pub type LPP0_R = crate::FieldReader; +pub type LPP0_R = crate::FieldReader; #[doc = "Field `LPP1` reader - Actual count of the Low Pass Filter for POSI1"] -pub type LPP1_R = crate::FieldReader; +pub type LPP1_R = crate::FieldReader; #[doc = "Field `LPP2` reader - Actual count of the Low Pass Filter for POSI2"] -pub type LPP2_R = crate::FieldReader; +pub type LPP2_R = crate::FieldReader; impl R { #[doc = "Bits 0:1 - Quadrature Decoder Current state"] #[inline(always)] @@ -64,15 +51,13 @@ 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"] +#[doc = "POSIF Debug register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pdbg::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pdbg::R`](R) reader structure"] +impl crate::Readable for PDBG_SPEC {} #[doc = "`reset()` method sets PDBG to value 0"] impl crate::Resettable for PDBG_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/posif0/pflg.rs b/src/posif0/pflg.rs index b0c910e4..19a46e5c 100644 --- a/src/posif0/pflg.rs +++ b/src/posif0/pflg.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CHES` reader - Correct Hall Event Status"] pub type CHES_R = crate::BitReader; #[doc = "Correct Hall Event Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl CHES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHES_A { + pub const fn variant(&self) -> CHES_A { match self.bits { false => CHES_A::VALUE1, true => CHES_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Correct Hall Event not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Correct Hall Event detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHES_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl WHES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WHES_A { + pub const fn variant(&self) -> WHES_A { match self.bits { false => WHES_A::VALUE1, true => WHES_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wrong Hall Event not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WHES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wrong Hall Event detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WHES_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl HIES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIES_A { + pub const fn variant(&self) -> HIES_A { match self.bits { false => HIES_A::VALUE1, true => HIES_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Transition on the Hall Inputs not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Transition on the Hall Inputs detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIES_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl MSTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSTS_A { + pub const fn variant(&self) -> MSTS_A { match self.bits { false => MSTS_A::VALUE1, true => MSTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer not done"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer done"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSTS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl INDXS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INDXS_A { + pub const fn variant(&self) -> INDXS_A { match self.bits { false => INDXS_A::VALUE1, true => INDXS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Index event not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INDXS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Index event detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INDXS_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl ERRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERRS_A { + pub const fn variant(&self) -> ERRS_A { match self.bits { false => ERRS_A::VALUE1, true => ERRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Phase Error event not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Phase Error event detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERRS_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl CNTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CNTS_A { + pub const fn variant(&self) -> CNTS_A { match self.bits { false => CNTS_A::VALUE1, true => CNTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Quadrature clock not generated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CNTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature clock generated"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CNTS_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl DIRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIRS_A { + pub const fn variant(&self) -> DIRS_A { match self.bits { false => DIRS_A::VALUE1, true => DIRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Change on direction not detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Change on direction detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIRS_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PCLKS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCLKS_A { + pub const fn variant(&self) -> PCLKS_A { match self.bits { false => PCLKS_A::VALUE1, true => PCLKS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Period clock not generated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCLKS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Period clock generated"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCLKS_A::VALUE2 @@ -384,15 +371,13 @@ impl R { PCLKS_R::new(((self.bits >> 12) & 1) != 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"] +#[doc = "Service Request Processing Interrupt Flags\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pflg::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pflg::R`](R) reader structure"] +impl crate::Readable for PFLG_SPEC {} #[doc = "`reset()` method sets PFLG to value 0"] impl crate::Resettable for PFLG_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/posif0/pflge.rs b/src/posif0/pflge.rs index ec8e8bd4..6fbb51b0 100644 --- a/src/posif0/pflge.rs +++ b/src/posif0/pflge.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ECHE` reader - Correct Hall Event Enable"] pub type ECHE_R = crate::BitReader; #[doc = "Correct Hall Event Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl ECHE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ECHE_A { + pub const fn variant(&self) -> ECHE_A { match self.bits { false => ECHE_A::VALUE1, true => ECHE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Correct Hall Event interrupt disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ECHE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Correct Hall Event interrupt enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ECHE_A::VALUE2 } } #[doc = "Field `ECHE` writer - Correct Hall Event Enable"] -pub type ECHE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, ECHE_A, O>; -impl<'a, const O: u8> ECHE_W<'a, O> { +pub type ECHE_W<'a, REG> = crate::BitWriter<'a, REG, ECHE_A>; +impl<'a, REG> ECHE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Correct Hall Event interrupt disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ECHE_A::VALUE1) } #[doc = "Correct Hall Event interrupt enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ECHE_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl EWHE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EWHE_A { + pub const fn variant(&self) -> EWHE_A { match self.bits { false => EWHE_A::VALUE1, true => EWHE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wrong Hall Event interrupt disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EWHE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wrong Hall Event interrupt enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EWHE_A::VALUE2 } } #[doc = "Field `EWHE` writer - Wrong Hall Event Enable"] -pub type EWHE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, EWHE_A, O>; -impl<'a, const O: u8> EWHE_W<'a, O> { +pub type EWHE_W<'a, REG> = crate::BitWriter<'a, REG, EWHE_A>; +impl<'a, REG> EWHE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wrong Hall Event interrupt disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EWHE_A::VALUE1) } #[doc = "Wrong Hall Event interrupt enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EWHE_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl EHIE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EHIE_A { + pub const fn variant(&self) -> EHIE_A { match self.bits { false => EHIE_A::VALUE1, true => EHIE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Update of the Hall Inputs interrupt is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EHIE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update of the Hall Inputs interrupt is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EHIE_A::VALUE2 } } #[doc = "Field `EHIE` writer - Hall Input Update Enable"] -pub type EHIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, EHIE_A, O>; -impl<'a, const O: u8> EHIE_W<'a, O> { +pub type EHIE_W<'a, REG> = crate::BitWriter<'a, REG, EHIE_A>; +impl<'a, REG> EHIE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Update of the Hall Inputs interrupt is disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EHIE_A::VALUE1) } #[doc = "Update of the Hall Inputs interrupt is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EHIE_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl EMST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMST_A { + pub const fn variant(&self) -> EMST_A { match self.bits { false => EMST_A::VALUE1, true => EMST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shadow transfer event interrupt disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shadow transfer event interrupt enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMST_A::VALUE2 } } #[doc = "Field `EMST` writer - Multi-Channel pattern shadow transfer enable"] -pub type EMST_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, EMST_A, O>; -impl<'a, const O: u8> EMST_W<'a, O> { +pub type EMST_W<'a, REG> = crate::BitWriter<'a, REG, EMST_A>; +impl<'a, REG> EMST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shadow transfer event interrupt disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMST_A::VALUE1) } #[doc = "Shadow transfer event interrupt enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMST_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl EINDX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EINDX_A { + pub const fn variant(&self) -> EINDX_A { match self.bits { false => EINDX_A::VALUE1, true => EINDX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Index event interrupt disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EINDX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Index event interrupt enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EINDX_A::VALUE2 } } #[doc = "Field `EINDX` writer - Quadrature Index Event Enable"] -pub type EINDX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, EINDX_A, O>; -impl<'a, const O: u8> EINDX_W<'a, O> { +pub type EINDX_W<'a, REG> = crate::BitWriter<'a, REG, EINDX_A>; +impl<'a, REG> EINDX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Index event interrupt disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EINDX_A::VALUE1) } #[doc = "Index event interrupt enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EINDX_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl EERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EERR_A { + pub const fn variant(&self) -> EERR_A { match self.bits { false => EERR_A::VALUE1, true => EERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Phase error event interrupt disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Phase error event interrupt enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EERR_A::VALUE2 } } #[doc = "Field `EERR` writer - Quadrature Phase Error Enable"] -pub type EERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, EERR_A, O>; -impl<'a, const O: u8> EERR_W<'a, O> { +pub type EERR_W<'a, REG> = crate::BitWriter<'a, REG, EERR_A>; +impl<'a, REG> EERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Phase error event interrupt disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EERR_A::VALUE1) } #[doc = "Phase error event interrupt enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EERR_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl ECNT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ECNT_A { + pub const fn variant(&self) -> ECNT_A { match self.bits { false => ECNT_A::VALUE1, true => ECNT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Quadrature CLK event interrupt disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ECNT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature CLK event interrupt enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ECNT_A::VALUE2 } } #[doc = "Field `ECNT` writer - Quadrature CLK interrupt Enable"] -pub type ECNT_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, ECNT_A, O>; -impl<'a, const O: u8> ECNT_W<'a, O> { +pub type ECNT_W<'a, REG> = crate::BitWriter<'a, REG, ECNT_A>; +impl<'a, REG> ECNT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Quadrature CLK event interrupt disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ECNT_A::VALUE1) } #[doc = "Quadrature CLK event interrupt enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ECNT_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl EDIR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EDIR_A { + pub const fn variant(&self) -> EDIR_A { match self.bits { false => EDIR_A::VALUE1, true => EDIR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Direction change event interrupt disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EDIR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Direction change event interrupt enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EDIR_A::VALUE2 } } #[doc = "Field `EDIR` writer - Quadrature direction change interrupt Enable"] -pub type EDIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, EDIR_A, O>; -impl<'a, const O: u8> EDIR_W<'a, O> { +pub type EDIR_W<'a, REG> = crate::BitWriter<'a, REG, EDIR_A>; +impl<'a, REG> EDIR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Direction change event interrupt disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EDIR_A::VALUE1) } #[doc = "Direction change event interrupt enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EDIR_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl EPCLK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPCLK_A { + pub const fn variant(&self) -> EPCLK_A { match self.bits { false => EPCLK_A::VALUE1, true => EPCLK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Quadrature Period CLK event interrupt disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPCLK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature Period CLK event interrupt enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPCLK_A::VALUE2 } } #[doc = "Field `EPCLK` writer - Quadrature Period CLK interrupt Enable"] -pub type EPCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, EPCLK_A, O>; -impl<'a, const O: u8> EPCLK_W<'a, O> { +pub type EPCLK_W<'a, REG> = crate::BitWriter<'a, REG, EPCLK_A>; +impl<'a, REG> EPCLK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Quadrature Period CLK event interrupt disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPCLK_A::VALUE1) } #[doc = "Quadrature Period CLK event interrupt enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPCLK_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl CHESEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHESEL_A { + pub const fn variant(&self) -> CHESEL_A { match self.bits { false => CHESEL_A::VALUE1, true => CHESEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Correct Hall Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHESEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Correct Hall Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHESEL_A::VALUE2 } } #[doc = "Field `CHESEL` writer - Correct Hall Event Service Request Selector"] -pub type CHESEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, CHESEL_A, O>; -impl<'a, const O: u8> CHESEL_W<'a, O> { +pub type CHESEL_W<'a, REG> = crate::BitWriter<'a, REG, CHESEL_A>; +impl<'a, REG> CHESEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Correct Hall Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHESEL_A::VALUE1) } #[doc = "Correct Hall Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHESEL_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl WHESEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WHESEL_A { + pub const fn variant(&self) -> WHESEL_A { match self.bits { false => WHESEL_A::VALUE1, true => WHESEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wrong Hall Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WHESEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wrong Hall Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WHESEL_A::VALUE2 } } #[doc = "Field `WHESEL` writer - Wrong Hall Event Service Request Selector"] -pub type WHESEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, WHESEL_A, O>; -impl<'a, const O: u8> WHESEL_W<'a, O> { +pub type WHESEL_W<'a, REG> = crate::BitWriter<'a, REG, WHESEL_A>; +impl<'a, REG> WHESEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wrong Hall Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WHESEL_A::VALUE1) } #[doc = "Wrong Hall Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WHESEL_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl HIESEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIESEL_A { + pub const fn variant(&self) -> HIESEL_A { match self.bits { false => HIESEL_A::VALUE1, true => HIESEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Hall Inputs Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIESEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Hall Inputs Update Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIESEL_A::VALUE2 } } #[doc = "Field `HIESEL` writer - Hall Inputs Update Event Service Request Selector"] -pub type HIESEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, HIESEL_A, O>; -impl<'a, const O: u8> HIESEL_W<'a, O> { +pub type HIESEL_W<'a, REG> = crate::BitWriter<'a, REG, HIESEL_A>; +impl<'a, REG> HIESEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Hall Inputs Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIESEL_A::VALUE1) } #[doc = "Hall Inputs Update Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIESEL_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl MSTSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSTSEL_A { + pub const fn variant(&self) -> MSTSEL_A { match self.bits { false => MSTSEL_A::VALUE1, true => MSTSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Multi-Channel pattern Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSTSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Multi-Channel pattern Update Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSTSEL_A::VALUE2 } } #[doc = "Field `MSTSEL` writer - Multi-Channel pattern Update Event Service Request Selector"] -pub type MSTSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, MSTSEL_A, O>; -impl<'a, const O: u8> MSTSEL_W<'a, O> { +pub type MSTSEL_W<'a, REG> = crate::BitWriter<'a, REG, MSTSEL_A>; +impl<'a, REG> MSTSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Multi-Channel pattern Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSTSEL_A::VALUE1) } #[doc = "Multi-Channel pattern Update Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSTSEL_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl INDSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INDSEL_A { + pub const fn variant(&self) -> INDSEL_A { match self.bits { false => INDSEL_A::VALUE1, true => INDSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Quadrature Index Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INDSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature Index Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INDSEL_A::VALUE2 } } #[doc = "Field `INDSEL` writer - Quadrature Index Event Service Request Selector"] -pub type INDSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, INDSEL_A, O>; -impl<'a, const O: u8> INDSEL_W<'a, O> { +pub type INDSEL_W<'a, REG> = crate::BitWriter<'a, REG, INDSEL_A>; +impl<'a, REG> INDSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Quadrature Index Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INDSEL_A::VALUE1) } #[doc = "Quadrature Index Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INDSEL_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl ERRSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERRSEL_A { + pub const fn variant(&self) -> ERRSEL_A { match self.bits { false => ERRSEL_A::VALUE1, true => ERRSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Quadrature Phase error Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERRSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature Phase error Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERRSEL_A::VALUE2 } } #[doc = "Field `ERRSEL` writer - Quadrature Phase Error Event Service Request Selector"] -pub type ERRSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, ERRSEL_A, O>; -impl<'a, const O: u8> ERRSEL_W<'a, O> { +pub type ERRSEL_W<'a, REG> = crate::BitWriter<'a, REG, ERRSEL_A>; +impl<'a, REG> ERRSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Quadrature Phase error Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERRSEL_A::VALUE1) } #[doc = "Quadrature Phase error Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERRSEL_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl CNTSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CNTSEL_A { + pub const fn variant(&self) -> CNTSEL_A { match self.bits { false => CNTSEL_A::VALUE1, true => CNTSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Quadrature Clock Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CNTSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature Clock Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CNTSEL_A::VALUE2 } } #[doc = "Field `CNTSEL` writer - Quadrature Clock Event Service Request Selector"] -pub type CNTSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, CNTSEL_A, O>; -impl<'a, const O: u8> CNTSEL_W<'a, O> { +pub type CNTSEL_W<'a, REG> = crate::BitWriter<'a, REG, CNTSEL_A>; +impl<'a, REG> CNTSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Quadrature Clock Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CNTSEL_A::VALUE1) } #[doc = "Quadrature Clock Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CNTSEL_A::VALUE2) } } @@ -853,34 +869,37 @@ impl From for bool { impl DIRSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIRSEL_A { + pub const fn variant(&self) -> DIRSEL_A { match self.bits { false => DIRSEL_A::VALUE1, true => DIRSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Quadrature Direction Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIRSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature Direction Update Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIRSEL_A::VALUE2 } } #[doc = "Field `DIRSEL` writer - Quadrature Direction Update Event Service Request Selector"] -pub type DIRSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, DIRSEL_A, O>; -impl<'a, const O: u8> DIRSEL_W<'a, O> { +pub type DIRSEL_W<'a, REG> = crate::BitWriter<'a, REG, DIRSEL_A>; +impl<'a, REG> DIRSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Quadrature Direction Update Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIRSEL_A::VALUE1) } #[doc = "Quadrature Direction Update Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIRSEL_A::VALUE2) } } @@ -903,34 +922,37 @@ impl From for bool { impl PCLSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCLSEL_A { + pub const fn variant(&self) -> PCLSEL_A { match self.bits { false => PCLSEL_A::VALUE1, true => PCLSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Quadrature Period clock Event interrupt forward to POSIFx.SR0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCLSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Quadrature Period clock Event interrupt forward to POSIFx.SR1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCLSEL_A::VALUE2 } } #[doc = "Field `PCLSEL` writer - Quadrature Period clock Event Service Request Selector"] -pub type PCLSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PFLGE_SPEC, PCLSEL_A, O>; -impl<'a, const O: u8> PCLSEL_W<'a, O> { +pub type PCLSEL_W<'a, REG> = crate::BitWriter<'a, REG, PCLSEL_A>; +impl<'a, REG> PCLSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Quadrature Period clock Event interrupt forward to POSIFx.SR0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PCLSEL_A::VALUE1) } #[doc = "Quadrature Period clock Event interrupt forward to POSIFx.SR1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PCLSEL_A::VALUE2) } } @@ -1030,130 +1052,131 @@ impl W { #[doc = "Bit 0 - Correct Hall Event Enable"] #[inline(always)] #[must_use] - pub fn eche(&mut self) -> ECHE_W<0> { - ECHE_W::new(self) + pub fn eche(&mut self) -> ECHE_W { + ECHE_W::new(self, 0) } #[doc = "Bit 1 - Wrong Hall Event Enable"] #[inline(always)] #[must_use] - pub fn ewhe(&mut self) -> EWHE_W<1> { - EWHE_W::new(self) + pub fn ewhe(&mut self) -> EWHE_W { + EWHE_W::new(self, 1) } #[doc = "Bit 2 - Hall Input Update Enable"] #[inline(always)] #[must_use] - pub fn ehie(&mut self) -> EHIE_W<2> { - EHIE_W::new(self) + pub fn ehie(&mut self) -> EHIE_W { + EHIE_W::new(self, 2) } #[doc = "Bit 4 - Multi-Channel pattern shadow transfer enable"] #[inline(always)] #[must_use] - pub fn emst(&mut self) -> EMST_W<4> { - EMST_W::new(self) + pub fn emst(&mut self) -> EMST_W { + EMST_W::new(self, 4) } #[doc = "Bit 8 - Quadrature Index Event Enable"] #[inline(always)] #[must_use] - pub fn eindx(&mut self) -> EINDX_W<8> { - EINDX_W::new(self) + pub fn eindx(&mut self) -> EINDX_W { + EINDX_W::new(self, 8) } #[doc = "Bit 9 - Quadrature Phase Error Enable"] #[inline(always)] #[must_use] - pub fn eerr(&mut self) -> EERR_W<9> { - EERR_W::new(self) + pub fn eerr(&mut self) -> EERR_W { + EERR_W::new(self, 9) } #[doc = "Bit 10 - Quadrature CLK interrupt Enable"] #[inline(always)] #[must_use] - pub fn ecnt(&mut self) -> ECNT_W<10> { - ECNT_W::new(self) + pub fn ecnt(&mut self) -> ECNT_W { + ECNT_W::new(self, 10) } #[doc = "Bit 11 - Quadrature direction change interrupt Enable"] #[inline(always)] #[must_use] - pub fn edir(&mut self) -> EDIR_W<11> { - EDIR_W::new(self) + pub fn edir(&mut self) -> EDIR_W { + EDIR_W::new(self, 11) } #[doc = "Bit 12 - Quadrature Period CLK interrupt Enable"] #[inline(always)] #[must_use] - pub fn epclk(&mut self) -> EPCLK_W<12> { - EPCLK_W::new(self) + pub fn epclk(&mut self) -> EPCLK_W { + EPCLK_W::new(self, 12) } #[doc = "Bit 16 - Correct Hall Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn chesel(&mut self) -> CHESEL_W<16> { - CHESEL_W::new(self) + pub fn chesel(&mut self) -> CHESEL_W { + CHESEL_W::new(self, 16) } #[doc = "Bit 17 - Wrong Hall Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn whesel(&mut self) -> WHESEL_W<17> { - WHESEL_W::new(self) + pub fn whesel(&mut self) -> WHESEL_W { + WHESEL_W::new(self, 17) } #[doc = "Bit 18 - Hall Inputs Update Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn hiesel(&mut self) -> HIESEL_W<18> { - HIESEL_W::new(self) + pub fn hiesel(&mut self) -> HIESEL_W { + HIESEL_W::new(self, 18) } #[doc = "Bit 20 - Multi-Channel pattern Update Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn mstsel(&mut self) -> MSTSEL_W<20> { - MSTSEL_W::new(self) + pub fn mstsel(&mut self) -> MSTSEL_W { + MSTSEL_W::new(self, 20) } #[doc = "Bit 24 - Quadrature Index Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn indsel(&mut self) -> INDSEL_W<24> { - INDSEL_W::new(self) + pub fn indsel(&mut self) -> INDSEL_W { + INDSEL_W::new(self, 24) } #[doc = "Bit 25 - Quadrature Phase Error Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn errsel(&mut self) -> ERRSEL_W<25> { - ERRSEL_W::new(self) + pub fn errsel(&mut self) -> ERRSEL_W { + ERRSEL_W::new(self, 25) } #[doc = "Bit 26 - Quadrature Clock Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn cntsel(&mut self) -> CNTSEL_W<26> { - CNTSEL_W::new(self) + pub fn cntsel(&mut self) -> CNTSEL_W { + CNTSEL_W::new(self, 26) } #[doc = "Bit 27 - Quadrature Direction Update Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn dirsel(&mut self) -> DIRSEL_W<27> { - DIRSEL_W::new(self) + pub fn dirsel(&mut self) -> DIRSEL_W { + DIRSEL_W::new(self, 27) } #[doc = "Bit 28 - Quadrature Period clock Event Service Request Selector"] #[inline(always)] #[must_use] - pub fn pclsel(&mut self) -> PCLSEL_W<28> { - PCLSEL_W::new(self) + pub fn pclsel(&mut self) -> PCLSEL_W { + PCLSEL_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Processing Interrupt Enable\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pflge::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pflge::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pflge::R`](R) reader structure"] +impl crate::Readable for PFLGE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pflge::W`](W) writer structure"] impl crate::Writable for PFLGE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/prun.rs b/src/posif0/prun.rs index 0d360cf9..b86504af 100644 --- a/src/posif0/prun.rs +++ b/src/posif0/prun.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `RB` reader - Run Bit"] pub type RB_R = crate::BitReader; #[doc = "Run Bit\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RB_A { + pub const fn variant(&self) -> RB_A { match self.bits { false => RB_A::VALUE1, true => RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "IDLE"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Running"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RB_A::VALUE2 @@ -56,15 +43,13 @@ impl R { RB_R::new((self.bits & 1) != 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"] +#[doc = "Service Request Processing Run Bit Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prun::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`prun::R`](R) reader structure"] +impl crate::Readable for PRUN_SPEC {} #[doc = "`reset()` method sets PRUN to value 0"] impl crate::Resettable for PRUN_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/posif0/prunc.rs b/src/posif0/prunc.rs index 5f0e8117..2fce90d9 100644 --- a/src/posif0/prunc.rs +++ b/src/posif0/prunc.rs @@ -1,56 +1,40 @@ #[doc = "Register `PRUNC` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CRB` writer - Clear Run bit"] -pub type CRB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRUNC_SPEC, bool, O>; +pub type CRB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CSM` writer - Clear Current internal status"] -pub type CSM_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRUNC_SPEC, bool, O>; +pub type CSM_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Clear Run bit"] #[inline(always)] #[must_use] - pub fn crb(&mut self) -> CRB_W<0> { - CRB_W::new(self) + pub fn crb(&mut self) -> CRB_W { + CRB_W::new(self, 0) } #[doc = "Bit 1 - Clear Current internal status"] #[inline(always)] #[must_use] - pub fn csm(&mut self) -> CSM_W<1> { - CSM_W::new(self) + pub fn csm(&mut self) -> CSM_W { + CSM_W::new(self, 1) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Processing Run Bit Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prunc::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PRUNC_SPEC; impl crate::RegisterSpec for PRUNC_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [prunc::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`prunc::W`](W) writer structure"] impl crate::Writable for PRUNC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/pruns.rs b/src/posif0/pruns.rs index ea75df20..42d05a66 100644 --- a/src/posif0/pruns.rs +++ b/src/posif0/pruns.rs @@ -1,48 +1,32 @@ #[doc = "Register `PRUNS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SRB` writer - Set Run bit"] -pub type SRB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRUNS_SPEC, bool, O>; +pub type SRB_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Set Run bit"] #[inline(always)] #[must_use] - pub fn srb(&mut self) -> SRB_W<0> { - SRB_W::new(self) + pub fn srb(&mut self) -> SRB_W { + SRB_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Processing Run Bit Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pruns::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PRUNS_SPEC; impl crate::RegisterSpec for PRUNS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [pruns::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`pruns::W`](W) writer structure"] impl crate::Writable for PRUNS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/psus.rs b/src/posif0/psus.rs index 5fa974c3..60570ebf 100644 --- a/src/posif0/psus.rs +++ b/src/posif0/psus.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `QSUS` reader - Quadrature Mode Suspend Config"] -pub type QSUS_R = crate::FieldReader; +pub type QSUS_R = crate::FieldReader; #[doc = "Quadrature Mode Suspend Config\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for QSUS_A { + type Ux = u8; +} impl QSUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> QSUS_A { + pub const fn variant(&self) -> QSUS_A { match self.bits { 0 => QSUS_A::VALUE1, 1 => QSUS_A::VALUE2, @@ -67,53 +38,57 @@ impl QSUS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Suspend request ignored"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == QSUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Stop immediately"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == QSUS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Suspend in the next index occurrence"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == QSUS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Suspend in the next phase (PhaseA or PhaseB) occurrence"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == QSUS_A::VALUE4 } } #[doc = "Field `QSUS` writer - Quadrature Mode Suspend Config"] -pub type QSUS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PSUS_SPEC, u8, QSUS_A, 2, O>; -impl<'a, const O: u8> QSUS_W<'a, O> { +pub type QSUS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, QSUS_A>; +impl<'a, REG> QSUS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Suspend request ignored"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(QSUS_A::VALUE1) } #[doc = "Stop immediately"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(QSUS_A::VALUE2) } #[doc = "Suspend in the next index occurrence"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(QSUS_A::VALUE3) } #[doc = "Suspend in the next phase (PhaseA or PhaseB) occurrence"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(QSUS_A::VALUE4) } } #[doc = "Field `MSUS` reader - Multi-Channel Mode Suspend Config"] -pub type MSUS_R = crate::FieldReader; +pub type MSUS_R = crate::FieldReader; #[doc = "Multi-Channel Mode Suspend Config\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MSUS_A { + type Ux = u8; +} impl MSUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSUS_A { + pub const fn variant(&self) -> MSUS_A { match self.bits { 0 => MSUS_A::VALUE1, 1 => MSUS_A::VALUE2, @@ -145,48 +123,52 @@ impl MSUS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Suspend request ignored"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Stop immediately. Multi-Channel pattern is not set to the reset value."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSUS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Stop immediately. Multi-Channel pattern is set to the reset value."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MSUS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Suspend with the synchronization of the PWM signal. Multi-Channel pattern is set to the reset value at the same time of the synchronization."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MSUS_A::VALUE4 } } #[doc = "Field `MSUS` writer - Multi-Channel Mode Suspend Config"] -pub type MSUS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PSUS_SPEC, u8, MSUS_A, 2, O>; -impl<'a, const O: u8> MSUS_W<'a, O> { +pub type MSUS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, MSUS_A>; +impl<'a, REG> MSUS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Suspend request ignored"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSUS_A::VALUE1) } #[doc = "Stop immediately. Multi-Channel pattern is not set to the reset value."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSUS_A::VALUE2) } #[doc = "Stop immediately. Multi-Channel pattern is set to the reset value."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MSUS_A::VALUE3) } #[doc = "Suspend with the synchronization of the PWM signal. Multi-Channel pattern is set to the reset value at the same time of the synchronization."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MSUS_A::VALUE4) } } @@ -206,34 +188,35 @@ impl W { #[doc = "Bits 0:1 - Quadrature Mode Suspend Config"] #[inline(always)] #[must_use] - pub fn qsus(&mut self) -> QSUS_W<0> { - QSUS_W::new(self) + pub fn qsus(&mut self) -> QSUS_W { + QSUS_W::new(self, 0) } #[doc = "Bits 2:3 - Multi-Channel Mode Suspend Config"] #[inline(always)] #[must_use] - pub fn msus(&mut self) -> MSUS_W<2> { - MSUS_W::new(self) + pub fn msus(&mut self) -> MSUS_W { + MSUS_W::new(self, 2) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Processing Suspend Config\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psus::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psus::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psus::R`](R) reader structure"] +impl crate::Readable for PSUS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psus::W`](W) writer structure"] impl crate::Writable for PSUS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/qdc.rs b/src/posif0/qdc.rs index 138555e2..834aa955 100644 --- a/src/posif0/qdc.rs +++ b/src/posif0/qdc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PALS` reader - Phase A Level selector"] pub type PALS_R = crate::BitReader; #[doc = "Phase A Level selector\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PALS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PALS_A { + pub const fn variant(&self) -> PALS_A { match self.bits { false => PALS_A::VALUE1, true => PALS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Phase A is active HIGH"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PALS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Phase A is active LOW"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PALS_A::VALUE2 } } #[doc = "Field `PALS` writer - Phase A Level selector"] -pub type PALS_W<'a, const O: u8> = crate::BitWriter<'a, u32, QDC_SPEC, PALS_A, O>; -impl<'a, const O: u8> PALS_W<'a, O> { +pub type PALS_W<'a, REG> = crate::BitWriter<'a, REG, PALS_A>; +impl<'a, REG> PALS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Phase A is active HIGH"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PALS_A::VALUE1) } #[doc = "Phase A is active LOW"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PALS_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PBLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PBLS_A { + pub const fn variant(&self) -> PBLS_A { match self.bits { false => PBLS_A::VALUE1, true => PBLS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Phase B is active HIGH"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PBLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Phase B is active LOW"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PBLS_A::VALUE2 } } #[doc = "Field `PBLS` writer - Phase B Level selector"] -pub type PBLS_W<'a, const O: u8> = crate::BitWriter<'a, u32, QDC_SPEC, PBLS_A, O>; -impl<'a, const O: u8> PBLS_W<'a, O> { +pub type PBLS_W<'a, REG> = crate::BitWriter<'a, REG, PBLS_A>; +impl<'a, REG> PBLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Phase B is active HIGH"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PBLS_A::VALUE1) } #[doc = "Phase B is active LOW"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PBLS_A::VALUE2) } } @@ -153,39 +127,42 @@ impl From for bool { impl PHS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PHS_A { + pub const fn variant(&self) -> PHS_A { match self.bits { false => PHS_A::VALUE1, true => PHS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Phase A is the leading signal for clockwise rotation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PHS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Phase B is the leading signal for clockwise rotation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PHS_A::VALUE2 } } #[doc = "Field `PHS` writer - Phase signals swap"] -pub type PHS_W<'a, const O: u8> = crate::BitWriter<'a, u32, QDC_SPEC, PHS_A, O>; -impl<'a, const O: u8> PHS_W<'a, O> { +pub type PHS_W<'a, REG> = crate::BitWriter<'a, REG, PHS_A>; +impl<'a, REG> PHS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Phase A is the leading signal for clockwise rotation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PHS_A::VALUE1) } #[doc = "Phase B is the leading signal for clockwise rotation"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PHS_A::VALUE2) } } #[doc = "Field `ICM` reader - Index Marker generations control"] -pub type ICM_R = crate::FieldReader; +pub type ICM_R = crate::FieldReader; #[doc = "Index Marker generations control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -203,10 +180,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ICM_A { + type Ux = u8; +} impl ICM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ICM_A::VALUE1), 1 => Some(ICM_A::VALUE2), @@ -214,38 +194,42 @@ impl ICM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No index marker generation on POSIFx.OUT3"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ICM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Only first index occurrence generated on POSIFx.OUT3"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ICM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "All index occurrences generated on POSIFx.OUT3"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ICM_A::VALUE3 } } #[doc = "Field `ICM` writer - Index Marker generations control"] -pub type ICM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, QDC_SPEC, u8, ICM_A, 2, O>; -impl<'a, const O: u8> ICM_W<'a, O> { +pub type ICM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, ICM_A>; +impl<'a, REG> ICM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No index marker generation on POSIFx.OUT3"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ICM_A::VALUE1) } #[doc = "Only first index occurrence generated on POSIFx.OUT3"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ICM_A::VALUE2) } #[doc = "All index occurrences generated on POSIFx.OUT3"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ICM_A::VALUE3) } } @@ -268,18 +252,18 @@ impl From for bool { impl DVAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DVAL_A { + pub const fn variant(&self) -> DVAL_A { match self.bits { false => DVAL_A::VALUE1, true => DVAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Counterclockwise rotation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DVAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clockwise rotation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DVAL_A::VALUE2 @@ -316,46 +300,47 @@ impl W { #[doc = "Bit 0 - Phase A Level selector"] #[inline(always)] #[must_use] - pub fn pals(&mut self) -> PALS_W<0> { - PALS_W::new(self) + pub fn pals(&mut self) -> PALS_W { + PALS_W::new(self, 0) } #[doc = "Bit 1 - Phase B Level selector"] #[inline(always)] #[must_use] - pub fn pbls(&mut self) -> PBLS_W<1> { - PBLS_W::new(self) + pub fn pbls(&mut self) -> PBLS_W { + PBLS_W::new(self, 1) } #[doc = "Bit 2 - Phase signals swap"] #[inline(always)] #[must_use] - pub fn phs(&mut self) -> PHS_W<2> { - PHS_W::new(self) + pub fn phs(&mut self) -> PHS_W { + PHS_W::new(self, 2) } #[doc = "Bits 4:5 - Index Marker generations control"] #[inline(always)] #[must_use] - pub fn icm(&mut self) -> ICM_W<4> { - ICM_W::new(self) + pub fn icm(&mut self) -> ICM_W { + ICM_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Quadrature Decoder Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qdc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`qdc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`qdc::R`](R) reader structure"] +impl crate::Readable for QDC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`qdc::W`](W) writer structure"] impl crate::Writable for QDC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/rpflg.rs b/src/posif0/rpflg.rs index 8cece14a..31711c13 100644 --- a/src/posif0/rpflg.rs +++ b/src/posif0/rpflg.rs @@ -1,112 +1,96 @@ #[doc = "Register `RPFLG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RCHE` writer - Correct Hall Event flag clear"] -pub type RCHE_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RCHE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RWHE` writer - Wrong Hall Event flag clear"] -pub type RWHE_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RWHE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RHIE` writer - Hall Inputs Update Event flag clear"] -pub type RHIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RHIE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RMST` writer - Multi-Channel Pattern shadow transfer flag clear"] -pub type RMST_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RMST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RINDX` writer - Quadrature Index flag clear"] -pub type RINDX_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RINDX_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RERR` writer - Quadrature Phase Error flag clear"] -pub type RERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RCNT` writer - Quadrature CLK flag clear"] -pub type RCNT_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RCNT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RDIR` writer - Quadrature Direction flag clear"] -pub type RDIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RDIR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RPCLK` writer - Quadrature period clock flag clear"] -pub type RPCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, RPFLG_SPEC, bool, O>; +pub type RPCLK_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Correct Hall Event flag clear"] #[inline(always)] #[must_use] - pub fn rche(&mut self) -> RCHE_W<0> { - RCHE_W::new(self) + pub fn rche(&mut self) -> RCHE_W { + RCHE_W::new(self, 0) } #[doc = "Bit 1 - Wrong Hall Event flag clear"] #[inline(always)] #[must_use] - pub fn rwhe(&mut self) -> RWHE_W<1> { - RWHE_W::new(self) + pub fn rwhe(&mut self) -> RWHE_W { + RWHE_W::new(self, 1) } #[doc = "Bit 2 - Hall Inputs Update Event flag clear"] #[inline(always)] #[must_use] - pub fn rhie(&mut self) -> RHIE_W<2> { - RHIE_W::new(self) + pub fn rhie(&mut self) -> RHIE_W { + RHIE_W::new(self, 2) } #[doc = "Bit 4 - Multi-Channel Pattern shadow transfer flag clear"] #[inline(always)] #[must_use] - pub fn rmst(&mut self) -> RMST_W<4> { - RMST_W::new(self) + pub fn rmst(&mut self) -> RMST_W { + RMST_W::new(self, 4) } #[doc = "Bit 8 - Quadrature Index flag clear"] #[inline(always)] #[must_use] - pub fn rindx(&mut self) -> RINDX_W<8> { - RINDX_W::new(self) + pub fn rindx(&mut self) -> RINDX_W { + RINDX_W::new(self, 8) } #[doc = "Bit 9 - Quadrature Phase Error flag clear"] #[inline(always)] #[must_use] - pub fn rerr(&mut self) -> RERR_W<9> { - RERR_W::new(self) + pub fn rerr(&mut self) -> RERR_W { + RERR_W::new(self, 9) } #[doc = "Bit 10 - Quadrature CLK flag clear"] #[inline(always)] #[must_use] - pub fn rcnt(&mut self) -> RCNT_W<10> { - RCNT_W::new(self) + pub fn rcnt(&mut self) -> RCNT_W { + RCNT_W::new(self, 10) } #[doc = "Bit 11 - Quadrature Direction flag clear"] #[inline(always)] #[must_use] - pub fn rdir(&mut self) -> RDIR_W<11> { - RDIR_W::new(self) + pub fn rdir(&mut self) -> RDIR_W { + RDIR_W::new(self, 11) } #[doc = "Bit 12 - Quadrature period clock flag clear"] #[inline(always)] #[must_use] - pub fn rpclk(&mut self) -> RPCLK_W<12> { - RPCLK_W::new(self) + pub fn rpclk(&mut self) -> RPCLK_W { + RPCLK_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Processing Interrupt Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rpflg::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RPFLG_SPEC; impl crate::RegisterSpec for RPFLG_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [rpflg::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`rpflg::W`](W) writer structure"] impl crate::Writable for RPFLG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/posif0/spflg.rs b/src/posif0/spflg.rs index c9231612..14cf4c48 100644 --- a/src/posif0/spflg.rs +++ b/src/posif0/spflg.rs @@ -1,112 +1,96 @@ #[doc = "Register `SPFLG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SCHE` writer - Correct Hall Event flag set"] -pub type SCHE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SCHE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SWHE` writer - Wrong Hall Event flag set"] -pub type SWHE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SWHE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SHIE` writer - Hall Inputs Update Event flag set"] -pub type SHIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SHIE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SMST` writer - Multi-Channel Pattern shadow transfer flag set"] -pub type SMST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SMST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SINDX` writer - Quadrature Index flag set"] -pub type SINDX_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SINDX_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SERR` writer - Quadrature Phase Error flag set"] -pub type SERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SCNT` writer - Quadrature CLK flag set"] -pub type SCNT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SCNT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SDIR` writer - Quadrature Direction flag set"] -pub type SDIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SDIR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SPCLK` writer - Quadrature period clock flag set"] -pub type SPCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, SPFLG_SPEC, bool, O>; +pub type SPCLK_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Correct Hall Event flag set"] #[inline(always)] #[must_use] - pub fn sche(&mut self) -> SCHE_W<0> { - SCHE_W::new(self) + pub fn sche(&mut self) -> SCHE_W { + SCHE_W::new(self, 0) } #[doc = "Bit 1 - Wrong Hall Event flag set"] #[inline(always)] #[must_use] - pub fn swhe(&mut self) -> SWHE_W<1> { - SWHE_W::new(self) + pub fn swhe(&mut self) -> SWHE_W { + SWHE_W::new(self, 1) } #[doc = "Bit 2 - Hall Inputs Update Event flag set"] #[inline(always)] #[must_use] - pub fn shie(&mut self) -> SHIE_W<2> { - SHIE_W::new(self) + pub fn shie(&mut self) -> SHIE_W { + SHIE_W::new(self, 2) } #[doc = "Bit 4 - Multi-Channel Pattern shadow transfer flag set"] #[inline(always)] #[must_use] - pub fn smst(&mut self) -> SMST_W<4> { - SMST_W::new(self) + pub fn smst(&mut self) -> SMST_W { + SMST_W::new(self, 4) } #[doc = "Bit 8 - Quadrature Index flag set"] #[inline(always)] #[must_use] - pub fn sindx(&mut self) -> SINDX_W<8> { - SINDX_W::new(self) + pub fn sindx(&mut self) -> SINDX_W { + SINDX_W::new(self, 8) } #[doc = "Bit 9 - Quadrature Phase Error flag set"] #[inline(always)] #[must_use] - pub fn serr(&mut self) -> SERR_W<9> { - SERR_W::new(self) + pub fn serr(&mut self) -> SERR_W { + SERR_W::new(self, 9) } #[doc = "Bit 10 - Quadrature CLK flag set"] #[inline(always)] #[must_use] - pub fn scnt(&mut self) -> SCNT_W<10> { - SCNT_W::new(self) + pub fn scnt(&mut self) -> SCNT_W { + SCNT_W::new(self, 10) } #[doc = "Bit 11 - Quadrature Direction flag set"] #[inline(always)] #[must_use] - pub fn sdir(&mut self) -> SDIR_W<11> { - SDIR_W::new(self) + pub fn sdir(&mut self) -> SDIR_W { + SDIR_W::new(self, 11) } #[doc = "Bit 12 - Quadrature period clock flag set"] #[inline(always)] #[must_use] - pub fn spclk(&mut self) -> SPCLK_W<12> { - SPCLK_W::new(self) + pub fn spclk(&mut self) -> SPCLK_W { + SPCLK_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Processing Interrupt Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`spflg::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SPFLG_SPEC; impl crate::RegisterSpec for SPFLG_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [spflg::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`spflg::W`](W) writer structure"] impl crate::Writable for SPFLG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb.rs b/src/ppb.rs index f9d42787..42465e61 100644 --- a/src/ppb.rs +++ b/src/ppb.rs @@ -2,521 +2,943 @@ #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 0x08], - #[doc = "0x08 - Auxiliary Control Register"] - pub actlr: ACTLR, + actlr: ACTLR, _reserved1: [u8; 0x04], + syst_csr: SYST_CSR, + syst_rvr: SYST_RVR, + syst_cvr: SYST_CVR, + syst_calib: SYST_CALIB, + _reserved5: [u8; 0xe0], + nvic_iser0: NVIC_ISER0, + nvic_iser1: NVIC_ISER1, + nvic_iser2: NVIC_ISER2, + nvic_iser3: NVIC_ISER3, + _reserved9: [u8; 0x70], + nvic_icer0: NVIC_ICER0, + nvic_icer1: NVIC_ICER1, + nvic_icer2: NVIC_ICER2, + nvic_icer3: NVIC_ICER3, + _reserved13: [u8; 0x70], + nvic_ispr0: NVIC_ISPR0, + nvic_ispr1: NVIC_ISPR1, + nvic_ispr2: NVIC_ISPR2, + nvic_ispr3: NVIC_ISPR3, + _reserved17: [u8; 0x70], + nvic_icpr0: NVIC_ICPR0, + nvic_icpr1: NVIC_ICPR1, + nvic_icpr2: NVIC_ICPR2, + nvic_icpr3: NVIC_ICPR3, + _reserved21: [u8; 0x70], + nvic_iabr0: NVIC_IABR0, + nvic_iabr1: NVIC_IABR1, + nvic_iabr2: NVIC_IABR2, + nvic_iabr3: NVIC_IABR3, + _reserved25: [u8; 0xf0], + nvic_ipr0: NVIC_IPR0, + nvic_ipr1: NVIC_IPR1, + nvic_ipr2: NVIC_IPR2, + nvic_ipr3: NVIC_IPR3, + nvic_ipr4: NVIC_IPR4, + nvic_ipr5: NVIC_IPR5, + nvic_ipr6: NVIC_IPR6, + nvic_ipr7: NVIC_IPR7, + nvic_ipr8: NVIC_IPR8, + nvic_ipr9: NVIC_IPR9, + nvic_ipr10: NVIC_IPR10, + nvic_ipr11: NVIC_IPR11, + nvic_ipr12: NVIC_IPR12, + nvic_ipr13: NVIC_IPR13, + nvic_ipr14: NVIC_IPR14, + nvic_ipr15: NVIC_IPR15, + nvic_ipr16: NVIC_IPR16, + nvic_ipr17: NVIC_IPR17, + nvic_ipr18: NVIC_IPR18, + nvic_ipr19: NVIC_IPR19, + nvic_ipr20: NVIC_IPR20, + nvic_ipr21: NVIC_IPR21, + nvic_ipr22: NVIC_IPR22, + nvic_ipr23: NVIC_IPR23, + nvic_ipr24: NVIC_IPR24, + nvic_ipr25: NVIC_IPR25, + nvic_ipr26: NVIC_IPR26, + nvic_ipr27: NVIC_IPR27, + _reserved53: [u8; 0x0890], + cpuid: CPUID, + icsr: ICSR, + vtor: VTOR, + aircr: AIRCR, + scr: SCR, + ccr: CCR, + shpr1: SHPR1, + shpr2: SHPR2, + shpr3: SHPR3, + shcsr: SHCSR, + cfsr: CFSR, + hfsr: HFSR, + _reserved65: [u8; 0x04], + mmfar: MMFAR, + bfar: BFAR, + afsr: AFSR, + _reserved68: [u8; 0x48], + cpacr: CPACR, + _reserved69: [u8; 0x04], + mpu_type: MPU_TYPE, + mpu_ctrl: MPU_CTRL, + mpu_rnr: MPU_RNR, + mpu_rbar: MPU_RBAR, + mpu_rasr: MPU_RASR, + mpu_rbar_a1: MPU_RBAR_A1, + mpu_rasr_a1: MPU_RASR_A1, + mpu_rbar_a2: MPU_RBAR_A2, + mpu_rasr_a2: MPU_RASR_A2, + mpu_rbar_a3: MPU_RBAR_A3, + mpu_rasr_a3: MPU_RASR_A3, + _reserved80: [u8; 0x0144], + stir: STIR, + _reserved81: [u8; 0x30], + fpccr: FPCCR, + fpcar: FPCAR, + fpdscr: FPDSCR, +} +impl RegisterBlock { + #[doc = "0x08 - Auxiliary Control Register"] + #[inline(always)] + pub const fn actlr(&self) -> &ACTLR { + &self.actlr + } #[doc = "0x10 - SysTick Control and Status Register"] - pub syst_csr: SYST_CSR, + #[inline(always)] + pub const fn syst_csr(&self) -> &SYST_CSR { + &self.syst_csr + } #[doc = "0x14 - SysTick Reload Value Register"] - pub syst_rvr: SYST_RVR, + #[inline(always)] + pub const fn syst_rvr(&self) -> &SYST_RVR { + &self.syst_rvr + } #[doc = "0x18 - SysTick Current Value Register"] - pub syst_cvr: SYST_CVR, + #[inline(always)] + pub const fn syst_cvr(&self) -> &SYST_CVR { + &self.syst_cvr + } #[doc = "0x1c - SysTick Calibration Value Register r"] - pub syst_calib: SYST_CALIB, - _reserved5: [u8; 0xe0], + #[inline(always)] + pub const fn syst_calib(&self) -> &SYST_CALIB { + &self.syst_calib + } #[doc = "0x100 - Interrupt Set-enable Register 0"] - pub nvic_iser0: NVIC_ISER0, + #[inline(always)] + pub const fn nvic_iser0(&self) -> &NVIC_ISER0 { + &self.nvic_iser0 + } #[doc = "0x104 - Interrupt Set-enable Register 1"] - pub nvic_iser1: NVIC_ISER1, + #[inline(always)] + pub const fn nvic_iser1(&self) -> &NVIC_ISER1 { + &self.nvic_iser1 + } #[doc = "0x108 - Interrupt Set-enable Register 2"] - pub nvic_iser2: NVIC_ISER2, + #[inline(always)] + pub const fn nvic_iser2(&self) -> &NVIC_ISER2 { + &self.nvic_iser2 + } #[doc = "0x10c - Interrupt Set-enable Register 3"] - pub nvic_iser3: NVIC_ISER3, - _reserved9: [u8; 0x70], + #[inline(always)] + pub const fn nvic_iser3(&self) -> &NVIC_ISER3 { + &self.nvic_iser3 + } #[doc = "0x180 - Interrupt Clear-enable Register 0"] - pub nvic_icer0: NVIC_ICER0, + #[inline(always)] + pub const fn nvic_icer0(&self) -> &NVIC_ICER0 { + &self.nvic_icer0 + } #[doc = "0x184 - Interrupt Clear-enable Register 1"] - pub nvic_icer1: NVIC_ICER1, + #[inline(always)] + pub const fn nvic_icer1(&self) -> &NVIC_ICER1 { + &self.nvic_icer1 + } #[doc = "0x188 - Interrupt Clear-enable Register 2"] - pub nvic_icer2: NVIC_ICER2, + #[inline(always)] + pub const fn nvic_icer2(&self) -> &NVIC_ICER2 { + &self.nvic_icer2 + } #[doc = "0x18c - Interrupt Clear-enable Register 3"] - pub nvic_icer3: NVIC_ICER3, - _reserved13: [u8; 0x70], + #[inline(always)] + pub const fn nvic_icer3(&self) -> &NVIC_ICER3 { + &self.nvic_icer3 + } #[doc = "0x200 - Interrupt Set-pending Register 0"] - pub nvic_ispr0: NVIC_ISPR0, + #[inline(always)] + pub const fn nvic_ispr0(&self) -> &NVIC_ISPR0 { + &self.nvic_ispr0 + } #[doc = "0x204 - Interrupt Set-pending Register 1"] - pub nvic_ispr1: NVIC_ISPR1, + #[inline(always)] + pub const fn nvic_ispr1(&self) -> &NVIC_ISPR1 { + &self.nvic_ispr1 + } #[doc = "0x208 - Interrupt Set-pending Register 2"] - pub nvic_ispr2: NVIC_ISPR2, + #[inline(always)] + pub const fn nvic_ispr2(&self) -> &NVIC_ISPR2 { + &self.nvic_ispr2 + } #[doc = "0x20c - Interrupt Set-pending Register 3"] - pub nvic_ispr3: NVIC_ISPR3, - _reserved17: [u8; 0x70], + #[inline(always)] + pub const fn nvic_ispr3(&self) -> &NVIC_ISPR3 { + &self.nvic_ispr3 + } #[doc = "0x280 - Interrupt Clear-pending Register 0"] - pub nvic_icpr0: NVIC_ICPR0, + #[inline(always)] + pub const fn nvic_icpr0(&self) -> &NVIC_ICPR0 { + &self.nvic_icpr0 + } #[doc = "0x284 - Interrupt Clear-pending Register 1"] - pub nvic_icpr1: NVIC_ICPR1, + #[inline(always)] + pub const fn nvic_icpr1(&self) -> &NVIC_ICPR1 { + &self.nvic_icpr1 + } #[doc = "0x288 - Interrupt Clear-pending Register 2"] - pub nvic_icpr2: NVIC_ICPR2, + #[inline(always)] + pub const fn nvic_icpr2(&self) -> &NVIC_ICPR2 { + &self.nvic_icpr2 + } #[doc = "0x28c - Interrupt Clear-pending Register 3"] - pub nvic_icpr3: NVIC_ICPR3, - _reserved21: [u8; 0x70], + #[inline(always)] + pub const fn nvic_icpr3(&self) -> &NVIC_ICPR3 { + &self.nvic_icpr3 + } #[doc = "0x300 - Interrupt Active Bit Register 0"] - pub nvic_iabr0: NVIC_IABR0, + #[inline(always)] + pub const fn nvic_iabr0(&self) -> &NVIC_IABR0 { + &self.nvic_iabr0 + } #[doc = "0x304 - Interrupt Active Bit Register 1"] - pub nvic_iabr1: NVIC_IABR1, + #[inline(always)] + pub const fn nvic_iabr1(&self) -> &NVIC_IABR1 { + &self.nvic_iabr1 + } #[doc = "0x308 - Interrupt Active Bit Register 2"] - pub nvic_iabr2: NVIC_IABR2, + #[inline(always)] + pub const fn nvic_iabr2(&self) -> &NVIC_IABR2 { + &self.nvic_iabr2 + } #[doc = "0x30c - Interrupt Active Bit Register 3"] - pub nvic_iabr3: NVIC_IABR3, - _reserved25: [u8; 0xf0], + #[inline(always)] + pub const fn nvic_iabr3(&self) -> &NVIC_IABR3 { + &self.nvic_iabr3 + } #[doc = "0x400 - Interrupt Priority Register 0"] - pub nvic_ipr0: NVIC_IPR0, + #[inline(always)] + pub const fn nvic_ipr0(&self) -> &NVIC_IPR0 { + &self.nvic_ipr0 + } #[doc = "0x404 - Interrupt Priority Register 1"] - pub nvic_ipr1: NVIC_IPR1, + #[inline(always)] + pub const fn nvic_ipr1(&self) -> &NVIC_IPR1 { + &self.nvic_ipr1 + } #[doc = "0x408 - Interrupt Priority Register 2"] - pub nvic_ipr2: NVIC_IPR2, + #[inline(always)] + pub const fn nvic_ipr2(&self) -> &NVIC_IPR2 { + &self.nvic_ipr2 + } #[doc = "0x40c - Interrupt Priority Register 3"] - pub nvic_ipr3: NVIC_IPR3, + #[inline(always)] + pub const fn nvic_ipr3(&self) -> &NVIC_IPR3 { + &self.nvic_ipr3 + } #[doc = "0x410 - Interrupt Priority Register 4"] - pub nvic_ipr4: NVIC_IPR4, + #[inline(always)] + pub const fn nvic_ipr4(&self) -> &NVIC_IPR4 { + &self.nvic_ipr4 + } #[doc = "0x414 - Interrupt Priority Register 5"] - pub nvic_ipr5: NVIC_IPR5, + #[inline(always)] + pub const fn nvic_ipr5(&self) -> &NVIC_IPR5 { + &self.nvic_ipr5 + } #[doc = "0x418 - Interrupt Priority Register 6"] - pub nvic_ipr6: NVIC_IPR6, + #[inline(always)] + pub const fn nvic_ipr6(&self) -> &NVIC_IPR6 { + &self.nvic_ipr6 + } #[doc = "0x41c - Interrupt Priority Register 7"] - pub nvic_ipr7: NVIC_IPR7, + #[inline(always)] + pub const fn nvic_ipr7(&self) -> &NVIC_IPR7 { + &self.nvic_ipr7 + } #[doc = "0x420 - Interrupt Priority Register 8"] - pub nvic_ipr8: NVIC_IPR8, + #[inline(always)] + pub const fn nvic_ipr8(&self) -> &NVIC_IPR8 { + &self.nvic_ipr8 + } #[doc = "0x424 - Interrupt Priority Register 9"] - pub nvic_ipr9: NVIC_IPR9, + #[inline(always)] + pub const fn nvic_ipr9(&self) -> &NVIC_IPR9 { + &self.nvic_ipr9 + } #[doc = "0x428 - Interrupt Priority Register 10"] - pub nvic_ipr10: NVIC_IPR10, + #[inline(always)] + pub const fn nvic_ipr10(&self) -> &NVIC_IPR10 { + &self.nvic_ipr10 + } #[doc = "0x42c - Interrupt Priority Register 11"] - pub nvic_ipr11: NVIC_IPR11, + #[inline(always)] + pub const fn nvic_ipr11(&self) -> &NVIC_IPR11 { + &self.nvic_ipr11 + } #[doc = "0x430 - Interrupt Priority Register 12"] - pub nvic_ipr12: NVIC_IPR12, + #[inline(always)] + pub const fn nvic_ipr12(&self) -> &NVIC_IPR12 { + &self.nvic_ipr12 + } #[doc = "0x434 - Interrupt Priority Register 13"] - pub nvic_ipr13: NVIC_IPR13, + #[inline(always)] + pub const fn nvic_ipr13(&self) -> &NVIC_IPR13 { + &self.nvic_ipr13 + } #[doc = "0x438 - Interrupt Priority Register 14"] - pub nvic_ipr14: NVIC_IPR14, + #[inline(always)] + pub const fn nvic_ipr14(&self) -> &NVIC_IPR14 { + &self.nvic_ipr14 + } #[doc = "0x43c - Interrupt Priority Register 15"] - pub nvic_ipr15: NVIC_IPR15, + #[inline(always)] + pub const fn nvic_ipr15(&self) -> &NVIC_IPR15 { + &self.nvic_ipr15 + } #[doc = "0x440 - Interrupt Priority Register 16"] - pub nvic_ipr16: NVIC_IPR16, + #[inline(always)] + pub const fn nvic_ipr16(&self) -> &NVIC_IPR16 { + &self.nvic_ipr16 + } #[doc = "0x444 - Interrupt Priority Register 17"] - pub nvic_ipr17: NVIC_IPR17, + #[inline(always)] + pub const fn nvic_ipr17(&self) -> &NVIC_IPR17 { + &self.nvic_ipr17 + } #[doc = "0x448 - Interrupt Priority Register 18"] - pub nvic_ipr18: NVIC_IPR18, + #[inline(always)] + pub const fn nvic_ipr18(&self) -> &NVIC_IPR18 { + &self.nvic_ipr18 + } #[doc = "0x44c - Interrupt Priority Register 19"] - pub nvic_ipr19: NVIC_IPR19, + #[inline(always)] + pub const fn nvic_ipr19(&self) -> &NVIC_IPR19 { + &self.nvic_ipr19 + } #[doc = "0x450 - Interrupt Priority Register 20"] - pub nvic_ipr20: NVIC_IPR20, + #[inline(always)] + pub const fn nvic_ipr20(&self) -> &NVIC_IPR20 { + &self.nvic_ipr20 + } #[doc = "0x454 - Interrupt Priority Register 21"] - pub nvic_ipr21: NVIC_IPR21, + #[inline(always)] + pub const fn nvic_ipr21(&self) -> &NVIC_IPR21 { + &self.nvic_ipr21 + } #[doc = "0x458 - Interrupt Priority Register 22"] - pub nvic_ipr22: NVIC_IPR22, + #[inline(always)] + pub const fn nvic_ipr22(&self) -> &NVIC_IPR22 { + &self.nvic_ipr22 + } #[doc = "0x45c - Interrupt Priority Register 23"] - pub nvic_ipr23: NVIC_IPR23, + #[inline(always)] + pub const fn nvic_ipr23(&self) -> &NVIC_IPR23 { + &self.nvic_ipr23 + } #[doc = "0x460 - Interrupt Priority Register 24"] - pub nvic_ipr24: NVIC_IPR24, + #[inline(always)] + pub const fn nvic_ipr24(&self) -> &NVIC_IPR24 { + &self.nvic_ipr24 + } #[doc = "0x464 - Interrupt Priority Register 25"] - pub nvic_ipr25: NVIC_IPR25, + #[inline(always)] + pub const fn nvic_ipr25(&self) -> &NVIC_IPR25 { + &self.nvic_ipr25 + } #[doc = "0x468 - Interrupt Priority Register 26"] - pub nvic_ipr26: NVIC_IPR26, + #[inline(always)] + pub const fn nvic_ipr26(&self) -> &NVIC_IPR26 { + &self.nvic_ipr26 + } #[doc = "0x46c - Interrupt Priority Register 27"] - pub nvic_ipr27: NVIC_IPR27, - _reserved53: [u8; 0x0890], + #[inline(always)] + pub const fn nvic_ipr27(&self) -> &NVIC_IPR27 { + &self.nvic_ipr27 + } #[doc = "0xd00 - CPUID Base Register"] - pub cpuid: CPUID, + #[inline(always)] + pub const fn cpuid(&self) -> &CPUID { + &self.cpuid + } #[doc = "0xd04 - Interrupt Control and State Register"] - pub icsr: ICSR, + #[inline(always)] + pub const fn icsr(&self) -> &ICSR { + &self.icsr + } #[doc = "0xd08 - Vector Table Offset Register"] - pub vtor: VTOR, + #[inline(always)] + pub const fn vtor(&self) -> &VTOR { + &self.vtor + } #[doc = "0xd0c - Application Interrupt and Reset Control Register"] - pub aircr: AIRCR, + #[inline(always)] + pub const fn aircr(&self) -> &AIRCR { + &self.aircr + } #[doc = "0xd10 - System Control Register"] - pub scr: SCR, + #[inline(always)] + pub const fn scr(&self) -> &SCR { + &self.scr + } #[doc = "0xd14 - Configuration and Control Register"] - pub ccr: CCR, + #[inline(always)] + pub const fn ccr(&self) -> &CCR { + &self.ccr + } #[doc = "0xd18 - System Handler Priority Register 1"] - pub shpr1: SHPR1, + #[inline(always)] + pub const fn shpr1(&self) -> &SHPR1 { + &self.shpr1 + } #[doc = "0xd1c - System Handler Priority Register 2"] - pub shpr2: SHPR2, + #[inline(always)] + pub const fn shpr2(&self) -> &SHPR2 { + &self.shpr2 + } #[doc = "0xd20 - System Handler Priority Register 3"] - pub shpr3: SHPR3, + #[inline(always)] + pub const fn shpr3(&self) -> &SHPR3 { + &self.shpr3 + } #[doc = "0xd24 - System Handler Control and State Register"] - pub shcsr: SHCSR, + #[inline(always)] + pub const fn shcsr(&self) -> &SHCSR { + &self.shcsr + } #[doc = "0xd28 - Configurable Fault Status Register"] - pub cfsr: CFSR, + #[inline(always)] + pub const fn cfsr(&self) -> &CFSR { + &self.cfsr + } #[doc = "0xd2c - HardFault Status Register"] - pub hfsr: HFSR, - _reserved65: [u8; 0x04], + #[inline(always)] + pub const fn hfsr(&self) -> &HFSR { + &self.hfsr + } #[doc = "0xd34 - MemManage Fault Address Register"] - pub mmfar: MMFAR, + #[inline(always)] + pub const fn mmfar(&self) -> &MMFAR { + &self.mmfar + } #[doc = "0xd38 - BusFault Address Register"] - pub bfar: BFAR, + #[inline(always)] + pub const fn bfar(&self) -> &BFAR { + &self.bfar + } #[doc = "0xd3c - Auxiliary Fault Status Register"] - pub afsr: AFSR, - _reserved68: [u8; 0x48], + #[inline(always)] + pub const fn afsr(&self) -> &AFSR { + &self.afsr + } #[doc = "0xd88 - Coprocessor Access Control Register"] - pub cpacr: CPACR, - _reserved69: [u8; 0x04], + #[inline(always)] + pub const fn cpacr(&self) -> &CPACR { + &self.cpacr + } #[doc = "0xd90 - MPU Type Register"] - pub mpu_type: MPU_TYPE, + #[inline(always)] + pub const fn mpu_type(&self) -> &MPU_TYPE { + &self.mpu_type + } #[doc = "0xd94 - MPU Control Register"] - pub mpu_ctrl: MPU_CTRL, + #[inline(always)] + pub const fn mpu_ctrl(&self) -> &MPU_CTRL { + &self.mpu_ctrl + } #[doc = "0xd98 - MPU Region Number Register"] - pub mpu_rnr: MPU_RNR, + #[inline(always)] + pub const fn mpu_rnr(&self) -> &MPU_RNR { + &self.mpu_rnr + } #[doc = "0xd9c - MPU Region Base Address Register"] - pub mpu_rbar: MPU_RBAR, + #[inline(always)] + pub const fn mpu_rbar(&self) -> &MPU_RBAR { + &self.mpu_rbar + } #[doc = "0xda0 - MPU Region Attribute and Size Register"] - pub mpu_rasr: MPU_RASR, + #[inline(always)] + pub const fn mpu_rasr(&self) -> &MPU_RASR { + &self.mpu_rasr + } #[doc = "0xda4 - MPU Region Base Address Register A1"] - pub mpu_rbar_a1: MPU_RBAR_A1, + #[inline(always)] + pub const fn mpu_rbar_a1(&self) -> &MPU_RBAR_A1 { + &self.mpu_rbar_a1 + } #[doc = "0xda8 - MPU Region Attribute and Size Register A1"] - pub mpu_rasr_a1: MPU_RASR_A1, + #[inline(always)] + pub const fn mpu_rasr_a1(&self) -> &MPU_RASR_A1 { + &self.mpu_rasr_a1 + } #[doc = "0xdac - MPU Region Base Address Register A2"] - pub mpu_rbar_a2: MPU_RBAR_A2, + #[inline(always)] + pub const fn mpu_rbar_a2(&self) -> &MPU_RBAR_A2 { + &self.mpu_rbar_a2 + } #[doc = "0xdb0 - MPU Region Attribute and Size Register A2"] - pub mpu_rasr_a2: MPU_RASR_A2, + #[inline(always)] + pub const fn mpu_rasr_a2(&self) -> &MPU_RASR_A2 { + &self.mpu_rasr_a2 + } #[doc = "0xdb4 - MPU Region Base Address Register A3"] - pub mpu_rbar_a3: MPU_RBAR_A3, + #[inline(always)] + pub const fn mpu_rbar_a3(&self) -> &MPU_RBAR_A3 { + &self.mpu_rbar_a3 + } #[doc = "0xdb8 - MPU Region Attribute and Size Register A3"] - pub mpu_rasr_a3: MPU_RASR_A3, - _reserved80: [u8; 0x0144], + #[inline(always)] + pub const fn mpu_rasr_a3(&self) -> &MPU_RASR_A3 { + &self.mpu_rasr_a3 + } #[doc = "0xf00 - Software Trigger Interrupt Register"] - pub stir: STIR, - _reserved81: [u8; 0x30], + #[inline(always)] + pub const fn stir(&self) -> &STIR { + &self.stir + } #[doc = "0xf34 - Floating-point Context Control Register"] - pub fpccr: FPCCR, + #[inline(always)] + pub const fn fpccr(&self) -> &FPCCR { + &self.fpccr + } #[doc = "0xf38 - Floating-point Context Address Register"] - pub fpcar: FPCAR, + #[inline(always)] + pub const fn fpcar(&self) -> &FPCAR { + &self.fpcar + } #[doc = "0xf3c - Floating-point Default Status Control Register"] - pub fpdscr: FPDSCR, + #[inline(always)] + pub const fn fpdscr(&self) -> &FPDSCR { + &self.fpdscr + } } -#[doc = "ACTLR (rw) register accessor: an alias for `Reg`"] +#[doc = "ACTLR (rw) register accessor: Auxiliary Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`actlr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`actlr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@actlr`] +module"] pub type ACTLR = crate::Reg; #[doc = "Auxiliary Control Register"] pub mod actlr; -#[doc = "SYST_CSR (rw) register accessor: an alias for `Reg`"] +#[doc = "SYST_CSR (rw) register accessor: SysTick Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`syst_csr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`syst_csr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@syst_csr`] +module"] pub type SYST_CSR = crate::Reg; #[doc = "SysTick Control and Status Register"] pub mod syst_csr; -#[doc = "SYST_RVR (rw) register accessor: an alias for `Reg`"] +#[doc = "SYST_RVR (rw) register accessor: SysTick Reload Value Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`syst_rvr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`syst_rvr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@syst_rvr`] +module"] pub type SYST_RVR = crate::Reg; #[doc = "SysTick Reload Value Register"] pub mod syst_rvr; -#[doc = "SYST_CVR (rw) register accessor: an alias for `Reg`"] +#[doc = "SYST_CVR (rw) register accessor: SysTick Current Value Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`syst_cvr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`syst_cvr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@syst_cvr`] +module"] pub type SYST_CVR = crate::Reg; #[doc = "SysTick Current Value Register"] pub mod syst_cvr; -#[doc = "SYST_CALIB (rw) register accessor: an alias for `Reg`"] +#[doc = "SYST_CALIB (rw) register accessor: SysTick Calibration Value Register r\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`syst_calib::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`syst_calib::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@syst_calib`] +module"] pub type SYST_CALIB = crate::Reg; #[doc = "SysTick Calibration Value Register r"] pub mod syst_calib; -#[doc = "NVIC_ISER0 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ISER0 (rw) register accessor: Interrupt Set-enable Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iser0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iser0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_iser0`] +module"] pub type NVIC_ISER0 = crate::Reg; #[doc = "Interrupt Set-enable Register 0"] pub mod nvic_iser0; -#[doc = "NVIC_ISER1 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ISER1 (rw) register accessor: Interrupt Set-enable Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iser1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iser1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_iser1`] +module"] pub type NVIC_ISER1 = crate::Reg; #[doc = "Interrupt Set-enable Register 1"] pub mod nvic_iser1; -#[doc = "NVIC_ISER2 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ISER2 (rw) register accessor: Interrupt Set-enable Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iser2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iser2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_iser2`] +module"] pub type NVIC_ISER2 = crate::Reg; #[doc = "Interrupt Set-enable Register 2"] pub mod nvic_iser2; -#[doc = "NVIC_ISER3 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ISER3 (rw) register accessor: Interrupt Set-enable Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iser3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iser3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_iser3`] +module"] pub type NVIC_ISER3 = crate::Reg; #[doc = "Interrupt Set-enable Register 3"] pub mod nvic_iser3; -#[doc = "NVIC_ICER0 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ICER0 (rw) register accessor: Interrupt Clear-enable Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icer0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icer0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_icer0`] +module"] pub type NVIC_ICER0 = crate::Reg; #[doc = "Interrupt Clear-enable Register 0"] pub mod nvic_icer0; -#[doc = "NVIC_ICER1 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ICER1 (rw) register accessor: Interrupt Clear-enable Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icer1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icer1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_icer1`] +module"] pub type NVIC_ICER1 = crate::Reg; #[doc = "Interrupt Clear-enable Register 1"] pub mod nvic_icer1; -#[doc = "NVIC_ICER2 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ICER2 (rw) register accessor: Interrupt Clear-enable Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icer2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icer2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_icer2`] +module"] pub type NVIC_ICER2 = crate::Reg; #[doc = "Interrupt Clear-enable Register 2"] pub mod nvic_icer2; -#[doc = "NVIC_ICER3 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ICER3 (rw) register accessor: Interrupt Clear-enable Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icer3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icer3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_icer3`] +module"] pub type NVIC_ICER3 = crate::Reg; #[doc = "Interrupt Clear-enable Register 3"] pub mod nvic_icer3; -#[doc = "NVIC_ISPR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ISPR0 (rw) register accessor: Interrupt Set-pending Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ispr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ispr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ispr0`] +module"] pub type NVIC_ISPR0 = crate::Reg; #[doc = "Interrupt Set-pending Register 0"] pub mod nvic_ispr0; -#[doc = "NVIC_ISPR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ISPR1 (rw) register accessor: Interrupt Set-pending Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ispr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ispr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ispr1`] +module"] pub type NVIC_ISPR1 = crate::Reg; #[doc = "Interrupt Set-pending Register 1"] pub mod nvic_ispr1; -#[doc = "NVIC_ISPR2 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ISPR2 (rw) register accessor: Interrupt Set-pending Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ispr2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ispr2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ispr2`] +module"] pub type NVIC_ISPR2 = crate::Reg; #[doc = "Interrupt Set-pending Register 2"] pub mod nvic_ispr2; -#[doc = "NVIC_ISPR3 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ISPR3 (rw) register accessor: Interrupt Set-pending Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ispr3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ispr3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ispr3`] +module"] pub type NVIC_ISPR3 = crate::Reg; #[doc = "Interrupt Set-pending Register 3"] pub mod nvic_ispr3; -#[doc = "NVIC_ICPR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ICPR0 (rw) register accessor: Interrupt Clear-pending Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icpr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icpr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_icpr0`] +module"] pub type NVIC_ICPR0 = crate::Reg; #[doc = "Interrupt Clear-pending Register 0"] pub mod nvic_icpr0; -#[doc = "NVIC_ICPR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ICPR1 (rw) register accessor: Interrupt Clear-pending Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icpr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icpr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_icpr1`] +module"] pub type NVIC_ICPR1 = crate::Reg; #[doc = "Interrupt Clear-pending Register 1"] pub mod nvic_icpr1; -#[doc = "NVIC_ICPR2 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ICPR2 (rw) register accessor: Interrupt Clear-pending Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icpr2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icpr2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_icpr2`] +module"] pub type NVIC_ICPR2 = crate::Reg; #[doc = "Interrupt Clear-pending Register 2"] pub mod nvic_icpr2; -#[doc = "NVIC_ICPR3 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_ICPR3 (rw) register accessor: Interrupt Clear-pending Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icpr3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icpr3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_icpr3`] +module"] pub type NVIC_ICPR3 = crate::Reg; #[doc = "Interrupt Clear-pending Register 3"] pub mod nvic_icpr3; -#[doc = "NVIC_IABR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IABR0 (rw) register accessor: Interrupt Active Bit Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iabr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iabr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_iabr0`] +module"] pub type NVIC_IABR0 = crate::Reg; #[doc = "Interrupt Active Bit Register 0"] pub mod nvic_iabr0; -#[doc = "NVIC_IABR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IABR1 (rw) register accessor: Interrupt Active Bit Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iabr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iabr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_iabr1`] +module"] pub type NVIC_IABR1 = crate::Reg; #[doc = "Interrupt Active Bit Register 1"] pub mod nvic_iabr1; -#[doc = "NVIC_IABR2 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IABR2 (rw) register accessor: Interrupt Active Bit Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iabr2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iabr2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_iabr2`] +module"] pub type NVIC_IABR2 = crate::Reg; #[doc = "Interrupt Active Bit Register 2"] pub mod nvic_iabr2; -#[doc = "NVIC_IABR3 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IABR3 (rw) register accessor: Interrupt Active Bit Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iabr3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iabr3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_iabr3`] +module"] pub type NVIC_IABR3 = crate::Reg; #[doc = "Interrupt Active Bit Register 3"] pub mod nvic_iabr3; -#[doc = "NVIC_IPR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR0 (rw) register accessor: Interrupt Priority Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr0`] +module"] pub type NVIC_IPR0 = crate::Reg; #[doc = "Interrupt Priority Register 0"] pub mod nvic_ipr0; -#[doc = "NVIC_IPR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR1 (rw) register accessor: Interrupt Priority Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr1`] +module"] pub type NVIC_IPR1 = crate::Reg; #[doc = "Interrupt Priority Register 1"] pub mod nvic_ipr1; -#[doc = "NVIC_IPR2 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR2 (rw) register accessor: Interrupt Priority Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr2`] +module"] pub type NVIC_IPR2 = crate::Reg; #[doc = "Interrupt Priority Register 2"] pub mod nvic_ipr2; -#[doc = "NVIC_IPR3 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR3 (rw) register accessor: Interrupt Priority Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr3`] +module"] pub type NVIC_IPR3 = crate::Reg; #[doc = "Interrupt Priority Register 3"] pub mod nvic_ipr3; -#[doc = "NVIC_IPR4 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR4 (rw) register accessor: Interrupt Priority Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr4`] +module"] pub type NVIC_IPR4 = crate::Reg; #[doc = "Interrupt Priority Register 4"] pub mod nvic_ipr4; -#[doc = "NVIC_IPR5 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR5 (rw) register accessor: Interrupt Priority Register 5\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr5::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr5::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr5`] +module"] pub type NVIC_IPR5 = crate::Reg; #[doc = "Interrupt Priority Register 5"] pub mod nvic_ipr5; -#[doc = "NVIC_IPR6 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR6 (rw) register accessor: Interrupt Priority Register 6\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr6::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr6::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr6`] +module"] pub type NVIC_IPR6 = crate::Reg; #[doc = "Interrupt Priority Register 6"] pub mod nvic_ipr6; -#[doc = "NVIC_IPR7 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR7 (rw) register accessor: Interrupt Priority Register 7\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr7::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr7::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr7`] +module"] pub type NVIC_IPR7 = crate::Reg; #[doc = "Interrupt Priority Register 7"] pub mod nvic_ipr7; -#[doc = "NVIC_IPR8 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR8 (rw) register accessor: Interrupt Priority Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr8::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr8::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr8`] +module"] pub type NVIC_IPR8 = crate::Reg; #[doc = "Interrupt Priority Register 8"] pub mod nvic_ipr8; -#[doc = "NVIC_IPR9 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR9 (rw) register accessor: Interrupt Priority Register 9\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr9::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr9::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr9`] +module"] pub type NVIC_IPR9 = crate::Reg; #[doc = "Interrupt Priority Register 9"] pub mod nvic_ipr9; -#[doc = "NVIC_IPR10 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR10 (rw) register accessor: Interrupt Priority Register 10\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr10::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr10::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr10`] +module"] pub type NVIC_IPR10 = crate::Reg; #[doc = "Interrupt Priority Register 10"] pub mod nvic_ipr10; -#[doc = "NVIC_IPR11 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR11 (rw) register accessor: Interrupt Priority Register 11\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr11::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr11::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr11`] +module"] pub type NVIC_IPR11 = crate::Reg; #[doc = "Interrupt Priority Register 11"] pub mod nvic_ipr11; -#[doc = "NVIC_IPR12 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR12 (rw) register accessor: Interrupt Priority Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr12::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr12::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr12`] +module"] pub type NVIC_IPR12 = crate::Reg; #[doc = "Interrupt Priority Register 12"] pub mod nvic_ipr12; -#[doc = "NVIC_IPR13 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR13 (rw) register accessor: Interrupt Priority Register 13\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr13::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr13::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr13`] +module"] pub type NVIC_IPR13 = crate::Reg; #[doc = "Interrupt Priority Register 13"] pub mod nvic_ipr13; -#[doc = "NVIC_IPR14 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR14 (rw) register accessor: Interrupt Priority Register 14\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr14::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr14::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr14`] +module"] pub type NVIC_IPR14 = crate::Reg; #[doc = "Interrupt Priority Register 14"] pub mod nvic_ipr14; -#[doc = "NVIC_IPR15 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR15 (rw) register accessor: Interrupt Priority Register 15\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr15::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr15::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr15`] +module"] pub type NVIC_IPR15 = crate::Reg; #[doc = "Interrupt Priority Register 15"] pub mod nvic_ipr15; -#[doc = "NVIC_IPR16 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR16 (rw) register accessor: Interrupt Priority Register 16\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr16::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr16::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr16`] +module"] pub type NVIC_IPR16 = crate::Reg; #[doc = "Interrupt Priority Register 16"] pub mod nvic_ipr16; -#[doc = "NVIC_IPR17 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR17 (rw) register accessor: Interrupt Priority Register 17\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr17::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr17::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr17`] +module"] pub type NVIC_IPR17 = crate::Reg; #[doc = "Interrupt Priority Register 17"] pub mod nvic_ipr17; -#[doc = "NVIC_IPR18 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR18 (rw) register accessor: Interrupt Priority Register 18\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr18::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr18::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr18`] +module"] pub type NVIC_IPR18 = crate::Reg; #[doc = "Interrupt Priority Register 18"] pub mod nvic_ipr18; -#[doc = "NVIC_IPR19 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR19 (rw) register accessor: Interrupt Priority Register 19\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr19::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr19::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr19`] +module"] pub type NVIC_IPR19 = crate::Reg; #[doc = "Interrupt Priority Register 19"] pub mod nvic_ipr19; -#[doc = "NVIC_IPR20 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR20 (rw) register accessor: Interrupt Priority Register 20\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr20::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr20::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr20`] +module"] pub type NVIC_IPR20 = crate::Reg; #[doc = "Interrupt Priority Register 20"] pub mod nvic_ipr20; -#[doc = "NVIC_IPR21 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR21 (rw) register accessor: Interrupt Priority Register 21\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr21::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr21::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr21`] +module"] pub type NVIC_IPR21 = crate::Reg; #[doc = "Interrupt Priority Register 21"] pub mod nvic_ipr21; -#[doc = "NVIC_IPR22 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR22 (rw) register accessor: Interrupt Priority Register 22\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr22::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr22::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr22`] +module"] pub type NVIC_IPR22 = crate::Reg; #[doc = "Interrupt Priority Register 22"] pub mod nvic_ipr22; -#[doc = "NVIC_IPR23 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR23 (rw) register accessor: Interrupt Priority Register 23\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr23::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr23::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr23`] +module"] pub type NVIC_IPR23 = crate::Reg; #[doc = "Interrupt Priority Register 23"] pub mod nvic_ipr23; -#[doc = "NVIC_IPR24 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR24 (rw) register accessor: Interrupt Priority Register 24\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr24::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr24::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr24`] +module"] pub type NVIC_IPR24 = crate::Reg; #[doc = "Interrupt Priority Register 24"] pub mod nvic_ipr24; -#[doc = "NVIC_IPR25 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR25 (rw) register accessor: Interrupt Priority Register 25\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr25::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr25::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr25`] +module"] pub type NVIC_IPR25 = crate::Reg; #[doc = "Interrupt Priority Register 25"] pub mod nvic_ipr25; -#[doc = "NVIC_IPR26 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR26 (rw) register accessor: Interrupt Priority Register 26\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr26::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr26::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr26`] +module"] pub type NVIC_IPR26 = crate::Reg; #[doc = "Interrupt Priority Register 26"] pub mod nvic_ipr26; -#[doc = "NVIC_IPR27 (rw) register accessor: an alias for `Reg`"] +#[doc = "NVIC_IPR27 (rw) register accessor: Interrupt Priority Register 27\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr27::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr27::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nvic_ipr27`] +module"] pub type NVIC_IPR27 = crate::Reg; #[doc = "Interrupt Priority Register 27"] pub mod nvic_ipr27; -#[doc = "CPUID (r) register accessor: an alias for `Reg`"] +#[doc = "CPUID (r) register accessor: CPUID Base Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cpuid::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cpuid`] +module"] pub type CPUID = crate::Reg; #[doc = "CPUID Base Register"] pub mod cpuid; -#[doc = "ICSR (rw) register accessor: an alias for `Reg`"] +#[doc = "ICSR (rw) register accessor: Interrupt Control and State Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`icsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`icsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@icsr`] +module"] pub type ICSR = crate::Reg; #[doc = "Interrupt Control and State Register"] pub mod icsr; -#[doc = "VTOR (rw) register accessor: an alias for `Reg`"] +#[doc = "VTOR (rw) register accessor: Vector Table Offset Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`vtor::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`vtor::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@vtor`] +module"] pub type VTOR = crate::Reg; #[doc = "Vector Table Offset Register"] pub mod vtor; -#[doc = "AIRCR (rw) register accessor: an alias for `Reg`"] +#[doc = "AIRCR (rw) register accessor: Application Interrupt and Reset Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`aircr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`aircr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@aircr`] +module"] pub type AIRCR = crate::Reg; #[doc = "Application Interrupt and Reset Control Register"] pub mod aircr; -#[doc = "SCR (rw) register accessor: an alias for `Reg`"] +#[doc = "SCR (rw) register accessor: System Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`scr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`scr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@scr`] +module"] pub type SCR = crate::Reg; #[doc = "System Control Register"] pub mod scr; -#[doc = "CCR (rw) register accessor: an alias for `Reg`"] +#[doc = "CCR (rw) register accessor: Configuration and Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ccr`] +module"] pub type CCR = crate::Reg; #[doc = "Configuration and Control Register"] pub mod ccr; -#[doc = "SHPR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "SHPR1 (rw) register accessor: System Handler Priority Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`shpr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`shpr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@shpr1`] +module"] pub type SHPR1 = crate::Reg; #[doc = "System Handler Priority Register 1"] pub mod shpr1; -#[doc = "SHPR2 (rw) register accessor: an alias for `Reg`"] +#[doc = "SHPR2 (rw) register accessor: System Handler Priority Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`shpr2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`shpr2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@shpr2`] +module"] pub type SHPR2 = crate::Reg; #[doc = "System Handler Priority Register 2"] pub mod shpr2; -#[doc = "SHPR3 (rw) register accessor: an alias for `Reg`"] +#[doc = "SHPR3 (rw) register accessor: System Handler Priority Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`shpr3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`shpr3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@shpr3`] +module"] pub type SHPR3 = crate::Reg; #[doc = "System Handler Priority Register 3"] pub mod shpr3; -#[doc = "SHCSR (rw) register accessor: an alias for `Reg`"] +#[doc = "SHCSR (rw) register accessor: System Handler Control and State Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`shcsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`shcsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@shcsr`] +module"] pub type SHCSR = crate::Reg; #[doc = "System Handler Control and State Register"] pub mod shcsr; -#[doc = "CFSR (rw) register accessor: an alias for `Reg`"] +#[doc = "CFSR (rw) register accessor: Configurable Fault Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cfsr`] +module"] pub type CFSR = crate::Reg; #[doc = "Configurable Fault Status Register"] pub mod cfsr; -#[doc = "HFSR (rw) register accessor: an alias for `Reg`"] +#[doc = "HFSR (rw) register accessor: HardFault Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hfsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hfsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hfsr`] +module"] pub type HFSR = crate::Reg; #[doc = "HardFault Status Register"] pub mod hfsr; -#[doc = "MMFAR (rw) register accessor: an alias for `Reg`"] +#[doc = "MMFAR (rw) register accessor: MemManage Fault Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmfar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmfar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mmfar`] +module"] pub type MMFAR = crate::Reg; #[doc = "MemManage Fault Address Register"] pub mod mmfar; -#[doc = "BFAR (rw) register accessor: an alias for `Reg`"] +#[doc = "BFAR (rw) register accessor: BusFault Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bfar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bfar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bfar`] +module"] pub type BFAR = crate::Reg; #[doc = "BusFault Address Register"] pub mod bfar; -#[doc = "AFSR (rw) register accessor: an alias for `Reg`"] +#[doc = "AFSR (rw) register accessor: Auxiliary Fault Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`afsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`afsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@afsr`] +module"] pub type AFSR = crate::Reg; #[doc = "Auxiliary Fault Status Register"] pub mod afsr; -#[doc = "CPACR (rw) register accessor: an alias for `Reg`"] +#[doc = "CPACR (rw) register accessor: Coprocessor Access Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cpacr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cpacr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cpacr`] +module"] pub type CPACR = crate::Reg; #[doc = "Coprocessor Access Control Register"] pub mod cpacr; -#[doc = "MPU_TYPE (r) register accessor: an alias for `Reg`"] +#[doc = "MPU_TYPE (r) register accessor: MPU Type Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_type::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_type`] +module"] pub type MPU_TYPE = crate::Reg; #[doc = "MPU Type Register"] pub mod mpu_type; -#[doc = "MPU_CTRL (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_CTRL (rw) register accessor: MPU Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_ctrl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_ctrl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_ctrl`] +module"] pub type MPU_CTRL = crate::Reg; #[doc = "MPU Control Register"] pub mod mpu_ctrl; -#[doc = "MPU_RNR (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RNR (rw) register accessor: MPU Region Number Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rnr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rnr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rnr`] +module"] pub type MPU_RNR = crate::Reg; #[doc = "MPU Region Number Register"] pub mod mpu_rnr; -#[doc = "MPU_RBAR (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RBAR (rw) register accessor: MPU Region Base Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rbar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rbar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rbar`] +module"] pub type MPU_RBAR = crate::Reg; #[doc = "MPU Region Base Address Register"] pub mod mpu_rbar; -#[doc = "MPU_RASR (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RASR (rw) register accessor: MPU Region Attribute and Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rasr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rasr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rasr`] +module"] pub type MPU_RASR = crate::Reg; #[doc = "MPU Region Attribute and Size Register"] pub mod mpu_rasr; -#[doc = "MPU_RBAR_A1 (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RBAR_A1 (rw) register accessor: MPU Region Base Address Register A1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rbar_a1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rbar_a1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rbar_a1`] +module"] pub type MPU_RBAR_A1 = crate::Reg; #[doc = "MPU Region Base Address Register A1"] pub mod mpu_rbar_a1; -#[doc = "MPU_RASR_A1 (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RASR_A1 (rw) register accessor: MPU Region Attribute and Size Register A1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rasr_a1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rasr_a1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rasr_a1`] +module"] pub type MPU_RASR_A1 = crate::Reg; #[doc = "MPU Region Attribute and Size Register A1"] pub mod mpu_rasr_a1; -#[doc = "MPU_RBAR_A2 (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RBAR_A2 (rw) register accessor: MPU Region Base Address Register A2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rbar_a2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rbar_a2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rbar_a2`] +module"] pub type MPU_RBAR_A2 = crate::Reg; #[doc = "MPU Region Base Address Register A2"] pub mod mpu_rbar_a2; -#[doc = "MPU_RASR_A2 (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RASR_A2 (rw) register accessor: MPU Region Attribute and Size Register A2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rasr_a2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rasr_a2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rasr_a2`] +module"] pub type MPU_RASR_A2 = crate::Reg; #[doc = "MPU Region Attribute and Size Register A2"] pub mod mpu_rasr_a2; -#[doc = "MPU_RBAR_A3 (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RBAR_A3 (rw) register accessor: MPU Region Base Address Register A3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rbar_a3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rbar_a3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rbar_a3`] +module"] pub type MPU_RBAR_A3 = crate::Reg; #[doc = "MPU Region Base Address Register A3"] pub mod mpu_rbar_a3; -#[doc = "MPU_RASR_A3 (rw) register accessor: an alias for `Reg`"] +#[doc = "MPU_RASR_A3 (rw) register accessor: MPU Region Attribute and Size Register A3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rasr_a3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rasr_a3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mpu_rasr_a3`] +module"] pub type MPU_RASR_A3 = crate::Reg; #[doc = "MPU Region Attribute and Size Register A3"] pub mod mpu_rasr_a3; -#[doc = "STIR (w) register accessor: an alias for `Reg`"] +#[doc = "STIR (w) register accessor: Software Trigger Interrupt Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`stir::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@stir`] +module"] pub type STIR = crate::Reg; #[doc = "Software Trigger Interrupt Register"] pub mod stir; -#[doc = "FPCCR (rw) register accessor: an alias for `Reg`"] +#[doc = "FPCCR (rw) register accessor: Floating-point Context Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpccr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpccr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fpccr`] +module"] pub type FPCCR = crate::Reg; #[doc = "Floating-point Context Control Register"] pub mod fpccr; -#[doc = "FPCAR (rw) register accessor: an alias for `Reg`"] +#[doc = "FPCAR (rw) register accessor: Floating-point Context Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpcar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpcar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fpcar`] +module"] pub type FPCAR = crate::Reg; #[doc = "Floating-point Context Address Register"] pub mod fpcar; -#[doc = "FPDSCR (rw) register accessor: an alias for `Reg`"] +#[doc = "FPDSCR (rw) register accessor: Floating-point Default Status Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpdscr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpdscr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fpdscr`] +module"] 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 fe38e9bb..dcccba2c 100644 --- a/src/ppb/actlr.rs +++ b/src/ppb/actlr.rs @@ -1,59 +1,27 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DISMCYCINT` reader - Disable load/store multiple"] -pub type DISMCYCINT_R = crate::BitReader; +pub type DISMCYCINT_R = crate::BitReader; #[doc = "Field `DISMCYCINT` writer - Disable load/store multiple"] -pub type DISMCYCINT_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACTLR_SPEC, bool, O>; +pub type DISMCYCINT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DISDEFWBUF` reader - Disable write buffer"] -pub type DISDEFWBUF_R = crate::BitReader; +pub type DISDEFWBUF_R = crate::BitReader; #[doc = "Field `DISDEFWBUF` writer - Disable write buffer"] -pub type DISDEFWBUF_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACTLR_SPEC, bool, O>; +pub type DISDEFWBUF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DISFOLD` reader - Disable IT folding"] -pub type DISFOLD_R = crate::BitReader; +pub type DISFOLD_R = crate::BitReader; #[doc = "Field `DISFOLD` writer - Disable IT folding"] -pub type DISFOLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACTLR_SPEC, bool, O>; +pub type DISFOLD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DISFPCA` reader - Disable FPCA update"] -pub type DISFPCA_R = crate::BitReader; +pub type DISFPCA_R = crate::BitReader; #[doc = "Field `DISFPCA` writer - Disable FPCA update"] -pub type DISFPCA_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACTLR_SPEC, bool, O>; +pub type DISFPCA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DISOOFP` reader - Disable out of order FP execution"] -pub type DISOOFP_R = crate::BitReader; +pub type DISOOFP_R = crate::BitReader; #[doc = "Field `DISOOFP` writer - Disable out of order FP execution"] -pub type DISOOFP_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACTLR_SPEC, bool, O>; +pub type DISOOFP_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Disable load/store multiple"] #[inline(always)] @@ -85,52 +53,53 @@ impl W { #[doc = "Bit 0 - Disable load/store multiple"] #[inline(always)] #[must_use] - pub fn dismcycint(&mut self) -> DISMCYCINT_W<0> { - DISMCYCINT_W::new(self) + pub fn dismcycint(&mut self) -> DISMCYCINT_W { + DISMCYCINT_W::new(self, 0) } #[doc = "Bit 1 - Disable write buffer"] #[inline(always)] #[must_use] - pub fn disdefwbuf(&mut self) -> DISDEFWBUF_W<1> { - DISDEFWBUF_W::new(self) + pub fn disdefwbuf(&mut self) -> DISDEFWBUF_W { + DISDEFWBUF_W::new(self, 1) } #[doc = "Bit 2 - Disable IT folding"] #[inline(always)] #[must_use] - pub fn disfold(&mut self) -> DISFOLD_W<2> { - DISFOLD_W::new(self) + pub fn disfold(&mut self) -> DISFOLD_W { + DISFOLD_W::new(self, 2) } #[doc = "Bit 8 - Disable FPCA update"] #[inline(always)] #[must_use] - pub fn disfpca(&mut self) -> DISFPCA_W<8> { - DISFPCA_W::new(self) + pub fn disfpca(&mut self) -> DISFPCA_W { + DISFPCA_W::new(self, 8) } #[doc = "Bit 9 - Disable out of order FP execution"] #[inline(always)] #[must_use] - pub fn disoofp(&mut self) -> DISOOFP_W<9> { - DISOOFP_W::new(self) + pub fn disoofp(&mut self) -> DISOOFP_W { + DISOOFP_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Auxiliary Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`actlr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`actlr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`actlr::R`](R) reader structure"] +impl crate::Readable for ACTLR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`actlr::W`](W) writer structure"] impl crate::Writable for ACTLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/afsr.rs b/src/ppb/afsr.rs index 87ef5ebd..b930ac6d 100644 --- a/src/ppb/afsr.rs +++ b/src/ppb/afsr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VALUE` reader - Reserved"] -pub type VALUE_R = crate::FieldReader; +pub type VALUE_R = crate::FieldReader; #[doc = "Field `VALUE` writer - Reserved"] -pub type VALUE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, AFSR_SPEC, u32, u32, 32, O>; +pub type VALUE_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Reserved"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Reserved"] #[inline(always)] #[must_use] - pub fn value(&mut self) -> VALUE_W<0> { - VALUE_W::new(self) + pub fn value(&mut self) -> VALUE_W { + VALUE_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Auxiliary Fault Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`afsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`afsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`afsr::R`](R) reader structure"] +impl crate::Readable for AFSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`afsr::W`](W) writer structure"] impl crate::Writable for AFSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/aircr.rs b/src/ppb/aircr.rs index ff7a5d61..3f132033 100644 --- a/src/ppb/aircr.rs +++ b/src/ppb/aircr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VECTRESET` writer - Reserved for Debug use."] -pub type VECTRESET_W<'a, const O: u8> = crate::BitWriter<'a, u32, AIRCR_SPEC, bool, O>; +pub type VECTRESET_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `VECTCLRACTIVE` writer - Reserved for Debug use."] -pub type VECTCLRACTIVE_W<'a, const O: u8> = crate::BitWriter<'a, u32, AIRCR_SPEC, bool, O>; +pub type VECTCLRACTIVE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "System reset request\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum SYSRESETREQ_AW { @@ -53,23 +21,26 @@ impl From for bool { } } #[doc = "Field `SYSRESETREQ` writer - System reset request"] -pub type SYSRESETREQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, AIRCR_SPEC, SYSRESETREQ_AW, O>; -impl<'a, const O: u8> SYSRESETREQ_W<'a, O> { +pub type SYSRESETREQ_W<'a, REG> = crate::BitWriter<'a, REG, SYSRESETREQ_AW>; +impl<'a, REG> SYSRESETREQ_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no system reset request"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SYSRESETREQ_AW::VALUE1) } #[doc = "asserts a signal to the outer system that requests a reset."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SYSRESETREQ_AW::VALUE2) } } #[doc = "Field `PRIGROUP` reader - Interrupt priority grouping field"] -pub type PRIGROUP_R = crate::FieldReader; +pub type PRIGROUP_R = crate::FieldReader; #[doc = "Field `PRIGROUP` writer - Interrupt priority grouping field"] -pub type PRIGROUP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, AIRCR_SPEC, u8, u8, 3, O>; +pub type PRIGROUP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `ENDIANNESS` reader - Data endianness bit"] pub type ENDIANNESS_R = crate::BitReader; #[doc = "Data endianness bit\n\nValue on reset: 0"] @@ -89,27 +60,27 @@ impl From for bool { impl ENDIANNESS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENDIANNESS_A { + pub const fn variant(&self) -> ENDIANNESS_A { match self.bits { false => ENDIANNESS_A::VALUE1, true => ENDIANNESS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Little-endian"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENDIANNESS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Big-endian."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENDIANNESS_A::VALUE2 } } #[doc = "Field `VECTKEY` reader - Register key"] -pub type VECTKEY_R = crate::FieldReader; +pub type VECTKEY_R = crate::FieldReader; #[doc = "Field `VECTKEY` writer - Register key"] -pub type VECTKEY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, AIRCR_SPEC, u16, u16, 16, O>; +pub type VECTKEY_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 8:10 - Interrupt priority grouping field"] #[inline(always)] @@ -131,52 +102,53 @@ impl W { #[doc = "Bit 0 - Reserved for Debug use."] #[inline(always)] #[must_use] - pub fn vectreset(&mut self) -> VECTRESET_W<0> { - VECTRESET_W::new(self) + pub fn vectreset(&mut self) -> VECTRESET_W { + VECTRESET_W::new(self, 0) } #[doc = "Bit 1 - Reserved for Debug use."] #[inline(always)] #[must_use] - pub fn vectclractive(&mut self) -> VECTCLRACTIVE_W<1> { - VECTCLRACTIVE_W::new(self) + pub fn vectclractive(&mut self) -> VECTCLRACTIVE_W { + VECTCLRACTIVE_W::new(self, 1) } #[doc = "Bit 2 - System reset request"] #[inline(always)] #[must_use] - pub fn sysresetreq(&mut self) -> SYSRESETREQ_W<2> { - SYSRESETREQ_W::new(self) + pub fn sysresetreq(&mut self) -> SYSRESETREQ_W { + SYSRESETREQ_W::new(self, 2) } #[doc = "Bits 8:10 - Interrupt priority grouping field"] #[inline(always)] #[must_use] - pub fn prigroup(&mut self) -> PRIGROUP_W<8> { - PRIGROUP_W::new(self) + pub fn prigroup(&mut self) -> PRIGROUP_W { + PRIGROUP_W::new(self, 8) } #[doc = "Bits 16:31 - Register key"] #[inline(always)] #[must_use] - pub fn vectkey(&mut self) -> VECTKEY_W<16> { - VECTKEY_W::new(self) + pub fn vectkey(&mut self) -> VECTKEY_W { + VECTKEY_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Application Interrupt and Reset Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`aircr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`aircr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`aircr::R`](R) reader structure"] +impl crate::Readable for AIRCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`aircr::W`](W) writer structure"] impl crate::Writable for AIRCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/bfar.rs b/src/ppb/bfar.rs index e8254a0f..9ac8d3eb 100644 --- a/src/ppb/bfar.rs +++ b/src/ppb/bfar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ADDRESS` reader - Address causing the fault"] -pub type ADDRESS_R = crate::FieldReader; +pub type ADDRESS_R = crate::FieldReader; #[doc = "Field `ADDRESS` writer - Address causing the fault"] -pub type ADDRESS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFAR_SPEC, u32, u32, 32, O>; +pub type ADDRESS_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Address causing the fault"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Address causing the fault"] #[inline(always)] #[must_use] - pub fn address(&mut self) -> ADDRESS_W<0> { - ADDRESS_W::new(self) + pub fn address(&mut self) -> ADDRESS_W { + ADDRESS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "BusFault Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bfar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bfar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`bfar::R`](R) reader structure"] +impl crate::Readable for BFAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`bfar::W`](W) writer structure"] impl crate::Writable for BFAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/ccr.rs b/src/ppb/ccr.rs index 934e82df..c138bfbe 100644 --- a/src/ppb/ccr.rs +++ b/src/ppb/ccr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `NONBASETHRDENA` reader - Non Base Thread Mode Enable"] pub type NONBASETHRDENA_R = crate::BitReader; #[doc = "Non Base Thread Mode Enable\n\nValue on reset: 0"] @@ -54,35 +22,39 @@ impl From for bool { impl NONBASETHRDENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NONBASETHRDENA_A { + pub const fn variant(&self) -> NONBASETHRDENA_A { match self.bits { false => NONBASETHRDENA_A::VALUE1, true => NONBASETHRDENA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "processor can enter Thread mode only when no exception is active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NONBASETHRDENA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "processor can enter Thread mode from any level under the control of an EXC_RETURN value, see Exception returnException return occurs when the processor is in Handler mode and executes one of the following instructions to load the EXC_RETURN value into the PC:an LDM or POP instruction that loads the PCan LDR instruction with PC as the destinationa BX instruction using any register.EXC_RETURN is the value loaded into the LR on exception entry. The exception mechanism relies on this value to detect when the processor has completed an exception handler. The lowest five bits of this value provide information on the return stack and processor mode. shows the EXC_RETURN values with a description of the exception return behavior. All EXC_RETURN values have bits\\[31:5\\] +set to one. When this value is loaded into the PC it indicates to the processor that the exception is complete, and the processor initiates the appropriate exception return sequence.Exception return behaviorEXC_RETURN\\[31:0\\]Description 0xFFFFFFF1 Return to Handler mode, exception return uses non-floating-point state from the MSP and execution uses MSP after return. 0xFFFFFFF9 Return to Thread mode, exception return uses non-floating-point state from MSP and execution uses MSP after return. 0xFFFFFFFD Return to Thread mode, exception return uses non-floating-point state from the PSP and execution uses PSP after return. 0xFFFFFFE1 Return to Handler mode, exception return uses floating-point-state from MSP and execution uses MSP after return. 0xFFFFFFE9 Return to Thread mode, exception return uses floating-point state from MSP and execution uses MSP after return. 0xFFFFFFED Return to Thread mode, exception return uses floating-point state from PSP and execution uses PSP after return. ."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NONBASETHRDENA_A::VALUE2 } } #[doc = "Field `NONBASETHRDENA` writer - Non Base Thread Mode Enable"] -pub type NONBASETHRDENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, NONBASETHRDENA_A, O>; -impl<'a, const O: u8> NONBASETHRDENA_W<'a, O> { +pub type NONBASETHRDENA_W<'a, REG> = crate::BitWriter<'a, REG, NONBASETHRDENA_A>; +impl<'a, REG> NONBASETHRDENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "processor can enter Thread mode only when no exception is active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NONBASETHRDENA_A::VALUE1) } #[doc = "processor can enter Thread mode from any level under the control of an EXC_RETURN value, see Exception returnException return occurs when the processor is in Handler mode and executes one of the following instructions to load the EXC_RETURN value into the PC:an LDM or POP instruction that loads the PCan LDR instruction with PC as the destinationa BX instruction using any register.EXC_RETURN is the value loaded into the LR on exception entry. The exception mechanism relies on this value to detect when the processor has completed an exception handler. The lowest five bits of this value provide information on the return stack and processor mode. shows the EXC_RETURN values with a description of the exception return behavior. All EXC_RETURN values have bits\\[31:5\\] set to one. When this value is loaded into the PC it indicates to the processor that the exception is complete, and the processor initiates the appropriate exception return sequence.Exception return behaviorEXC_RETURN\\[31:0\\]Description 0xFFFFFFF1 Return to Handler mode, exception return uses non-floating-point state from the MSP and execution uses MSP after return. 0xFFFFFFF9 Return to Thread mode, exception return uses non-floating-point state from MSP and execution uses MSP after return. 0xFFFFFFFD Return to Thread mode, exception return uses non-floating-point state from the PSP and execution uses PSP after return. 0xFFFFFFE1 Return to Handler mode, exception return uses floating-point-state from MSP and execution uses MSP after return. 0xFFFFFFE9 Return to Thread mode, exception return uses floating-point state from MSP and execution uses MSP after return. 0xFFFFFFED Return to Thread mode, exception return uses floating-point state from PSP and execution uses PSP after return. ."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NONBASETHRDENA_A::VALUE2) } } @@ -105,34 +77,37 @@ impl From for bool { impl USERSETMPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USERSETMPEND_A { + pub const fn variant(&self) -> USERSETMPEND_A { match self.bits { false => USERSETMPEND_A::VALUE1, true => USERSETMPEND_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USERSETMPEND_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USERSETMPEND_A::VALUE2 } } #[doc = "Field `USERSETMPEND` writer - User Set Pending Enable"] -pub type USERSETMPEND_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, USERSETMPEND_A, O>; -impl<'a, const O: u8> USERSETMPEND_W<'a, O> { +pub type USERSETMPEND_W<'a, REG> = crate::BitWriter<'a, REG, USERSETMPEND_A>; +impl<'a, REG> USERSETMPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USERSETMPEND_A::VALUE1) } #[doc = "enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USERSETMPEND_A::VALUE2) } } @@ -155,34 +130,37 @@ impl From for bool { impl UNALIGN_TRP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UNALIGN_TRP_A { + pub const fn variant(&self) -> UNALIGN_TRP_A { match self.bits { false => UNALIGN_TRP_A::VALUE1, true => UNALIGN_TRP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "do not trap unaligned halfword and word accesses"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UNALIGN_TRP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "trap unaligned halfword and word accesses."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UNALIGN_TRP_A::VALUE2 } } #[doc = "Field `UNALIGN_TRP` writer - Unaligned Access Trap Enable"] -pub type UNALIGN_TRP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, UNALIGN_TRP_A, O>; -impl<'a, const O: u8> UNALIGN_TRP_W<'a, O> { +pub type UNALIGN_TRP_W<'a, REG> = crate::BitWriter<'a, REG, UNALIGN_TRP_A>; +impl<'a, REG> UNALIGN_TRP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "do not trap unaligned halfword and word accesses"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UNALIGN_TRP_A::VALUE1) } #[doc = "trap unaligned halfword and word accesses."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UNALIGN_TRP_A::VALUE2) } } @@ -205,34 +183,37 @@ impl From for bool { impl DIV_0_TRP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIV_0_TRP_A { + pub const fn variant(&self) -> DIV_0_TRP_A { match self.bits { false => DIV_0_TRP_A::VALUE1, true => DIV_0_TRP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "do not trap divide by 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIV_0_TRP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "trap divide by 0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIV_0_TRP_A::VALUE2 } } #[doc = "Field `DIV_0_TRP` writer - Divide by Zero Trap Enable"] -pub type DIV_0_TRP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, DIV_0_TRP_A, O>; -impl<'a, const O: u8> DIV_0_TRP_W<'a, O> { +pub type DIV_0_TRP_W<'a, REG> = crate::BitWriter<'a, REG, DIV_0_TRP_A>; +impl<'a, REG> DIV_0_TRP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "do not trap divide by 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIV_0_TRP_A::VALUE1) } #[doc = "trap divide by 0."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIV_0_TRP_A::VALUE2) } } @@ -255,34 +236,37 @@ impl From for bool { impl BFHFNMIGN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFHFNMIGN_A { + pub const fn variant(&self) -> BFHFNMIGN_A { match self.bits { false => BFHFNMIGN_A::VALUE1, true => BFHFNMIGN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "data bus faults caused by load and store instructions cause a lock-up"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFHFNMIGN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "handlers running at priority -1 and -2 ignore data bus faults caused by load and store instructions."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFHFNMIGN_A::VALUE2 } } #[doc = "Field `BFHFNMIGN` writer - Bus Fault Hard Fault and NMI Ignore"] -pub type BFHFNMIGN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, BFHFNMIGN_A, O>; -impl<'a, const O: u8> BFHFNMIGN_W<'a, O> { +pub type BFHFNMIGN_W<'a, REG> = crate::BitWriter<'a, REG, BFHFNMIGN_A>; +impl<'a, REG> BFHFNMIGN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "data bus faults caused by load and store instructions cause a lock-up"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFHFNMIGN_A::VALUE1) } #[doc = "handlers running at priority -1 and -2 ignore data bus faults caused by load and store instructions."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFHFNMIGN_A::VALUE2) } } @@ -305,34 +289,37 @@ impl From for bool { impl STKALIGN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STKALIGN_A { + pub const fn variant(&self) -> STKALIGN_A { match self.bits { false => STKALIGN_A::VALUE1, true => STKALIGN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "4-byte aligned"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STKALIGN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "8-byte aligned."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STKALIGN_A::VALUE2 } } #[doc = "Field `STKALIGN` writer - Stack Alignment"] -pub type STKALIGN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, STKALIGN_A, O>; -impl<'a, const O: u8> STKALIGN_W<'a, O> { +pub type STKALIGN_W<'a, REG> = crate::BitWriter<'a, REG, STKALIGN_A>; +impl<'a, REG> STKALIGN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "4-byte aligned"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STKALIGN_A::VALUE1) } #[doc = "8-byte aligned."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STKALIGN_A::VALUE2) } } @@ -372,58 +359,59 @@ impl W { #[doc = "Bit 0 - Non Base Thread Mode Enable"] #[inline(always)] #[must_use] - pub fn nonbasethrdena(&mut self) -> NONBASETHRDENA_W<0> { - NONBASETHRDENA_W::new(self) + pub fn nonbasethrdena(&mut self) -> NONBASETHRDENA_W { + NONBASETHRDENA_W::new(self, 0) } #[doc = "Bit 1 - User Set Pending Enable"] #[inline(always)] #[must_use] - pub fn usersetmpend(&mut self) -> USERSETMPEND_W<1> { - USERSETMPEND_W::new(self) + pub fn usersetmpend(&mut self) -> USERSETMPEND_W { + USERSETMPEND_W::new(self, 1) } #[doc = "Bit 3 - Unaligned Access Trap Enable"] #[inline(always)] #[must_use] - pub fn unalign_trp(&mut self) -> UNALIGN_TRP_W<3> { - UNALIGN_TRP_W::new(self) + pub fn unalign_trp(&mut self) -> UNALIGN_TRP_W { + UNALIGN_TRP_W::new(self, 3) } #[doc = "Bit 4 - Divide by Zero Trap Enable"] #[inline(always)] #[must_use] - pub fn div_0_trp(&mut self) -> DIV_0_TRP_W<4> { - DIV_0_TRP_W::new(self) + pub fn div_0_trp(&mut self) -> DIV_0_TRP_W { + DIV_0_TRP_W::new(self, 4) } #[doc = "Bit 8 - Bus Fault Hard Fault and NMI Ignore"] #[inline(always)] #[must_use] - pub fn bfhfnmign(&mut self) -> BFHFNMIGN_W<8> { - BFHFNMIGN_W::new(self) + pub fn bfhfnmign(&mut self) -> BFHFNMIGN_W { + BFHFNMIGN_W::new(self, 8) } #[doc = "Bit 9 - Stack Alignment"] #[inline(always)] #[must_use] - pub fn stkalign(&mut self) -> STKALIGN_W<9> { - STKALIGN_W::new(self) + pub fn stkalign(&mut self) -> STKALIGN_W { + STKALIGN_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Configuration and Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ccr::R`](R) reader structure"] +impl crate::Readable for CCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ccr::W`](W) writer structure"] impl crate::Writable for CCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/cfsr.rs b/src/ppb/cfsr.rs index 96ca9e4a..71e69531 100644 --- a/src/ppb/cfsr.rs +++ b/src/ppb/cfsr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `IACCVIOL` reader - Instruction access violation flag"] pub type IACCVIOL_R = crate::BitReader; #[doc = "Instruction access violation flag\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl IACCVIOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IACCVIOL_A { + pub const fn variant(&self) -> IACCVIOL_A { match self.bits { false => IACCVIOL_A::VALUE1, true => IACCVIOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no instruction access violation fault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IACCVIOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor attempted an instruction fetch from a location that does not permit execution."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IACCVIOL_A::VALUE2 } } #[doc = "Field `IACCVIOL` writer - Instruction access violation flag"] -pub type IACCVIOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, IACCVIOL_A, O>; -impl<'a, const O: u8> IACCVIOL_W<'a, O> { +pub type IACCVIOL_W<'a, REG> = crate::BitWriter<'a, REG, IACCVIOL_A>; +impl<'a, REG> IACCVIOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no instruction access violation fault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IACCVIOL_A::VALUE1) } #[doc = "the processor attempted an instruction fetch from a location that does not permit execution."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IACCVIOL_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl DACCVIOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DACCVIOL_A { + pub const fn variant(&self) -> DACCVIOL_A { match self.bits { false => DACCVIOL_A::VALUE1, true => DACCVIOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no data access violation fault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DACCVIOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor attempted a load or store at a location that does not permit the operation."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DACCVIOL_A::VALUE2 } } #[doc = "Field `DACCVIOL` writer - Data access violation flag"] -pub type DACCVIOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, DACCVIOL_A, O>; -impl<'a, const O: u8> DACCVIOL_W<'a, O> { +pub type DACCVIOL_W<'a, REG> = crate::BitWriter<'a, REG, DACCVIOL_A>; +impl<'a, REG> DACCVIOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no data access violation fault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DACCVIOL_A::VALUE1) } #[doc = "the processor attempted a load or store at a location that does not permit the operation."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DACCVIOL_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl MUNSTKERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MUNSTKERR_A { + pub const fn variant(&self) -> MUNSTKERR_A { match self.bits { false => MUNSTKERR_A::VALUE1, true => MUNSTKERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no unstacking fault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MUNSTKERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "unstack for an exception return has caused one or more access violations."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MUNSTKERR_A::VALUE2 } } #[doc = "Field `MUNSTKERR` writer - MemManage fault on unstacking for a return from exception"] -pub type MUNSTKERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, MUNSTKERR_A, O>; -impl<'a, const O: u8> MUNSTKERR_W<'a, O> { +pub type MUNSTKERR_W<'a, REG> = crate::BitWriter<'a, REG, MUNSTKERR_A>; +impl<'a, REG> MUNSTKERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no unstacking fault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MUNSTKERR_A::VALUE1) } #[doc = "unstack for an exception return has caused one or more access violations."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MUNSTKERR_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl MSTKERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSTKERR_A { + pub const fn variant(&self) -> MSTKERR_A { match self.bits { false => MSTKERR_A::VALUE1, true => MSTKERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no stacking fault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSTKERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "stacking for an exception entry has caused one or more access violations."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSTKERR_A::VALUE2 } } #[doc = "Field `MSTKERR` writer - MemManage fault on stacking for exception entry"] -pub type MSTKERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, MSTKERR_A, O>; -impl<'a, const O: u8> MSTKERR_W<'a, O> { +pub type MSTKERR_W<'a, REG> = crate::BitWriter<'a, REG, MSTKERR_A>; +impl<'a, REG> MSTKERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no stacking fault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSTKERR_A::VALUE1) } #[doc = "stacking for an exception entry has caused one or more access violations."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSTKERR_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl MLSPERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MLSPERR_A { + pub const fn variant(&self) -> MLSPERR_A { match self.bits { false => MLSPERR_A::VALUE1, true => MLSPERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No MemManage fault occurred during floating-point lazy state preservation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MLSPERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A MemManage fault occurred during floating-point lazy state preservation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MLSPERR_A::VALUE2 } } #[doc = "Field `MLSPERR` writer - MemManage fault during floating point lazy state preservation"] -pub type MLSPERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, MLSPERR_A, O>; -impl<'a, const O: u8> MLSPERR_W<'a, O> { +pub type MLSPERR_W<'a, REG> = crate::BitWriter<'a, REG, MLSPERR_A>; +impl<'a, REG> MLSPERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No MemManage fault occurred during floating-point lazy state preservation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MLSPERR_A::VALUE1) } #[doc = "A MemManage fault occurred during floating-point lazy state preservation"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MLSPERR_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl MMARVALID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MMARVALID_A { + pub const fn variant(&self) -> MMARVALID_A { match self.bits { false => MMARVALID_A::VALUE1, true => MMARVALID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "value in MMAR is not a valid fault address"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MMARVALID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "MMAR holds a valid fault address."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MMARVALID_A::VALUE2 } } #[doc = "Field `MMARVALID` writer - MemManage Fault Address Register (MMFAR) valid flag"] -pub type MMARVALID_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, MMARVALID_A, O>; -impl<'a, const O: u8> MMARVALID_W<'a, O> { +pub type MMARVALID_W<'a, REG> = crate::BitWriter<'a, REG, MMARVALID_A>; +impl<'a, REG> MMARVALID_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "value in MMAR is not a valid fault address"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MMARVALID_A::VALUE1) } #[doc = "MMAR holds a valid fault address."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MMARVALID_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl IBUSERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IBUSERR_A { + pub const fn variant(&self) -> IBUSERR_A { match self.bits { false => IBUSERR_A::VALUE1, true => IBUSERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no instruction bus error"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IBUSERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "instruction bus error."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IBUSERR_A::VALUE2 } } #[doc = "Field `IBUSERR` writer - Instruction bus error"] -pub type IBUSERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, IBUSERR_A, O>; -impl<'a, const O: u8> IBUSERR_W<'a, O> { +pub type IBUSERR_W<'a, REG> = crate::BitWriter<'a, REG, IBUSERR_A>; +impl<'a, REG> IBUSERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no instruction bus error"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IBUSERR_A::VALUE1) } #[doc = "instruction bus error."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IBUSERR_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PRECISERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRECISERR_A { + pub const fn variant(&self) -> PRECISERR_A { match self.bits { false => PRECISERR_A::VALUE1, true => PRECISERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no precise data bus error"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRECISERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "a data bus error has occurred, and the PC value stacked for the exception return points to the instruction that caused the fault."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRECISERR_A::VALUE2 } } #[doc = "Field `PRECISERR` writer - Precise data bus error"] -pub type PRECISERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, PRECISERR_A, O>; -impl<'a, const O: u8> PRECISERR_W<'a, O> { +pub type PRECISERR_W<'a, REG> = crate::BitWriter<'a, REG, PRECISERR_A>; +impl<'a, REG> PRECISERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no precise data bus error"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRECISERR_A::VALUE1) } #[doc = "a data bus error has occurred, and the PC value stacked for the exception return points to the instruction that caused the fault."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRECISERR_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl IMPRECISERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IMPRECISERR_A { + pub const fn variant(&self) -> IMPRECISERR_A { match self.bits { false => IMPRECISERR_A::VALUE1, true => IMPRECISERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no imprecise data bus error"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IMPRECISERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "a data bus error has occurred, but the return address in the stack frame is not related to the instruction that caused the error."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IMPRECISERR_A::VALUE2 } } #[doc = "Field `IMPRECISERR` writer - Imprecise data bus error"] -pub type IMPRECISERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, IMPRECISERR_A, O>; -impl<'a, const O: u8> IMPRECISERR_W<'a, O> { +pub type IMPRECISERR_W<'a, REG> = crate::BitWriter<'a, REG, IMPRECISERR_A>; +impl<'a, REG> IMPRECISERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no imprecise data bus error"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IMPRECISERR_A::VALUE1) } #[doc = "a data bus error has occurred, but the return address in the stack frame is not related to the instruction that caused the error."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IMPRECISERR_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl UNSTKERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UNSTKERR_A { + pub const fn variant(&self) -> UNSTKERR_A { match self.bits { false => UNSTKERR_A::VALUE1, true => UNSTKERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no unstacking fault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UNSTKERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "stacking for an exception entry has caused one or more BusFaults."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UNSTKERR_A::VALUE2 } } #[doc = "Field `UNSTKERR` writer - BusFault on unstacking for a return from exception"] -pub type UNSTKERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, UNSTKERR_A, O>; -impl<'a, const O: u8> UNSTKERR_W<'a, O> { +pub type UNSTKERR_W<'a, REG> = crate::BitWriter<'a, REG, UNSTKERR_A>; +impl<'a, REG> UNSTKERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no unstacking fault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UNSTKERR_A::VALUE1) } #[doc = "stacking for an exception entry has caused one or more BusFaults."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UNSTKERR_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl STKERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STKERR_A { + pub const fn variant(&self) -> STKERR_A { match self.bits { false => STKERR_A::VALUE1, true => STKERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no stacking fault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STKERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "stacking for an exception entry has caused one or more BusFaults."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STKERR_A::VALUE2 } } #[doc = "Field `STKERR` writer - BusFault on stacking for exception entry"] -pub type STKERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, STKERR_A, O>; -impl<'a, const O: u8> STKERR_W<'a, O> { +pub type STKERR_W<'a, REG> = crate::BitWriter<'a, REG, STKERR_A>; +impl<'a, REG> STKERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no stacking fault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STKERR_A::VALUE1) } #[doc = "stacking for an exception entry has caused one or more BusFaults."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STKERR_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl LSPERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LSPERR_A { + pub const fn variant(&self) -> LSPERR_A { match self.bits { false => LSPERR_A::VALUE1, true => LSPERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No bus fault occurred during floating-point lazy state preservation."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LSPERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A bus fault occurred during floating-point lazy state preservation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LSPERR_A::VALUE2 } } #[doc = "Field `LSPERR` writer - BusFault during floating point lazy state preservation"] -pub type LSPERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, LSPERR_A, O>; -impl<'a, const O: u8> LSPERR_W<'a, O> { +pub type LSPERR_W<'a, REG> = crate::BitWriter<'a, REG, LSPERR_A>; +impl<'a, REG> LSPERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No bus fault occurred during floating-point lazy state preservation."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LSPERR_A::VALUE1) } #[doc = "A bus fault occurred during floating-point lazy state preservation"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LSPERR_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl BFARVALID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFARVALID_A { + pub const fn variant(&self) -> BFARVALID_A { match self.bits { false => BFARVALID_A::VALUE1, true => BFARVALID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "value in BFAR is not a valid fault address"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFARVALID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "BFAR holds a valid fault address."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFARVALID_A::VALUE2 } } #[doc = "Field `BFARVALID` writer - BusFault Address Register (BFAR) valid flag"] -pub type BFARVALID_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, BFARVALID_A, O>; -impl<'a, const O: u8> BFARVALID_W<'a, O> { +pub type BFARVALID_W<'a, REG> = crate::BitWriter<'a, REG, BFARVALID_A>; +impl<'a, REG> BFARVALID_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "value in BFAR is not a valid fault address"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFARVALID_A::VALUE1) } #[doc = "BFAR holds a valid fault address."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFARVALID_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl UNDEFINSTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UNDEFINSTR_A { + pub const fn variant(&self) -> UNDEFINSTR_A { match self.bits { false => UNDEFINSTR_A::VALUE1, true => UNDEFINSTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no undefined instruction UsageFault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UNDEFINSTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor has attempted to execute an undefined instruction."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UNDEFINSTR_A::VALUE2 } } #[doc = "Field `UNDEFINSTR` writer - Undefined instruction UsageFault"] -pub type UNDEFINSTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, UNDEFINSTR_A, O>; -impl<'a, const O: u8> UNDEFINSTR_W<'a, O> { +pub type UNDEFINSTR_W<'a, REG> = crate::BitWriter<'a, REG, UNDEFINSTR_A>; +impl<'a, REG> UNDEFINSTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no undefined instruction UsageFault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UNDEFINSTR_A::VALUE1) } #[doc = "the processor has attempted to execute an undefined instruction."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UNDEFINSTR_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl INVSTATE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INVSTATE_A { + pub const fn variant(&self) -> INVSTATE_A { match self.bits { false => INVSTATE_A::VALUE1, true => INVSTATE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no invalid state UsageFault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INVSTATE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor has attempted to execute an instruction that makes illegal use of the EPSR."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INVSTATE_A::VALUE2 } } #[doc = "Field `INVSTATE` writer - Invalid state UsageFault"] -pub type INVSTATE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, INVSTATE_A, O>; -impl<'a, const O: u8> INVSTATE_W<'a, O> { +pub type INVSTATE_W<'a, REG> = crate::BitWriter<'a, REG, INVSTATE_A>; +impl<'a, REG> INVSTATE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no invalid state UsageFault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INVSTATE_A::VALUE1) } #[doc = "the processor has attempted to execute an instruction that makes illegal use of the EPSR."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INVSTATE_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl INVPC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INVPC_A { + pub const fn variant(&self) -> INVPC_A { match self.bits { false => INVPC_A::VALUE1, true => INVPC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no invalid PC load UsageFault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INVPC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor has attempted an illegal load of EXC_RETURN to the PC, as a result of an invalid context, or an invalid EXC_RETURN value."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INVPC_A::VALUE2 } } #[doc = "Field `INVPC` writer - Invalid PC load UsageFault"] -pub type INVPC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, INVPC_A, O>; -impl<'a, const O: u8> INVPC_W<'a, O> { +pub type INVPC_W<'a, REG> = crate::BitWriter<'a, REG, INVPC_A>; +impl<'a, REG> INVPC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no invalid PC load UsageFault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INVPC_A::VALUE1) } #[doc = "the processor has attempted an illegal load of EXC_RETURN to the PC, as a result of an invalid context, or an invalid EXC_RETURN value."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INVPC_A::VALUE2) } } @@ -853,34 +869,37 @@ impl From for bool { impl NOCP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NOCP_A { + pub const fn variant(&self) -> NOCP_A { match self.bits { false => NOCP_A::VALUE1, true => NOCP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no UsageFault caused by attempting to access a coprocessor"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NOCP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor has attempted to access a coprocessor."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NOCP_A::VALUE2 } } #[doc = "Field `NOCP` writer - No coprocessor UsageFault"] -pub type NOCP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, NOCP_A, O>; -impl<'a, const O: u8> NOCP_W<'a, O> { +pub type NOCP_W<'a, REG> = crate::BitWriter<'a, REG, NOCP_A>; +impl<'a, REG> NOCP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no UsageFault caused by attempting to access a coprocessor"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NOCP_A::VALUE1) } #[doc = "the processor has attempted to access a coprocessor."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NOCP_A::VALUE2) } } @@ -903,34 +922,37 @@ impl From for bool { impl UNALIGNED_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UNALIGNED_A { + pub const fn variant(&self) -> UNALIGNED_A { match self.bits { false => UNALIGNED_A::VALUE1, true => UNALIGNED_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no unaligned access fault, or unaligned access trapping not enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UNALIGNED_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor has made an unaligned memory access."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UNALIGNED_A::VALUE2 } } #[doc = "Field `UNALIGNED` writer - Unaligned access UsageFault"] -pub type UNALIGNED_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, UNALIGNED_A, O>; -impl<'a, const O: u8> UNALIGNED_W<'a, O> { +pub type UNALIGNED_W<'a, REG> = crate::BitWriter<'a, REG, UNALIGNED_A>; +impl<'a, REG> UNALIGNED_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no unaligned access fault, or unaligned access trapping not enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UNALIGNED_A::VALUE1) } #[doc = "the processor has made an unaligned memory access."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UNALIGNED_A::VALUE2) } } @@ -953,34 +975,37 @@ impl From for bool { impl DIVBYZERO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIVBYZERO_A { + pub const fn variant(&self) -> DIVBYZERO_A { match self.bits { false => DIVBYZERO_A::VALUE1, true => DIVBYZERO_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no divide by zero fault, or divide by zero trapping not enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIVBYZERO_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor has executed an SDIV or UDIV instruction with a divisor of 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIVBYZERO_A::VALUE2 } } #[doc = "Field `DIVBYZERO` writer - Divide by zero UsageFault"] -pub type DIVBYZERO_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFSR_SPEC, DIVBYZERO_A, O>; -impl<'a, const O: u8> DIVBYZERO_W<'a, O> { +pub type DIVBYZERO_W<'a, REG> = crate::BitWriter<'a, REG, DIVBYZERO_A>; +impl<'a, REG> DIVBYZERO_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no divide by zero fault, or divide by zero trapping not enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIVBYZERO_A::VALUE1) } #[doc = "the processor has executed an SDIV or UDIV instruction with a divisor of 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIVBYZERO_A::VALUE2) } } @@ -1085,136 +1110,137 @@ impl W { #[doc = "Bit 0 - Instruction access violation flag"] #[inline(always)] #[must_use] - pub fn iaccviol(&mut self) -> IACCVIOL_W<0> { - IACCVIOL_W::new(self) + pub fn iaccviol(&mut self) -> IACCVIOL_W { + IACCVIOL_W::new(self, 0) } #[doc = "Bit 1 - Data access violation flag"] #[inline(always)] #[must_use] - pub fn daccviol(&mut self) -> DACCVIOL_W<1> { - DACCVIOL_W::new(self) + pub fn daccviol(&mut self) -> DACCVIOL_W { + DACCVIOL_W::new(self, 1) } #[doc = "Bit 3 - MemManage fault on unstacking for a return from exception"] #[inline(always)] #[must_use] - pub fn munstkerr(&mut self) -> MUNSTKERR_W<3> { - MUNSTKERR_W::new(self) + pub fn munstkerr(&mut self) -> MUNSTKERR_W { + MUNSTKERR_W::new(self, 3) } #[doc = "Bit 4 - MemManage fault on stacking for exception entry"] #[inline(always)] #[must_use] - pub fn mstkerr(&mut self) -> MSTKERR_W<4> { - MSTKERR_W::new(self) + pub fn mstkerr(&mut self) -> MSTKERR_W { + MSTKERR_W::new(self, 4) } #[doc = "Bit 5 - MemManage fault during floating point lazy state preservation"] #[inline(always)] #[must_use] - pub fn mlsperr(&mut self) -> MLSPERR_W<5> { - MLSPERR_W::new(self) + pub fn mlsperr(&mut self) -> MLSPERR_W { + MLSPERR_W::new(self, 5) } #[doc = "Bit 7 - MemManage Fault Address Register (MMFAR) valid flag"] #[inline(always)] #[must_use] - pub fn mmarvalid(&mut self) -> MMARVALID_W<7> { - MMARVALID_W::new(self) + pub fn mmarvalid(&mut self) -> MMARVALID_W { + MMARVALID_W::new(self, 7) } #[doc = "Bit 8 - Instruction bus error"] #[inline(always)] #[must_use] - pub fn ibuserr(&mut self) -> IBUSERR_W<8> { - IBUSERR_W::new(self) + pub fn ibuserr(&mut self) -> IBUSERR_W { + IBUSERR_W::new(self, 8) } #[doc = "Bit 9 - Precise data bus error"] #[inline(always)] #[must_use] - pub fn preciserr(&mut self) -> PRECISERR_W<9> { - PRECISERR_W::new(self) + pub fn preciserr(&mut self) -> PRECISERR_W { + PRECISERR_W::new(self, 9) } #[doc = "Bit 10 - Imprecise data bus error"] #[inline(always)] #[must_use] - pub fn impreciserr(&mut self) -> IMPRECISERR_W<10> { - IMPRECISERR_W::new(self) + pub fn impreciserr(&mut self) -> IMPRECISERR_W { + IMPRECISERR_W::new(self, 10) } #[doc = "Bit 11 - BusFault on unstacking for a return from exception"] #[inline(always)] #[must_use] - pub fn unstkerr(&mut self) -> UNSTKERR_W<11> { - UNSTKERR_W::new(self) + pub fn unstkerr(&mut self) -> UNSTKERR_W { + UNSTKERR_W::new(self, 11) } #[doc = "Bit 12 - BusFault on stacking for exception entry"] #[inline(always)] #[must_use] - pub fn stkerr(&mut self) -> STKERR_W<12> { - STKERR_W::new(self) + pub fn stkerr(&mut self) -> STKERR_W { + STKERR_W::new(self, 12) } #[doc = "Bit 13 - BusFault during floating point lazy state preservation"] #[inline(always)] #[must_use] - pub fn lsperr(&mut self) -> LSPERR_W<13> { - LSPERR_W::new(self) + pub fn lsperr(&mut self) -> LSPERR_W { + LSPERR_W::new(self, 13) } #[doc = "Bit 15 - BusFault Address Register (BFAR) valid flag"] #[inline(always)] #[must_use] - pub fn bfarvalid(&mut self) -> BFARVALID_W<15> { - BFARVALID_W::new(self) + pub fn bfarvalid(&mut self) -> BFARVALID_W { + BFARVALID_W::new(self, 15) } #[doc = "Bit 16 - Undefined instruction UsageFault"] #[inline(always)] #[must_use] - pub fn undefinstr(&mut self) -> UNDEFINSTR_W<16> { - UNDEFINSTR_W::new(self) + pub fn undefinstr(&mut self) -> UNDEFINSTR_W { + UNDEFINSTR_W::new(self, 16) } #[doc = "Bit 17 - Invalid state UsageFault"] #[inline(always)] #[must_use] - pub fn invstate(&mut self) -> INVSTATE_W<17> { - INVSTATE_W::new(self) + pub fn invstate(&mut self) -> INVSTATE_W { + INVSTATE_W::new(self, 17) } #[doc = "Bit 18 - Invalid PC load UsageFault"] #[inline(always)] #[must_use] - pub fn invpc(&mut self) -> INVPC_W<18> { - INVPC_W::new(self) + pub fn invpc(&mut self) -> INVPC_W { + INVPC_W::new(self, 18) } #[doc = "Bit 19 - No coprocessor UsageFault"] #[inline(always)] #[must_use] - pub fn nocp(&mut self) -> NOCP_W<19> { - NOCP_W::new(self) + pub fn nocp(&mut self) -> NOCP_W { + NOCP_W::new(self, 19) } #[doc = "Bit 24 - Unaligned access UsageFault"] #[inline(always)] #[must_use] - pub fn unaligned(&mut self) -> UNALIGNED_W<24> { - UNALIGNED_W::new(self) + pub fn unaligned(&mut self) -> UNALIGNED_W { + UNALIGNED_W::new(self, 24) } #[doc = "Bit 25 - Divide by zero UsageFault"] #[inline(always)] #[must_use] - pub fn divbyzero(&mut self) -> DIVBYZERO_W<25> { - DIVBYZERO_W::new(self) + pub fn divbyzero(&mut self) -> DIVBYZERO_W { + DIVBYZERO_W::new(self, 25) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Configurable Fault Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cfsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cfsr::R`](R) reader structure"] +impl crate::Readable for CFSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cfsr::W`](W) writer structure"] impl crate::Writable for CFSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/cpacr.rs b/src/ppb/cpacr.rs index dc2a5458..d18bcf99 100644 --- a/src/ppb/cpacr.rs +++ b/src/ppb/cpacr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CP10` reader - Access privileges for coprocessor 10"] -pub type CP10_R = crate::FieldReader; +pub type CP10_R = crate::FieldReader; #[doc = "Access privileges for coprocessor 10\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CP10_A { + type Ux = u8; +} impl CP10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CP10_A::VALUE1), 1 => Some(CP10_A::VALUE2), @@ -64,43 +35,47 @@ impl CP10_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Access denied. Any attempted access generates a NOCP UsageFault."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CP10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Privileged access only. An unprivileged access generates a NOCP fault."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CP10_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Full access."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CP10_A::VALUE4 } } #[doc = "Field `CP10` writer - Access privileges for coprocessor 10"] -pub type CP10_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CPACR_SPEC, u8, CP10_A, 2, O>; -impl<'a, const O: u8> CP10_W<'a, O> { +pub type CP10_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CP10_A>; +impl<'a, REG> CP10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Access denied. Any attempted access generates a NOCP UsageFault."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CP10_A::VALUE1) } #[doc = "Privileged access only. An unprivileged access generates a NOCP fault."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CP10_A::VALUE2) } #[doc = "Full access."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CP10_A::VALUE4) } } #[doc = "Field `CP11` reader - Access privileges for coprocessor 11"] -pub type CP11_R = crate::FieldReader; +pub type CP11_R = crate::FieldReader; #[doc = "Access privileges for coprocessor 11\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CP11_A { + type Ux = u8; +} impl CP11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CP11_A::VALUE1), 1 => Some(CP11_A::VALUE2), @@ -129,38 +107,42 @@ impl CP11_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Access denied. Any attempted access generates a NOCP UsageFault."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CP11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Privileged access only. An unprivileged access generates a NOCP fault."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CP11_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Full access."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CP11_A::VALUE4 } } #[doc = "Field `CP11` writer - Access privileges for coprocessor 11"] -pub type CP11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CPACR_SPEC, u8, CP11_A, 2, O>; -impl<'a, const O: u8> CP11_W<'a, O> { +pub type CP11_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CP11_A>; +impl<'a, REG> CP11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Access denied. Any attempted access generates a NOCP UsageFault."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CP11_A::VALUE1) } #[doc = "Privileged access only. An unprivileged access generates a NOCP fault."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CP11_A::VALUE2) } #[doc = "Full access."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CP11_A::VALUE4) } } @@ -180,34 +162,35 @@ impl W { #[doc = "Bits 20:21 - Access privileges for coprocessor 10"] #[inline(always)] #[must_use] - pub fn cp10(&mut self) -> CP10_W<20> { - CP10_W::new(self) + pub fn cp10(&mut self) -> CP10_W { + CP10_W::new(self, 20) } #[doc = "Bits 22:23 - Access privileges for coprocessor 11"] #[inline(always)] #[must_use] - pub fn cp11(&mut self) -> CP11_W<22> { - CP11_W::new(self) + pub fn cp11(&mut self) -> CP11_W { + CP11_W::new(self, 22) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Coprocessor Access Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cpacr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cpacr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cpacr::R`](R) reader structure"] +impl crate::Readable for CPACR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cpacr::W`](W) writer structure"] impl crate::Writable for CPACR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/cpuid.rs b/src/ppb/cpuid.rs index 65f1a5d6..743272f8 100644 --- a/src/ppb/cpuid.rs +++ b/src/ppb/cpuid.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `Revision` reader - Revision number"] -pub type REVISION_R = crate::FieldReader; +pub type REVISION_R = crate::FieldReader; #[doc = "Revision number\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -28,23 +15,26 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REVISION_A { + type Ux = u8; +} impl REVISION_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(REVISION_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Patch 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REVISION_A::VALUE1 } } #[doc = "Field `PartNo` reader - Part number of the processor"] -pub type PART_NO_R = crate::FieldReader; +pub type PART_NO_R = crate::FieldReader; #[doc = "Part number of the processor\n\nValue on reset: 3108"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u16)] @@ -58,25 +48,28 @@ impl From for u16 { variant as _ } } +impl crate::FieldSpec for PART_NO_A { + type Ux = u16; +} impl PART_NO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 3108 => Some(PART_NO_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Cortex-M4"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PART_NO_A::VALUE1 } } #[doc = "Field `Constant` reader - Reads as 0xF"] -pub type CONSTANT_R = crate::FieldReader; +pub type CONSTANT_R = crate::FieldReader; #[doc = "Field `Variant` reader - Variant number"] -pub type VARIANT_R = crate::FieldReader; +pub type VARIANT_R = crate::FieldReader; #[doc = "Variant number\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -90,23 +83,26 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for VARIANT_A { + type Ux = u8; +} impl VARIANT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(VARIANT_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Revision 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VARIANT_A::VALUE1 } } #[doc = "Field `Implementer` reader - Implementer code"] -pub type IMPLEMENTER_R = crate::FieldReader; +pub type IMPLEMENTER_R = crate::FieldReader; #[doc = "Implementer code\n\nValue on reset: 65"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -120,16 +116,19 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for IMPLEMENTER_A { + type Ux = u8; +} impl IMPLEMENTER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 65 => Some(IMPLEMENTER_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "ARM"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IMPLEMENTER_A::VALUE1 @@ -162,15 +161,13 @@ 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"] +#[doc = "CPUID Base Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cpuid::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cpuid::R`](R) reader structure"] +impl crate::Readable for CPUID_SPEC {} #[doc = "`reset()` method sets CPUID to value 0x410f_c241"] impl crate::Resettable for CPUID_SPEC { const RESET_VALUE: Self::Ux = 0x410f_c241; diff --git a/src/ppb/fpcar.rs b/src/ppb/fpcar.rs index f6dabd1c..45dcdd57 100644 --- a/src/ppb/fpcar.rs +++ b/src/ppb/fpcar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ADDRESS` reader - Address"] -pub type ADDRESS_R = crate::FieldReader; +pub type ADDRESS_R = crate::FieldReader; #[doc = "Field `ADDRESS` writer - Address"] -pub type ADDRESS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FPCAR_SPEC, u32, u32, 29, O>; +pub type ADDRESS_W<'a, REG> = crate::FieldWriter<'a, REG, 29, u32>; impl R { #[doc = "Bits 3:31 - Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 3:31 - Address"] #[inline(always)] #[must_use] - pub fn address(&mut self) -> ADDRESS_W<3> { - ADDRESS_W::new(self) + pub fn address(&mut self) -> ADDRESS_W { + ADDRESS_W::new(self, 3) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Floating-point Context Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpcar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpcar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fpcar::R`](R) reader structure"] +impl crate::Readable for FPCAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fpcar::W`](W) writer structure"] impl crate::Writable for FPCAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/fpccr.rs b/src/ppb/fpccr.rs index 4ad84e99..193d9aed 100644 --- a/src/ppb/fpccr.rs +++ b/src/ppb/fpccr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `LSPACT` reader - Lazy State Preservation Active"] pub type LSPACT_R = crate::BitReader; #[doc = "Lazy State Preservation Active\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl LSPACT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LSPACT_A { + pub const fn variant(&self) -> LSPACT_A { match self.bits { false => LSPACT_A::VALUE1, true => LSPACT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Lazy state preservation is not active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LSPACT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Lazy state preservation is active. floating-point stack frame has been allocated but saving state to it has been deferred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LSPACT_A::VALUE2 } } #[doc = "Field `LSPACT` writer - Lazy State Preservation Active"] -pub type LSPACT_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, LSPACT_A, O>; -impl<'a, const O: u8> LSPACT_W<'a, O> { +pub type LSPACT_W<'a, REG> = crate::BitWriter<'a, REG, LSPACT_A>; +impl<'a, REG> LSPACT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Lazy state preservation is not active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LSPACT_A::VALUE1) } #[doc = "Lazy state preservation is active. floating-point stack frame has been allocated but saving state to it has been deferred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LSPACT_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl USER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USER_A { + pub const fn variant(&self) -> USER_A { match self.bits { false => USER_A::VALUE1, true => USER_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Privilege level was not user when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Privilege level was user when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USER_A::VALUE2 } } #[doc = "Field `USER` writer - User allocated Stack Frame"] -pub type USER_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, USER_A, O>; -impl<'a, const O: u8> USER_W<'a, O> { +pub type USER_W<'a, REG> = crate::BitWriter<'a, REG, USER_A>; +impl<'a, REG> USER_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Privilege level was not user when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USER_A::VALUE1) } #[doc = "Privilege level was user when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USER_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl THREAD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> THREAD_A { + pub const fn variant(&self) -> THREAD_A { match self.bits { false => THREAD_A::VALUE1, true => THREAD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Mode was not Thread Mode when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == THREAD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Mode was Thread Mode when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == THREAD_A::VALUE2 } } #[doc = "Field `THREAD` writer - Thread Mode allocated Stack Frame"] -pub type THREAD_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, THREAD_A, O>; -impl<'a, const O: u8> THREAD_W<'a, O> { +pub type THREAD_W<'a, REG> = crate::BitWriter<'a, REG, THREAD_A>; +impl<'a, REG> THREAD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Mode was not Thread Mode when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(THREAD_A::VALUE1) } #[doc = "Mode was Thread Mode when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(THREAD_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl HFRDY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HFRDY_A { + pub const fn variant(&self) -> HFRDY_A { match self.bits { false => HFRDY_A::VALUE1, true => HFRDY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Priority did not permit setting the HardFault handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HFRDY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Priority permitted setting the HardFault handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HFRDY_A::VALUE2 } } #[doc = "Field `HFRDY` writer - HardFault Ready"] -pub type HFRDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, HFRDY_A, O>; -impl<'a, const O: u8> HFRDY_W<'a, O> { +pub type HFRDY_W<'a, REG> = crate::BitWriter<'a, REG, HFRDY_A>; +impl<'a, REG> HFRDY_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Priority did not permit setting the HardFault handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HFRDY_A::VALUE1) } #[doc = "Priority permitted setting the HardFault handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HFRDY_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl MMRDY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MMRDY_A { + pub const fn variant(&self) -> MMRDY_A { match self.bits { false => MMRDY_A::VALUE1, true => MMRDY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == MMRDY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "MemManage is enabled and priority permitted setting the MemManage handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MMRDY_A::VALUE2 } } #[doc = "Field `MMRDY` writer - MemManage Ready"] -pub type MMRDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, MMRDY_A, O>; -impl<'a, const O: u8> MMRDY_W<'a, O> { +pub type MMRDY_W<'a, REG> = crate::BitWriter<'a, REG, MMRDY_A>; +impl<'a, REG> MMRDY_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MMRDY_A::VALUE1) } #[doc = "MemManage is enabled and priority permitted setting the MemManage handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MMRDY_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl BFRDY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFRDY_A { + pub const fn variant(&self) -> BFRDY_A { match self.bits { false => BFRDY_A::VALUE1, true => BFRDY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == BFRDY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "BusFault is enabled and priority permitted setting the BusFault handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFRDY_A::VALUE2 } } #[doc = "Field `BFRDY` writer - BusFault Ready"] -pub type BFRDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, BFRDY_A, O>; -impl<'a, const O: u8> BFRDY_W<'a, O> { +pub type BFRDY_W<'a, REG> = crate::BitWriter<'a, REG, BFRDY_A>; +impl<'a, REG> BFRDY_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFRDY_A::VALUE1) } #[doc = "BusFault is enabled and priority permitted setting the BusFault handler to the pending state when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFRDY_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl MONRDY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MONRDY_A { + pub const fn variant(&self) -> MONRDY_A { match self.bits { false => MONRDY_A::VALUE1, true => MONRDY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Debug Monitor is disabled or priority did not permit setting MON_PEND when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MONRDY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Debug Monitor is enabled and priority permits setting MON_PEND when the floating-point stack frame was allocated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MONRDY_A::VALUE2 } } #[doc = "Field `MONRDY` writer - Monitor Ready"] -pub type MONRDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, MONRDY_A, O>; -impl<'a, const O: u8> MONRDY_W<'a, O> { +pub type MONRDY_W<'a, REG> = crate::BitWriter<'a, REG, MONRDY_A>; +impl<'a, REG> MONRDY_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Debug Monitor is disabled or priority did not permit setting MON_PEND when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MONRDY_A::VALUE1) } #[doc = "Debug Monitor is enabled and priority permits setting MON_PEND when the floating-point stack frame was allocated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MONRDY_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl LSPEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LSPEN_A { + pub const fn variant(&self) -> LSPEN_A { match self.bits { false => LSPEN_A::VALUE1, true => LSPEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable automatic lazy state preservation for floating-point context."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LSPEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable automatic lazy state preservation for floating-point context."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LSPEN_A::VALUE2 } } #[doc = "Field `LSPEN` writer - Lazy State Preservation Enabled"] -pub type LSPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, LSPEN_A, O>; -impl<'a, const O: u8> LSPEN_W<'a, O> { +pub type LSPEN_W<'a, REG> = crate::BitWriter<'a, REG, LSPEN_A>; +impl<'a, REG> LSPEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable automatic lazy state preservation for floating-point context."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LSPEN_A::VALUE1) } #[doc = "Enable automatic lazy state preservation for floating-point context."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LSPEN_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl ASPEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASPEN_A { + pub const fn variant(&self) -> ASPEN_A { match self.bits { false => ASPEN_A::VALUE1, true => ASPEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable CONTROL setting on execution of a floating-point instruction."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASPEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable CONTROL setting on execution of a floating-point instruction."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASPEN_A::VALUE2 } } #[doc = "Field `ASPEN` writer - Automatic State Preservation"] -pub type ASPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPCCR_SPEC, ASPEN_A, O>; -impl<'a, const O: u8> ASPEN_W<'a, O> { +pub type ASPEN_W<'a, REG> = crate::BitWriter<'a, REG, ASPEN_A>; +impl<'a, REG> ASPEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable CONTROL setting on execution of a floating-point instruction."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASPEN_A::VALUE1) } #[doc = "Enable CONTROL setting on execution of a floating-point instruction."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASPEN_A::VALUE2) } } @@ -535,76 +530,77 @@ impl W { #[doc = "Bit 0 - Lazy State Preservation Active"] #[inline(always)] #[must_use] - pub fn lspact(&mut self) -> LSPACT_W<0> { - LSPACT_W::new(self) + pub fn lspact(&mut self) -> LSPACT_W { + LSPACT_W::new(self, 0) } #[doc = "Bit 1 - User allocated Stack Frame"] #[inline(always)] #[must_use] - pub fn user(&mut self) -> USER_W<1> { - USER_W::new(self) + pub fn user(&mut self) -> USER_W { + USER_W::new(self, 1) } #[doc = "Bit 3 - Thread Mode allocated Stack Frame"] #[inline(always)] #[must_use] - pub fn thread(&mut self) -> THREAD_W<3> { - THREAD_W::new(self) + pub fn thread(&mut self) -> THREAD_W { + THREAD_W::new(self, 3) } #[doc = "Bit 4 - HardFault Ready"] #[inline(always)] #[must_use] - pub fn hfrdy(&mut self) -> HFRDY_W<4> { - HFRDY_W::new(self) + pub fn hfrdy(&mut self) -> HFRDY_W { + HFRDY_W::new(self, 4) } #[doc = "Bit 5 - MemManage Ready"] #[inline(always)] #[must_use] - pub fn mmrdy(&mut self) -> MMRDY_W<5> { - MMRDY_W::new(self) + pub fn mmrdy(&mut self) -> MMRDY_W { + MMRDY_W::new(self, 5) } #[doc = "Bit 6 - BusFault Ready"] #[inline(always)] #[must_use] - pub fn bfrdy(&mut self) -> BFRDY_W<6> { - BFRDY_W::new(self) + pub fn bfrdy(&mut self) -> BFRDY_W { + BFRDY_W::new(self, 6) } #[doc = "Bit 8 - Monitor Ready"] #[inline(always)] #[must_use] - pub fn monrdy(&mut self) -> MONRDY_W<8> { - MONRDY_W::new(self) + pub fn monrdy(&mut self) -> MONRDY_W { + MONRDY_W::new(self, 8) } #[doc = "Bit 30 - Lazy State Preservation Enabled"] #[inline(always)] #[must_use] - pub fn lspen(&mut self) -> LSPEN_W<30> { - LSPEN_W::new(self) + pub fn lspen(&mut self) -> LSPEN_W { + LSPEN_W::new(self, 30) } #[doc = "Bit 31 - Automatic State Preservation"] #[inline(always)] #[must_use] - pub fn aspen(&mut self) -> ASPEN_W<31> { - ASPEN_W::new(self) + pub fn aspen(&mut self) -> ASPEN_W { + ASPEN_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Floating-point Context Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpccr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpccr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fpccr::R`](R) reader structure"] +impl crate::Readable for FPCCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fpccr::W`](W) writer structure"] impl crate::Writable for FPCCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/fpdscr.rs b/src/ppb/fpdscr.rs index 246a1fb6..0b953969 100644 --- a/src/ppb/fpdscr.rs +++ b/src/ppb/fpdscr.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RMode` reader - Default value for FPSCR.RMode"] -pub type RMODE_R = crate::FieldReader; +pub type RMODE_R = crate::FieldReader; #[doc = "Field `RMode` writer - Default value for FPSCR.RMode"] -pub type RMODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FPDSCR_SPEC, u8, u8, 2, O>; +pub type RMODE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `FZ` reader - Default value for FPSCR.FZ"] -pub type FZ_R = crate::BitReader; +pub type FZ_R = crate::BitReader; #[doc = "Field `FZ` writer - Default value for FPSCR.FZ"] -pub type FZ_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPDSCR_SPEC, bool, O>; +pub type FZ_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DN` reader - Default value for FPSCR.DN"] -pub type DN_R = crate::BitReader; +pub type DN_R = crate::BitReader; #[doc = "Field `DN` writer - Default value for FPSCR.DN"] -pub type DN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPDSCR_SPEC, bool, O>; +pub type DN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHP` reader - Default value for FPSCR.AHP"] -pub type AHP_R = crate::BitReader; +pub type AHP_R = crate::BitReader; #[doc = "Field `AHP` writer - Default value for FPSCR.AHP"] -pub type AHP_W<'a, const O: u8> = crate::BitWriter<'a, u32, FPDSCR_SPEC, bool, O>; +pub type AHP_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 22:23 - Default value for FPSCR.RMode"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 22:23 - Default value for FPSCR.RMode"] #[inline(always)] #[must_use] - pub fn rmode(&mut self) -> RMODE_W<22> { - RMODE_W::new(self) + pub fn rmode(&mut self) -> RMODE_W { + RMODE_W::new(self, 22) } #[doc = "Bit 24 - Default value for FPSCR.FZ"] #[inline(always)] #[must_use] - pub fn fz(&mut self) -> FZ_W<24> { - FZ_W::new(self) + pub fn fz(&mut self) -> FZ_W { + FZ_W::new(self, 24) } #[doc = "Bit 25 - Default value for FPSCR.DN"] #[inline(always)] #[must_use] - pub fn dn(&mut self) -> DN_W<25> { - DN_W::new(self) + pub fn dn(&mut self) -> DN_W { + DN_W::new(self, 25) } #[doc = "Bit 26 - Default value for FPSCR.AHP"] #[inline(always)] #[must_use] - pub fn ahp(&mut self) -> AHP_W<26> { - AHP_W::new(self) + pub fn ahp(&mut self) -> AHP_W { + AHP_W::new(self, 26) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Floating-point Default Status Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fpdscr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fpdscr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fpdscr::R`](R) reader structure"] +impl crate::Readable for FPDSCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fpdscr::W`](W) writer structure"] impl crate::Writable for FPDSCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/hfsr.rs b/src/ppb/hfsr.rs index 6ae8bdc7..e7190033 100644 --- a/src/ppb/hfsr.rs +++ b/src/ppb/hfsr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VECTTBL` reader - BusFault on vector table read"] pub type VECTTBL_R = crate::BitReader; #[doc = "BusFault on vector table read\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl VECTTBL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VECTTBL_A { + pub const fn variant(&self) -> VECTTBL_A { match self.bits { false => VECTTBL_A::VALUE1, true => VECTTBL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no BusFault on vector table read"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VECTTBL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "BusFault on vector table read"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VECTTBL_A::VALUE2 } } #[doc = "Field `VECTTBL` writer - BusFault on vector table read"] -pub type VECTTBL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HFSR_SPEC, VECTTBL_A, O>; -impl<'a, const O: u8> VECTTBL_W<'a, O> { +pub type VECTTBL_W<'a, REG> = crate::BitWriter<'a, REG, VECTTBL_A>; +impl<'a, REG> VECTTBL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no BusFault on vector table read"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VECTTBL_A::VALUE1) } #[doc = "BusFault on vector table read"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VECTTBL_A::VALUE2) } } @@ -103,41 +74,44 @@ impl From for bool { impl FORCED_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FORCED_A { + pub const fn variant(&self) -> FORCED_A { match self.bits { false => FORCED_A::VALUE1, true => FORCED_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no forced HardFault"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FORCED_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "forced HardFault."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FORCED_A::VALUE2 } } #[doc = "Field `FORCED` writer - Forced HardFault"] -pub type FORCED_W<'a, const O: u8> = crate::BitWriter<'a, u32, HFSR_SPEC, FORCED_A, O>; -impl<'a, const O: u8> FORCED_W<'a, O> { +pub type FORCED_W<'a, REG> = crate::BitWriter<'a, REG, FORCED_A>; +impl<'a, REG> FORCED_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no forced HardFault"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FORCED_A::VALUE1) } #[doc = "forced HardFault."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FORCED_A::VALUE2) } } #[doc = "Field `DEBUGEVT` reader - Reserved for Debug use"] -pub type DEBUGEVT_R = crate::BitReader; +pub type DEBUGEVT_R = crate::BitReader; #[doc = "Field `DEBUGEVT` writer - Reserved for Debug use"] -pub type DEBUGEVT_W<'a, const O: u8> = crate::BitWriter<'a, u32, HFSR_SPEC, bool, O>; +pub type DEBUGEVT_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 1 - BusFault on vector table read"] #[inline(always)] @@ -159,40 +133,41 @@ impl W { #[doc = "Bit 1 - BusFault on vector table read"] #[inline(always)] #[must_use] - pub fn vecttbl(&mut self) -> VECTTBL_W<1> { - VECTTBL_W::new(self) + pub fn vecttbl(&mut self) -> VECTTBL_W { + VECTTBL_W::new(self, 1) } #[doc = "Bit 30 - Forced HardFault"] #[inline(always)] #[must_use] - pub fn forced(&mut self) -> FORCED_W<30> { - FORCED_W::new(self) + pub fn forced(&mut self) -> FORCED_W { + FORCED_W::new(self, 30) } #[doc = "Bit 31 - Reserved for Debug use"] #[inline(always)] #[must_use] - pub fn debugevt(&mut self) -> DEBUGEVT_W<31> { - DEBUGEVT_W::new(self) + pub fn debugevt(&mut self) -> DEBUGEVT_W { + DEBUGEVT_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "HardFault Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hfsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hfsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hfsr::R`](R) reader structure"] +impl crate::Readable for HFSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hfsr::W`](W) writer structure"] impl crate::Writable for HFSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/icsr.rs b/src/ppb/icsr.rs index 1a6f98ea..15ae88d2 100644 --- a/src/ppb/icsr.rs +++ b/src/ppb/icsr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VECTACTIVE` reader - Active exception number"] -pub type VECTACTIVE_R = crate::FieldReader; +pub type VECTACTIVE_R = crate::FieldReader; #[doc = "Active exception number\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u16)] @@ -49,16 +17,19 @@ impl From for u16 { variant as _ } } +impl crate::FieldSpec for VECTACTIVE_A { + type Ux = u16; +} impl VECTACTIVE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(VECTACTIVE_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Thread mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VECTACTIVE_A::VALUE1 @@ -83,25 +54,25 @@ impl From for bool { impl RETTOBASE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RETTOBASE_A { + pub const fn variant(&self) -> RETTOBASE_A { match self.bits { false => RETTOBASE_A::VALUE1, true => RETTOBASE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "there are preempted active exceptions to execute"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RETTOBASE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "there are no active exceptions, or the currently-executing exception is the only active exception."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RETTOBASE_A::VALUE2 } } #[doc = "Field `VECTPENDING` reader - Vector Pending"] -pub type VECTPENDING_R = crate::FieldReader; +pub type VECTPENDING_R = crate::FieldReader; #[doc = "Vector Pending\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -115,16 +86,19 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for VECTPENDING_A { + type Ux = u8; +} impl VECTPENDING_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(VECTPENDING_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no pending exceptions"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VECTPENDING_A::VALUE1 @@ -149,18 +123,18 @@ impl From for bool { impl ISRPENDING_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ISRPENDING_A { + pub const fn variant(&self) -> ISRPENDING_A { match self.bits { false => ISRPENDING_A::VALUE1, true => ISRPENDING_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "interrupt not pending"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ISRPENDING_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "interrupt pending."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ISRPENDING_A::VALUE2 @@ -181,16 +155,19 @@ impl From for bool { } } #[doc = "Field `PENDSTCLR` writer - SysTick exception clear-pending bit"] -pub type PENDSTCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, ICSR_SPEC, PENDSTCLR_AW, O>; -impl<'a, const O: u8> PENDSTCLR_W<'a, O> { +pub type PENDSTCLR_W<'a, REG> = crate::BitWriter<'a, REG, PENDSTCLR_AW>; +impl<'a, REG> PENDSTCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PENDSTCLR_AW::VALUE1) } #[doc = "removes the pending state from the SysTick exception."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PENDSTCLR_AW::VALUE2) } } @@ -213,34 +190,37 @@ impl From for bool { impl PENDSTSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PENDSTSET_A { + pub const fn variant(&self) -> PENDSTSET_A { match self.bits { false => PENDSTSET_A::VALUE1, true => PENDSTSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "no effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PENDSTSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "changes SysTick exception state to pending."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PENDSTSET_A::VALUE2 } } #[doc = "Field `PENDSTSET` writer - SysTick exception set-pending bit"] -pub type PENDSTSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, ICSR_SPEC, PENDSTSET_A, O>; -impl<'a, const O: u8> PENDSTSET_W<'a, O> { +pub type PENDSTSET_W<'a, REG> = crate::BitWriter<'a, REG, PENDSTSET_A>; +impl<'a, REG> PENDSTSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PENDSTSET_A::VALUE1) } #[doc = "changes SysTick exception state to pending."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PENDSTSET_A::VALUE2) } } @@ -259,27 +239,30 @@ impl From for bool { } } #[doc = "Field `PENDSVCLR` writer - PendSV clear-pending bit"] -pub type PENDSVCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, ICSR_SPEC, PENDSVCLR_AW, O>; -impl<'a, const O: u8> PENDSVCLR_W<'a, O> { +pub type PENDSVCLR_W<'a, REG> = crate::BitWriter<'a, REG, PENDSVCLR_AW>; +impl<'a, REG> PENDSVCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "no effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PENDSVCLR_AW::VALUE1) } #[doc = "removes the pending state from the PendSV exception."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PENDSVCLR_AW::VALUE2) } } #[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 type PENDSVSET_R = crate::BitReader; +pub type PENDSVSET_R = crate::BitReader; #[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 type PENDSVSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, ICSR_SPEC, bool, O>; +pub type PENDSVSET_W<'a, REG> = crate::BitWriter<'a, REG>; #[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 type NMIPENDSET_R = crate::BitReader; +pub type NMIPENDSET_R = crate::BitReader; #[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 type NMIPENDSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, ICSR_SPEC, bool, O>; +pub type NMIPENDSET_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:8 - Active exception number"] #[inline(always)] @@ -321,52 +304,53 @@ impl W { #[doc = "Bit 25 - SysTick exception clear-pending bit"] #[inline(always)] #[must_use] - pub fn pendstclr(&mut self) -> PENDSTCLR_W<25> { - PENDSTCLR_W::new(self) + pub fn pendstclr(&mut self) -> PENDSTCLR_W { + PENDSTCLR_W::new(self, 25) } #[doc = "Bit 26 - SysTick exception set-pending bit"] #[inline(always)] #[must_use] - pub fn pendstset(&mut self) -> PENDSTSET_W<26> { - PENDSTSET_W::new(self) + pub fn pendstset(&mut self) -> PENDSTSET_W { + PENDSTSET_W::new(self, 26) } #[doc = "Bit 27 - PendSV clear-pending bit"] #[inline(always)] #[must_use] - pub fn pendsvclr(&mut self) -> PENDSVCLR_W<27> { - PENDSVCLR_W::new(self) + pub fn pendsvclr(&mut self) -> PENDSVCLR_W { + PENDSVCLR_W::new(self, 27) } #[doc = "Bit 28 - 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.,"] #[inline(always)] #[must_use] - pub fn pendsvset(&mut self) -> PENDSVSET_W<28> { - PENDSVSET_W::new(self) + pub fn pendsvset(&mut self) -> PENDSVSET_W { + PENDSVSET_W::new(self, 28) } #[doc = "Bit 31 - 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.,"] #[inline(always)] #[must_use] - pub fn nmipendset(&mut self) -> NMIPENDSET_W<31> { - NMIPENDSET_W::new(self) + pub fn nmipendset(&mut self) -> NMIPENDSET_W { + NMIPENDSET_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Control and State Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`icsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`icsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`icsr::R`](R) reader structure"] +impl crate::Readable for ICSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`icsr::W`](W) writer structure"] impl crate::Writable for ICSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mmfar.rs b/src/ppb/mmfar.rs index f72a4551..525c4f88 100644 --- a/src/ppb/mmfar.rs +++ b/src/ppb/mmfar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ADDRESS` reader - Address causing the fault"] -pub type ADDRESS_R = crate::FieldReader; +pub type ADDRESS_R = crate::FieldReader; #[doc = "Field `ADDRESS` writer - Address causing the fault"] -pub type ADDRESS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MMFAR_SPEC, u32, u32, 32, O>; +pub type ADDRESS_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Address causing the fault"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Address causing the fault"] #[inline(always)] #[must_use] - pub fn address(&mut self) -> ADDRESS_W<0> { - ADDRESS_W::new(self) + pub fn address(&mut self) -> ADDRESS_W { + ADDRESS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MemManage Fault Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mmfar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mmfar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mmfar::R`](R) reader structure"] +impl crate::Readable for MMFAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mmfar::W`](W) writer structure"] impl crate::Writable for MMFAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_ctrl.rs b/src/ppb/mpu_ctrl.rs index 69031ee7..b4c9e9dd 100644 --- a/src/ppb/mpu_ctrl.rs +++ b/src/ppb/mpu_ctrl.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENABLE` reader - Enable MPU"] pub type ENABLE_R = crate::BitReader; #[doc = "Enable MPU\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl ENABLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENABLE_A { + pub const fn variant(&self) -> ENABLE_A { match self.bits { false => ENABLE_A::VALUE1, true => ENABLE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "MPU disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENABLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "MPU enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENABLE_A::VALUE2 } } #[doc = "Field `ENABLE` writer - Enable MPU"] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_CTRL_SPEC, ENABLE_A, O>; -impl<'a, const O: u8> ENABLE_W<'a, O> { +pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG, ENABLE_A>; +impl<'a, REG> ENABLE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "MPU disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENABLE_A::VALUE1) } #[doc = "MPU enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENABLE_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl HFNMIENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HFNMIENA_A { + pub const fn variant(&self) -> HFNMIENA_A { match self.bits { false => HFNMIENA_A::VALUE1, true => HFNMIENA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "MPU is disabled during hard fault, NMI, and FAULTMASK handlers, regardless of the value of the ENABLE bit"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HFNMIENA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the MPU is enabled during hard fault, NMI, and FAULTMASK handlers."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HFNMIENA_A::VALUE2 } } #[doc = "Field `HFNMIENA` writer - Enable the operation of MPU during hard fault, NMI, and FAULTMASK handlers"] -pub type HFNMIENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_CTRL_SPEC, HFNMIENA_A, O>; -impl<'a, const O: u8> HFNMIENA_W<'a, O> { +pub type HFNMIENA_W<'a, REG> = crate::BitWriter<'a, REG, HFNMIENA_A>; +impl<'a, REG> HFNMIENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "MPU is disabled during hard fault, NMI, and FAULTMASK handlers, regardless of the value of the ENABLE bit"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HFNMIENA_A::VALUE1) } #[doc = "the MPU is enabled during hard fault, NMI, and FAULTMASK handlers."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HFNMIENA_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PRIVDEFENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRIVDEFENA_A { + pub const fn variant(&self) -> PRIVDEFENA_A { match self.bits { false => PRIVDEFENA_A::VALUE1, true => PRIVDEFENA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == PRIVDEFENA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "If the MPU is enabled, enables use of the default memory map as a background region for privileged software accesses."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRIVDEFENA_A::VALUE2 } } #[doc = "Field `PRIVDEFENA` writer - Enables privileged software access to the default memory map"] -pub type PRIVDEFENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_CTRL_SPEC, PRIVDEFENA_A, O>; -impl<'a, const O: u8> PRIVDEFENA_W<'a, O> { +pub type PRIVDEFENA_W<'a, REG> = crate::BitWriter<'a, REG, PRIVDEFENA_A>; +impl<'a, REG> PRIVDEFENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRIVDEFENA_A::VALUE1) } #[doc = "If the MPU is enabled, enables use of the default memory map as a background region for privileged software accesses."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRIVDEFENA_A::VALUE2) } } @@ -205,40 +182,41 @@ impl W { #[doc = "Bit 0 - Enable MPU"] #[inline(always)] #[must_use] - pub fn enable(&mut self) -> ENABLE_W<0> { - ENABLE_W::new(self) + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W::new(self, 0) } #[doc = "Bit 1 - Enable the operation of MPU during hard fault, NMI, and FAULTMASK handlers"] #[inline(always)] #[must_use] - pub fn hfnmiena(&mut self) -> HFNMIENA_W<1> { - HFNMIENA_W::new(self) + pub fn hfnmiena(&mut self) -> HFNMIENA_W { + HFNMIENA_W::new(self, 1) } #[doc = "Bit 2 - Enables privileged software access to the default memory map"] #[inline(always)] #[must_use] - pub fn privdefena(&mut self) -> PRIVDEFENA_W<2> { - PRIVDEFENA_W::new(self) + pub fn privdefena(&mut self) -> PRIVDEFENA_W { + PRIVDEFENA_W::new(self, 2) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_ctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_ctrl::R`](R) reader structure"] +impl crate::Readable for MPU_CTRL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_ctrl::W`](W) writer structure"] impl crate::Writable for MPU_CTRL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rasr.rs b/src/ppb/mpu_rasr.rs index c686c8d7..6c4d1356 100644 --- a/src/ppb/mpu_rasr.rs +++ b/src/ppb/mpu_rasr.rs @@ -1,49 +1,17 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENABLE` reader - Region enable bit."] -pub type ENABLE_R = crate::BitReader; +pub type ENABLE_R = crate::BitReader; #[doc = "Field `ENABLE` writer - Region enable bit."] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_SPEC, bool, O>; +pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SIZE` reader - MPU protection region size"] -pub type SIZE_R = crate::FieldReader; +pub type SIZE_R = crate::FieldReader; #[doc = "Field `SIZE` writer - MPU protection region size"] -pub type SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_SPEC, u8, u8, 5, O>; +pub type SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `SRD` reader - Subregion disable bits"] -pub type SRD_R = crate::FieldReader; +pub type SRD_R = crate::FieldReader; #[doc = "Subregion disable bits\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,61 +27,68 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRD_A { + type Ux = u8; +} impl SRD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRD_A::VALUE1), 1 => Some(SRD_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "corresponding sub-region is enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "corresponding sub-region is disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRD_A::VALUE2 } } #[doc = "Field `SRD` writer - Subregion disable bits"] -pub type SRD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_SPEC, u8, SRD_A, 8, O>; -impl<'a, const O: u8> SRD_W<'a, O> { +pub type SRD_W<'a, REG> = crate::FieldWriter<'a, REG, 8, SRD_A>; +impl<'a, REG> SRD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "corresponding sub-region is enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRD_A::VALUE1) } #[doc = "corresponding sub-region is disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRD_A::VALUE2) } } #[doc = "Field `B` reader - Memory access attribute"] -pub type B_R = crate::BitReader; +pub type B_R = crate::BitReader; #[doc = "Field `B` writer - Memory access attribute"] -pub type B_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_SPEC, bool, O>; +pub type B_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `C` reader - Memory access attribute"] -pub type C_R = crate::BitReader; +pub type C_R = crate::BitReader; #[doc = "Field `C` writer - Memory access attribute"] -pub type C_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_SPEC, bool, O>; +pub type C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S` reader - Shareable bit"] -pub type S_R = crate::BitReader; +pub type S_R = crate::BitReader; #[doc = "Field `S` writer - Shareable bit"] -pub type S_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_SPEC, bool, O>; +pub type S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TEX` reader - Memory access attribute"] -pub type TEX_R = crate::FieldReader; +pub type TEX_R = crate::FieldReader; #[doc = "Field `TEX` writer - Memory access attribute"] -pub type TEX_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_SPEC, u8, u8, 3, O>; +pub type TEX_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `AP` reader - Access permission field"] -pub type AP_R = crate::FieldReader; +pub type AP_R = crate::FieldReader; #[doc = "Field `AP` writer - Access permission field"] -pub type AP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_SPEC, u8, u8, 3, O>; +pub type AP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `XN` reader - Instruction access disable bit"] pub type XN_R = crate::BitReader; #[doc = "Instruction access disable bit\n\nValue on reset: 0"] @@ -133,34 +108,37 @@ impl From for bool { impl XN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XN_A { + pub const fn variant(&self) -> XN_A { match self.bits { false => XN_A::VALUE1, true => XN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "instruction fetches enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "instruction fetches disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XN_A::VALUE2 } } #[doc = "Field `XN` writer - Instruction access disable bit"] -pub type XN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_SPEC, XN_A, O>; -impl<'a, const O: u8> XN_W<'a, O> { +pub type XN_W<'a, REG> = crate::BitWriter<'a, REG, XN_A>; +impl<'a, REG> XN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "instruction fetches enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XN_A::VALUE1) } #[doc = "instruction fetches disabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XN_A::VALUE2) } } @@ -215,76 +193,77 @@ impl W { #[doc = "Bit 0 - Region enable bit."] #[inline(always)] #[must_use] - pub fn enable(&mut self) -> ENABLE_W<0> { - ENABLE_W::new(self) + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W::new(self, 0) } #[doc = "Bits 1:5 - MPU protection region size"] #[inline(always)] #[must_use] - pub fn size(&mut self) -> SIZE_W<1> { - SIZE_W::new(self) + pub fn size(&mut self) -> SIZE_W { + SIZE_W::new(self, 1) } #[doc = "Bits 8:15 - Subregion disable bits"] #[inline(always)] #[must_use] - pub fn srd(&mut self) -> SRD_W<8> { - SRD_W::new(self) + pub fn srd(&mut self) -> SRD_W { + SRD_W::new(self, 8) } #[doc = "Bit 16 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn b(&mut self) -> B_W<16> { - B_W::new(self) + pub fn b(&mut self) -> B_W { + B_W::new(self, 16) } #[doc = "Bit 17 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn c(&mut self) -> C_W<17> { - C_W::new(self) + pub fn c(&mut self) -> C_W { + C_W::new(self, 17) } #[doc = "Bit 18 - Shareable bit"] #[inline(always)] #[must_use] - pub fn s(&mut self) -> S_W<18> { - S_W::new(self) + pub fn s(&mut self) -> S_W { + S_W::new(self, 18) } #[doc = "Bits 19:21 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn tex(&mut self) -> TEX_W<19> { - TEX_W::new(self) + pub fn tex(&mut self) -> TEX_W { + TEX_W::new(self, 19) } #[doc = "Bits 24:26 - Access permission field"] #[inline(always)] #[must_use] - pub fn ap(&mut self) -> AP_W<24> { - AP_W::new(self) + pub fn ap(&mut self) -> AP_W { + AP_W::new(self, 24) } #[doc = "Bit 28 - Instruction access disable bit"] #[inline(always)] #[must_use] - pub fn xn(&mut self) -> XN_W<28> { - XN_W::new(self) + pub fn xn(&mut self) -> XN_W { + XN_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Attribute and Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rasr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rasr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rasr::R`](R) reader structure"] +impl crate::Readable for MPU_RASR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rasr::W`](W) writer structure"] impl crate::Writable for MPU_RASR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rasr_a1.rs b/src/ppb/mpu_rasr_a1.rs index 4380d3b3..68a75f85 100644 --- a/src/ppb/mpu_rasr_a1.rs +++ b/src/ppb/mpu_rasr_a1.rs @@ -1,49 +1,17 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENABLE` reader - Region enable bit."] -pub type ENABLE_R = crate::BitReader; +pub type ENABLE_R = crate::BitReader; #[doc = "Field `ENABLE` writer - Region enable bit."] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A1_SPEC, bool, O>; +pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SIZE` reader - MPU protection region size"] -pub type SIZE_R = crate::FieldReader; +pub type SIZE_R = crate::FieldReader; #[doc = "Field `SIZE` writer - MPU protection region size"] -pub type SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A1_SPEC, u8, u8, 5, O>; +pub type SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `SRD` reader - Subregion disable bits"] -pub type SRD_R = crate::FieldReader; +pub type SRD_R = crate::FieldReader; #[doc = "Subregion disable bits\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,61 +27,68 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRD_A { + type Ux = u8; +} impl SRD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRD_A::VALUE1), 1 => Some(SRD_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "corresponding sub-region is enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "corresponding sub-region is disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRD_A::VALUE2 } } #[doc = "Field `SRD` writer - Subregion disable bits"] -pub type SRD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A1_SPEC, u8, SRD_A, 8, O>; -impl<'a, const O: u8> SRD_W<'a, O> { +pub type SRD_W<'a, REG> = crate::FieldWriter<'a, REG, 8, SRD_A>; +impl<'a, REG> SRD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "corresponding sub-region is enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRD_A::VALUE1) } #[doc = "corresponding sub-region is disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRD_A::VALUE2) } } #[doc = "Field `B` reader - Memory access attribute"] -pub type B_R = crate::BitReader; +pub type B_R = crate::BitReader; #[doc = "Field `B` writer - Memory access attribute"] -pub type B_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A1_SPEC, bool, O>; +pub type B_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `C` reader - Memory access attribute"] -pub type C_R = crate::BitReader; +pub type C_R = crate::BitReader; #[doc = "Field `C` writer - Memory access attribute"] -pub type C_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A1_SPEC, bool, O>; +pub type C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S` reader - Shareable bit"] -pub type S_R = crate::BitReader; +pub type S_R = crate::BitReader; #[doc = "Field `S` writer - Shareable bit"] -pub type S_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A1_SPEC, bool, O>; +pub type S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TEX` reader - Memory access attribute"] -pub type TEX_R = crate::FieldReader; +pub type TEX_R = crate::FieldReader; #[doc = "Field `TEX` writer - Memory access attribute"] -pub type TEX_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A1_SPEC, u8, u8, 3, O>; +pub type TEX_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `AP` reader - Access permission field"] -pub type AP_R = crate::FieldReader; +pub type AP_R = crate::FieldReader; #[doc = "Field `AP` writer - Access permission field"] -pub type AP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A1_SPEC, u8, u8, 3, O>; +pub type AP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `XN` reader - Instruction access disable bit"] pub type XN_R = crate::BitReader; #[doc = "Instruction access disable bit\n\nValue on reset: 0"] @@ -133,34 +108,37 @@ impl From for bool { impl XN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XN_A { + pub const fn variant(&self) -> XN_A { match self.bits { false => XN_A::VALUE1, true => XN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "instruction fetches enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "instruction fetches disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XN_A::VALUE2 } } #[doc = "Field `XN` writer - Instruction access disable bit"] -pub type XN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A1_SPEC, XN_A, O>; -impl<'a, const O: u8> XN_W<'a, O> { +pub type XN_W<'a, REG> = crate::BitWriter<'a, REG, XN_A>; +impl<'a, REG> XN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "instruction fetches enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XN_A::VALUE1) } #[doc = "instruction fetches disabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XN_A::VALUE2) } } @@ -215,76 +193,77 @@ impl W { #[doc = "Bit 0 - Region enable bit."] #[inline(always)] #[must_use] - pub fn enable(&mut self) -> ENABLE_W<0> { - ENABLE_W::new(self) + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W::new(self, 0) } #[doc = "Bits 1:5 - MPU protection region size"] #[inline(always)] #[must_use] - pub fn size(&mut self) -> SIZE_W<1> { - SIZE_W::new(self) + pub fn size(&mut self) -> SIZE_W { + SIZE_W::new(self, 1) } #[doc = "Bits 8:15 - Subregion disable bits"] #[inline(always)] #[must_use] - pub fn srd(&mut self) -> SRD_W<8> { - SRD_W::new(self) + pub fn srd(&mut self) -> SRD_W { + SRD_W::new(self, 8) } #[doc = "Bit 16 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn b(&mut self) -> B_W<16> { - B_W::new(self) + pub fn b(&mut self) -> B_W { + B_W::new(self, 16) } #[doc = "Bit 17 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn c(&mut self) -> C_W<17> { - C_W::new(self) + pub fn c(&mut self) -> C_W { + C_W::new(self, 17) } #[doc = "Bit 18 - Shareable bit"] #[inline(always)] #[must_use] - pub fn s(&mut self) -> S_W<18> { - S_W::new(self) + pub fn s(&mut self) -> S_W { + S_W::new(self, 18) } #[doc = "Bits 19:21 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn tex(&mut self) -> TEX_W<19> { - TEX_W::new(self) + pub fn tex(&mut self) -> TEX_W { + TEX_W::new(self, 19) } #[doc = "Bits 24:26 - Access permission field"] #[inline(always)] #[must_use] - pub fn ap(&mut self) -> AP_W<24> { - AP_W::new(self) + pub fn ap(&mut self) -> AP_W { + AP_W::new(self, 24) } #[doc = "Bit 28 - Instruction access disable bit"] #[inline(always)] #[must_use] - pub fn xn(&mut self) -> XN_W<28> { - XN_W::new(self) + pub fn xn(&mut self) -> XN_W { + XN_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Attribute and Size Register A1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rasr_a1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rasr_a1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rasr_a1::R`](R) reader structure"] +impl crate::Readable for MPU_RASR_A1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rasr_a1::W`](W) writer structure"] impl crate::Writable for MPU_RASR_A1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rasr_a2.rs b/src/ppb/mpu_rasr_a2.rs index df67ff19..ffcbdd46 100644 --- a/src/ppb/mpu_rasr_a2.rs +++ b/src/ppb/mpu_rasr_a2.rs @@ -1,49 +1,17 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENABLE` reader - Region enable bit."] -pub type ENABLE_R = crate::BitReader; +pub type ENABLE_R = crate::BitReader; #[doc = "Field `ENABLE` writer - Region enable bit."] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A2_SPEC, bool, O>; +pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SIZE` reader - MPU protection region size"] -pub type SIZE_R = crate::FieldReader; +pub type SIZE_R = crate::FieldReader; #[doc = "Field `SIZE` writer - MPU protection region size"] -pub type SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A2_SPEC, u8, u8, 5, O>; +pub type SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `SRD` reader - Subregion disable bits"] -pub type SRD_R = crate::FieldReader; +pub type SRD_R = crate::FieldReader; #[doc = "Subregion disable bits\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,61 +27,68 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRD_A { + type Ux = u8; +} impl SRD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRD_A::VALUE1), 1 => Some(SRD_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "corresponding sub-region is enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "corresponding sub-region is disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRD_A::VALUE2 } } #[doc = "Field `SRD` writer - Subregion disable bits"] -pub type SRD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A2_SPEC, u8, SRD_A, 8, O>; -impl<'a, const O: u8> SRD_W<'a, O> { +pub type SRD_W<'a, REG> = crate::FieldWriter<'a, REG, 8, SRD_A>; +impl<'a, REG> SRD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "corresponding sub-region is enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRD_A::VALUE1) } #[doc = "corresponding sub-region is disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRD_A::VALUE2) } } #[doc = "Field `B` reader - Memory access attribute"] -pub type B_R = crate::BitReader; +pub type B_R = crate::BitReader; #[doc = "Field `B` writer - Memory access attribute"] -pub type B_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A2_SPEC, bool, O>; +pub type B_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `C` reader - Memory access attribute"] -pub type C_R = crate::BitReader; +pub type C_R = crate::BitReader; #[doc = "Field `C` writer - Memory access attribute"] -pub type C_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A2_SPEC, bool, O>; +pub type C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S` reader - Shareable bit"] -pub type S_R = crate::BitReader; +pub type S_R = crate::BitReader; #[doc = "Field `S` writer - Shareable bit"] -pub type S_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A2_SPEC, bool, O>; +pub type S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TEX` reader - Memory access attribute"] -pub type TEX_R = crate::FieldReader; +pub type TEX_R = crate::FieldReader; #[doc = "Field `TEX` writer - Memory access attribute"] -pub type TEX_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A2_SPEC, u8, u8, 3, O>; +pub type TEX_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `AP` reader - Access permission field"] -pub type AP_R = crate::FieldReader; +pub type AP_R = crate::FieldReader; #[doc = "Field `AP` writer - Access permission field"] -pub type AP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A2_SPEC, u8, u8, 3, O>; +pub type AP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `XN` reader - Instruction access disable bit"] pub type XN_R = crate::BitReader; #[doc = "Instruction access disable bit\n\nValue on reset: 0"] @@ -133,34 +108,37 @@ impl From for bool { impl XN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XN_A { + pub const fn variant(&self) -> XN_A { match self.bits { false => XN_A::VALUE1, true => XN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "instruction fetches enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "instruction fetches disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XN_A::VALUE2 } } #[doc = "Field `XN` writer - Instruction access disable bit"] -pub type XN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A2_SPEC, XN_A, O>; -impl<'a, const O: u8> XN_W<'a, O> { +pub type XN_W<'a, REG> = crate::BitWriter<'a, REG, XN_A>; +impl<'a, REG> XN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "instruction fetches enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XN_A::VALUE1) } #[doc = "instruction fetches disabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XN_A::VALUE2) } } @@ -215,76 +193,77 @@ impl W { #[doc = "Bit 0 - Region enable bit."] #[inline(always)] #[must_use] - pub fn enable(&mut self) -> ENABLE_W<0> { - ENABLE_W::new(self) + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W::new(self, 0) } #[doc = "Bits 1:5 - MPU protection region size"] #[inline(always)] #[must_use] - pub fn size(&mut self) -> SIZE_W<1> { - SIZE_W::new(self) + pub fn size(&mut self) -> SIZE_W { + SIZE_W::new(self, 1) } #[doc = "Bits 8:15 - Subregion disable bits"] #[inline(always)] #[must_use] - pub fn srd(&mut self) -> SRD_W<8> { - SRD_W::new(self) + pub fn srd(&mut self) -> SRD_W { + SRD_W::new(self, 8) } #[doc = "Bit 16 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn b(&mut self) -> B_W<16> { - B_W::new(self) + pub fn b(&mut self) -> B_W { + B_W::new(self, 16) } #[doc = "Bit 17 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn c(&mut self) -> C_W<17> { - C_W::new(self) + pub fn c(&mut self) -> C_W { + C_W::new(self, 17) } #[doc = "Bit 18 - Shareable bit"] #[inline(always)] #[must_use] - pub fn s(&mut self) -> S_W<18> { - S_W::new(self) + pub fn s(&mut self) -> S_W { + S_W::new(self, 18) } #[doc = "Bits 19:21 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn tex(&mut self) -> TEX_W<19> { - TEX_W::new(self) + pub fn tex(&mut self) -> TEX_W { + TEX_W::new(self, 19) } #[doc = "Bits 24:26 - Access permission field"] #[inline(always)] #[must_use] - pub fn ap(&mut self) -> AP_W<24> { - AP_W::new(self) + pub fn ap(&mut self) -> AP_W { + AP_W::new(self, 24) } #[doc = "Bit 28 - Instruction access disable bit"] #[inline(always)] #[must_use] - pub fn xn(&mut self) -> XN_W<28> { - XN_W::new(self) + pub fn xn(&mut self) -> XN_W { + XN_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Attribute and Size Register A2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rasr_a2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rasr_a2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rasr_a2::R`](R) reader structure"] +impl crate::Readable for MPU_RASR_A2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rasr_a2::W`](W) writer structure"] impl crate::Writable for MPU_RASR_A2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rasr_a3.rs b/src/ppb/mpu_rasr_a3.rs index 9f407308..927ab69a 100644 --- a/src/ppb/mpu_rasr_a3.rs +++ b/src/ppb/mpu_rasr_a3.rs @@ -1,49 +1,17 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENABLE` reader - Region enable bit."] -pub type ENABLE_R = crate::BitReader; +pub type ENABLE_R = crate::BitReader; #[doc = "Field `ENABLE` writer - Region enable bit."] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A3_SPEC, bool, O>; +pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SIZE` reader - MPU protection region size"] -pub type SIZE_R = crate::FieldReader; +pub type SIZE_R = crate::FieldReader; #[doc = "Field `SIZE` writer - MPU protection region size"] -pub type SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A3_SPEC, u8, u8, 5, O>; +pub type SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `SRD` reader - Subregion disable bits"] -pub type SRD_R = crate::FieldReader; +pub type SRD_R = crate::FieldReader; #[doc = "Subregion disable bits\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,61 +27,68 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRD_A { + type Ux = u8; +} impl SRD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRD_A::VALUE1), 1 => Some(SRD_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "corresponding sub-region is enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "corresponding sub-region is disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRD_A::VALUE2 } } #[doc = "Field `SRD` writer - Subregion disable bits"] -pub type SRD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A3_SPEC, u8, SRD_A, 8, O>; -impl<'a, const O: u8> SRD_W<'a, O> { +pub type SRD_W<'a, REG> = crate::FieldWriter<'a, REG, 8, SRD_A>; +impl<'a, REG> SRD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "corresponding sub-region is enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRD_A::VALUE1) } #[doc = "corresponding sub-region is disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRD_A::VALUE2) } } #[doc = "Field `B` reader - Memory access attribute"] -pub type B_R = crate::BitReader; +pub type B_R = crate::BitReader; #[doc = "Field `B` writer - Memory access attribute"] -pub type B_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A3_SPEC, bool, O>; +pub type B_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `C` reader - Memory access attribute"] -pub type C_R = crate::BitReader; +pub type C_R = crate::BitReader; #[doc = "Field `C` writer - Memory access attribute"] -pub type C_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A3_SPEC, bool, O>; +pub type C_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `S` reader - Shareable bit"] -pub type S_R = crate::BitReader; +pub type S_R = crate::BitReader; #[doc = "Field `S` writer - Shareable bit"] -pub type S_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A3_SPEC, bool, O>; +pub type S_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TEX` reader - Memory access attribute"] -pub type TEX_R = crate::FieldReader; +pub type TEX_R = crate::FieldReader; #[doc = "Field `TEX` writer - Memory access attribute"] -pub type TEX_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A3_SPEC, u8, u8, 3, O>; +pub type TEX_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `AP` reader - Access permission field"] -pub type AP_R = crate::FieldReader; +pub type AP_R = crate::FieldReader; #[doc = "Field `AP` writer - Access permission field"] -pub type AP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RASR_A3_SPEC, u8, u8, 3, O>; +pub type AP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `XN` reader - Instruction access disable bit"] pub type XN_R = crate::BitReader; #[doc = "Instruction access disable bit\n\nValue on reset: 0"] @@ -133,34 +108,37 @@ impl From for bool { impl XN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XN_A { + pub const fn variant(&self) -> XN_A { match self.bits { false => XN_A::VALUE1, true => XN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "instruction fetches enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "instruction fetches disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XN_A::VALUE2 } } #[doc = "Field `XN` writer - Instruction access disable bit"] -pub type XN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RASR_A3_SPEC, XN_A, O>; -impl<'a, const O: u8> XN_W<'a, O> { +pub type XN_W<'a, REG> = crate::BitWriter<'a, REG, XN_A>; +impl<'a, REG> XN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "instruction fetches enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XN_A::VALUE1) } #[doc = "instruction fetches disabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XN_A::VALUE2) } } @@ -215,76 +193,77 @@ impl W { #[doc = "Bit 0 - Region enable bit."] #[inline(always)] #[must_use] - pub fn enable(&mut self) -> ENABLE_W<0> { - ENABLE_W::new(self) + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W::new(self, 0) } #[doc = "Bits 1:5 - MPU protection region size"] #[inline(always)] #[must_use] - pub fn size(&mut self) -> SIZE_W<1> { - SIZE_W::new(self) + pub fn size(&mut self) -> SIZE_W { + SIZE_W::new(self, 1) } #[doc = "Bits 8:15 - Subregion disable bits"] #[inline(always)] #[must_use] - pub fn srd(&mut self) -> SRD_W<8> { - SRD_W::new(self) + pub fn srd(&mut self) -> SRD_W { + SRD_W::new(self, 8) } #[doc = "Bit 16 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn b(&mut self) -> B_W<16> { - B_W::new(self) + pub fn b(&mut self) -> B_W { + B_W::new(self, 16) } #[doc = "Bit 17 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn c(&mut self) -> C_W<17> { - C_W::new(self) + pub fn c(&mut self) -> C_W { + C_W::new(self, 17) } #[doc = "Bit 18 - Shareable bit"] #[inline(always)] #[must_use] - pub fn s(&mut self) -> S_W<18> { - S_W::new(self) + pub fn s(&mut self) -> S_W { + S_W::new(self, 18) } #[doc = "Bits 19:21 - Memory access attribute"] #[inline(always)] #[must_use] - pub fn tex(&mut self) -> TEX_W<19> { - TEX_W::new(self) + pub fn tex(&mut self) -> TEX_W { + TEX_W::new(self, 19) } #[doc = "Bits 24:26 - Access permission field"] #[inline(always)] #[must_use] - pub fn ap(&mut self) -> AP_W<24> { - AP_W::new(self) + pub fn ap(&mut self) -> AP_W { + AP_W::new(self, 24) } #[doc = "Bit 28 - Instruction access disable bit"] #[inline(always)] #[must_use] - pub fn xn(&mut self) -> XN_W<28> { - XN_W::new(self) + pub fn xn(&mut self) -> XN_W { + XN_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Attribute and Size Register A3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rasr_a3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rasr_a3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rasr_a3::R`](R) reader structure"] +impl crate::Readable for MPU_RASR_A3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rasr_a3::W`](W) writer structure"] impl crate::Writable for MPU_RASR_A3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rbar.rs b/src/ppb/mpu_rbar.rs index 8d3bf045..5637cc66 100644 --- a/src/ppb/mpu_rbar.rs +++ b/src/ppb/mpu_rbar.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `REGION` reader - MPU region field"] -pub type REGION_R = crate::FieldReader; +pub type REGION_R = crate::FieldReader; #[doc = "Field `REGION` writer - MPU region field"] -pub type REGION_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RBAR_SPEC, u8, u8, 4, O>; +pub type REGION_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `VALID` reader - MPU Region Number valid bit"] pub type VALID_R = crate::BitReader; #[doc = "MPU Region Number valid bit\n\nValue on reset: 0"] @@ -57,41 +25,44 @@ impl From for bool { impl VALID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VALID_A { + pub const fn variant(&self) -> VALID_A { match self.bits { false => VALID_A::VALUE1, true => VALID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == VALID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor: - updates the value of the MPU_RNR to the value of the REGION field - updates the base address for the region specified in the REGION field."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VALID_A::VALUE2 } } #[doc = "Field `VALID` writer - MPU Region Number valid bit"] -pub type VALID_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RBAR_SPEC, VALID_A, O>; -impl<'a, const O: u8> VALID_W<'a, O> { +pub type VALID_W<'a, REG> = crate::BitWriter<'a, REG, VALID_A>; +impl<'a, REG> VALID_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VALID_A::VALUE1) } #[doc = "the processor: - updates the value of the MPU_RNR to the value of the REGION field - updates the base address for the region specified in the REGION field."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VALID_A::VALUE2) } } #[doc = "Field `ADDR` reader - Region base address field"] -pub type ADDR_R = crate::FieldReader; +pub type ADDR_R = crate::FieldReader; #[doc = "Field `ADDR` writer - Region base address field"] -pub type ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RBAR_SPEC, u32, u32, 23, O>; +pub type ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 23, u32>; impl R { #[doc = "Bits 0:3 - MPU region field"] #[inline(always)] @@ -113,40 +84,41 @@ impl W { #[doc = "Bits 0:3 - MPU region field"] #[inline(always)] #[must_use] - pub fn region(&mut self) -> REGION_W<0> { - REGION_W::new(self) + pub fn region(&mut self) -> REGION_W { + REGION_W::new(self, 0) } #[doc = "Bit 4 - MPU Region Number valid bit"] #[inline(always)] #[must_use] - pub fn valid(&mut self) -> VALID_W<4> { - VALID_W::new(self) + pub fn valid(&mut self) -> VALID_W { + VALID_W::new(self, 4) } #[doc = "Bits 9:31 - Region base address field"] #[inline(always)] #[must_use] - pub fn addr(&mut self) -> ADDR_W<9> { - ADDR_W::new(self) + pub fn addr(&mut self) -> ADDR_W { + ADDR_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Base Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rbar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rbar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rbar::R`](R) reader structure"] +impl crate::Readable for MPU_RBAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rbar::W`](W) writer structure"] impl crate::Writable for MPU_RBAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rbar_a1.rs b/src/ppb/mpu_rbar_a1.rs index 7936770d..7a85aa78 100644 --- a/src/ppb/mpu_rbar_a1.rs +++ b/src/ppb/mpu_rbar_a1.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `REGION` reader - MPU region field"] -pub type REGION_R = crate::FieldReader; +pub type REGION_R = crate::FieldReader; #[doc = "Field `REGION` writer - MPU region field"] -pub type REGION_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RBAR_A1_SPEC, u8, u8, 4, O>; +pub type REGION_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `VALID` reader - MPU Region Number valid bit"] pub type VALID_R = crate::BitReader; #[doc = "MPU Region Number valid bit\n\nValue on reset: 0"] @@ -57,41 +25,44 @@ impl From for bool { impl VALID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VALID_A { + pub const fn variant(&self) -> VALID_A { match self.bits { false => VALID_A::VALUE1, true => VALID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == VALID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor: - updates the value of the MPU_RNR to the value of the REGION field - updates the base address for the region specified in the REGION field."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VALID_A::VALUE2 } } #[doc = "Field `VALID` writer - MPU Region Number valid bit"] -pub type VALID_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RBAR_A1_SPEC, VALID_A, O>; -impl<'a, const O: u8> VALID_W<'a, O> { +pub type VALID_W<'a, REG> = crate::BitWriter<'a, REG, VALID_A>; +impl<'a, REG> VALID_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VALID_A::VALUE1) } #[doc = "the processor: - updates the value of the MPU_RNR to the value of the REGION field - updates the base address for the region specified in the REGION field."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VALID_A::VALUE2) } } #[doc = "Field `ADDR` reader - Region base address field"] -pub type ADDR_R = crate::FieldReader; +pub type ADDR_R = crate::FieldReader; #[doc = "Field `ADDR` writer - Region base address field"] -pub type ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RBAR_A1_SPEC, u32, u32, 23, O>; +pub type ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 23, u32>; impl R { #[doc = "Bits 0:3 - MPU region field"] #[inline(always)] @@ -113,40 +84,41 @@ impl W { #[doc = "Bits 0:3 - MPU region field"] #[inline(always)] #[must_use] - pub fn region(&mut self) -> REGION_W<0> { - REGION_W::new(self) + pub fn region(&mut self) -> REGION_W { + REGION_W::new(self, 0) } #[doc = "Bit 4 - MPU Region Number valid bit"] #[inline(always)] #[must_use] - pub fn valid(&mut self) -> VALID_W<4> { - VALID_W::new(self) + pub fn valid(&mut self) -> VALID_W { + VALID_W::new(self, 4) } #[doc = "Bits 9:31 - Region base address field"] #[inline(always)] #[must_use] - pub fn addr(&mut self) -> ADDR_W<9> { - ADDR_W::new(self) + pub fn addr(&mut self) -> ADDR_W { + ADDR_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Base Address Register A1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rbar_a1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rbar_a1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rbar_a1::R`](R) reader structure"] +impl crate::Readable for MPU_RBAR_A1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rbar_a1::W`](W) writer structure"] impl crate::Writable for MPU_RBAR_A1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rbar_a2.rs b/src/ppb/mpu_rbar_a2.rs index 6fb3b912..3f943c30 100644 --- a/src/ppb/mpu_rbar_a2.rs +++ b/src/ppb/mpu_rbar_a2.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `REGION` reader - MPU region field"] -pub type REGION_R = crate::FieldReader; +pub type REGION_R = crate::FieldReader; #[doc = "Field `REGION` writer - MPU region field"] -pub type REGION_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RBAR_A2_SPEC, u8, u8, 4, O>; +pub type REGION_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `VALID` reader - MPU Region Number valid bit"] pub type VALID_R = crate::BitReader; #[doc = "MPU Region Number valid bit\n\nValue on reset: 0"] @@ -57,41 +25,44 @@ impl From for bool { impl VALID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VALID_A { + pub const fn variant(&self) -> VALID_A { match self.bits { false => VALID_A::VALUE1, true => VALID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == VALID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor: - updates the value of the MPU_RNR to the value of the REGION field - updates the base address for the region specified in the REGION field."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VALID_A::VALUE2 } } #[doc = "Field `VALID` writer - MPU Region Number valid bit"] -pub type VALID_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RBAR_A2_SPEC, VALID_A, O>; -impl<'a, const O: u8> VALID_W<'a, O> { +pub type VALID_W<'a, REG> = crate::BitWriter<'a, REG, VALID_A>; +impl<'a, REG> VALID_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VALID_A::VALUE1) } #[doc = "the processor: - updates the value of the MPU_RNR to the value of the REGION field - updates the base address for the region specified in the REGION field."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VALID_A::VALUE2) } } #[doc = "Field `ADDR` reader - Region base address field"] -pub type ADDR_R = crate::FieldReader; +pub type ADDR_R = crate::FieldReader; #[doc = "Field `ADDR` writer - Region base address field"] -pub type ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RBAR_A2_SPEC, u32, u32, 23, O>; +pub type ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 23, u32>; impl R { #[doc = "Bits 0:3 - MPU region field"] #[inline(always)] @@ -113,40 +84,41 @@ impl W { #[doc = "Bits 0:3 - MPU region field"] #[inline(always)] #[must_use] - pub fn region(&mut self) -> REGION_W<0> { - REGION_W::new(self) + pub fn region(&mut self) -> REGION_W { + REGION_W::new(self, 0) } #[doc = "Bit 4 - MPU Region Number valid bit"] #[inline(always)] #[must_use] - pub fn valid(&mut self) -> VALID_W<4> { - VALID_W::new(self) + pub fn valid(&mut self) -> VALID_W { + VALID_W::new(self, 4) } #[doc = "Bits 9:31 - Region base address field"] #[inline(always)] #[must_use] - pub fn addr(&mut self) -> ADDR_W<9> { - ADDR_W::new(self) + pub fn addr(&mut self) -> ADDR_W { + ADDR_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Base Address Register A2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rbar_a2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rbar_a2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rbar_a2::R`](R) reader structure"] +impl crate::Readable for MPU_RBAR_A2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rbar_a2::W`](W) writer structure"] impl crate::Writable for MPU_RBAR_A2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rbar_a3.rs b/src/ppb/mpu_rbar_a3.rs index 39101fe4..42198e82 100644 --- a/src/ppb/mpu_rbar_a3.rs +++ b/src/ppb/mpu_rbar_a3.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `REGION` reader - MPU region field"] -pub type REGION_R = crate::FieldReader; +pub type REGION_R = crate::FieldReader; #[doc = "Field `REGION` writer - MPU region field"] -pub type REGION_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RBAR_A3_SPEC, u8, u8, 4, O>; +pub type REGION_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `VALID` reader - MPU Region Number valid bit"] pub type VALID_R = crate::BitReader; #[doc = "MPU Region Number valid bit\n\nValue on reset: 0"] @@ -57,41 +25,44 @@ impl From for bool { impl VALID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VALID_A { + pub const fn variant(&self) -> VALID_A { match self.bits { false => VALID_A::VALUE1, true => VALID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == VALID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "the processor: - updates the value of the MPU_RNR to the value of the REGION field - updates the base address for the region specified in the REGION field."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VALID_A::VALUE2 } } #[doc = "Field `VALID` writer - MPU Region Number valid bit"] -pub type VALID_W<'a, const O: u8> = crate::BitWriter<'a, u32, MPU_RBAR_A3_SPEC, VALID_A, O>; -impl<'a, const O: u8> VALID_W<'a, O> { +pub type VALID_W<'a, REG> = crate::BitWriter<'a, REG, VALID_A>; +impl<'a, REG> VALID_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VALID_A::VALUE1) } #[doc = "the processor: - updates the value of the MPU_RNR to the value of the REGION field - updates the base address for the region specified in the REGION field."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VALID_A::VALUE2) } } #[doc = "Field `ADDR` reader - Region base address field"] -pub type ADDR_R = crate::FieldReader; +pub type ADDR_R = crate::FieldReader; #[doc = "Field `ADDR` writer - Region base address field"] -pub type ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RBAR_A3_SPEC, u32, u32, 23, O>; +pub type ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 23, u32>; impl R { #[doc = "Bits 0:3 - MPU region field"] #[inline(always)] @@ -113,40 +84,41 @@ impl W { #[doc = "Bits 0:3 - MPU region field"] #[inline(always)] #[must_use] - pub fn region(&mut self) -> REGION_W<0> { - REGION_W::new(self) + pub fn region(&mut self) -> REGION_W { + REGION_W::new(self, 0) } #[doc = "Bit 4 - MPU Region Number valid bit"] #[inline(always)] #[must_use] - pub fn valid(&mut self) -> VALID_W<4> { - VALID_W::new(self) + pub fn valid(&mut self) -> VALID_W { + VALID_W::new(self, 4) } #[doc = "Bits 9:31 - Region base address field"] #[inline(always)] #[must_use] - pub fn addr(&mut self) -> ADDR_W<9> { - ADDR_W::new(self) + pub fn addr(&mut self) -> ADDR_W { + ADDR_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Base Address Register A3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rbar_a3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rbar_a3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rbar_a3::R`](R) reader structure"] +impl crate::Readable for MPU_RBAR_A3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rbar_a3::W`](W) writer structure"] impl crate::Writable for MPU_RBAR_A3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_rnr.rs b/src/ppb/mpu_rnr.rs index b768c674..bc0cce5f 100644 --- a/src/ppb/mpu_rnr.rs +++ b/src/ppb/mpu_rnr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `REGION` reader - Region"] -pub type REGION_R = crate::FieldReader; +pub type REGION_R = crate::FieldReader; #[doc = "Field `REGION` writer - Region"] -pub type REGION_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MPU_RNR_SPEC, u8, u8, 8, O>; +pub type REGION_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Region"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:7 - Region"] #[inline(always)] #[must_use] - pub fn region(&mut self) -> REGION_W<0> { - REGION_W::new(self) + pub fn region(&mut self) -> REGION_W { + REGION_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "MPU Region Number Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_rnr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mpu_rnr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mpu_rnr::R`](R) reader structure"] +impl crate::Readable for MPU_RNR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mpu_rnr::W`](W) writer structure"] impl crate::Writable for MPU_RNR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/mpu_type.rs b/src/ppb/mpu_type.rs index 8df06c6a..09bdf4a0 100644 --- a/src/ppb/mpu_type.rs +++ b/src/ppb/mpu_type.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `SEPARATE` reader - Support for unified or separate instruction and date memory maps"] -pub type SEPARATE_R = crate::BitReader; +pub type SEPARATE_R = crate::BitReader; #[doc = "Field `DREGION` reader - Number of supported MPU data regions"] -pub type DREGION_R = crate::FieldReader; +pub type DREGION_R = crate::FieldReader; #[doc = "Field `IREGION` reader - Number of supported MPU instruction regions"] -pub type IREGION_R = crate::FieldReader; +pub type IREGION_R = crate::FieldReader; impl R { #[doc = "Bit 0 - Support for unified or separate instruction and date memory maps"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "MPU Type Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mpu_type::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`mpu_type::R`](R) reader structure"] +impl crate::Readable for MPU_TYPE_SPEC {} #[doc = "`reset()` method sets MPU_TYPE to value 0x0800"] impl crate::Resettable for MPU_TYPE_SPEC { const RESET_VALUE: Self::Ux = 0x0800; diff --git a/src/ppb/nvic_iabr0.rs b/src/ppb/nvic_iabr0.rs index ce359511..52dc8717 100644 --- a/src/ppb/nvic_iabr0.rs +++ b/src/ppb/nvic_iabr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ACTIVE` reader - Interrupt active flags:"] -pub type ACTIVE_R = crate::FieldReader; +pub type ACTIVE_R = crate::FieldReader; #[doc = "Interrupt active flags:\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for ACTIVE_A { + type Ux = u32; +} impl ACTIVE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ACTIVE_A::VALUE1), 1 => Some(ACTIVE_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "interrupt not active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ACTIVE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "interrupt active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ACTIVE_A::VALUE2 } } #[doc = "Field `ACTIVE` writer - Interrupt active flags:"] -pub type ACTIVE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IABR0_SPEC, u32, ACTIVE_A, 32, O>; -impl<'a, const O: u8> ACTIVE_W<'a, O> { +pub type ACTIVE_W<'a, REG> = crate::FieldWriter<'a, REG, 32, ACTIVE_A>; +impl<'a, REG> ACTIVE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt not active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ACTIVE_A::VALUE1) } #[doc = "interrupt active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ACTIVE_A::VALUE2) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt active flags:"] #[inline(always)] #[must_use] - pub fn active(&mut self) -> ACTIVE_W<0> { - ACTIVE_W::new(self) + pub fn active(&mut self) -> ACTIVE_W { + ACTIVE_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Active Bit Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iabr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iabr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_iabr0::R`](R) reader structure"] +impl crate::Readable for NVIC_IABR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_iabr0::W`](W) writer structure"] impl crate::Writable for NVIC_IABR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_iabr1.rs b/src/ppb/nvic_iabr1.rs index fa303418..830e6ee2 100644 --- a/src/ppb/nvic_iabr1.rs +++ b/src/ppb/nvic_iabr1.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ACTIVE` reader - Interrupt active flags:"] -pub type ACTIVE_R = crate::FieldReader; +pub type ACTIVE_R = crate::FieldReader; #[doc = "Interrupt active flags:\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for ACTIVE_A { + type Ux = u32; +} impl ACTIVE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ACTIVE_A::VALUE1), 1 => Some(ACTIVE_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "interrupt not active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ACTIVE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "interrupt active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ACTIVE_A::VALUE2 } } #[doc = "Field `ACTIVE` writer - Interrupt active flags:"] -pub type ACTIVE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IABR1_SPEC, u32, ACTIVE_A, 32, O>; -impl<'a, const O: u8> ACTIVE_W<'a, O> { +pub type ACTIVE_W<'a, REG> = crate::FieldWriter<'a, REG, 32, ACTIVE_A>; +impl<'a, REG> ACTIVE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt not active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ACTIVE_A::VALUE1) } #[doc = "interrupt active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ACTIVE_A::VALUE2) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt active flags:"] #[inline(always)] #[must_use] - pub fn active(&mut self) -> ACTIVE_W<0> { - ACTIVE_W::new(self) + pub fn active(&mut self) -> ACTIVE_W { + ACTIVE_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Active Bit Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iabr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iabr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_iabr1::R`](R) reader structure"] +impl crate::Readable for NVIC_IABR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_iabr1::W`](W) writer structure"] impl crate::Writable for NVIC_IABR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_iabr2.rs b/src/ppb/nvic_iabr2.rs index 2836e07c..d38c9527 100644 --- a/src/ppb/nvic_iabr2.rs +++ b/src/ppb/nvic_iabr2.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ACTIVE` reader - Interrupt active flags:"] -pub type ACTIVE_R = crate::FieldReader; +pub type ACTIVE_R = crate::FieldReader; #[doc = "Interrupt active flags:\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for ACTIVE_A { + type Ux = u32; +} impl ACTIVE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ACTIVE_A::VALUE1), 1 => Some(ACTIVE_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "interrupt not active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ACTIVE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "interrupt active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ACTIVE_A::VALUE2 } } #[doc = "Field `ACTIVE` writer - Interrupt active flags:"] -pub type ACTIVE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IABR2_SPEC, u32, ACTIVE_A, 32, O>; -impl<'a, const O: u8> ACTIVE_W<'a, O> { +pub type ACTIVE_W<'a, REG> = crate::FieldWriter<'a, REG, 32, ACTIVE_A>; +impl<'a, REG> ACTIVE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt not active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ACTIVE_A::VALUE1) } #[doc = "interrupt active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ACTIVE_A::VALUE2) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt active flags:"] #[inline(always)] #[must_use] - pub fn active(&mut self) -> ACTIVE_W<0> { - ACTIVE_W::new(self) + pub fn active(&mut self) -> ACTIVE_W { + ACTIVE_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Active Bit Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iabr2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iabr2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_iabr2::R`](R) reader structure"] +impl crate::Readable for NVIC_IABR2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_iabr2::W`](W) writer structure"] impl crate::Writable for NVIC_IABR2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_iabr3.rs b/src/ppb/nvic_iabr3.rs index ab307b63..8961960b 100644 --- a/src/ppb/nvic_iabr3.rs +++ b/src/ppb/nvic_iabr3.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ACTIVE` reader - Interrupt active flags:"] -pub type ACTIVE_R = crate::FieldReader; +pub type ACTIVE_R = crate::FieldReader; #[doc = "Interrupt active flags:\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for ACTIVE_A { + type Ux = u32; +} impl ACTIVE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ACTIVE_A::VALUE1), 1 => Some(ACTIVE_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "interrupt not active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ACTIVE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "interrupt active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ACTIVE_A::VALUE2 } } #[doc = "Field `ACTIVE` writer - Interrupt active flags:"] -pub type ACTIVE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IABR3_SPEC, u32, ACTIVE_A, 32, O>; -impl<'a, const O: u8> ACTIVE_W<'a, O> { +pub type ACTIVE_W<'a, REG> = crate::FieldWriter<'a, REG, 32, ACTIVE_A>; +impl<'a, REG> ACTIVE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt not active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ACTIVE_A::VALUE1) } #[doc = "interrupt active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ACTIVE_A::VALUE2) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt active flags:"] #[inline(always)] #[must_use] - pub fn active(&mut self) -> ACTIVE_W<0> { - ACTIVE_W::new(self) + pub fn active(&mut self) -> ACTIVE_W { + ACTIVE_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Active Bit Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iabr3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iabr3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_iabr3::R`](R) reader structure"] +impl crate::Readable for NVIC_IABR3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_iabr3::W`](W) writer structure"] impl crate::Writable for NVIC_IABR3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_icer0.rs b/src/ppb/nvic_icer0.rs index 1435dcb5..7094549e 100644 --- a/src/ppb/nvic_icer0.rs +++ b/src/ppb/nvic_icer0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] -pub type CLRENA_R = crate::FieldReader; +pub type CLRENA_R = crate::FieldReader; #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for CLRENA_A { + type Ux = u32; +} impl CLRENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLRENA_A::VALUE3), 1 => Some(CLRENA_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt disabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLRENA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLRENA_A::VALUE4 } } #[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] -pub type CLRENA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ICER0_SPEC, u32, CLRENA_A, 32, O>; -impl<'a, const O: u8> CLRENA_W<'a, O> { +pub type CLRENA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRENA_A>; +impl<'a, REG> CLRENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt disabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLRENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLRENA_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt clear-enable bits."] #[inline(always)] #[must_use] - pub fn clrena(&mut self) -> CLRENA_W<0> { - CLRENA_W::new(self) + pub fn clrena(&mut self) -> CLRENA_W { + CLRENA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Clear-enable Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icer0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icer0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_icer0::R`](R) reader structure"] +impl crate::Readable for NVIC_ICER0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_icer0::W`](W) writer structure"] impl crate::Writable for NVIC_ICER0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_icer1.rs b/src/ppb/nvic_icer1.rs index 2cecb19e..55928e23 100644 --- a/src/ppb/nvic_icer1.rs +++ b/src/ppb/nvic_icer1.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] -pub type CLRENA_R = crate::FieldReader; +pub type CLRENA_R = crate::FieldReader; #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for CLRENA_A { + type Ux = u32; +} impl CLRENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLRENA_A::VALUE3), 1 => Some(CLRENA_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt disabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLRENA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLRENA_A::VALUE4 } } #[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] -pub type CLRENA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ICER1_SPEC, u32, CLRENA_A, 32, O>; -impl<'a, const O: u8> CLRENA_W<'a, O> { +pub type CLRENA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRENA_A>; +impl<'a, REG> CLRENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt disabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLRENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLRENA_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt clear-enable bits."] #[inline(always)] #[must_use] - pub fn clrena(&mut self) -> CLRENA_W<0> { - CLRENA_W::new(self) + pub fn clrena(&mut self) -> CLRENA_W { + CLRENA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Clear-enable Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icer1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icer1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_icer1::R`](R) reader structure"] +impl crate::Readable for NVIC_ICER1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_icer1::W`](W) writer structure"] impl crate::Writable for NVIC_ICER1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_icer2.rs b/src/ppb/nvic_icer2.rs index f3ed5c82..8cc5b40d 100644 --- a/src/ppb/nvic_icer2.rs +++ b/src/ppb/nvic_icer2.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] -pub type CLRENA_R = crate::FieldReader; +pub type CLRENA_R = crate::FieldReader; #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for CLRENA_A { + type Ux = u32; +} impl CLRENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLRENA_A::VALUE3), 1 => Some(CLRENA_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt disabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLRENA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLRENA_A::VALUE4 } } #[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] -pub type CLRENA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ICER2_SPEC, u32, CLRENA_A, 32, O>; -impl<'a, const O: u8> CLRENA_W<'a, O> { +pub type CLRENA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRENA_A>; +impl<'a, REG> CLRENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt disabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLRENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLRENA_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt clear-enable bits."] #[inline(always)] #[must_use] - pub fn clrena(&mut self) -> CLRENA_W<0> { - CLRENA_W::new(self) + pub fn clrena(&mut self) -> CLRENA_W { + CLRENA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Clear-enable Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icer2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icer2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_icer2::R`](R) reader structure"] +impl crate::Readable for NVIC_ICER2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_icer2::W`](W) writer structure"] impl crate::Writable for NVIC_ICER2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_icer3.rs b/src/ppb/nvic_icer3.rs index 78cba255..bd025a8d 100644 --- a/src/ppb/nvic_icer3.rs +++ b/src/ppb/nvic_icer3.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLRENA` reader - Interrupt clear-enable bits."] -pub type CLRENA_R = crate::FieldReader; +pub type CLRENA_R = crate::FieldReader; #[doc = "Interrupt clear-enable bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for CLRENA_A { + type Ux = u32; +} impl CLRENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLRENA_A::VALUE3), 1 => Some(CLRENA_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt disabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLRENA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLRENA_A::VALUE4 } } #[doc = "Field `CLRENA` writer - Interrupt clear-enable bits."] -pub type CLRENA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ICER3_SPEC, u32, CLRENA_A, 32, O>; -impl<'a, const O: u8> CLRENA_W<'a, O> { +pub type CLRENA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRENA_A>; +impl<'a, REG> CLRENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt disabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLRENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLRENA_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt clear-enable bits."] #[inline(always)] #[must_use] - pub fn clrena(&mut self) -> CLRENA_W<0> { - CLRENA_W::new(self) + pub fn clrena(&mut self) -> CLRENA_W { + CLRENA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Clear-enable Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icer3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icer3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_icer3::R`](R) reader structure"] +impl crate::Readable for NVIC_ICER3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_icer3::W`](W) writer structure"] impl crate::Writable for NVIC_ICER3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_icpr0.rs b/src/ppb/nvic_icpr0.rs index ecaaa44f..3aaac3e7 100644 --- a/src/ppb/nvic_icpr0.rs +++ b/src/ppb/nvic_icpr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."] -pub type CLRPEND_R = crate::FieldReader; +pub type CLRPEND_R = crate::FieldReader; #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for CLRPEND_A { + type Ux = u32; +} impl CLRPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLRPEND_A::VALUE3), 1 => Some(CLRPEND_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt is not pending"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLRPEND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt is pending."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLRPEND_A::VALUE4 } } #[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."] -pub type CLRPEND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ICPR0_SPEC, u32, CLRPEND_A, 32, O>; -impl<'a, const O: u8> CLRPEND_W<'a, O> { +pub type CLRPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRPEND_A>; +impl<'a, REG> CLRPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt is not pending"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLRPEND_A::VALUE3) } #[doc = "interrupt is pending."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLRPEND_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-pending bits."] #[inline(always)] #[must_use] - pub fn clrpend(&mut self) -> CLRPEND_W<0> { - CLRPEND_W::new(self) + pub fn clrpend(&mut self) -> CLRPEND_W { + CLRPEND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Clear-pending Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icpr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icpr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_icpr0::R`](R) reader structure"] +impl crate::Readable for NVIC_ICPR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_icpr0::W`](W) writer structure"] impl crate::Writable for NVIC_ICPR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_icpr1.rs b/src/ppb/nvic_icpr1.rs index d025b841..2b3e19be 100644 --- a/src/ppb/nvic_icpr1.rs +++ b/src/ppb/nvic_icpr1.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."] -pub type CLRPEND_R = crate::FieldReader; +pub type CLRPEND_R = crate::FieldReader; #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for CLRPEND_A { + type Ux = u32; +} impl CLRPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLRPEND_A::VALUE3), 1 => Some(CLRPEND_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt is not pending"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLRPEND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt is pending."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLRPEND_A::VALUE4 } } #[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."] -pub type CLRPEND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ICPR1_SPEC, u32, CLRPEND_A, 32, O>; -impl<'a, const O: u8> CLRPEND_W<'a, O> { +pub type CLRPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRPEND_A>; +impl<'a, REG> CLRPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt is not pending"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLRPEND_A::VALUE3) } #[doc = "interrupt is pending."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLRPEND_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-pending bits."] #[inline(always)] #[must_use] - pub fn clrpend(&mut self) -> CLRPEND_W<0> { - CLRPEND_W::new(self) + pub fn clrpend(&mut self) -> CLRPEND_W { + CLRPEND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Clear-pending Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icpr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icpr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_icpr1::R`](R) reader structure"] +impl crate::Readable for NVIC_ICPR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_icpr1::W`](W) writer structure"] impl crate::Writable for NVIC_ICPR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_icpr2.rs b/src/ppb/nvic_icpr2.rs index f63ee45b..13d8cf15 100644 --- a/src/ppb/nvic_icpr2.rs +++ b/src/ppb/nvic_icpr2.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."] -pub type CLRPEND_R = crate::FieldReader; +pub type CLRPEND_R = crate::FieldReader; #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for CLRPEND_A { + type Ux = u32; +} impl CLRPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLRPEND_A::VALUE3), 1 => Some(CLRPEND_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt is not pending"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLRPEND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt is pending."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLRPEND_A::VALUE4 } } #[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."] -pub type CLRPEND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ICPR2_SPEC, u32, CLRPEND_A, 32, O>; -impl<'a, const O: u8> CLRPEND_W<'a, O> { +pub type CLRPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRPEND_A>; +impl<'a, REG> CLRPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt is not pending"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLRPEND_A::VALUE3) } #[doc = "interrupt is pending."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLRPEND_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-pending bits."] #[inline(always)] #[must_use] - pub fn clrpend(&mut self) -> CLRPEND_W<0> { - CLRPEND_W::new(self) + pub fn clrpend(&mut self) -> CLRPEND_W { + CLRPEND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Clear-pending Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icpr2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icpr2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_icpr2::R`](R) reader structure"] +impl crate::Readable for NVIC_ICPR2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_icpr2::W`](W) writer structure"] impl crate::Writable for NVIC_ICPR2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_icpr3.rs b/src/ppb/nvic_icpr3.rs index 643ae009..b78d44eb 100644 --- a/src/ppb/nvic_icpr3.rs +++ b/src/ppb/nvic_icpr3.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLRPEND` reader - Interrupt set-pending bits."] -pub type CLRPEND_R = crate::FieldReader; +pub type CLRPEND_R = crate::FieldReader; #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for CLRPEND_A { + type Ux = u32; +} impl CLRPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLRPEND_A::VALUE3), 1 => Some(CLRPEND_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt is not pending"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLRPEND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt is pending."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLRPEND_A::VALUE4 } } #[doc = "Field `CLRPEND` writer - Interrupt set-pending bits."] -pub type CLRPEND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ICPR3_SPEC, u32, CLRPEND_A, 32, O>; -impl<'a, const O: u8> CLRPEND_W<'a, O> { +pub type CLRPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, CLRPEND_A>; +impl<'a, REG> CLRPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt is not pending"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLRPEND_A::VALUE3) } #[doc = "interrupt is pending."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLRPEND_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-pending bits."] #[inline(always)] #[must_use] - pub fn clrpend(&mut self) -> CLRPEND_W<0> { - CLRPEND_W::new(self) + pub fn clrpend(&mut self) -> CLRPEND_W { + CLRPEND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Clear-pending Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_icpr3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_icpr3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_icpr3::R`](R) reader structure"] +impl crate::Readable for NVIC_ICPR3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_icpr3::W`](W) writer structure"] impl crate::Writable for NVIC_ICPR3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr0.rs b/src/ppb/nvic_ipr0.rs index 5f3e9ece..4c386e0b 100644 --- a/src/ppb/nvic_ipr0.rs +++ b/src/ppb/nvic_ipr0.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR0_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR0_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR0_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR0_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr0::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr0::W`](W) writer structure"] impl crate::Writable for NVIC_IPR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr1.rs b/src/ppb/nvic_ipr1.rs index 915c92b9..af72cde9 100644 --- a/src/ppb/nvic_ipr1.rs +++ b/src/ppb/nvic_ipr1.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR1_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR1_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR1_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR1_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr1::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr1::W`](W) writer structure"] impl crate::Writable for NVIC_IPR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr10.rs b/src/ppb/nvic_ipr10.rs index 51aacf36..766ca00f 100644 --- a/src/ppb/nvic_ipr10.rs +++ b/src/ppb/nvic_ipr10.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR10_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR10_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR10_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR10_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 10\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr10::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr10::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr10::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR10_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr10::W`](W) writer structure"] impl crate::Writable for NVIC_IPR10_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr11.rs b/src/ppb/nvic_ipr11.rs index fef70625..a0afb84b 100644 --- a/src/ppb/nvic_ipr11.rs +++ b/src/ppb/nvic_ipr11.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR11_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR11_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR11_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR11_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 11\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr11::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr11::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr11::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR11_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr11::W`](W) writer structure"] impl crate::Writable for NVIC_IPR11_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr12.rs b/src/ppb/nvic_ipr12.rs index 669ec75e..58814f63 100644 --- a/src/ppb/nvic_ipr12.rs +++ b/src/ppb/nvic_ipr12.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR12_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR12_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR12_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR12_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 12\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr12::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr12::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr12::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR12_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr12::W`](W) writer structure"] impl crate::Writable for NVIC_IPR12_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr13.rs b/src/ppb/nvic_ipr13.rs index 10d9b222..4d0c1003 100644 --- a/src/ppb/nvic_ipr13.rs +++ b/src/ppb/nvic_ipr13.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR13_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR13_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR13_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR13_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 13\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr13::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr13::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr13::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR13_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr13::W`](W) writer structure"] impl crate::Writable for NVIC_IPR13_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr14.rs b/src/ppb/nvic_ipr14.rs index 9e3fcd4c..1a161d3e 100644 --- a/src/ppb/nvic_ipr14.rs +++ b/src/ppb/nvic_ipr14.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR14_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR14_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR14_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR14_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 14\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr14::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr14::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr14::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR14_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr14::W`](W) writer structure"] impl crate::Writable for NVIC_IPR14_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr15.rs b/src/ppb/nvic_ipr15.rs index 9ea021ae..169403b2 100644 --- a/src/ppb/nvic_ipr15.rs +++ b/src/ppb/nvic_ipr15.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR15_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR15_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR15_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR15_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 15\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr15::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr15::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr15::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR15_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr15::W`](W) writer structure"] impl crate::Writable for NVIC_IPR15_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr16.rs b/src/ppb/nvic_ipr16.rs index a369aa38..e1ab2638 100644 --- a/src/ppb/nvic_ipr16.rs +++ b/src/ppb/nvic_ipr16.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR16_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR16_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR16_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR16_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 16\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr16::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr16::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr16::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR16_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr16::W`](W) writer structure"] impl crate::Writable for NVIC_IPR16_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr17.rs b/src/ppb/nvic_ipr17.rs index 5f169c0b..52744d3c 100644 --- a/src/ppb/nvic_ipr17.rs +++ b/src/ppb/nvic_ipr17.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR17_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR17_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR17_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR17_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 17\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr17::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr17::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr17::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR17_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr17::W`](W) writer structure"] impl crate::Writable for NVIC_IPR17_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr18.rs b/src/ppb/nvic_ipr18.rs index e075048b..103d33b1 100644 --- a/src/ppb/nvic_ipr18.rs +++ b/src/ppb/nvic_ipr18.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR18_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR18_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR18_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR18_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 18\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr18::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr18::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr18::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR18_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr18::W`](W) writer structure"] impl crate::Writable for NVIC_IPR18_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr19.rs b/src/ppb/nvic_ipr19.rs index 59a10536..df1fa06c 100644 --- a/src/ppb/nvic_ipr19.rs +++ b/src/ppb/nvic_ipr19.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR19_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR19_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR19_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR19_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 19\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr19::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr19::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr19::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR19_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr19::W`](W) writer structure"] impl crate::Writable for NVIC_IPR19_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr2.rs b/src/ppb/nvic_ipr2.rs index a4d5441d..44b633c9 100644 --- a/src/ppb/nvic_ipr2.rs +++ b/src/ppb/nvic_ipr2.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR2_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR2_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR2_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR2_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr2::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr2::W`](W) writer structure"] impl crate::Writable for NVIC_IPR2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr20.rs b/src/ppb/nvic_ipr20.rs index c02c64ac..293ab41a 100644 --- a/src/ppb/nvic_ipr20.rs +++ b/src/ppb/nvic_ipr20.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR20_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR20_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR20_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR20_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 20\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr20::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr20::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr20::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR20_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr20::W`](W) writer structure"] impl crate::Writable for NVIC_IPR20_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr21.rs b/src/ppb/nvic_ipr21.rs index 98fab8fa..14b19c1f 100644 --- a/src/ppb/nvic_ipr21.rs +++ b/src/ppb/nvic_ipr21.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR21_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR21_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR21_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR21_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 21\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr21::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr21::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr21::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR21_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr21::W`](W) writer structure"] impl crate::Writable for NVIC_IPR21_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr22.rs b/src/ppb/nvic_ipr22.rs index cf408cbb..df2a3379 100644 --- a/src/ppb/nvic_ipr22.rs +++ b/src/ppb/nvic_ipr22.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR22_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR22_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR22_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR22_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 22\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr22::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr22::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr22::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR22_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr22::W`](W) writer structure"] impl crate::Writable for NVIC_IPR22_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr23.rs b/src/ppb/nvic_ipr23.rs index 7dcfa780..5168901d 100644 --- a/src/ppb/nvic_ipr23.rs +++ b/src/ppb/nvic_ipr23.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR23_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR23_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR23_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR23_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 23\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr23::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr23::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr23::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR23_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr23::W`](W) writer structure"] impl crate::Writable for NVIC_IPR23_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr24.rs b/src/ppb/nvic_ipr24.rs index c99b6146..2efb581b 100644 --- a/src/ppb/nvic_ipr24.rs +++ b/src/ppb/nvic_ipr24.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR24_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR24_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR24_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR24_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 24\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr24::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr24::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr24::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR24_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr24::W`](W) writer structure"] impl crate::Writable for NVIC_IPR24_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr25.rs b/src/ppb/nvic_ipr25.rs index efc462c7..ceffc845 100644 --- a/src/ppb/nvic_ipr25.rs +++ b/src/ppb/nvic_ipr25.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR25_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR25_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR25_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR25_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 25\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr25::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr25::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr25::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR25_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr25::W`](W) writer structure"] impl crate::Writable for NVIC_IPR25_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr26.rs b/src/ppb/nvic_ipr26.rs index 3c02ef2d..2aba0700 100644 --- a/src/ppb/nvic_ipr26.rs +++ b/src/ppb/nvic_ipr26.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR26_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR26_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR26_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR26_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 26\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr26::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr26::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr26::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR26_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr26::W`](W) writer structure"] impl crate::Writable for NVIC_IPR26_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr27.rs b/src/ppb/nvic_ipr27.rs index 45f0d45a..1e150160 100644 --- a/src/ppb/nvic_ipr27.rs +++ b/src/ppb/nvic_ipr27.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR27_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR27_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR27_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR27_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 27\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr27::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr27::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr27::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR27_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr27::W`](W) writer structure"] impl crate::Writable for NVIC_IPR27_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr3.rs b/src/ppb/nvic_ipr3.rs index 2e8a6cff..69bfc44b 100644 --- a/src/ppb/nvic_ipr3.rs +++ b/src/ppb/nvic_ipr3.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR3_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR3_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR3_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR3_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr3::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr3::W`](W) writer structure"] impl crate::Writable for NVIC_IPR3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr4.rs b/src/ppb/nvic_ipr4.rs index eeb770d7..95efccb3 100644 --- a/src/ppb/nvic_ipr4.rs +++ b/src/ppb/nvic_ipr4.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR4_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR4_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR4_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR4_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr4::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr4::W`](W) writer structure"] impl crate::Writable for NVIC_IPR4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr5.rs b/src/ppb/nvic_ipr5.rs index 1f6578dd..61ca8e6a 100644 --- a/src/ppb/nvic_ipr5.rs +++ b/src/ppb/nvic_ipr5.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR5_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR5_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR5_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR5_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 5\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr5::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr5::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr5::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR5_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr5::W`](W) writer structure"] impl crate::Writable for NVIC_IPR5_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr6.rs b/src/ppb/nvic_ipr6.rs index 43d1a093..f0de0d11 100644 --- a/src/ppb/nvic_ipr6.rs +++ b/src/ppb/nvic_ipr6.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR6_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR6_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR6_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR6_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 6\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr6::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr6::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr6::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR6_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr6::W`](W) writer structure"] impl crate::Writable for NVIC_IPR6_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr7.rs b/src/ppb/nvic_ipr7.rs index 379dd3f5..6ee3779d 100644 --- a/src/ppb/nvic_ipr7.rs +++ b/src/ppb/nvic_ipr7.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR7_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR7_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR7_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR7_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 7\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr7::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr7::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr7::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR7_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr7::W`](W) writer structure"] impl crate::Writable for NVIC_IPR7_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr8.rs b/src/ppb/nvic_ipr8.rs index 79da4acb..e1d03f2d 100644 --- a/src/ppb/nvic_ipr8.rs +++ b/src/ppb/nvic_ipr8.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR8_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR8_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR8_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR8_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 8\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr8::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr8::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr8::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR8_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr8::W`](W) writer structure"] impl crate::Writable for NVIC_IPR8_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ipr9.rs b/src/ppb/nvic_ipr9.rs index 6a0fef6f..14cacf42 100644 --- a/src/ppb/nvic_ipr9.rs +++ b/src/ppb/nvic_ipr9.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PRI_0` reader - Priority value 0"] -pub type PRI_0_R = crate::FieldReader; +pub type PRI_0_R = crate::FieldReader; #[doc = "Field `PRI_0` writer - Priority value 0"] -pub type PRI_0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR9_SPEC, u8, u8, 8, O>; +pub type PRI_0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_1` reader - Priority value 1"] -pub type PRI_1_R = crate::FieldReader; +pub type PRI_1_R = crate::FieldReader; #[doc = "Field `PRI_1` writer - Priority value 1"] -pub type PRI_1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR9_SPEC, u8, u8, 8, O>; +pub type PRI_1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_2` reader - Priority value 2"] -pub type PRI_2_R = crate::FieldReader; +pub type PRI_2_R = crate::FieldReader; #[doc = "Field `PRI_2` writer - Priority value 2"] -pub type PRI_2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR9_SPEC, u8, u8, 8, O>; +pub type PRI_2_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_3` reader - Priority value 3"] -pub type PRI_3_R = crate::FieldReader; +pub type PRI_3_R = crate::FieldReader; #[doc = "Field `PRI_3` writer - Priority value 3"] -pub type PRI_3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_IPR9_SPEC, u8, u8, 8, O>; +pub type PRI_3_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:7 - Priority value 0"] #[inline(always)] #[must_use] - pub fn pri_0(&mut self) -> PRI_0_W<0> { - PRI_0_W::new(self) + pub fn pri_0(&mut self) -> PRI_0_W { + PRI_0_W::new(self, 0) } #[doc = "Bits 8:15 - Priority value 1"] #[inline(always)] #[must_use] - pub fn pri_1(&mut self) -> PRI_1_W<8> { - PRI_1_W::new(self) + pub fn pri_1(&mut self) -> PRI_1_W { + PRI_1_W::new(self, 8) } #[doc = "Bits 16:23 - Priority value 2"] #[inline(always)] #[must_use] - pub fn pri_2(&mut self) -> PRI_2_W<16> { - PRI_2_W::new(self) + pub fn pri_2(&mut self) -> PRI_2_W { + PRI_2_W::new(self, 16) } #[doc = "Bits 24:31 - Priority value 3"] #[inline(always)] #[must_use] - pub fn pri_3(&mut self) -> PRI_3_W<24> { - PRI_3_W::new(self) + pub fn pri_3(&mut self) -> PRI_3_W { + PRI_3_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Priority Register 9\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ipr9::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ipr9::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ipr9::R`](R) reader structure"] +impl crate::Readable for NVIC_IPR9_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ipr9::W`](W) writer structure"] impl crate::Writable for NVIC_IPR9_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_iser0.rs b/src/ppb/nvic_iser0.rs index 883b8d28..0e3d80a6 100644 --- a/src/ppb/nvic_iser0.rs +++ b/src/ppb/nvic_iser0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SETENA` reader - Interrupt set-enable bits"] -pub type SETENA_R = crate::FieldReader; +pub type SETENA_R = crate::FieldReader; #[doc = "Interrupt set-enable bits\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for SETENA_A { + type Ux = u32; +} impl SETENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SETENA_A::VALUE3), 1 => Some(SETENA_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt disabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SETENA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SETENA_A::VALUE4 } } #[doc = "Field `SETENA` writer - Interrupt set-enable bits"] -pub type SETENA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ISER0_SPEC, u32, SETENA_A, 32, O>; -impl<'a, const O: u8> SETENA_W<'a, O> { +pub type SETENA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, SETENA_A>; +impl<'a, REG> SETENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt disabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SETENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SETENA_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-enable bits"] #[inline(always)] #[must_use] - pub fn setena(&mut self) -> SETENA_W<0> { - SETENA_W::new(self) + pub fn setena(&mut self) -> SETENA_W { + SETENA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Set-enable Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iser0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iser0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_iser0::R`](R) reader structure"] +impl crate::Readable for NVIC_ISER0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_iser0::W`](W) writer structure"] impl crate::Writable for NVIC_ISER0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_iser1.rs b/src/ppb/nvic_iser1.rs index ac38f7e6..d2fc5c13 100644 --- a/src/ppb/nvic_iser1.rs +++ b/src/ppb/nvic_iser1.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SETENA` reader - Interrupt set-enable bits"] -pub type SETENA_R = crate::FieldReader; +pub type SETENA_R = crate::FieldReader; #[doc = "Interrupt set-enable bits\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for SETENA_A { + type Ux = u32; +} impl SETENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SETENA_A::VALUE3), 1 => Some(SETENA_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt disabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SETENA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SETENA_A::VALUE4 } } #[doc = "Field `SETENA` writer - Interrupt set-enable bits"] -pub type SETENA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ISER1_SPEC, u32, SETENA_A, 32, O>; -impl<'a, const O: u8> SETENA_W<'a, O> { +pub type SETENA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, SETENA_A>; +impl<'a, REG> SETENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt disabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SETENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SETENA_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-enable bits"] #[inline(always)] #[must_use] - pub fn setena(&mut self) -> SETENA_W<0> { - SETENA_W::new(self) + pub fn setena(&mut self) -> SETENA_W { + SETENA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Set-enable Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iser1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iser1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_iser1::R`](R) reader structure"] +impl crate::Readable for NVIC_ISER1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_iser1::W`](W) writer structure"] impl crate::Writable for NVIC_ISER1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_iser2.rs b/src/ppb/nvic_iser2.rs index 6f9c38cb..c229ef91 100644 --- a/src/ppb/nvic_iser2.rs +++ b/src/ppb/nvic_iser2.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SETENA` reader - Interrupt set-enable bits"] -pub type SETENA_R = crate::FieldReader; +pub type SETENA_R = crate::FieldReader; #[doc = "Interrupt set-enable bits\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for SETENA_A { + type Ux = u32; +} impl SETENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SETENA_A::VALUE3), 1 => Some(SETENA_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt disabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SETENA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SETENA_A::VALUE4 } } #[doc = "Field `SETENA` writer - Interrupt set-enable bits"] -pub type SETENA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ISER2_SPEC, u32, SETENA_A, 32, O>; -impl<'a, const O: u8> SETENA_W<'a, O> { +pub type SETENA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, SETENA_A>; +impl<'a, REG> SETENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt disabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SETENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SETENA_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-enable bits"] #[inline(always)] #[must_use] - pub fn setena(&mut self) -> SETENA_W<0> { - SETENA_W::new(self) + pub fn setena(&mut self) -> SETENA_W { + SETENA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Set-enable Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iser2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iser2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_iser2::R`](R) reader structure"] +impl crate::Readable for NVIC_ISER2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_iser2::W`](W) writer structure"] impl crate::Writable for NVIC_ISER2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_iser3.rs b/src/ppb/nvic_iser3.rs index 530d1e42..c157540b 100644 --- a/src/ppb/nvic_iser3.rs +++ b/src/ppb/nvic_iser3.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SETENA` reader - Interrupt set-enable bits"] -pub type SETENA_R = crate::FieldReader; +pub type SETENA_R = crate::FieldReader; #[doc = "Interrupt set-enable bits\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for SETENA_A { + type Ux = u32; +} impl SETENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SETENA_A::VALUE3), 1 => Some(SETENA_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt disabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SETENA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SETENA_A::VALUE4 } } #[doc = "Field `SETENA` writer - Interrupt set-enable bits"] -pub type SETENA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ISER3_SPEC, u32, SETENA_A, 32, O>; -impl<'a, const O: u8> SETENA_W<'a, O> { +pub type SETENA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, SETENA_A>; +impl<'a, REG> SETENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt disabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SETENA_A::VALUE3) } #[doc = "interrupt enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SETENA_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-enable bits"] #[inline(always)] #[must_use] - pub fn setena(&mut self) -> SETENA_W<0> { - SETENA_W::new(self) + pub fn setena(&mut self) -> SETENA_W { + SETENA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Set-enable Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_iser3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_iser3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_iser3::R`](R) reader structure"] +impl crate::Readable for NVIC_ISER3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_iser3::W`](W) writer structure"] impl crate::Writable for NVIC_ISER3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ispr0.rs b/src/ppb/nvic_ispr0.rs index e471e561..68bfdd33 100644 --- a/src/ppb/nvic_ispr0.rs +++ b/src/ppb/nvic_ispr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SETPEND` reader - Interrupt set-pending bits."] -pub type SETPEND_R = crate::FieldReader; +pub type SETPEND_R = crate::FieldReader; #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for SETPEND_A { + type Ux = u32; +} impl SETPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SETPEND_A::VALUE3), 1 => Some(SETPEND_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt is not pending"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SETPEND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt is pending."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SETPEND_A::VALUE4 } } #[doc = "Field `SETPEND` writer - Interrupt set-pending bits."] -pub type SETPEND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ISPR0_SPEC, u32, SETPEND_A, 32, O>; -impl<'a, const O: u8> SETPEND_W<'a, O> { +pub type SETPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, SETPEND_A>; +impl<'a, REG> SETPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt is not pending"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SETPEND_A::VALUE3) } #[doc = "interrupt is pending."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SETPEND_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-pending bits."] #[inline(always)] #[must_use] - pub fn setpend(&mut self) -> SETPEND_W<0> { - SETPEND_W::new(self) + pub fn setpend(&mut self) -> SETPEND_W { + SETPEND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Set-pending Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ispr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ispr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ispr0::R`](R) reader structure"] +impl crate::Readable for NVIC_ISPR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ispr0::W`](W) writer structure"] impl crate::Writable for NVIC_ISPR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ispr1.rs b/src/ppb/nvic_ispr1.rs index 38f6b4b7..5fe721dd 100644 --- a/src/ppb/nvic_ispr1.rs +++ b/src/ppb/nvic_ispr1.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SETPEND` reader - Interrupt set-pending bits."] -pub type SETPEND_R = crate::FieldReader; +pub type SETPEND_R = crate::FieldReader; #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for SETPEND_A { + type Ux = u32; +} impl SETPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SETPEND_A::VALUE3), 1 => Some(SETPEND_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt is not pending"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SETPEND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt is pending."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SETPEND_A::VALUE4 } } #[doc = "Field `SETPEND` writer - Interrupt set-pending bits."] -pub type SETPEND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ISPR1_SPEC, u32, SETPEND_A, 32, O>; -impl<'a, const O: u8> SETPEND_W<'a, O> { +pub type SETPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, SETPEND_A>; +impl<'a, REG> SETPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt is not pending"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SETPEND_A::VALUE3) } #[doc = "interrupt is pending."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SETPEND_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-pending bits."] #[inline(always)] #[must_use] - pub fn setpend(&mut self) -> SETPEND_W<0> { - SETPEND_W::new(self) + pub fn setpend(&mut self) -> SETPEND_W { + SETPEND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Set-pending Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ispr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ispr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ispr1::R`](R) reader structure"] +impl crate::Readable for NVIC_ISPR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ispr1::W`](W) writer structure"] impl crate::Writable for NVIC_ISPR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ispr2.rs b/src/ppb/nvic_ispr2.rs index 45af0a08..e4c31c8a 100644 --- a/src/ppb/nvic_ispr2.rs +++ b/src/ppb/nvic_ispr2.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SETPEND` reader - Interrupt set-pending bits."] -pub type SETPEND_R = crate::FieldReader; +pub type SETPEND_R = crate::FieldReader; #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for SETPEND_A { + type Ux = u32; +} impl SETPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SETPEND_A::VALUE3), 1 => Some(SETPEND_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt is not pending"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SETPEND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt is pending."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SETPEND_A::VALUE4 } } #[doc = "Field `SETPEND` writer - Interrupt set-pending bits."] -pub type SETPEND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ISPR2_SPEC, u32, SETPEND_A, 32, O>; -impl<'a, const O: u8> SETPEND_W<'a, O> { +pub type SETPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, SETPEND_A>; +impl<'a, REG> SETPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt is not pending"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SETPEND_A::VALUE3) } #[doc = "interrupt is pending."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SETPEND_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-pending bits."] #[inline(always)] #[must_use] - pub fn setpend(&mut self) -> SETPEND_W<0> { - SETPEND_W::new(self) + pub fn setpend(&mut self) -> SETPEND_W { + SETPEND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Set-pending Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ispr2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ispr2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ispr2::R`](R) reader structure"] +impl crate::Readable for NVIC_ISPR2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ispr2::W`](W) writer structure"] impl crate::Writable for NVIC_ISPR2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/nvic_ispr3.rs b/src/ppb/nvic_ispr3.rs index 5a1dbe6f..7da487ab 100644 --- a/src/ppb/nvic_ispr3.rs +++ b/src/ppb/nvic_ispr3.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SETPEND` reader - Interrupt set-pending bits."] -pub type SETPEND_R = crate::FieldReader; +pub type SETPEND_R = crate::FieldReader; #[doc = "Interrupt set-pending bits.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u32)] @@ -51,38 +19,45 @@ impl From for u32 { variant as _ } } +impl crate::FieldSpec for SETPEND_A { + type Ux = u32; +} impl SETPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SETPEND_A::VALUE3), 1 => Some(SETPEND_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "interrupt is not pending"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SETPEND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "interrupt is pending."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SETPEND_A::VALUE4 } } #[doc = "Field `SETPEND` writer - Interrupt set-pending bits."] -pub type SETPEND_W<'a, const O: u8> = crate::FieldWriter<'a, u32, NVIC_ISPR3_SPEC, u32, SETPEND_A, 32, O>; -impl<'a, const O: u8> SETPEND_W<'a, O> { +pub type SETPEND_W<'a, REG> = crate::FieldWriter<'a, REG, 32, SETPEND_A>; +impl<'a, REG> SETPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "interrupt is not pending"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SETPEND_A::VALUE3) } #[doc = "interrupt is pending."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SETPEND_A::VALUE4) } } @@ -97,28 +72,29 @@ impl W { #[doc = "Bits 0:31 - Interrupt set-pending bits."] #[inline(always)] #[must_use] - pub fn setpend(&mut self) -> SETPEND_W<0> { - SETPEND_W::new(self) + pub fn setpend(&mut self) -> SETPEND_W { + SETPEND_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Set-pending Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nvic_ispr3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nvic_ispr3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nvic_ispr3::R`](R) reader structure"] +impl crate::Readable for NVIC_ISPR3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nvic_ispr3::W`](W) writer structure"] impl crate::Writable for NVIC_ISPR3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/scr.rs b/src/ppb/scr.rs index 091d8c58..799c238d 100644 --- a/src/ppb/scr.rs +++ b/src/ppb/scr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SLEEPONEXIT` reader - Sleep on Exit"] pub type SLEEPONEXIT_R = crate::BitReader; #[doc = "Sleep on Exit\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SLEEPONEXIT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SLEEPONEXIT_A { + pub const fn variant(&self) -> SLEEPONEXIT_A { match self.bits { false => SLEEPONEXIT_A::VALUE1, true => SLEEPONEXIT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "do not sleep when returning to Thread mode."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SLEEPONEXIT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "enter sleep, or deep sleep, on return from an ISR."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SLEEPONEXIT_A::VALUE2 } } #[doc = "Field `SLEEPONEXIT` writer - Sleep on Exit"] -pub type SLEEPONEXIT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SCR_SPEC, SLEEPONEXIT_A, O>; -impl<'a, const O: u8> SLEEPONEXIT_W<'a, O> { +pub type SLEEPONEXIT_W<'a, REG> = crate::BitWriter<'a, REG, SLEEPONEXIT_A>; +impl<'a, REG> SLEEPONEXIT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "do not sleep when returning to Thread mode."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SLEEPONEXIT_A::VALUE1) } #[doc = "enter sleep, or deep sleep, on return from an ISR."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SLEEPONEXIT_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl SLEEPDEEP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SLEEPDEEP_A { + pub const fn variant(&self) -> SLEEPDEEP_A { match self.bits { false => SLEEPDEEP_A::VALUE1, true => SLEEPDEEP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "sleep"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SLEEPDEEP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "deep sleep"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SLEEPDEEP_A::VALUE2 } } #[doc = "Field `SLEEPDEEP` writer - Sleep or Deep Sleep"] -pub type SLEEPDEEP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SCR_SPEC, SLEEPDEEP_A, O>; -impl<'a, const O: u8> SLEEPDEEP_W<'a, O> { +pub type SLEEPDEEP_W<'a, REG> = crate::BitWriter<'a, REG, SLEEPDEEP_A>; +impl<'a, REG> SLEEPDEEP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "sleep"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SLEEPDEEP_A::VALUE1) } #[doc = "deep sleep"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SLEEPDEEP_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl SEVONPEND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SEVONPEND_A { + pub const fn variant(&self) -> SEVONPEND_A { match self.bits { false => SEVONPEND_A::VALUE1, true => SEVONPEND_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "only enabled interrupts or events can wakeup the processor, disabled interrupts are excluded"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SEVONPEND_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "enabled events and all interrupts, including disabled interrupts, can wakeup the processor."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SEVONPEND_A::VALUE2 } } #[doc = "Field `SEVONPEND` writer - Send Event on Pending bit:"] -pub type SEVONPEND_W<'a, const O: u8> = crate::BitWriter<'a, u32, SCR_SPEC, SEVONPEND_A, O>; -impl<'a, const O: u8> SEVONPEND_W<'a, O> { +pub type SEVONPEND_W<'a, REG> = crate::BitWriter<'a, REG, SEVONPEND_A>; +impl<'a, REG> SEVONPEND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "only enabled interrupts or events can wakeup the processor, disabled interrupts are excluded"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEVONPEND_A::VALUE1) } #[doc = "enabled events and all interrupts, including disabled interrupts, can wakeup the processor."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEVONPEND_A::VALUE2) } } @@ -205,40 +182,41 @@ impl W { #[doc = "Bit 1 - Sleep on Exit"] #[inline(always)] #[must_use] - pub fn sleeponexit(&mut self) -> SLEEPONEXIT_W<1> { - SLEEPONEXIT_W::new(self) + pub fn sleeponexit(&mut self) -> SLEEPONEXIT_W { + SLEEPONEXIT_W::new(self, 1) } #[doc = "Bit 2 - Sleep or Deep Sleep"] #[inline(always)] #[must_use] - pub fn sleepdeep(&mut self) -> SLEEPDEEP_W<2> { - SLEEPDEEP_W::new(self) + pub fn sleepdeep(&mut self) -> SLEEPDEEP_W { + SLEEPDEEP_W::new(self, 2) } #[doc = "Bit 4 - Send Event on Pending bit:"] #[inline(always)] #[must_use] - pub fn sevonpend(&mut self) -> SEVONPEND_W<4> { - SEVONPEND_W::new(self) + pub fn sevonpend(&mut self) -> SEVONPEND_W { + SEVONPEND_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "System Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`scr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`scr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`scr::R`](R) reader structure"] +impl crate::Readable for SCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`scr::W`](W) writer structure"] impl crate::Writable for SCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/shcsr.rs b/src/ppb/shcsr.rs index 5743e611..eb827aee 100644 --- a/src/ppb/shcsr.rs +++ b/src/ppb/shcsr.rs @@ -1,95 +1,63 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MEMFAULTACT` reader - MemManage exception active bit"] -pub type MEMFAULTACT_R = crate::BitReader; +pub type MEMFAULTACT_R = crate::BitReader; #[doc = "Field `MEMFAULTACT` writer - MemManage exception active bit"] -pub type MEMFAULTACT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type MEMFAULTACT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BUSFAULTACT` reader - BusFault exception active bit"] -pub type BUSFAULTACT_R = crate::BitReader; +pub type BUSFAULTACT_R = crate::BitReader; #[doc = "Field `BUSFAULTACT` writer - BusFault exception active bit"] -pub type BUSFAULTACT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type BUSFAULTACT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `USGFAULTACT` reader - UsageFault exception active bit"] -pub type USGFAULTACT_R = crate::BitReader; +pub type USGFAULTACT_R = crate::BitReader; #[doc = "Field `USGFAULTACT` writer - UsageFault exception active bit"] -pub type USGFAULTACT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type USGFAULTACT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SVCALLACT` reader - SVCall active bit"] -pub type SVCALLACT_R = crate::BitReader; +pub type SVCALLACT_R = crate::BitReader; #[doc = "Field `SVCALLACT` writer - SVCall active bit"] -pub type SVCALLACT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type SVCALLACT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MONITORACT` reader - Debug monitor active bit"] -pub type MONITORACT_R = crate::BitReader; +pub type MONITORACT_R = crate::BitReader; #[doc = "Field `MONITORACT` writer - Debug monitor active bit"] -pub type MONITORACT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type MONITORACT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PENDSVACT` reader - PendSV exception active bit"] -pub type PENDSVACT_R = crate::BitReader; +pub type PENDSVACT_R = crate::BitReader; #[doc = "Field `PENDSVACT` writer - PendSV exception active bit"] -pub type PENDSVACT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type PENDSVACT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SYSTICKACT` reader - SysTick exception active bit"] -pub type SYSTICKACT_R = crate::BitReader; +pub type SYSTICKACT_R = crate::BitReader; #[doc = "Field `SYSTICKACT` writer - SysTick exception active bit"] -pub type SYSTICKACT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type SYSTICKACT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `USGFAULTPENDED` reader - UsageFault exception pending bit"] -pub type USGFAULTPENDED_R = crate::BitReader; +pub type USGFAULTPENDED_R = crate::BitReader; #[doc = "Field `USGFAULTPENDED` writer - UsageFault exception pending bit"] -pub type USGFAULTPENDED_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type USGFAULTPENDED_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MEMFAULTPENDED` reader - MemManage exception pending bit"] -pub type MEMFAULTPENDED_R = crate::BitReader; +pub type MEMFAULTPENDED_R = crate::BitReader; #[doc = "Field `MEMFAULTPENDED` writer - MemManage exception pending bit"] -pub type MEMFAULTPENDED_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type MEMFAULTPENDED_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BUSFAULTPENDED` reader - BusFault exception pending bit"] -pub type BUSFAULTPENDED_R = crate::BitReader; +pub type BUSFAULTPENDED_R = crate::BitReader; #[doc = "Field `BUSFAULTPENDED` writer - BusFault exception pending bit"] -pub type BUSFAULTPENDED_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type BUSFAULTPENDED_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SVCALLPENDED` reader - SVCall pending bit"] -pub type SVCALLPENDED_R = crate::BitReader; +pub type SVCALLPENDED_R = crate::BitReader; #[doc = "Field `SVCALLPENDED` writer - SVCall pending bit"] -pub type SVCALLPENDED_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type SVCALLPENDED_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MEMFAULTENA` reader - MemManage enable bit"] -pub type MEMFAULTENA_R = crate::BitReader; +pub type MEMFAULTENA_R = crate::BitReader; #[doc = "Field `MEMFAULTENA` writer - MemManage enable bit"] -pub type MEMFAULTENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type MEMFAULTENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BUSFAULTENA` reader - BusFault enable bit"] -pub type BUSFAULTENA_R = crate::BitReader; +pub type BUSFAULTENA_R = crate::BitReader; #[doc = "Field `BUSFAULTENA` writer - BusFault enable bit"] -pub type BUSFAULTENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type BUSFAULTENA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `USGFAULTENA` reader - UsageFault enable bit"] -pub type USGFAULTENA_R = crate::BitReader; +pub type USGFAULTENA_R = crate::BitReader; #[doc = "Field `USGFAULTENA` writer - UsageFault enable bit"] -pub type USGFAULTENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHCSR_SPEC, bool, O>; +pub type USGFAULTENA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - MemManage exception active bit"] #[inline(always)] @@ -166,106 +134,107 @@ impl W { #[doc = "Bit 0 - MemManage exception active bit"] #[inline(always)] #[must_use] - pub fn memfaultact(&mut self) -> MEMFAULTACT_W<0> { - MEMFAULTACT_W::new(self) + pub fn memfaultact(&mut self) -> MEMFAULTACT_W { + MEMFAULTACT_W::new(self, 0) } #[doc = "Bit 1 - BusFault exception active bit"] #[inline(always)] #[must_use] - pub fn busfaultact(&mut self) -> BUSFAULTACT_W<1> { - BUSFAULTACT_W::new(self) + pub fn busfaultact(&mut self) -> BUSFAULTACT_W { + BUSFAULTACT_W::new(self, 1) } #[doc = "Bit 3 - UsageFault exception active bit"] #[inline(always)] #[must_use] - pub fn usgfaultact(&mut self) -> USGFAULTACT_W<3> { - USGFAULTACT_W::new(self) + pub fn usgfaultact(&mut self) -> USGFAULTACT_W { + USGFAULTACT_W::new(self, 3) } #[doc = "Bit 7 - SVCall active bit"] #[inline(always)] #[must_use] - pub fn svcallact(&mut self) -> SVCALLACT_W<7> { - SVCALLACT_W::new(self) + pub fn svcallact(&mut self) -> SVCALLACT_W { + SVCALLACT_W::new(self, 7) } #[doc = "Bit 8 - Debug monitor active bit"] #[inline(always)] #[must_use] - pub fn monitoract(&mut self) -> MONITORACT_W<8> { - MONITORACT_W::new(self) + pub fn monitoract(&mut self) -> MONITORACT_W { + MONITORACT_W::new(self, 8) } #[doc = "Bit 10 - PendSV exception active bit"] #[inline(always)] #[must_use] - pub fn pendsvact(&mut self) -> PENDSVACT_W<10> { - PENDSVACT_W::new(self) + pub fn pendsvact(&mut self) -> PENDSVACT_W { + PENDSVACT_W::new(self, 10) } #[doc = "Bit 11 - SysTick exception active bit"] #[inline(always)] #[must_use] - pub fn systickact(&mut self) -> SYSTICKACT_W<11> { - SYSTICKACT_W::new(self) + pub fn systickact(&mut self) -> SYSTICKACT_W { + SYSTICKACT_W::new(self, 11) } #[doc = "Bit 12 - UsageFault exception pending bit"] #[inline(always)] #[must_use] - pub fn usgfaultpended(&mut self) -> USGFAULTPENDED_W<12> { - USGFAULTPENDED_W::new(self) + pub fn usgfaultpended(&mut self) -> USGFAULTPENDED_W { + USGFAULTPENDED_W::new(self, 12) } #[doc = "Bit 13 - MemManage exception pending bit"] #[inline(always)] #[must_use] - pub fn memfaultpended(&mut self) -> MEMFAULTPENDED_W<13> { - MEMFAULTPENDED_W::new(self) + pub fn memfaultpended(&mut self) -> MEMFAULTPENDED_W { + MEMFAULTPENDED_W::new(self, 13) } #[doc = "Bit 14 - BusFault exception pending bit"] #[inline(always)] #[must_use] - pub fn busfaultpended(&mut self) -> BUSFAULTPENDED_W<14> { - BUSFAULTPENDED_W::new(self) + pub fn busfaultpended(&mut self) -> BUSFAULTPENDED_W { + BUSFAULTPENDED_W::new(self, 14) } #[doc = "Bit 15 - SVCall pending bit"] #[inline(always)] #[must_use] - pub fn svcallpended(&mut self) -> SVCALLPENDED_W<15> { - SVCALLPENDED_W::new(self) + pub fn svcallpended(&mut self) -> SVCALLPENDED_W { + SVCALLPENDED_W::new(self, 15) } #[doc = "Bit 16 - MemManage enable bit"] #[inline(always)] #[must_use] - pub fn memfaultena(&mut self) -> MEMFAULTENA_W<16> { - MEMFAULTENA_W::new(self) + pub fn memfaultena(&mut self) -> MEMFAULTENA_W { + MEMFAULTENA_W::new(self, 16) } #[doc = "Bit 17 - BusFault enable bit"] #[inline(always)] #[must_use] - pub fn busfaultena(&mut self) -> BUSFAULTENA_W<17> { - BUSFAULTENA_W::new(self) + pub fn busfaultena(&mut self) -> BUSFAULTENA_W { + BUSFAULTENA_W::new(self, 17) } #[doc = "Bit 18 - UsageFault enable bit"] #[inline(always)] #[must_use] - pub fn usgfaultena(&mut self) -> USGFAULTENA_W<18> { - USGFAULTENA_W::new(self) + pub fn usgfaultena(&mut self) -> USGFAULTENA_W { + USGFAULTENA_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "System Handler Control and State Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`shcsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`shcsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`shcsr::R`](R) reader structure"] +impl crate::Readable for SHCSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`shcsr::W`](W) writer structure"] impl crate::Writable for SHCSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/shpr1.rs b/src/ppb/shpr1.rs index ac59e932..20c3cc26 100644 --- a/src/ppb/shpr1.rs +++ b/src/ppb/shpr1.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRI_4` reader - Priority of system handler 4, MemManage"] -pub type PRI_4_R = crate::FieldReader; +pub type PRI_4_R = crate::FieldReader; #[doc = "Field `PRI_4` writer - Priority of system handler 4, MemManage"] -pub type PRI_4_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SHPR1_SPEC, u8, u8, 8, O>; +pub type PRI_4_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_5` reader - Priority of system handler 5, BusFault"] -pub type PRI_5_R = crate::FieldReader; +pub type PRI_5_R = crate::FieldReader; #[doc = "Field `PRI_5` writer - Priority of system handler 5, BusFault"] -pub type PRI_5_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SHPR1_SPEC, u8, u8, 8, O>; +pub type PRI_5_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_6` reader - Priority of system handler 6, UsageFault"] -pub type PRI_6_R = crate::FieldReader; +pub type PRI_6_R = crate::FieldReader; #[doc = "Field `PRI_6` writer - Priority of system handler 6, UsageFault"] -pub type PRI_6_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SHPR1_SPEC, u8, u8, 8, O>; +pub type PRI_6_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 0:7 - Priority of system handler 4, MemManage"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bits 0:7 - Priority of system handler 4, MemManage"] #[inline(always)] #[must_use] - pub fn pri_4(&mut self) -> PRI_4_W<0> { - PRI_4_W::new(self) + pub fn pri_4(&mut self) -> PRI_4_W { + PRI_4_W::new(self, 0) } #[doc = "Bits 8:15 - Priority of system handler 5, BusFault"] #[inline(always)] #[must_use] - pub fn pri_5(&mut self) -> PRI_5_W<8> { - PRI_5_W::new(self) + pub fn pri_5(&mut self) -> PRI_5_W { + PRI_5_W::new(self, 8) } #[doc = "Bits 16:23 - Priority of system handler 6, UsageFault"] #[inline(always)] #[must_use] - pub fn pri_6(&mut self) -> PRI_6_W<16> { - PRI_6_W::new(self) + pub fn pri_6(&mut self) -> PRI_6_W { + PRI_6_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "System Handler Priority Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`shpr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`shpr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`shpr1::R`](R) reader structure"] +impl crate::Readable for SHPR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`shpr1::W`](W) writer structure"] impl crate::Writable for SHPR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/shpr2.rs b/src/ppb/shpr2.rs index cf66478e..512c2869 100644 --- a/src/ppb/shpr2.rs +++ b/src/ppb/shpr2.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRI_11` reader - Priority of system handler 11, SVCall"] -pub type PRI_11_R = crate::FieldReader; +pub type PRI_11_R = crate::FieldReader; #[doc = "Field `PRI_11` writer - Priority of system handler 11, SVCall"] -pub type PRI_11_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SHPR2_SPEC, u8, u8, 8, O>; +pub type PRI_11_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 24:31 - Priority of system handler 11, SVCall"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 24:31 - Priority of system handler 11, SVCall"] #[inline(always)] #[must_use] - pub fn pri_11(&mut self) -> PRI_11_W<24> { - PRI_11_W::new(self) + pub fn pri_11(&mut self) -> PRI_11_W { + PRI_11_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "System Handler Priority Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`shpr2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`shpr2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`shpr2::R`](R) reader structure"] +impl crate::Readable for SHPR2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`shpr2::W`](W) writer structure"] impl crate::Writable for SHPR2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/shpr3.rs b/src/ppb/shpr3.rs index f1a04a9b..2c6409fc 100644 --- a/src/ppb/shpr3.rs +++ b/src/ppb/shpr3.rs @@ -1,47 +1,15 @@ #[doc = "Register `SHPR3` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRI_14` reader - Priority of system handler 14"] -pub type PRI_14_R = crate::FieldReader; +pub type PRI_14_R = crate::FieldReader; #[doc = "Field `PRI_14` writer - Priority of system handler 14"] -pub type PRI_14_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SHPR3_SPEC, u8, u8, 8, O>; +pub type PRI_14_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRI_15` reader - Priority of system handler 15"] -pub type PRI_15_R = crate::FieldReader; +pub type PRI_15_R = crate::FieldReader; #[doc = "Field `PRI_15` writer - Priority of system handler 15"] -pub type PRI_15_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SHPR3_SPEC, u8, u8, 8, O>; +pub type PRI_15_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bits 16:23 - Priority of system handler 14"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 16:23 - Priority of system handler 14"] #[inline(always)] #[must_use] - pub fn pri_14(&mut self) -> PRI_14_W<16> { - PRI_14_W::new(self) + pub fn pri_14(&mut self) -> PRI_14_W { + PRI_14_W::new(self, 16) } #[doc = "Bits 24:31 - Priority of system handler 15"] #[inline(always)] #[must_use] - pub fn pri_15(&mut self) -> PRI_15_W<24> { - PRI_15_W::new(self) + pub fn pri_15(&mut self) -> PRI_15_W { + PRI_15_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "System Handler Priority Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`shpr3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`shpr3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`shpr3::R`](R) reader structure"] +impl crate::Readable for SHPR3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`shpr3::W`](W) writer structure"] impl crate::Writable for SHPR3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/stir.rs b/src/ppb/stir.rs index 5fa01db6..3563ea07 100644 --- a/src/ppb/stir.rs +++ b/src/ppb/stir.rs @@ -1,48 +1,32 @@ #[doc = "Register `STIR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `INTID` writer - Interrupt ID of the interrupt to trigger"] -pub type INTID_W<'a, const O: u8> = crate::FieldWriter<'a, u32, STIR_SPEC, u16, u16, 9, O>; +pub type INTID_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16>; impl W { #[doc = "Bits 0:8 - Interrupt ID of the interrupt to trigger"] #[inline(always)] #[must_use] - pub fn intid(&mut self) -> INTID_W<0> { - INTID_W::new(self) + pub fn intid(&mut self) -> INTID_W { + INTID_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Software Trigger Interrupt Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`stir::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct STIR_SPEC; impl crate::RegisterSpec for STIR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [stir::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`stir::W`](W) writer structure"] impl crate::Writable for STIR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/syst_calib.rs b/src/ppb/syst_calib.rs index 6195258d..05a942bc 100644 --- a/src/ppb/syst_calib.rs +++ b/src/ppb/syst_calib.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TENMS` reader - Ten Milliseconds Reload Value"] -pub type TENMS_R = crate::FieldReader; +pub type TENMS_R = crate::FieldReader; #[doc = "Field `TENMS` writer - Ten Milliseconds Reload Value"] -pub type TENMS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYST_CALIB_SPEC, u32, u32, 24, O>; +pub type TENMS_W<'a, REG> = crate::FieldWriter<'a, REG, 24, u32>; #[doc = "Field `SKEW` reader - Ten Milliseconds Skewed"] pub type SKEW_R = crate::BitReader; #[doc = "Ten Milliseconds Skewed\n\nValue on reset: 1"] @@ -57,34 +25,37 @@ impl From for bool { impl SKEW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SKEW_A { + pub const fn variant(&self) -> SKEW_A { match self.bits { false => SKEW_A::VALUE1, true => SKEW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "TENMS value is exact"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SKEW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "TENMS value is inexact, or not given."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SKEW_A::VALUE2 } } #[doc = "Field `SKEW` writer - Ten Milliseconds Skewed"] -pub type SKEW_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYST_CALIB_SPEC, SKEW_A, O>; -impl<'a, const O: u8> SKEW_W<'a, O> { +pub type SKEW_W<'a, REG> = crate::BitWriter<'a, REG, SKEW_A>; +impl<'a, REG> SKEW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "TENMS value is exact"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SKEW_A::VALUE1) } #[doc = "TENMS value is inexact, or not given."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SKEW_A::VALUE2) } } @@ -107,34 +78,37 @@ impl From for bool { impl NOREF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NOREF_A { + pub const fn variant(&self) -> NOREF_A { match self.bits { false => NOREF_A::VALUE1, true => NOREF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "reference clock provided"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NOREF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "no reference clock provided."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NOREF_A::VALUE2 } } #[doc = "Field `NOREF` writer - No Reference Clock"] -pub type NOREF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYST_CALIB_SPEC, NOREF_A, O>; -impl<'a, const O: u8> NOREF_W<'a, O> { +pub type NOREF_W<'a, REG> = crate::BitWriter<'a, REG, NOREF_A>; +impl<'a, REG> NOREF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "reference clock provided"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NOREF_A::VALUE1) } #[doc = "no reference clock provided."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NOREF_A::VALUE2) } } @@ -159,40 +133,41 @@ impl W { #[doc = "Bits 0:23 - Ten Milliseconds Reload Value"] #[inline(always)] #[must_use] - pub fn tenms(&mut self) -> TENMS_W<0> { - TENMS_W::new(self) + pub fn tenms(&mut self) -> TENMS_W { + TENMS_W::new(self, 0) } #[doc = "Bit 30 - Ten Milliseconds Skewed"] #[inline(always)] #[must_use] - pub fn skew(&mut self) -> SKEW_W<30> { - SKEW_W::new(self) + pub fn skew(&mut self) -> SKEW_W { + SKEW_W::new(self, 30) } #[doc = "Bit 31 - No Reference Clock"] #[inline(always)] #[must_use] - pub fn noref(&mut self) -> NOREF_W<31> { - NOREF_W::new(self) + pub fn noref(&mut self) -> NOREF_W { + NOREF_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "SysTick Calibration Value Register r\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`syst_calib::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`syst_calib::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`syst_calib::R`](R) reader structure"] +impl crate::Readable for SYST_CALIB_SPEC {} +#[doc = "`write(|w| ..)` method takes [`syst_calib::W`](W) writer structure"] impl crate::Writable for SYST_CALIB_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/syst_csr.rs b/src/ppb/syst_csr.rs index ff5a4a0b..ded1ff7c 100644 --- a/src/ppb/syst_csr.rs +++ b/src/ppb/syst_csr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENABLE` reader - Enable"] pub type ENABLE_R = crate::BitReader; #[doc = "Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl ENABLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENABLE_A { + pub const fn variant(&self) -> ENABLE_A { match self.bits { false => ENABLE_A::VALUE1, true => ENABLE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "counter disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENABLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "counter enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENABLE_A::VALUE2 } } #[doc = "Field `ENABLE` writer - Enable"] -pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYST_CSR_SPEC, ENABLE_A, O>; -impl<'a, const O: u8> ENABLE_W<'a, O> { +pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG, ENABLE_A>; +impl<'a, REG> ENABLE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "counter disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENABLE_A::VALUE1) } #[doc = "counter enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENABLE_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl TICKINT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TICKINT_A { + pub const fn variant(&self) -> TICKINT_A { match self.bits { false => TICKINT_A::VALUE1, true => TICKINT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "counting down to zero does not assert the SysTick exception request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TICKINT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "counting down to zero to asserts the SysTick exception request."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TICKINT_A::VALUE2 } } #[doc = "Field `TICKINT` writer - Tick Interrupt Enable"] -pub type TICKINT_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYST_CSR_SPEC, TICKINT_A, O>; -impl<'a, const O: u8> TICKINT_W<'a, O> { +pub type TICKINT_W<'a, REG> = crate::BitWriter<'a, REG, TICKINT_A>; +impl<'a, REG> TICKINT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "counting down to zero does not assert the SysTick exception request"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TICKINT_A::VALUE1) } #[doc = "counting down to zero to asserts the SysTick exception request."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TICKINT_A::VALUE2) } } @@ -153,41 +127,44 @@ impl From for bool { impl CLKSOURCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CLKSOURCE_A { + pub const fn variant(&self) -> CLKSOURCE_A { match self.bits { false => CLKSOURCE_A::VALUE1, true => CLKSOURCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "external clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CLKSOURCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "processor clock."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CLKSOURCE_A::VALUE2 } } #[doc = "Field `CLKSOURCE` writer - Indicates the clock source:"] -pub type CLKSOURCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYST_CSR_SPEC, CLKSOURCE_A, O>; -impl<'a, const O: u8> CLKSOURCE_W<'a, O> { +pub type CLKSOURCE_W<'a, REG> = crate::BitWriter<'a, REG, CLKSOURCE_A>; +impl<'a, REG> CLKSOURCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "external clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CLKSOURCE_A::VALUE1) } #[doc = "processor clock."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CLKSOURCE_A::VALUE2) } } #[doc = "Field `COUNTFLAG` reader - Counter Flag"] -pub type COUNTFLAG_R = crate::BitReader; +pub type COUNTFLAG_R = crate::BitReader; #[doc = "Field `COUNTFLAG` writer - Counter Flag"] -pub type COUNTFLAG_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYST_CSR_SPEC, bool, O>; +pub type COUNTFLAG_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Enable"] #[inline(always)] @@ -214,46 +191,47 @@ impl W { #[doc = "Bit 0 - Enable"] #[inline(always)] #[must_use] - pub fn enable(&mut self) -> ENABLE_W<0> { - ENABLE_W::new(self) + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W::new(self, 0) } #[doc = "Bit 1 - Tick Interrupt Enable"] #[inline(always)] #[must_use] - pub fn tickint(&mut self) -> TICKINT_W<1> { - TICKINT_W::new(self) + pub fn tickint(&mut self) -> TICKINT_W { + TICKINT_W::new(self, 1) } #[doc = "Bit 2 - Indicates the clock source:"] #[inline(always)] #[must_use] - pub fn clksource(&mut self) -> CLKSOURCE_W<2> { - CLKSOURCE_W::new(self) + pub fn clksource(&mut self) -> CLKSOURCE_W { + CLKSOURCE_W::new(self, 2) } #[doc = "Bit 16 - Counter Flag"] #[inline(always)] #[must_use] - pub fn countflag(&mut self) -> COUNTFLAG_W<16> { - COUNTFLAG_W::new(self) + pub fn countflag(&mut self) -> COUNTFLAG_W { + COUNTFLAG_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "SysTick Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`syst_csr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`syst_csr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`syst_csr::R`](R) reader structure"] +impl crate::Readable for SYST_CSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`syst_csr::W`](W) writer structure"] impl crate::Writable for SYST_CSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/syst_cvr.rs b/src/ppb/syst_cvr.rs index bf36f048..ee6bbfc1 100644 --- a/src/ppb/syst_cvr.rs +++ b/src/ppb/syst_cvr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CURRENT` reader - Current Value"] -pub type CURRENT_R = crate::FieldReader; +pub type CURRENT_R = crate::FieldReader; #[doc = "Field `CURRENT` writer - Current Value"] -pub type CURRENT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYST_CVR_SPEC, u32, u32, 24, O>; +pub type CURRENT_W<'a, REG> = crate::FieldWriter<'a, REG, 24, u32>; impl R { #[doc = "Bits 0:23 - Current Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:23 - Current Value"] #[inline(always)] #[must_use] - pub fn current(&mut self) -> CURRENT_W<0> { - CURRENT_W::new(self) + pub fn current(&mut self) -> CURRENT_W { + CURRENT_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "SysTick Current Value Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`syst_cvr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`syst_cvr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`syst_cvr::R`](R) reader structure"] +impl crate::Readable for SYST_CVR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`syst_cvr::W`](W) writer structure"] impl crate::Writable for SYST_CVR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/syst_rvr.rs b/src/ppb/syst_rvr.rs index b2394192..4abcea43 100644 --- a/src/ppb/syst_rvr.rs +++ b/src/ppb/syst_rvr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RELOAD` reader - Reload Value"] -pub type RELOAD_R = crate::FieldReader; +pub type RELOAD_R = crate::FieldReader; #[doc = "Field `RELOAD` writer - Reload Value"] -pub type RELOAD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYST_RVR_SPEC, u32, u32, 24, O>; +pub type RELOAD_W<'a, REG> = crate::FieldWriter<'a, REG, 24, u32>; impl R { #[doc = "Bits 0:23 - Reload Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:23 - Reload Value"] #[inline(always)] #[must_use] - pub fn reload(&mut self) -> RELOAD_W<0> { - RELOAD_W::new(self) + pub fn reload(&mut self) -> RELOAD_W { + RELOAD_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "SysTick Reload Value Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`syst_rvr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`syst_rvr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`syst_rvr::R`](R) reader structure"] +impl crate::Readable for SYST_RVR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`syst_rvr::W`](W) writer structure"] impl crate::Writable for SYST_RVR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/ppb/vtor.rs b/src/ppb/vtor.rs index 4850d7c2..b61aca35 100644 --- a/src/ppb/vtor.rs +++ b/src/ppb/vtor.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TBLOFF` reader - Vector table base offset field"] -pub type TBLOFF_R = crate::FieldReader; +pub type TBLOFF_R = crate::FieldReader; #[doc = "Field `TBLOFF` writer - Vector table base offset field"] -pub type TBLOFF_W<'a, const O: u8> = crate::FieldWriter<'a, u32, VTOR_SPEC, u32, u32, 22, O>; +pub type TBLOFF_W<'a, REG> = crate::FieldWriter<'a, REG, 22, u32>; impl R { #[doc = "Bits 10:31 - Vector table base offset field"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 10:31 - Vector table base offset field"] #[inline(always)] #[must_use] - pub fn tbloff(&mut self) -> TBLOFF_W<10> { - TBLOFF_W::new(self) + pub fn tbloff(&mut self) -> TBLOFF_W { + TBLOFF_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Vector Table Offset Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`vtor::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`vtor::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`vtor::R`](R) reader structure"] +impl crate::Readable for VTOR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`vtor::W`](W) writer structure"] impl crate::Writable for VTOR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/pref.rs b/src/pref.rs index 6a6934b2..0793aca6 100644 --- a/src/pref.rs +++ b/src/pref.rs @@ -1,10 +1,17 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + pcon: PCON, +} +impl RegisterBlock { #[doc = "0x00 - Prefetch Configuration Register"] - pub pcon: PCON, + #[inline(always)] + pub const fn pcon(&self) -> &PCON { + &self.pcon + } } -#[doc = "PCON (rw) register accessor: an alias for `Reg`"] +#[doc = "PCON (rw) register accessor: Prefetch Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pcon`] +module"] 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 7d11ca92..ad01fc19 100644 --- a/src/pref/pcon.rs +++ b/src/pref/pcon.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `IBYP` reader - Instruction Prefetch Buffer Bypass"] pub type IBYP_R = crate::BitReader; #[doc = "Instruction Prefetch Buffer Bypass\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl IBYP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IBYP_A { + pub const fn variant(&self) -> IBYP_A { match self.bits { false => IBYP_A::VALUE1, true => IBYP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Instruction prefetch buffer not bypassed."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IBYP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Instruction prefetch buffer bypassed."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IBYP_A::VALUE2 } } #[doc = "Field `IBYP` writer - Instruction Prefetch Buffer Bypass"] -pub type IBYP_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCON_SPEC, IBYP_A, O>; -impl<'a, const O: u8> IBYP_W<'a, O> { +pub type IBYP_W<'a, REG> = crate::BitWriter<'a, REG, IBYP_A>; +impl<'a, REG> IBYP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Instruction prefetch buffer not bypassed."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IBYP_A::VALUE1) } #[doc = "Instruction prefetch buffer bypassed."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IBYP_A::VALUE2) } } @@ -99,16 +70,19 @@ impl From for bool { } } #[doc = "Field `IINV` writer - Instruction Prefetch Buffer Invalidate"] -pub type IINV_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCON_SPEC, IINV_AW, O>; -impl<'a, const O: u8> IINV_W<'a, O> { +pub type IINV_W<'a, REG> = crate::BitWriter<'a, REG, IINV_AW>; +impl<'a, REG> IINV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IINV_AW::VALUE1) } #[doc = "Initiate invalidation of entire instruction cache."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IINV_AW::VALUE2) } } @@ -123,34 +97,35 @@ impl W { #[doc = "Bit 0 - Instruction Prefetch Buffer Bypass"] #[inline(always)] #[must_use] - pub fn ibyp(&mut self) -> IBYP_W<0> { - IBYP_W::new(self) + pub fn ibyp(&mut self) -> IBYP_W { + IBYP_W::new(self, 0) } #[doc = "Bit 1 - Instruction Prefetch Buffer Invalidate"] #[inline(always)] #[must_use] - pub fn iinv(&mut self) -> IINV_W<1> { - IINV_W::new(self) + pub fn iinv(&mut self) -> IINV_W { + IINV_W::new(self, 1) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Prefetch Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pcon::R`](R) reader structure"] +impl crate::Readable for PCON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pcon::W`](W) writer structure"] impl crate::Writable for PCON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/rtc.rs b/src/rtc.rs index 0529561a..2ab363da 100644 --- a/src/rtc.rs +++ b/src/rtc.rs @@ -1,64 +1,116 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + id: ID, + ctr: CTR, + rawstat: RAWSTAT, + stssr: STSSR, + msksr: MSKSR, + clrsr: CLRSR, + atim0: ATIM0, + atim1: ATIM1, + tim0: TIM0, + tim1: TIM1, +} +impl RegisterBlock { #[doc = "0x00 - RTC ID Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } #[doc = "0x04 - RTC Control Register"] - pub ctr: CTR, + #[inline(always)] + pub const fn ctr(&self) -> &CTR { + &self.ctr + } #[doc = "0x08 - RTC Raw Service Request Register"] - pub rawstat: RAWSTAT, + #[inline(always)] + pub const fn rawstat(&self) -> &RAWSTAT { + &self.rawstat + } #[doc = "0x0c - RTC Service Request Status Register"] - pub stssr: STSSR, + #[inline(always)] + pub const fn stssr(&self) -> &STSSR { + &self.stssr + } #[doc = "0x10 - RTC Service Request Mask Register"] - pub msksr: MSKSR, + #[inline(always)] + pub const fn msksr(&self) -> &MSKSR { + &self.msksr + } #[doc = "0x14 - RTC Clear Service Request Register"] - pub clrsr: CLRSR, + #[inline(always)] + pub const fn clrsr(&self) -> &CLRSR { + &self.clrsr + } #[doc = "0x18 - RTC Alarm Time Register 0"] - pub atim0: ATIM0, + #[inline(always)] + pub const fn atim0(&self) -> &ATIM0 { + &self.atim0 + } #[doc = "0x1c - RTC Alarm Time Register 1"] - pub atim1: ATIM1, + #[inline(always)] + pub const fn atim1(&self) -> &ATIM1 { + &self.atim1 + } #[doc = "0x20 - RTC Time Register 0"] - pub tim0: TIM0, + #[inline(always)] + pub const fn tim0(&self) -> &TIM0 { + &self.tim0 + } #[doc = "0x24 - RTC Time Register 1"] - pub tim1: TIM1, + #[inline(always)] + pub const fn tim1(&self) -> &TIM1 { + &self.tim1 + } } -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: RTC ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "RTC ID Register"] pub mod id; -#[doc = "CTR (rw) register accessor: an alias for `Reg`"] +#[doc = "CTR (rw) register accessor: RTC Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctr`] +module"] pub type CTR = crate::Reg; #[doc = "RTC Control Register"] pub mod ctr; -#[doc = "RAWSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "RAWSTAT (r) register accessor: RTC Raw Service Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rawstat`] +module"] pub type RAWSTAT = crate::Reg; #[doc = "RTC Raw Service Request Register"] pub mod rawstat; -#[doc = "STSSR (r) register accessor: an alias for `Reg`"] +#[doc = "STSSR (r) register accessor: RTC Service Request Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`stssr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@stssr`] +module"] pub type STSSR = crate::Reg; #[doc = "RTC Service Request Status Register"] pub mod stssr; -#[doc = "MSKSR (rw) register accessor: an alias for `Reg`"] +#[doc = "MSKSR (rw) register accessor: RTC Service Request Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msksr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`msksr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@msksr`] +module"] pub type MSKSR = crate::Reg; #[doc = "RTC Service Request Mask Register"] pub mod msksr; -#[doc = "CLRSR (w) register accessor: an alias for `Reg`"] +#[doc = "CLRSR (w) register accessor: RTC Clear Service Request Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clrsr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clrsr`] +module"] pub type CLRSR = crate::Reg; #[doc = "RTC Clear Service Request Register"] pub mod clrsr; -#[doc = "ATIM0 (rw) register accessor: an alias for `Reg`"] +#[doc = "ATIM0 (rw) register accessor: RTC Alarm Time Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`atim0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`atim0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@atim0`] +module"] pub type ATIM0 = crate::Reg; #[doc = "RTC Alarm Time Register 0"] pub mod atim0; -#[doc = "ATIM1 (rw) register accessor: an alias for `Reg`"] +#[doc = "ATIM1 (rw) register accessor: RTC Alarm Time Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`atim1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`atim1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@atim1`] +module"] pub type ATIM1 = crate::Reg; #[doc = "RTC Alarm Time Register 1"] pub mod atim1; -#[doc = "TIM0 (rw) register accessor: an alias for `Reg`"] +#[doc = "TIM0 (rw) register accessor: RTC Time Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tim0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tim0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tim0`] +module"] pub type TIM0 = crate::Reg; #[doc = "RTC Time Register 0"] pub mod tim0; -#[doc = "TIM1 (rw) register accessor: an alias for `Reg`"] +#[doc = "TIM1 (rw) register accessor: RTC Time Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tim1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tim1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tim1`] +module"] 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 ef23a03d..f69fc1a0 100644 --- a/src/rtc/atim0.rs +++ b/src/rtc/atim0.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ASE` reader - Alarm Seconds Compare Value"] -pub type ASE_R = crate::FieldReader; +pub type ASE_R = crate::FieldReader; #[doc = "Field `ASE` writer - Alarm Seconds Compare Value"] -pub type ASE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ATIM0_SPEC, u8, u8, 6, O>; +pub type ASE_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `AMI` reader - Alarm Minutes Compare Value"] -pub type AMI_R = crate::FieldReader; +pub type AMI_R = crate::FieldReader; #[doc = "Field `AMI` writer - Alarm Minutes Compare Value"] -pub type AMI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ATIM0_SPEC, u8, u8, 6, O>; +pub type AMI_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `AHO` reader - Alarm Hours Compare Value"] -pub type AHO_R = crate::FieldReader; +pub type AHO_R = crate::FieldReader; #[doc = "Field `AHO` writer - Alarm Hours Compare Value"] -pub type AHO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ATIM0_SPEC, u8, u8, 5, O>; +pub type AHO_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `ADA` reader - Alarm Days Compare Value"] -pub type ADA_R = crate::FieldReader; +pub type ADA_R = crate::FieldReader; #[doc = "Field `ADA` writer - Alarm Days Compare Value"] -pub type ADA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ATIM0_SPEC, u8, u8, 5, O>; +pub type ADA_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; impl R { #[doc = "Bits 0:5 - Alarm Seconds Compare Value"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:5 - Alarm Seconds Compare Value"] #[inline(always)] #[must_use] - pub fn ase(&mut self) -> ASE_W<0> { - ASE_W::new(self) + pub fn ase(&mut self) -> ASE_W { + ASE_W::new(self, 0) } #[doc = "Bits 8:13 - Alarm Minutes Compare Value"] #[inline(always)] #[must_use] - pub fn ami(&mut self) -> AMI_W<8> { - AMI_W::new(self) + pub fn ami(&mut self) -> AMI_W { + AMI_W::new(self, 8) } #[doc = "Bits 16:20 - Alarm Hours Compare Value"] #[inline(always)] #[must_use] - pub fn aho(&mut self) -> AHO_W<16> { - AHO_W::new(self) + pub fn aho(&mut self) -> AHO_W { + AHO_W::new(self, 16) } #[doc = "Bits 24:28 - Alarm Days Compare Value"] #[inline(always)] #[must_use] - pub fn ada(&mut self) -> ADA_W<24> { - ADA_W::new(self) + pub fn ada(&mut self) -> ADA_W { + ADA_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RTC Alarm Time Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`atim0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`atim0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`atim0::R`](R) reader structure"] +impl crate::Readable for ATIM0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`atim0::W`](W) writer structure"] impl crate::Writable for ATIM0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/rtc/atim1.rs b/src/rtc/atim1.rs index 880d7cf5..697728e4 100644 --- a/src/rtc/atim1.rs +++ b/src/rtc/atim1.rs @@ -1,47 +1,15 @@ #[doc = "Register `ATIM1` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `AMO` reader - Alarm Month Compare Value"] -pub type AMO_R = crate::FieldReader; +pub type AMO_R = crate::FieldReader; #[doc = "Field `AMO` writer - Alarm Month Compare Value"] -pub type AMO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ATIM1_SPEC, u8, u8, 4, O>; +pub type AMO_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `AYE` reader - Alarm Year Compare Value"] -pub type AYE_R = crate::FieldReader; +pub type AYE_R = crate::FieldReader; #[doc = "Field `AYE` writer - Alarm Year Compare Value"] -pub type AYE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ATIM1_SPEC, u16, u16, 16, O>; +pub type AYE_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 8:11 - Alarm Month Compare Value"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 8:11 - Alarm Month Compare Value"] #[inline(always)] #[must_use] - pub fn amo(&mut self) -> AMO_W<8> { - AMO_W::new(self) + pub fn amo(&mut self) -> AMO_W { + AMO_W::new(self, 8) } #[doc = "Bits 16:31 - Alarm Year Compare Value"] #[inline(always)] #[must_use] - pub fn aye(&mut self) -> AYE_W<16> { - AYE_W::new(self) + pub fn aye(&mut self) -> AYE_W { + AYE_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RTC Alarm Time Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`atim1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`atim1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`atim1::R`](R) reader structure"] +impl crate::Readable for ATIM1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`atim1::W`](W) writer structure"] impl crate::Writable for ATIM1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/rtc/clrsr.rs b/src/rtc/clrsr.rs index f042d323..394c1f3d 100644 --- a/src/rtc/clrsr.rs +++ b/src/rtc/clrsr.rs @@ -1,96 +1,80 @@ #[doc = "Register `CLRSR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RPSE` writer - Periodic Seconds Interrupt Clear"] -pub type RPSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLRSR_SPEC, bool, O>; +pub type RPSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RPMI` writer - Periodic Minutes Interrupt Clear"] -pub type RPMI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLRSR_SPEC, bool, O>; +pub type RPMI_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RPHO` writer - Periodic Hours Interrupt Clear"] -pub type RPHO_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLRSR_SPEC, bool, O>; +pub type RPHO_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RPDA` writer - Periodic Days Interrupt Clear"] -pub type RPDA_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLRSR_SPEC, bool, O>; +pub type RPDA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RPMO` writer - Periodic Months Interrupt Clear"] -pub type RPMO_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLRSR_SPEC, bool, O>; +pub type RPMO_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RPYE` writer - Periodic Years Interrupt Clear"] -pub type RPYE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLRSR_SPEC, bool, O>; +pub type RPYE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RAI` writer - Alarm Interrupt Clear"] -pub type RAI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLRSR_SPEC, bool, O>; +pub type RAI_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Periodic Seconds Interrupt Clear"] #[inline(always)] #[must_use] - pub fn rpse(&mut self) -> RPSE_W<0> { - RPSE_W::new(self) + pub fn rpse(&mut self) -> RPSE_W { + RPSE_W::new(self, 0) } #[doc = "Bit 1 - Periodic Minutes Interrupt Clear"] #[inline(always)] #[must_use] - pub fn rpmi(&mut self) -> RPMI_W<1> { - RPMI_W::new(self) + pub fn rpmi(&mut self) -> RPMI_W { + RPMI_W::new(self, 1) } #[doc = "Bit 2 - Periodic Hours Interrupt Clear"] #[inline(always)] #[must_use] - pub fn rpho(&mut self) -> RPHO_W<2> { - RPHO_W::new(self) + pub fn rpho(&mut self) -> RPHO_W { + RPHO_W::new(self, 2) } #[doc = "Bit 3 - Periodic Days Interrupt Clear"] #[inline(always)] #[must_use] - pub fn rpda(&mut self) -> RPDA_W<3> { - RPDA_W::new(self) + pub fn rpda(&mut self) -> RPDA_W { + RPDA_W::new(self, 3) } #[doc = "Bit 5 - Periodic Months Interrupt Clear"] #[inline(always)] #[must_use] - pub fn rpmo(&mut self) -> RPMO_W<5> { - RPMO_W::new(self) + pub fn rpmo(&mut self) -> RPMO_W { + RPMO_W::new(self, 5) } #[doc = "Bit 6 - Periodic Years Interrupt Clear"] #[inline(always)] #[must_use] - pub fn rpye(&mut self) -> RPYE_W<6> { - RPYE_W::new(self) + pub fn rpye(&mut self) -> RPYE_W { + RPYE_W::new(self, 6) } #[doc = "Bit 8 - Alarm Interrupt Clear"] #[inline(always)] #[must_use] - pub fn rai(&mut self) -> RAI_W<8> { - RAI_W::new(self) + pub fn rai(&mut self) -> RAI_W { + RAI_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RTC Clear Service Request Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clrsr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CLRSR_SPEC; impl crate::RegisterSpec for CLRSR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [clrsr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`clrsr::W`](W) writer structure"] impl crate::Writable for CLRSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/rtc/ctr.rs b/src/rtc/ctr.rs index 8ed6b327..d9c5fdca 100644 --- a/src/rtc/ctr.rs +++ b/src/rtc/ctr.rs @@ -1,75 +1,43 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENB` reader - RTC Module Enable"] -pub type ENB_R = crate::BitReader; +pub type ENB_R = crate::BitReader; #[doc = "Field `ENB` writer - RTC Module Enable"] -pub type ENB_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type ENB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TAE` reader - Timer Alarm Enable for Hibernation Wake-up"] -pub type TAE_R = crate::BitReader; +pub type TAE_R = crate::BitReader; #[doc = "Field `TAE` writer - Timer Alarm Enable for Hibernation Wake-up"] -pub type TAE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type TAE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ESEC` reader - Enable Seconds Comparison for Hibernation Wake-up"] -pub type ESEC_R = crate::BitReader; +pub type ESEC_R = crate::BitReader; #[doc = "Field `ESEC` writer - Enable Seconds Comparison for Hibernation Wake-up"] -pub type ESEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type ESEC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EMIC` reader - Enable Minutes Comparison for Hibernation Wake-up"] -pub type EMIC_R = crate::BitReader; +pub type EMIC_R = crate::BitReader; #[doc = "Field `EMIC` writer - Enable Minutes Comparison for Hibernation Wake-up"] -pub type EMIC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type EMIC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EHOC` reader - Enable Hours Comparison for Hibernation Wake-up"] -pub type EHOC_R = crate::BitReader; +pub type EHOC_R = crate::BitReader; #[doc = "Field `EHOC` writer - Enable Hours Comparison for Hibernation Wake-up"] -pub type EHOC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type EHOC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EDAC` reader - Enable Days Comparison for Hibernation Wake-up"] -pub type EDAC_R = crate::BitReader; +pub type EDAC_R = crate::BitReader; #[doc = "Field `EDAC` writer - Enable Days Comparison for Hibernation Wake-up"] -pub type EDAC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type EDAC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EMOC` reader - Enable Months Comparison for Hibernation Wake-up"] -pub type EMOC_R = crate::BitReader; +pub type EMOC_R = crate::BitReader; #[doc = "Field `EMOC` writer - Enable Months Comparison for Hibernation Wake-up"] -pub type EMOC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type EMOC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EYEC` reader - Enable Years Comparison for Hibernation Wake-up"] -pub type EYEC_R = crate::BitReader; +pub type EYEC_R = crate::BitReader; #[doc = "Field `EYEC` writer - Enable Years Comparison for Hibernation Wake-up"] -pub type EYEC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type EYEC_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DIV` reader - RTC Clock Divider Value"] -pub type DIV_R = crate::FieldReader; +pub type DIV_R = crate::FieldReader; #[doc = "Field `DIV` writer - RTC Clock Divider Value"] -pub type DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTR_SPEC, u16, u16, 16, O>; +pub type DIV_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bit 0 - RTC Module Enable"] #[inline(always)] @@ -121,76 +89,77 @@ impl W { #[doc = "Bit 0 - RTC Module Enable"] #[inline(always)] #[must_use] - pub fn enb(&mut self) -> ENB_W<0> { - ENB_W::new(self) + pub fn enb(&mut self) -> ENB_W { + ENB_W::new(self, 0) } #[doc = "Bit 2 - Timer Alarm Enable for Hibernation Wake-up"] #[inline(always)] #[must_use] - pub fn tae(&mut self) -> TAE_W<2> { - TAE_W::new(self) + pub fn tae(&mut self) -> TAE_W { + TAE_W::new(self, 2) } #[doc = "Bit 8 - Enable Seconds Comparison for Hibernation Wake-up"] #[inline(always)] #[must_use] - pub fn esec(&mut self) -> ESEC_W<8> { - ESEC_W::new(self) + pub fn esec(&mut self) -> ESEC_W { + ESEC_W::new(self, 8) } #[doc = "Bit 9 - Enable Minutes Comparison for Hibernation Wake-up"] #[inline(always)] #[must_use] - pub fn emic(&mut self) -> EMIC_W<9> { - EMIC_W::new(self) + pub fn emic(&mut self) -> EMIC_W { + EMIC_W::new(self, 9) } #[doc = "Bit 10 - Enable Hours Comparison for Hibernation Wake-up"] #[inline(always)] #[must_use] - pub fn ehoc(&mut self) -> EHOC_W<10> { - EHOC_W::new(self) + pub fn ehoc(&mut self) -> EHOC_W { + EHOC_W::new(self, 10) } #[doc = "Bit 11 - Enable Days Comparison for Hibernation Wake-up"] #[inline(always)] #[must_use] - pub fn edac(&mut self) -> EDAC_W<11> { - EDAC_W::new(self) + pub fn edac(&mut self) -> EDAC_W { + EDAC_W::new(self, 11) } #[doc = "Bit 13 - Enable Months Comparison for Hibernation Wake-up"] #[inline(always)] #[must_use] - pub fn emoc(&mut self) -> EMOC_W<13> { - EMOC_W::new(self) + pub fn emoc(&mut self) -> EMOC_W { + EMOC_W::new(self, 13) } #[doc = "Bit 14 - Enable Years Comparison for Hibernation Wake-up"] #[inline(always)] #[must_use] - pub fn eyec(&mut self) -> EYEC_W<14> { - EYEC_W::new(self) + pub fn eyec(&mut self) -> EYEC_W { + EYEC_W::new(self, 14) } #[doc = "Bits 16:31 - RTC Clock Divider Value"] #[inline(always)] #[must_use] - pub fn div(&mut self) -> DIV_W<16> { - DIV_W::new(self) + pub fn div(&mut self) -> DIV_W { + DIV_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RTC Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ctr::R`](R) reader structure"] +impl crate::Readable for CTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ctr::W`](W) writer structure"] impl crate::Writable for CTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/rtc/id.rs b/src/rtc/id.rs index d91a31a5..054dd711 100644 --- a/src/rtc/id.rs +++ b/src/rtc/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "RTC ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00a3_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00a3_c000; diff --git a/src/rtc/msksr.rs b/src/rtc/msksr.rs index 553f4525..3cca6f20 100644 --- a/src/rtc/msksr.rs +++ b/src/rtc/msksr.rs @@ -1,67 +1,35 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `MPSE` reader - Periodic Seconds Interrupt Mask"] -pub type MPSE_R = crate::BitReader; +pub type MPSE_R = crate::BitReader; #[doc = "Field `MPSE` writer - Periodic Seconds Interrupt Mask"] -pub type MPSE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MSKSR_SPEC, bool, O>; +pub type MPSE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MPMI` reader - Periodic Minutes Interrupt Mask"] -pub type MPMI_R = crate::BitReader; +pub type MPMI_R = crate::BitReader; #[doc = "Field `MPMI` writer - Periodic Minutes Interrupt Mask"] -pub type MPMI_W<'a, const O: u8> = crate::BitWriter<'a, u32, MSKSR_SPEC, bool, O>; +pub type MPMI_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MPHO` reader - Periodic Hours Interrupt Mask"] -pub type MPHO_R = crate::BitReader; +pub type MPHO_R = crate::BitReader; #[doc = "Field `MPHO` writer - Periodic Hours Interrupt Mask"] -pub type MPHO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MSKSR_SPEC, bool, O>; +pub type MPHO_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MPDA` reader - Periodic Days Interrupt Mask"] -pub type MPDA_R = crate::BitReader; +pub type MPDA_R = crate::BitReader; #[doc = "Field `MPDA` writer - Periodic Days Interrupt Mask"] -pub type MPDA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MSKSR_SPEC, bool, O>; +pub type MPDA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MPMO` reader - Periodic Months Interrupt Mask"] -pub type MPMO_R = crate::BitReader; +pub type MPMO_R = crate::BitReader; #[doc = "Field `MPMO` writer - Periodic Months Interrupt Mask"] -pub type MPMO_W<'a, const O: u8> = crate::BitWriter<'a, u32, MSKSR_SPEC, bool, O>; +pub type MPMO_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MPYE` reader - Periodic Years Interrupt Mask"] -pub type MPYE_R = crate::BitReader; +pub type MPYE_R = crate::BitReader; #[doc = "Field `MPYE` writer - Periodic Years Interrupt Mask"] -pub type MPYE_W<'a, const O: u8> = crate::BitWriter<'a, u32, MSKSR_SPEC, bool, O>; +pub type MPYE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `MAI` reader - Alarm Interrupt Mask"] -pub type MAI_R = crate::BitReader; +pub type MAI_R = crate::BitReader; #[doc = "Field `MAI` writer - Alarm Interrupt Mask"] -pub type MAI_W<'a, const O: u8> = crate::BitWriter<'a, u32, MSKSR_SPEC, bool, O>; +pub type MAI_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Periodic Seconds Interrupt Mask"] #[inline(always)] @@ -103,64 +71,65 @@ impl W { #[doc = "Bit 0 - Periodic Seconds Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mpse(&mut self) -> MPSE_W<0> { - MPSE_W::new(self) + pub fn mpse(&mut self) -> MPSE_W { + MPSE_W::new(self, 0) } #[doc = "Bit 1 - Periodic Minutes Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mpmi(&mut self) -> MPMI_W<1> { - MPMI_W::new(self) + pub fn mpmi(&mut self) -> MPMI_W { + MPMI_W::new(self, 1) } #[doc = "Bit 2 - Periodic Hours Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mpho(&mut self) -> MPHO_W<2> { - MPHO_W::new(self) + pub fn mpho(&mut self) -> MPHO_W { + MPHO_W::new(self, 2) } #[doc = "Bit 3 - Periodic Days Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mpda(&mut self) -> MPDA_W<3> { - MPDA_W::new(self) + pub fn mpda(&mut self) -> MPDA_W { + MPDA_W::new(self, 3) } #[doc = "Bit 5 - Periodic Months Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mpmo(&mut self) -> MPMO_W<5> { - MPMO_W::new(self) + pub fn mpmo(&mut self) -> MPMO_W { + MPMO_W::new(self, 5) } #[doc = "Bit 6 - Periodic Years Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mpye(&mut self) -> MPYE_W<6> { - MPYE_W::new(self) + pub fn mpye(&mut self) -> MPYE_W { + MPYE_W::new(self, 6) } #[doc = "Bit 8 - Alarm Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mai(&mut self) -> MAI_W<8> { - MAI_W::new(self) + pub fn mai(&mut self) -> MAI_W { + MAI_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RTC Service Request Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`msksr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`msksr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`msksr::R`](R) reader structure"] +impl crate::Readable for MSKSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`msksr::W`](W) writer structure"] impl crate::Writable for MSKSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/rtc/rawstat.rs b/src/rtc/rawstat.rs index b52d8d9f..70dc6fe6 100644 --- a/src/rtc/rawstat.rs +++ b/src/rtc/rawstat.rs @@ -1,32 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `RPSE` reader - Raw Periodic Seconds Service Request"] -pub type RPSE_R = crate::BitReader; +pub type RPSE_R = crate::BitReader; #[doc = "Field `RPMI` reader - Raw Periodic Minutes Service Request"] -pub type RPMI_R = crate::BitReader; +pub type RPMI_R = crate::BitReader; #[doc = "Field `RPHO` reader - Raw Periodic Hours Service Request"] -pub type RPHO_R = crate::BitReader; +pub type RPHO_R = crate::BitReader; #[doc = "Field `RPDA` reader - Raw Periodic Days Service Request"] -pub type RPDA_R = crate::BitReader; +pub type RPDA_R = crate::BitReader; #[doc = "Field `RPMO` reader - Raw Periodic Months Service Request"] -pub type RPMO_R = crate::BitReader; +pub type RPMO_R = crate::BitReader; #[doc = "Field `RPYE` reader - Raw Periodic Years Service Request"] -pub type RPYE_R = crate::BitReader; +pub type RPYE_R = crate::BitReader; #[doc = "Field `RAI` reader - Raw Alarm Service Request"] -pub type RAI_R = crate::BitReader; +pub type RAI_R = crate::BitReader; impl R { #[doc = "Bit 0 - Raw Periodic Seconds Service Request"] #[inline(always)] @@ -64,15 +51,13 @@ impl R { RAI_R::new(((self.bits >> 8) & 1) != 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"] +#[doc = "RTC Raw Service Request Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rawstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`rawstat::R`](R) reader structure"] +impl crate::Readable for RAWSTAT_SPEC {} #[doc = "`reset()` method sets RAWSTAT to value 0"] impl crate::Resettable for RAWSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/rtc/stssr.rs b/src/rtc/stssr.rs index 6daac831..5f7ce517 100644 --- a/src/rtc/stssr.rs +++ b/src/rtc/stssr.rs @@ -1,32 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `SPSE` reader - Periodic Seconds Service Request Status after Masking"] -pub type SPSE_R = crate::BitReader; +pub type SPSE_R = crate::BitReader; #[doc = "Field `SPMI` reader - Periodic Minutes Service Request Status after Masking"] -pub type SPMI_R = crate::BitReader; +pub type SPMI_R = crate::BitReader; #[doc = "Field `SPHO` reader - Periodic Hours Service Request Status after Masking"] -pub type SPHO_R = crate::BitReader; +pub type SPHO_R = crate::BitReader; #[doc = "Field `SPDA` reader - Periodic Days Service Request Status after Masking"] -pub type SPDA_R = crate::BitReader; +pub type SPDA_R = crate::BitReader; #[doc = "Field `SPMO` reader - Periodic Months Service Request Status after Masking"] -pub type SPMO_R = crate::BitReader; +pub type SPMO_R = crate::BitReader; #[doc = "Field `SPYE` reader - Periodic Years Service Request Status after Masking"] -pub type SPYE_R = crate::BitReader; +pub type SPYE_R = crate::BitReader; #[doc = "Field `SAI` reader - Alarm Service Request Status after Masking"] -pub type SAI_R = crate::BitReader; +pub type SAI_R = crate::BitReader; impl R { #[doc = "Bit 0 - Periodic Seconds Service Request Status after Masking"] #[inline(always)] @@ -64,15 +51,13 @@ impl R { SAI_R::new(((self.bits >> 8) & 1) != 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"] +#[doc = "RTC Service Request Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`stssr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`stssr::R`](R) reader structure"] +impl crate::Readable for STSSR_SPEC {} #[doc = "`reset()` method sets STSSR to value 0"] impl crate::Resettable for STSSR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/rtc/tim0.rs b/src/rtc/tim0.rs index 04dd71aa..f53256c8 100644 --- a/src/rtc/tim0.rs +++ b/src/rtc/tim0.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SE` reader - Seconds Time Value"] -pub type SE_R = crate::FieldReader; +pub type SE_R = crate::FieldReader; #[doc = "Field `SE` writer - Seconds Time Value"] -pub type SE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIM0_SPEC, u8, u8, 6, O>; +pub type SE_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `MI` reader - Minutes Time Value"] -pub type MI_R = crate::FieldReader; +pub type MI_R = crate::FieldReader; #[doc = "Field `MI` writer - Minutes Time Value"] -pub type MI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIM0_SPEC, u8, u8, 6, O>; +pub type MI_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `HO` reader - Hours Time Value"] -pub type HO_R = crate::FieldReader; +pub type HO_R = crate::FieldReader; #[doc = "Field `HO` writer - Hours Time Value"] -pub type HO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIM0_SPEC, u8, u8, 5, O>; +pub type HO_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `DA` reader - Days Time Value"] -pub type DA_R = crate::FieldReader; +pub type DA_R = crate::FieldReader; #[doc = "Field `DA` writer - Days Time Value"] -pub type DA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIM0_SPEC, u8, u8, 5, O>; +pub type DA_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; impl R { #[doc = "Bits 0:5 - Seconds Time Value"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:5 - Seconds Time Value"] #[inline(always)] #[must_use] - pub fn se(&mut self) -> SE_W<0> { - SE_W::new(self) + pub fn se(&mut self) -> SE_W { + SE_W::new(self, 0) } #[doc = "Bits 8:13 - Minutes Time Value"] #[inline(always)] #[must_use] - pub fn mi(&mut self) -> MI_W<8> { - MI_W::new(self) + pub fn mi(&mut self) -> MI_W { + MI_W::new(self, 8) } #[doc = "Bits 16:20 - Hours Time Value"] #[inline(always)] #[must_use] - pub fn ho(&mut self) -> HO_W<16> { - HO_W::new(self) + pub fn ho(&mut self) -> HO_W { + HO_W::new(self, 16) } #[doc = "Bits 24:28 - Days Time Value"] #[inline(always)] #[must_use] - pub fn da(&mut self) -> DA_W<24> { - DA_W::new(self) + pub fn da(&mut self) -> DA_W { + DA_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RTC Time Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tim0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tim0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tim0::R`](R) reader structure"] +impl crate::Readable for TIM0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tim0::W`](W) writer structure"] impl crate::Writable for TIM0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/rtc/tim1.rs b/src/rtc/tim1.rs index bb3b5168..b77a05ea 100644 --- a/src/rtc/tim1.rs +++ b/src/rtc/tim1.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DAWE` reader - Days of Week Time Value"] -pub type DAWE_R = crate::FieldReader; +pub type DAWE_R = crate::FieldReader; #[doc = "Field `DAWE` writer - Days of Week Time Value"] -pub type DAWE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIM1_SPEC, u8, u8, 3, O>; +pub type DAWE_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `MO` reader - Month Time Value"] -pub type MO_R = crate::FieldReader; +pub type MO_R = crate::FieldReader; #[doc = "Field `MO` writer - Month Time Value"] -pub type MO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIM1_SPEC, u8, u8, 4, O>; +pub type MO_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `YE` reader - Year Time Value"] -pub type YE_R = crate::FieldReader; +pub type YE_R = crate::FieldReader; #[doc = "Field `YE` writer - Year Time Value"] -pub type YE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TIM1_SPEC, u16, u16, 16, O>; +pub type YE_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:2 - Days of Week Time Value"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bits 0:2 - Days of Week Time Value"] #[inline(always)] #[must_use] - pub fn dawe(&mut self) -> DAWE_W<0> { - DAWE_W::new(self) + pub fn dawe(&mut self) -> DAWE_W { + DAWE_W::new(self, 0) } #[doc = "Bits 8:11 - Month Time Value"] #[inline(always)] #[must_use] - pub fn mo(&mut self) -> MO_W<8> { - MO_W::new(self) + pub fn mo(&mut self) -> MO_W { + MO_W::new(self, 8) } #[doc = "Bits 16:31 - Year Time Value"] #[inline(always)] #[must_use] - pub fn ye(&mut self) -> YE_W<16> { - YE_W::new(self) + pub fn ye(&mut self) -> YE_W { + YE_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RTC Time Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tim1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tim1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tim1::R`](R) reader structure"] +impl crate::Readable for TIM1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tim1::W`](W) writer structure"] impl crate::Writable for TIM1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk.rs b/src/scu_clk.rs index 8b407716..edd3a218 100644 --- a/src/scu_clk.rs +++ b/src/scu_clk.rs @@ -1,138 +1,250 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + clkstat: CLKSTAT, + clkset: CLKSET, + clkclr: CLKCLR, + sysclkcr: SYSCLKCR, + cpuclkcr: CPUCLKCR, + pbclkcr: PBCLKCR, + usbclkcr: USBCLKCR, + _reserved7: [u8; 0x04], + ccuclkcr: CCUCLKCR, + wdtclkcr: WDTCLKCR, + extclkcr: EXTCLKCR, + mlinkclkcr: MLINKCLKCR, + sleepcr: SLEEPCR, + dsleepcr: DSLEEPCR, + _reserved13: [u8; 0x08], + cgatstat0: CGATSTAT0, + cgatset0: CGATSET0, + cgatclr0: CGATCLR0, + cgatstat1: CGATSTAT1, + cgatset1: CGATSET1, + cgatclr1: CGATCLR1, + cgatstat2: CGATSTAT2, + cgatset2: CGATSET2, + cgatclr2: CGATCLR2, +} +impl RegisterBlock { #[doc = "0x00 - Clock Status Register"] - pub clkstat: CLKSTAT, + #[inline(always)] + pub const fn clkstat(&self) -> &CLKSTAT { + &self.clkstat + } #[doc = "0x04 - CLK Set Register"] - pub clkset: CLKSET, + #[inline(always)] + pub const fn clkset(&self) -> &CLKSET { + &self.clkset + } #[doc = "0x08 - CLK Clear Register"] - pub clkclr: CLKCLR, + #[inline(always)] + pub const fn clkclr(&self) -> &CLKCLR { + &self.clkclr + } #[doc = "0x0c - System Clock Control Register"] - pub sysclkcr: SYSCLKCR, + #[inline(always)] + pub const fn sysclkcr(&self) -> &SYSCLKCR { + &self.sysclkcr + } #[doc = "0x10 - CPU Clock Control Register"] - pub cpuclkcr: CPUCLKCR, + #[inline(always)] + pub const fn cpuclkcr(&self) -> &CPUCLKCR { + &self.cpuclkcr + } #[doc = "0x14 - Peripheral Bus Clock Control Register"] - pub pbclkcr: PBCLKCR, + #[inline(always)] + pub const fn pbclkcr(&self) -> &PBCLKCR { + &self.pbclkcr + } #[doc = "0x18 - USB Clock Control Register"] - pub usbclkcr: USBCLKCR, - _reserved7: [u8; 0x04], + #[inline(always)] + pub const fn usbclkcr(&self) -> &USBCLKCR { + &self.usbclkcr + } #[doc = "0x20 - CCU Clock Control Register"] - pub ccuclkcr: CCUCLKCR, + #[inline(always)] + pub const fn ccuclkcr(&self) -> &CCUCLKCR { + &self.ccuclkcr + } #[doc = "0x24 - WDT Clock Control Register"] - pub wdtclkcr: WDTCLKCR, + #[inline(always)] + pub const fn wdtclkcr(&self) -> &WDTCLKCR { + &self.wdtclkcr + } #[doc = "0x28 - External Clock Control"] - pub extclkcr: EXTCLKCR, + #[inline(always)] + pub const fn extclkcr(&self) -> &EXTCLKCR { + &self.extclkcr + } #[doc = "0x2c - Multi-Link Clock Control"] - pub mlinkclkcr: MLINKCLKCR, + #[inline(always)] + pub const fn mlinkclkcr(&self) -> &MLINKCLKCR { + &self.mlinkclkcr + } #[doc = "0x30 - Sleep Control Register"] - pub sleepcr: SLEEPCR, + #[inline(always)] + pub const fn sleepcr(&self) -> &SLEEPCR { + &self.sleepcr + } #[doc = "0x34 - Deep Sleep Control Register"] - pub dsleepcr: DSLEEPCR, - _reserved13: [u8; 0x08], + #[inline(always)] + pub const fn dsleepcr(&self) -> &DSLEEPCR { + &self.dsleepcr + } #[doc = "0x40 - Peripheral 0 Clock Gating Status"] - pub cgatstat0: CGATSTAT0, + #[inline(always)] + pub const fn cgatstat0(&self) -> &CGATSTAT0 { + &self.cgatstat0 + } #[doc = "0x44 - Peripheral 0 Clock Gating Set"] - pub cgatset0: CGATSET0, + #[inline(always)] + pub const fn cgatset0(&self) -> &CGATSET0 { + &self.cgatset0 + } #[doc = "0x48 - Peripheral 0 Clock Gating Clear"] - pub cgatclr0: CGATCLR0, + #[inline(always)] + pub const fn cgatclr0(&self) -> &CGATCLR0 { + &self.cgatclr0 + } #[doc = "0x4c - Peripheral 1 Clock Gating Status"] - pub cgatstat1: CGATSTAT1, + #[inline(always)] + pub const fn cgatstat1(&self) -> &CGATSTAT1 { + &self.cgatstat1 + } #[doc = "0x50 - Peripheral 1 Clock Gating Set"] - pub cgatset1: CGATSET1, + #[inline(always)] + pub const fn cgatset1(&self) -> &CGATSET1 { + &self.cgatset1 + } #[doc = "0x54 - Peripheral 1 Clock Gating Clear"] - pub cgatclr1: CGATCLR1, + #[inline(always)] + pub const fn cgatclr1(&self) -> &CGATCLR1 { + &self.cgatclr1 + } #[doc = "0x58 - Peripheral 2 Clock Gating Status"] - pub cgatstat2: CGATSTAT2, + #[inline(always)] + pub const fn cgatstat2(&self) -> &CGATSTAT2 { + &self.cgatstat2 + } #[doc = "0x5c - Peripheral 2 Clock Gating Set"] - pub cgatset2: CGATSET2, + #[inline(always)] + pub const fn cgatset2(&self) -> &CGATSET2 { + &self.cgatset2 + } #[doc = "0x60 - Peripheral 2 Clock Gating Clear"] - pub cgatclr2: CGATCLR2, + #[inline(always)] + pub const fn cgatclr2(&self) -> &CGATCLR2 { + &self.cgatclr2 + } } -#[doc = "CLKSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "CLKSTAT (r) register accessor: Clock Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clkstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clkstat`] +module"] pub type CLKSTAT = crate::Reg; #[doc = "Clock Status Register"] pub mod clkstat; -#[doc = "CLKSET (w) register accessor: an alias for `Reg`"] +#[doc = "CLKSET (w) register accessor: CLK Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clkset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clkset`] +module"] pub type CLKSET = crate::Reg; #[doc = "CLK Set Register"] pub mod clkset; -#[doc = "CLKCLR (w) register accessor: an alias for `Reg`"] +#[doc = "CLKCLR (w) register accessor: CLK Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clkclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clkclr`] +module"] pub type CLKCLR = crate::Reg; #[doc = "CLK Clear Register"] pub mod clkclr; -#[doc = "SYSCLKCR (rw) register accessor: an alias for `Reg`"] +#[doc = "SYSCLKCR (rw) register accessor: System Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sysclkcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sysclkcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sysclkcr`] +module"] pub type SYSCLKCR = crate::Reg; #[doc = "System Clock Control Register"] pub mod sysclkcr; -#[doc = "CPUCLKCR (rw) register accessor: an alias for `Reg`"] +#[doc = "CPUCLKCR (rw) register accessor: CPU Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cpuclkcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cpuclkcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cpuclkcr`] +module"] pub type CPUCLKCR = crate::Reg; #[doc = "CPU Clock Control Register"] pub mod cpuclkcr; -#[doc = "PBCLKCR (rw) register accessor: an alias for `Reg`"] +#[doc = "PBCLKCR (rw) register accessor: Peripheral Bus Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pbclkcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pbclkcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pbclkcr`] +module"] pub type PBCLKCR = crate::Reg; #[doc = "Peripheral Bus Clock Control Register"] pub mod pbclkcr; -#[doc = "USBCLKCR (rw) register accessor: an alias for `Reg`"] +#[doc = "USBCLKCR (rw) register accessor: USB Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`usbclkcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`usbclkcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@usbclkcr`] +module"] pub type USBCLKCR = crate::Reg; #[doc = "USB Clock Control Register"] pub mod usbclkcr; -#[doc = "CCUCLKCR (rw) register accessor: an alias for `Reg`"] +#[doc = "CCUCLKCR (rw) register accessor: CCU Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccuclkcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccuclkcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ccuclkcr`] +module"] pub type CCUCLKCR = crate::Reg; #[doc = "CCU Clock Control Register"] pub mod ccuclkcr; -#[doc = "WDTCLKCR (rw) register accessor: an alias for `Reg`"] +#[doc = "WDTCLKCR (rw) register accessor: WDT Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`wdtclkcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`wdtclkcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdtclkcr`] +module"] pub type WDTCLKCR = crate::Reg; #[doc = "WDT Clock Control Register"] pub mod wdtclkcr; -#[doc = "EXTCLKCR (rw) register accessor: an alias for `Reg`"] +#[doc = "EXTCLKCR (rw) register accessor: External Clock Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`extclkcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`extclkcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@extclkcr`] +module"] pub type EXTCLKCR = crate::Reg; #[doc = "External Clock Control"] pub mod extclkcr; -#[doc = "MLINKCLKCR (rw) register accessor: an alias for `Reg`"] +#[doc = "MLINKCLKCR (rw) register accessor: Multi-Link Clock Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mlinkclkcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mlinkclkcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mlinkclkcr`] +module"] pub type MLINKCLKCR = crate::Reg; #[doc = "Multi-Link Clock Control"] pub mod mlinkclkcr; -#[doc = "SLEEPCR (rw) register accessor: an alias for `Reg`"] +#[doc = "SLEEPCR (rw) register accessor: Sleep Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sleepcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sleepcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sleepcr`] +module"] pub type SLEEPCR = crate::Reg; #[doc = "Sleep Control Register"] pub mod sleepcr; -#[doc = "DSLEEPCR (rw) register accessor: an alias for `Reg`"] +#[doc = "DSLEEPCR (rw) register accessor: Deep Sleep Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsleepcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dsleepcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dsleepcr`] +module"] pub type DSLEEPCR = crate::Reg; #[doc = "Deep Sleep Control Register"] pub mod dsleepcr; -#[doc = "CGATSTAT0 (r) register accessor: an alias for `Reg`"] +#[doc = "CGATSTAT0 (r) register accessor: Peripheral 0 Clock Gating Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgatstat0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatstat0`] +module"] pub type CGATSTAT0 = crate::Reg; #[doc = "Peripheral 0 Clock Gating Status"] pub mod cgatstat0; -#[doc = "CGATSET0 (w) register accessor: an alias for `Reg`"] +#[doc = "CGATSET0 (w) register accessor: Peripheral 0 Clock Gating Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatset0::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatset0`] +module"] pub type CGATSET0 = crate::Reg; #[doc = "Peripheral 0 Clock Gating Set"] pub mod cgatset0; -#[doc = "CGATCLR0 (w) register accessor: an alias for `Reg`"] +#[doc = "CGATCLR0 (w) register accessor: Peripheral 0 Clock Gating Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatclr0::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatclr0`] +module"] pub type CGATCLR0 = crate::Reg; #[doc = "Peripheral 0 Clock Gating Clear"] pub mod cgatclr0; -#[doc = "CGATSTAT1 (r) register accessor: an alias for `Reg`"] +#[doc = "CGATSTAT1 (r) register accessor: Peripheral 1 Clock Gating Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgatstat1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatstat1`] +module"] pub type CGATSTAT1 = crate::Reg; #[doc = "Peripheral 1 Clock Gating Status"] pub mod cgatstat1; -#[doc = "CGATSET1 (w) register accessor: an alias for `Reg`"] +#[doc = "CGATSET1 (w) register accessor: Peripheral 1 Clock Gating Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatset1::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatset1`] +module"] pub type CGATSET1 = crate::Reg; #[doc = "Peripheral 1 Clock Gating Set"] pub mod cgatset1; -#[doc = "CGATCLR1 (w) register accessor: an alias for `Reg`"] +#[doc = "CGATCLR1 (w) register accessor: Peripheral 1 Clock Gating Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatclr1::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatclr1`] +module"] pub type CGATCLR1 = crate::Reg; #[doc = "Peripheral 1 Clock Gating Clear"] pub mod cgatclr1; -#[doc = "CGATSTAT2 (r) register accessor: an alias for `Reg`"] +#[doc = "CGATSTAT2 (r) register accessor: Peripheral 2 Clock Gating Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgatstat2::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatstat2`] +module"] pub type CGATSTAT2 = crate::Reg; #[doc = "Peripheral 2 Clock Gating Status"] pub mod cgatstat2; -#[doc = "CGATSET2 (w) register accessor: an alias for `Reg`"] +#[doc = "CGATSET2 (w) register accessor: Peripheral 2 Clock Gating Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatset2::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatset2`] +module"] pub type CGATSET2 = crate::Reg; #[doc = "Peripheral 2 Clock Gating Set"] pub mod cgatset2; -#[doc = "CGATCLR2 (w) register accessor: an alias for `Reg`"] +#[doc = "CGATCLR2 (w) register accessor: Peripheral 2 Clock Gating Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatclr2::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cgatclr2`] +module"] 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 4344c21d..f4c00734 100644 --- a/src/scu_clk/ccuclkcr.rs +++ b/src/scu_clk/ccuclkcr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CCUDIV` reader - CCU Clock Divider Enable"] pub type CCUDIV_R = crate::BitReader; #[doc = "CCU Clock Divider Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CCUDIV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCUDIV_A { + pub const fn variant(&self) -> CCUDIV_A { match self.bits { false => CCUDIV_A::VALUE1, true => CCUDIV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fCCU = fSYS"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCUDIV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fCCU = fSYS / 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCUDIV_A::VALUE2 } } #[doc = "Field `CCUDIV` writer - CCU Clock Divider Enable"] -pub type CCUDIV_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCUCLKCR_SPEC, CCUDIV_A, O>; -impl<'a, const O: u8> CCUDIV_W<'a, O> { +pub type CCUDIV_W<'a, REG> = crate::BitWriter<'a, REG, CCUDIV_A>; +impl<'a, REG> CCUDIV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fCCU = fSYS"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCUDIV_A::VALUE1) } #[doc = "fCCU = fSYS / 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCUDIV_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - CCU Clock Divider Enable"] #[inline(always)] #[must_use] - pub fn ccudiv(&mut self) -> CCUDIV_W<0> { - CCUDIV_W::new(self) + pub fn ccudiv(&mut self) -> CCUDIV_W { + CCUDIV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CCU Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccuclkcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccuclkcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ccuclkcr::R`](R) reader structure"] +impl crate::Readable for CCUCLKCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ccuclkcr::W`](W) writer structure"] impl crate::Writable for CCUCLKCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/cgatclr0.rs b/src/scu_clk/cgatclr0.rs index 059592ca..db1e532a 100644 --- a/src/scu_clk/cgatclr0.rs +++ b/src/scu_clk/cgatclr0.rs @@ -1,24 +1,5 @@ #[doc = "Register `CGATCLR0` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "VADC Gating Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum VADC_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `VADC` writer - VADC Gating Clear"] -pub type VADC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, VADC_AW, O>; -impl<'a, const O: u8> VADC_W<'a, O> { +pub type VADC_W<'a, REG> = crate::BitWriter<'a, REG, VADC_AW>; +impl<'a, REG> VADC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VADC_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VADC_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `DSD` writer - DSD Gating Clear"] -pub type DSD_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, DSD_AW, O>; -impl<'a, const O: u8> DSD_W<'a, O> { +pub type DSD_W<'a, REG> = crate::BitWriter<'a, REG, DSD_AW>; +impl<'a, REG> DSD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSD_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSD_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CCU40` writer - CCU40 Gating Clear"] -pub type CCU40_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, CCU40_AW, O>; -impl<'a, const O: u8> CCU40_W<'a, O> { +pub type CCU40_W<'a, REG> = crate::BitWriter<'a, REG, CCU40_AW>; +impl<'a, REG> CCU40_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU40_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU40_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CCU41` writer - CCU41 Gating Clear"] -pub type CCU41_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, CCU41_AW, O>; -impl<'a, const O: u8> CCU41_W<'a, O> { +pub type CCU41_W<'a, REG> = crate::BitWriter<'a, REG, CCU41_AW>; +impl<'a, REG> CCU41_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU41_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU41_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CCU42` writer - CCU42 Gating Clear"] -pub type CCU42_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, CCU42_AW, O>; -impl<'a, const O: u8> CCU42_W<'a, O> { +pub type CCU42_W<'a, REG> = crate::BitWriter<'a, REG, CCU42_AW>; +impl<'a, REG> CCU42_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU42_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU42_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CCU80` writer - CCU80 Gating Clear"] -pub type CCU80_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, CCU80_AW, O>; -impl<'a, const O: u8> CCU80_W<'a, O> { +pub type CCU80_W<'a, REG> = crate::BitWriter<'a, REG, CCU80_AW>; +impl<'a, REG> CCU80_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU80_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU80_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CCU81` writer - CCU81 Gating Clear"] -pub type CCU81_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, CCU81_AW, O>; -impl<'a, const O: u8> CCU81_W<'a, O> { +pub type CCU81_W<'a, REG> = crate::BitWriter<'a, REG, CCU81_AW>; +impl<'a, REG> CCU81_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU81_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU81_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `POSIF0` writer - POSIF0 Gating Clear"] -pub type POSIF0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, POSIF0_AW, O>; -impl<'a, const O: u8> POSIF0_W<'a, O> { +pub type POSIF0_W<'a, REG> = crate::BitWriter<'a, REG, POSIF0_AW>; +impl<'a, REG> POSIF0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSIF0_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSIF0_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `POSIF1` writer - POSIF1 Gating Clear"] -pub type POSIF1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, POSIF1_AW, O>; -impl<'a, const O: u8> POSIF1_W<'a, O> { +pub type POSIF1_W<'a, REG> = crate::BitWriter<'a, REG, POSIF1_AW>; +impl<'a, REG> POSIF1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSIF1_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSIF1_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `USIC0` writer - USIC0 Gating Clear"] -pub type USIC0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, USIC0_AW, O>; -impl<'a, const O: u8> USIC0_W<'a, O> { +pub type USIC0_W<'a, REG> = crate::BitWriter<'a, REG, USIC0_AW>; +impl<'a, REG> USIC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC0_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC0_AW::VALUE2) } } @@ -314,16 +325,19 @@ impl From for bool { } } #[doc = "Field `ERU1` writer - ERU1 Gating Clear"] -pub type ERU1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, ERU1_AW, O>; -impl<'a, const O: u8> ERU1_W<'a, O> { +pub type ERU1_W<'a, REG> = crate::BitWriter<'a, REG, ERU1_AW>; +impl<'a, REG> ERU1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERU1_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERU1_AW::VALUE2) } } @@ -342,16 +356,19 @@ impl From for bool { } } #[doc = "Field `HRPWM0` writer - HRPWM0 Gating Clear"] -pub type HRPWM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR0_SPEC, HRPWM0_AW, O>; -impl<'a, const O: u8> HRPWM0_W<'a, O> { +pub type HRPWM0_W<'a, REG> = crate::BitWriter<'a, REG, HRPWM0_AW>; +impl<'a, REG> HRPWM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRPWM0_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRPWM0_AW::VALUE2) } } @@ -359,90 +376,93 @@ impl W { #[doc = "Bit 0 - VADC Gating Clear"] #[inline(always)] #[must_use] - pub fn vadc(&mut self) -> VADC_W<0> { - VADC_W::new(self) + pub fn vadc(&mut self) -> VADC_W { + VADC_W::new(self, 0) } #[doc = "Bit 1 - DSD Gating Clear"] #[inline(always)] #[must_use] - pub fn dsd(&mut self) -> DSD_W<1> { - DSD_W::new(self) + pub fn dsd(&mut self) -> DSD_W { + DSD_W::new(self, 1) } #[doc = "Bit 2 - CCU40 Gating Clear"] #[inline(always)] #[must_use] - pub fn ccu40(&mut self) -> CCU40_W<2> { - CCU40_W::new(self) + pub fn ccu40(&mut self) -> CCU40_W { + CCU40_W::new(self, 2) } #[doc = "Bit 3 - CCU41 Gating Clear"] #[inline(always)] #[must_use] - pub fn ccu41(&mut self) -> CCU41_W<3> { - CCU41_W::new(self) + pub fn ccu41(&mut self) -> CCU41_W { + CCU41_W::new(self, 3) } #[doc = "Bit 4 - CCU42 Gating Clear"] #[inline(always)] #[must_use] - pub fn ccu42(&mut self) -> CCU42_W<4> { - CCU42_W::new(self) + pub fn ccu42(&mut self) -> CCU42_W { + CCU42_W::new(self, 4) } #[doc = "Bit 7 - CCU80 Gating Clear"] #[inline(always)] #[must_use] - pub fn ccu80(&mut self) -> CCU80_W<7> { - CCU80_W::new(self) + pub fn ccu80(&mut self) -> CCU80_W { + CCU80_W::new(self, 7) } #[doc = "Bit 8 - CCU81 Gating Clear"] #[inline(always)] #[must_use] - pub fn ccu81(&mut self) -> CCU81_W<8> { - CCU81_W::new(self) + pub fn ccu81(&mut self) -> CCU81_W { + CCU81_W::new(self, 8) } #[doc = "Bit 9 - POSIF0 Gating Clear"] #[inline(always)] #[must_use] - pub fn posif0(&mut self) -> POSIF0_W<9> { - POSIF0_W::new(self) + pub fn posif0(&mut self) -> POSIF0_W { + POSIF0_W::new(self, 9) } #[doc = "Bit 10 - POSIF1 Gating Clear"] #[inline(always)] #[must_use] - pub fn posif1(&mut self) -> POSIF1_W<10> { - POSIF1_W::new(self) + pub fn posif1(&mut self) -> POSIF1_W { + POSIF1_W::new(self, 10) } #[doc = "Bit 11 - USIC0 Gating Clear"] #[inline(always)] #[must_use] - pub fn usic0(&mut self) -> USIC0_W<11> { - USIC0_W::new(self) + pub fn usic0(&mut self) -> USIC0_W { + USIC0_W::new(self, 11) } #[doc = "Bit 16 - ERU1 Gating Clear"] #[inline(always)] #[must_use] - pub fn eru1(&mut self) -> ERU1_W<16> { - ERU1_W::new(self) + pub fn eru1(&mut self) -> ERU1_W { + ERU1_W::new(self, 16) } #[doc = "Bit 23 - HRPWM0 Gating Clear"] #[inline(always)] #[must_use] - pub fn hrpwm0(&mut self) -> HRPWM0_W<23> { - HRPWM0_W::new(self) + pub fn hrpwm0(&mut self) -> HRPWM0_W { + HRPWM0_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Peripheral 0 Clock Gating Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatclr0::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CGATCLR0_SPEC; impl crate::RegisterSpec for CGATCLR0_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cgatclr0::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cgatclr0::W`](W) writer structure"] impl crate::Writable for CGATCLR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/cgatclr1.rs b/src/scu_clk/cgatclr1.rs index 002a09e6..66a45ab2 100644 --- a/src/scu_clk/cgatclr1.rs +++ b/src/scu_clk/cgatclr1.rs @@ -1,24 +1,5 @@ #[doc = "Register `CGATCLR1` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "CCU43 Gating Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CCU43_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CCU43` writer - CCU43 Gating Clear"] -pub type CCU43_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR1_SPEC, CCU43_AW, O>; -impl<'a, const O: u8> CCU43_W<'a, O> { +pub type CCU43_W<'a, REG> = crate::BitWriter<'a, REG, CCU43_AW>; +impl<'a, REG> CCU43_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU43_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU43_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `LEDTSCU0` writer - LEDTS Gating Clear"] -pub type LEDTSCU0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR1_SPEC, LEDTSCU0_AW, O>; -impl<'a, const O: u8> LEDTSCU0_W<'a, O> { +pub type LEDTSCU0_W<'a, REG> = crate::BitWriter<'a, REG, LEDTSCU0_AW>; +impl<'a, REG> LEDTSCU0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LEDTSCU0_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LEDTSCU0_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `MCAN0` writer - MultiCAN Gating Clear"] -pub type MCAN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR1_SPEC, MCAN0_AW, O>; -impl<'a, const O: u8> MCAN0_W<'a, O> { +pub type MCAN0_W<'a, REG> = crate::BitWriter<'a, REG, MCAN0_AW>; +impl<'a, REG> MCAN0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCAN0_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCAN0_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `DAC` writer - DAC Gating Clear"] -pub type DAC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR1_SPEC, DAC_AW, O>; -impl<'a, const O: u8> DAC_W<'a, O> { +pub type DAC_W<'a, REG> = crate::BitWriter<'a, REG, DAC_AW>; +impl<'a, REG> DAC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DAC_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DAC_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `USIC1` writer - USIC1 Gating Clear"] -pub type USIC1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR1_SPEC, USIC1_AW, O>; -impl<'a, const O: u8> USIC1_W<'a, O> { +pub type USIC1_W<'a, REG> = crate::BitWriter<'a, REG, USIC1_AW>; +impl<'a, REG> USIC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC1_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC1_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `PPORTS` writer - PORTS Gating Clear"] -pub type PPORTS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR1_SPEC, PPORTS_AW, O>; -impl<'a, const O: u8> PPORTS_W<'a, O> { +pub type PPORTS_W<'a, REG> = crate::BitWriter<'a, REG, PPORTS_AW>; +impl<'a, REG> PPORTS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPORTS_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPORTS_AW::VALUE2) } } @@ -191,54 +190,57 @@ impl W { #[doc = "Bit 0 - CCU43 Gating Clear"] #[inline(always)] #[must_use] - pub fn ccu43(&mut self) -> CCU43_W<0> { - CCU43_W::new(self) + pub fn ccu43(&mut self) -> CCU43_W { + CCU43_W::new(self, 0) } #[doc = "Bit 3 - LEDTS Gating Clear"] #[inline(always)] #[must_use] - pub fn ledtscu0(&mut self) -> LEDTSCU0_W<3> { - LEDTSCU0_W::new(self) + pub fn ledtscu0(&mut self) -> LEDTSCU0_W { + LEDTSCU0_W::new(self, 3) } #[doc = "Bit 4 - MultiCAN Gating Clear"] #[inline(always)] #[must_use] - pub fn mcan0(&mut self) -> MCAN0_W<4> { - MCAN0_W::new(self) + pub fn mcan0(&mut self) -> MCAN0_W { + MCAN0_W::new(self, 4) } #[doc = "Bit 5 - DAC Gating Clear"] #[inline(always)] #[must_use] - pub fn dac(&mut self) -> DAC_W<5> { - DAC_W::new(self) + pub fn dac(&mut self) -> DAC_W { + DAC_W::new(self, 5) } #[doc = "Bit 7 - USIC1 Gating Clear"] #[inline(always)] #[must_use] - pub fn usic1(&mut self) -> USIC1_W<7> { - USIC1_W::new(self) + pub fn usic1(&mut self) -> USIC1_W { + USIC1_W::new(self, 7) } #[doc = "Bit 9 - PORTS Gating Clear"] #[inline(always)] #[must_use] - pub fn pports(&mut self) -> PPORTS_W<9> { - PPORTS_W::new(self) + pub fn pports(&mut self) -> PPORTS_W { + PPORTS_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Peripheral 1 Clock Gating Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatclr1::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CGATCLR1_SPEC; impl crate::RegisterSpec for CGATCLR1_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cgatclr1::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cgatclr1::W`](W) writer structure"] impl crate::Writable for CGATCLR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/cgatclr2.rs b/src/scu_clk/cgatclr2.rs index 37784d0f..f7ea6638 100644 --- a/src/scu_clk/cgatclr2.rs +++ b/src/scu_clk/cgatclr2.rs @@ -1,24 +1,5 @@ #[doc = "Register `CGATCLR2` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "WDT Gating Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum WDT_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `WDT` writer - WDT Gating Clear"] -pub type WDT_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR2_SPEC, WDT_AW, O>; -impl<'a, const O: u8> WDT_W<'a, O> { +pub type WDT_W<'a, REG> = crate::BitWriter<'a, REG, WDT_AW>; +impl<'a, REG> WDT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDT_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDT_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `ETH0` writer - ETH0 Gating Clear"] -pub type ETH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR2_SPEC, ETH0_AW, O>; -impl<'a, const O: u8> ETH0_W<'a, O> { +pub type ETH0_W<'a, REG> = crate::BitWriter<'a, REG, ETH0_AW>; +impl<'a, REG> ETH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ETH0_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ETH0_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `DMA0` writer - DMA0 Gating Clear"] -pub type DMA0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR2_SPEC, DMA0_AW, O>; -impl<'a, const O: u8> DMA0_W<'a, O> { +pub type DMA0_W<'a, REG> = crate::BitWriter<'a, REG, DMA0_AW>; +impl<'a, REG> DMA0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DMA0_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DMA0_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `FCE` writer - FCE Gating Clear"] -pub type FCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR2_SPEC, FCE_AW, O>; -impl<'a, const O: u8> FCE_W<'a, O> { +pub type FCE_W<'a, REG> = crate::BitWriter<'a, REG, FCE_AW>; +impl<'a, REG> FCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FCE_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FCE_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `USB` writer - USB Gating Clear"] -pub type USB_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATCLR2_SPEC, USB_AW, O>; -impl<'a, const O: u8> USB_W<'a, O> { +pub type USB_W<'a, REG> = crate::BitWriter<'a, REG, USB_AW>; +impl<'a, REG> USB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USB_AW::VALUE1) } #[doc = "Disable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USB_AW::VALUE2) } } @@ -163,48 +159,51 @@ impl W { #[doc = "Bit 1 - WDT Gating Clear"] #[inline(always)] #[must_use] - pub fn wdt(&mut self) -> WDT_W<1> { - WDT_W::new(self) + pub fn wdt(&mut self) -> WDT_W { + WDT_W::new(self, 1) } #[doc = "Bit 2 - ETH0 Gating Clear"] #[inline(always)] #[must_use] - pub fn eth0(&mut self) -> ETH0_W<2> { - ETH0_W::new(self) + pub fn eth0(&mut self) -> ETH0_W { + ETH0_W::new(self, 2) } #[doc = "Bit 4 - DMA0 Gating Clear"] #[inline(always)] #[must_use] - pub fn dma0(&mut self) -> DMA0_W<4> { - DMA0_W::new(self) + pub fn dma0(&mut self) -> DMA0_W { + DMA0_W::new(self, 4) } #[doc = "Bit 6 - FCE Gating Clear"] #[inline(always)] #[must_use] - pub fn fce(&mut self) -> FCE_W<6> { - FCE_W::new(self) + pub fn fce(&mut self) -> FCE_W { + FCE_W::new(self, 6) } #[doc = "Bit 7 - USB Gating Clear"] #[inline(always)] #[must_use] - pub fn usb(&mut self) -> USB_W<7> { - USB_W::new(self) + pub fn usb(&mut self) -> USB_W { + USB_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Peripheral 2 Clock Gating Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatclr2::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CGATCLR2_SPEC; impl crate::RegisterSpec for CGATCLR2_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cgatclr2::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cgatclr2::W`](W) writer structure"] impl crate::Writable for CGATCLR2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/cgatset0.rs b/src/scu_clk/cgatset0.rs index 01eccbb7..32ca079b 100644 --- a/src/scu_clk/cgatset0.rs +++ b/src/scu_clk/cgatset0.rs @@ -1,24 +1,5 @@ #[doc = "Register `CGATSET0` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "VADC Gating Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum VADC_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `VADC` writer - VADC Gating Set"] -pub type VADC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, VADC_AW, O>; -impl<'a, const O: u8> VADC_W<'a, O> { +pub type VADC_W<'a, REG> = crate::BitWriter<'a, REG, VADC_AW>; +impl<'a, REG> VADC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VADC_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VADC_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `DSD` writer - DSD Gating Set"] -pub type DSD_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, DSD_AW, O>; -impl<'a, const O: u8> DSD_W<'a, O> { +pub type DSD_W<'a, REG> = crate::BitWriter<'a, REG, DSD_AW>; +impl<'a, REG> DSD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSD_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSD_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CCU40` writer - CCU40 Gating Set"] -pub type CCU40_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, CCU40_AW, O>; -impl<'a, const O: u8> CCU40_W<'a, O> { +pub type CCU40_W<'a, REG> = crate::BitWriter<'a, REG, CCU40_AW>; +impl<'a, REG> CCU40_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU40_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU40_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CCU41` writer - CCU41 Gating Set"] -pub type CCU41_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, CCU41_AW, O>; -impl<'a, const O: u8> CCU41_W<'a, O> { +pub type CCU41_W<'a, REG> = crate::BitWriter<'a, REG, CCU41_AW>; +impl<'a, REG> CCU41_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU41_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU41_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CCU42` writer - CCU42 Gating Set"] -pub type CCU42_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, CCU42_AW, O>; -impl<'a, const O: u8> CCU42_W<'a, O> { +pub type CCU42_W<'a, REG> = crate::BitWriter<'a, REG, CCU42_AW>; +impl<'a, REG> CCU42_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU42_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU42_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CCU80` writer - CCU80 Gating Set"] -pub type CCU80_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, CCU80_AW, O>; -impl<'a, const O: u8> CCU80_W<'a, O> { +pub type CCU80_W<'a, REG> = crate::BitWriter<'a, REG, CCU80_AW>; +impl<'a, REG> CCU80_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU80_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU80_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CCU81` writer - CCU81 Gating Set"] -pub type CCU81_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, CCU81_AW, O>; -impl<'a, const O: u8> CCU81_W<'a, O> { +pub type CCU81_W<'a, REG> = crate::BitWriter<'a, REG, CCU81_AW>; +impl<'a, REG> CCU81_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU81_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU81_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `POSIF0` writer - POSIF0 Gating Set"] -pub type POSIF0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, POSIF0_AW, O>; -impl<'a, const O: u8> POSIF0_W<'a, O> { +pub type POSIF0_W<'a, REG> = crate::BitWriter<'a, REG, POSIF0_AW>; +impl<'a, REG> POSIF0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSIF0_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSIF0_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `POSIF1` writer - POSIF1 Gating Set"] -pub type POSIF1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, POSIF1_AW, O>; -impl<'a, const O: u8> POSIF1_W<'a, O> { +pub type POSIF1_W<'a, REG> = crate::BitWriter<'a, REG, POSIF1_AW>; +impl<'a, REG> POSIF1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSIF1_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSIF1_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `USIC0` writer - USIC0 Gating Set"] -pub type USIC0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, USIC0_AW, O>; -impl<'a, const O: u8> USIC0_W<'a, O> { +pub type USIC0_W<'a, REG> = crate::BitWriter<'a, REG, USIC0_AW>; +impl<'a, REG> USIC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC0_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC0_AW::VALUE2) } } @@ -314,16 +325,19 @@ impl From for bool { } } #[doc = "Field `ERU1` writer - ERU1 Gating Set"] -pub type ERU1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, ERU1_AW, O>; -impl<'a, const O: u8> ERU1_W<'a, O> { +pub type ERU1_W<'a, REG> = crate::BitWriter<'a, REG, ERU1_AW>; +impl<'a, REG> ERU1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERU1_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERU1_AW::VALUE2) } } @@ -342,16 +356,19 @@ impl From for bool { } } #[doc = "Field `HRPWM0` writer - HRPWM0 Gating Set"] -pub type HRPWM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET0_SPEC, HRPWM0_AW, O>; -impl<'a, const O: u8> HRPWM0_W<'a, O> { +pub type HRPWM0_W<'a, REG> = crate::BitWriter<'a, REG, HRPWM0_AW>; +impl<'a, REG> HRPWM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRPWM0_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRPWM0_AW::VALUE2) } } @@ -359,90 +376,93 @@ impl W { #[doc = "Bit 0 - VADC Gating Set"] #[inline(always)] #[must_use] - pub fn vadc(&mut self) -> VADC_W<0> { - VADC_W::new(self) + pub fn vadc(&mut self) -> VADC_W { + VADC_W::new(self, 0) } #[doc = "Bit 1 - DSD Gating Set"] #[inline(always)] #[must_use] - pub fn dsd(&mut self) -> DSD_W<1> { - DSD_W::new(self) + pub fn dsd(&mut self) -> DSD_W { + DSD_W::new(self, 1) } #[doc = "Bit 2 - CCU40 Gating Set"] #[inline(always)] #[must_use] - pub fn ccu40(&mut self) -> CCU40_W<2> { - CCU40_W::new(self) + pub fn ccu40(&mut self) -> CCU40_W { + CCU40_W::new(self, 2) } #[doc = "Bit 3 - CCU41 Gating Set"] #[inline(always)] #[must_use] - pub fn ccu41(&mut self) -> CCU41_W<3> { - CCU41_W::new(self) + pub fn ccu41(&mut self) -> CCU41_W { + CCU41_W::new(self, 3) } #[doc = "Bit 4 - CCU42 Gating Set"] #[inline(always)] #[must_use] - pub fn ccu42(&mut self) -> CCU42_W<4> { - CCU42_W::new(self) + pub fn ccu42(&mut self) -> CCU42_W { + CCU42_W::new(self, 4) } #[doc = "Bit 7 - CCU80 Gating Set"] #[inline(always)] #[must_use] - pub fn ccu80(&mut self) -> CCU80_W<7> { - CCU80_W::new(self) + pub fn ccu80(&mut self) -> CCU80_W { + CCU80_W::new(self, 7) } #[doc = "Bit 8 - CCU81 Gating Set"] #[inline(always)] #[must_use] - pub fn ccu81(&mut self) -> CCU81_W<8> { - CCU81_W::new(self) + pub fn ccu81(&mut self) -> CCU81_W { + CCU81_W::new(self, 8) } #[doc = "Bit 9 - POSIF0 Gating Set"] #[inline(always)] #[must_use] - pub fn posif0(&mut self) -> POSIF0_W<9> { - POSIF0_W::new(self) + pub fn posif0(&mut self) -> POSIF0_W { + POSIF0_W::new(self, 9) } #[doc = "Bit 10 - POSIF1 Gating Set"] #[inline(always)] #[must_use] - pub fn posif1(&mut self) -> POSIF1_W<10> { - POSIF1_W::new(self) + pub fn posif1(&mut self) -> POSIF1_W { + POSIF1_W::new(self, 10) } #[doc = "Bit 11 - USIC0 Gating Set"] #[inline(always)] #[must_use] - pub fn usic0(&mut self) -> USIC0_W<11> { - USIC0_W::new(self) + pub fn usic0(&mut self) -> USIC0_W { + USIC0_W::new(self, 11) } #[doc = "Bit 16 - ERU1 Gating Set"] #[inline(always)] #[must_use] - pub fn eru1(&mut self) -> ERU1_W<16> { - ERU1_W::new(self) + pub fn eru1(&mut self) -> ERU1_W { + ERU1_W::new(self, 16) } #[doc = "Bit 23 - HRPWM0 Gating Set"] #[inline(always)] #[must_use] - pub fn hrpwm0(&mut self) -> HRPWM0_W<23> { - HRPWM0_W::new(self) + pub fn hrpwm0(&mut self) -> HRPWM0_W { + HRPWM0_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Peripheral 0 Clock Gating Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatset0::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CGATSET0_SPEC; impl crate::RegisterSpec for CGATSET0_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cgatset0::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cgatset0::W`](W) writer structure"] impl crate::Writable for CGATSET0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/cgatset1.rs b/src/scu_clk/cgatset1.rs index 2bb71cb1..f2e189e9 100644 --- a/src/scu_clk/cgatset1.rs +++ b/src/scu_clk/cgatset1.rs @@ -1,24 +1,5 @@ #[doc = "Register `CGATSET1` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "CCU43 Gating Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CCU43_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CCU43` writer - CCU43 Gating Set"] -pub type CCU43_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET1_SPEC, CCU43_AW, O>; -impl<'a, const O: u8> CCU43_W<'a, O> { +pub type CCU43_W<'a, REG> = crate::BitWriter<'a, REG, CCU43_AW>; +impl<'a, REG> CCU43_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU43_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU43_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `LEDTSCU0` writer - LEDTS Gating Set"] -pub type LEDTSCU0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET1_SPEC, LEDTSCU0_AW, O>; -impl<'a, const O: u8> LEDTSCU0_W<'a, O> { +pub type LEDTSCU0_W<'a, REG> = crate::BitWriter<'a, REG, LEDTSCU0_AW>; +impl<'a, REG> LEDTSCU0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LEDTSCU0_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LEDTSCU0_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `MCAN0` writer - MultiCAN Gating Set"] -pub type MCAN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET1_SPEC, MCAN0_AW, O>; -impl<'a, const O: u8> MCAN0_W<'a, O> { +pub type MCAN0_W<'a, REG> = crate::BitWriter<'a, REG, MCAN0_AW>; +impl<'a, REG> MCAN0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCAN0_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCAN0_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `DAC` writer - DAC Gating Set"] -pub type DAC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET1_SPEC, DAC_AW, O>; -impl<'a, const O: u8> DAC_W<'a, O> { +pub type DAC_W<'a, REG> = crate::BitWriter<'a, REG, DAC_AW>; +impl<'a, REG> DAC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DAC_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DAC_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `USIC1` writer - USIC1 Gating Set"] -pub type USIC1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET1_SPEC, USIC1_AW, O>; -impl<'a, const O: u8> USIC1_W<'a, O> { +pub type USIC1_W<'a, REG> = crate::BitWriter<'a, REG, USIC1_AW>; +impl<'a, REG> USIC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC1_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC1_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `PPORTS` writer - PORTS Gating Set"] -pub type PPORTS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET1_SPEC, PPORTS_AW, O>; -impl<'a, const O: u8> PPORTS_W<'a, O> { +pub type PPORTS_W<'a, REG> = crate::BitWriter<'a, REG, PPORTS_AW>; +impl<'a, REG> PPORTS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPORTS_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPORTS_AW::VALUE2) } } @@ -191,54 +190,57 @@ impl W { #[doc = "Bit 0 - CCU43 Gating Set"] #[inline(always)] #[must_use] - pub fn ccu43(&mut self) -> CCU43_W<0> { - CCU43_W::new(self) + pub fn ccu43(&mut self) -> CCU43_W { + CCU43_W::new(self, 0) } #[doc = "Bit 3 - LEDTS Gating Set"] #[inline(always)] #[must_use] - pub fn ledtscu0(&mut self) -> LEDTSCU0_W<3> { - LEDTSCU0_W::new(self) + pub fn ledtscu0(&mut self) -> LEDTSCU0_W { + LEDTSCU0_W::new(self, 3) } #[doc = "Bit 4 - MultiCAN Gating Set"] #[inline(always)] #[must_use] - pub fn mcan0(&mut self) -> MCAN0_W<4> { - MCAN0_W::new(self) + pub fn mcan0(&mut self) -> MCAN0_W { + MCAN0_W::new(self, 4) } #[doc = "Bit 5 - DAC Gating Set"] #[inline(always)] #[must_use] - pub fn dac(&mut self) -> DAC_W<5> { - DAC_W::new(self) + pub fn dac(&mut self) -> DAC_W { + DAC_W::new(self, 5) } #[doc = "Bit 7 - USIC1 Gating Set"] #[inline(always)] #[must_use] - pub fn usic1(&mut self) -> USIC1_W<7> { - USIC1_W::new(self) + pub fn usic1(&mut self) -> USIC1_W { + USIC1_W::new(self, 7) } #[doc = "Bit 9 - PORTS Gating Set"] #[inline(always)] #[must_use] - pub fn pports(&mut self) -> PPORTS_W<9> { - PPORTS_W::new(self) + pub fn pports(&mut self) -> PPORTS_W { + PPORTS_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Peripheral 1 Clock Gating Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatset1::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CGATSET1_SPEC; impl crate::RegisterSpec for CGATSET1_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cgatset1::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cgatset1::W`](W) writer structure"] impl crate::Writable for CGATSET1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/cgatset2.rs b/src/scu_clk/cgatset2.rs index b2603eba..33b8360c 100644 --- a/src/scu_clk/cgatset2.rs +++ b/src/scu_clk/cgatset2.rs @@ -1,24 +1,5 @@ #[doc = "Register `CGATSET2` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "WDT Gating Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum WDT_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `WDT` writer - WDT Gating Set"] -pub type WDT_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET2_SPEC, WDT_AW, O>; -impl<'a, const O: u8> WDT_W<'a, O> { +pub type WDT_W<'a, REG> = crate::BitWriter<'a, REG, WDT_AW>; +impl<'a, REG> WDT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDT_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDT_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `ETH0` writer - ETH0 Gating Set"] -pub type ETH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET2_SPEC, ETH0_AW, O>; -impl<'a, const O: u8> ETH0_W<'a, O> { +pub type ETH0_W<'a, REG> = crate::BitWriter<'a, REG, ETH0_AW>; +impl<'a, REG> ETH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ETH0_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ETH0_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `DMA0` writer - DMA0 Gating Set"] -pub type DMA0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET2_SPEC, DMA0_AW, O>; -impl<'a, const O: u8> DMA0_W<'a, O> { +pub type DMA0_W<'a, REG> = crate::BitWriter<'a, REG, DMA0_AW>; +impl<'a, REG> DMA0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DMA0_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DMA0_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `FCE` writer - FCE Gating Set"] -pub type FCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET2_SPEC, FCE_AW, O>; -impl<'a, const O: u8> FCE_W<'a, O> { +pub type FCE_W<'a, REG> = crate::BitWriter<'a, REG, FCE_AW>; +impl<'a, REG> FCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FCE_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FCE_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `USB` writer - USB Gating Set"] -pub type USB_W<'a, const O: u8> = crate::BitWriter<'a, u32, CGATSET2_SPEC, USB_AW, O>; -impl<'a, const O: u8> USB_W<'a, O> { +pub type USB_W<'a, REG> = crate::BitWriter<'a, REG, USB_AW>; +impl<'a, REG> USB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USB_AW::VALUE1) } #[doc = "Enable gating"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USB_AW::VALUE2) } } @@ -163,48 +159,51 @@ impl W { #[doc = "Bit 1 - WDT Gating Set"] #[inline(always)] #[must_use] - pub fn wdt(&mut self) -> WDT_W<1> { - WDT_W::new(self) + pub fn wdt(&mut self) -> WDT_W { + WDT_W::new(self, 1) } #[doc = "Bit 2 - ETH0 Gating Set"] #[inline(always)] #[must_use] - pub fn eth0(&mut self) -> ETH0_W<2> { - ETH0_W::new(self) + pub fn eth0(&mut self) -> ETH0_W { + ETH0_W::new(self, 2) } #[doc = "Bit 4 - DMA0 Gating Set"] #[inline(always)] #[must_use] - pub fn dma0(&mut self) -> DMA0_W<4> { - DMA0_W::new(self) + pub fn dma0(&mut self) -> DMA0_W { + DMA0_W::new(self, 4) } #[doc = "Bit 6 - FCE Gating Set"] #[inline(always)] #[must_use] - pub fn fce(&mut self) -> FCE_W<6> { - FCE_W::new(self) + pub fn fce(&mut self) -> FCE_W { + FCE_W::new(self, 6) } #[doc = "Bit 7 - USB Gating Set"] #[inline(always)] #[must_use] - pub fn usb(&mut self) -> USB_W<7> { - USB_W::new(self) + pub fn usb(&mut self) -> USB_W { + USB_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Peripheral 2 Clock Gating Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cgatset2::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CGATSET2_SPEC; impl crate::RegisterSpec for CGATSET2_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cgatset2::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cgatset2::W`](W) writer structure"] impl crate::Writable for CGATSET2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/cgatstat0.rs b/src/scu_clk/cgatstat0.rs index bd4d4762..cc9cd5c5 100644 --- a/src/scu_clk/cgatstat0.rs +++ b/src/scu_clk/cgatstat0.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VADC` reader - VADC Gating Status"] pub type VADC_R = crate::BitReader; #[doc = "VADC Gating Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl VADC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VADC_A { + pub const fn variant(&self) -> VADC_A { match self.bits { false => VADC_A::VALUE1, true => VADC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VADC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VADC_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl DSD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSD_A { + pub const fn variant(&self) -> DSD_A { match self.bits { false => DSD_A::VALUE1, true => DSD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSD_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl CCU40_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU40_A { + pub const fn variant(&self) -> CCU40_A { match self.bits { false => CCU40_A::VALUE1, true => CCU40_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU40_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU40_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl CCU41_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU41_A { + pub const fn variant(&self) -> CCU41_A { match self.bits { false => CCU41_A::VALUE1, true => CCU41_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU41_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU41_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl CCU42_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU42_A { + pub const fn variant(&self) -> CCU42_A { match self.bits { false => CCU42_A::VALUE1, true => CCU42_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU42_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU42_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl CCU80_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU80_A { + pub const fn variant(&self) -> CCU80_A { match self.bits { false => CCU80_A::VALUE1, true => CCU80_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU80_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU80_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl CCU81_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU81_A { + pub const fn variant(&self) -> CCU81_A { match self.bits { false => CCU81_A::VALUE1, true => CCU81_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU81_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU81_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl POSIF0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> POSIF0_A { + pub const fn variant(&self) -> POSIF0_A { match self.bits { false => POSIF0_A::VALUE1, true => POSIF0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == POSIF0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == POSIF0_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl POSIF1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> POSIF1_A { + pub const fn variant(&self) -> POSIF1_A { match self.bits { false => POSIF1_A::VALUE1, true => POSIF1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == POSIF1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == POSIF1_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl USIC0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USIC0_A { + pub const fn variant(&self) -> USIC0_A { match self.bits { false => USIC0_A::VALUE1, true => USIC0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USIC0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USIC0_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl ERU1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERU1_A { + pub const fn variant(&self) -> ERU1_A { match self.bits { false => ERU1_A::VALUE1, true => ERU1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERU1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERU1_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl HRPWM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRPWM0_A { + pub const fn variant(&self) -> HRPWM0_A { match self.bits { false => HRPWM0_A::VALUE1, true => HRPWM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HRPWM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRPWM0_A::VALUE2 @@ -507,15 +494,13 @@ impl R { HRPWM0_R::new(((self.bits >> 23) & 1) != 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"] +#[doc = "Peripheral 0 Clock Gating Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgatstat0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cgatstat0::R`](R) reader structure"] +impl crate::Readable for CGATSTAT0_SPEC {} #[doc = "`reset()` method sets CGATSTAT0 to value 0"] impl crate::Resettable for CGATSTAT0_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_clk/cgatstat1.rs b/src/scu_clk/cgatstat1.rs index 9e6972af..ede4c916 100644 --- a/src/scu_clk/cgatstat1.rs +++ b/src/scu_clk/cgatstat1.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CCU43` reader - CCU43 Gating Status"] pub type CCU43_R = crate::BitReader; #[doc = "CCU43 Gating Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl CCU43_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU43_A { + pub const fn variant(&self) -> CCU43_A { match self.bits { false => CCU43_A::VALUE1, true => CCU43_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU43_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU43_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl LEDTSCU0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LEDTSCU0_A { + pub const fn variant(&self) -> LEDTSCU0_A { match self.bits { false => LEDTSCU0_A::VALUE1, true => LEDTSCU0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LEDTSCU0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LEDTSCU0_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl MCAN0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCAN0_A { + pub const fn variant(&self) -> MCAN0_A { match self.bits { false => MCAN0_A::VALUE1, true => MCAN0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCAN0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCAN0_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl DAC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DAC_A { + pub const fn variant(&self) -> DAC_A { match self.bits { false => DAC_A::VALUE1, true => DAC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DAC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DAC_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl USIC1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USIC1_A { + pub const fn variant(&self) -> USIC1_A { match self.bits { false => USIC1_A::VALUE1, true => USIC1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USIC1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USIC1_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PPORTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPORTS_A { + pub const fn variant(&self) -> PPORTS_A { match self.bits { false => PPORTS_A::VALUE1, true => PPORTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPORTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPORTS_A::VALUE2 @@ -261,15 +248,13 @@ impl R { PPORTS_R::new(((self.bits >> 9) & 1) != 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"] +#[doc = "Peripheral 1 Clock Gating Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgatstat1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cgatstat1::R`](R) reader structure"] +impl crate::Readable for CGATSTAT1_SPEC {} #[doc = "`reset()` method sets CGATSTAT1 to value 0"] impl crate::Resettable for CGATSTAT1_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_clk/cgatstat2.rs b/src/scu_clk/cgatstat2.rs index a70f6a65..a1763cad 100644 --- a/src/scu_clk/cgatstat2.rs +++ b/src/scu_clk/cgatstat2.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `WDT` reader - WDT Gating Status"] pub type WDT_R = crate::BitReader; #[doc = "WDT Gating Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl WDT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WDT_A { + pub const fn variant(&self) -> WDT_A { match self.bits { false => WDT_A::VALUE1, true => WDT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WDT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WDT_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl ETH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ETH0_A { + pub const fn variant(&self) -> ETH0_A { match self.bits { false => ETH0_A::VALUE1, true => ETH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ETH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ETH0_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl DMA0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DMA0_A { + pub const fn variant(&self) -> DMA0_A { match self.bits { false => DMA0_A::VALUE1, true => DMA0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DMA0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DMA0_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl FCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FCE_A { + pub const fn variant(&self) -> FCE_A { match self.bits { false => FCE_A::VALUE1, true => FCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FCE_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl USB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USB_A { + pub const fn variant(&self) -> USB_A { match self.bits { false => USB_A::VALUE1, true => USB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Gating de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Gating asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USB_A::VALUE2 @@ -220,15 +207,13 @@ impl R { USB_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "Peripheral 2 Clock Gating Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cgatstat2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`cgatstat2::R`](R) reader structure"] +impl crate::Readable for CGATSTAT2_SPEC {} #[doc = "`reset()` method sets CGATSTAT2 to value 0"] impl crate::Resettable for CGATSTAT2_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_clk/clkclr.rs b/src/scu_clk/clkclr.rs index 534fe6ce..a103e85f 100644 --- a/src/scu_clk/clkclr.rs +++ b/src/scu_clk/clkclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `CLKCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "USB Clock Disable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum USBCDI_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `USBCDI` writer - USB Clock Disable"] -pub type USBCDI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKCLR_SPEC, USBCDI_AW, O>; -impl<'a, const O: u8> USBCDI_W<'a, O> { +pub type USBCDI_W<'a, REG> = crate::BitWriter<'a, REG, USBCDI_AW>; +impl<'a, REG> USBCDI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBCDI_AW::VALUE1) } #[doc = "Disable clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBCDI_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `ETH0CDI` writer - Ethernet Clock Disable"] -pub type ETH0CDI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKCLR_SPEC, ETH0CDI_AW, O>; -impl<'a, const O: u8> ETH0CDI_W<'a, O> { +pub type ETH0CDI_W<'a, REG> = crate::BitWriter<'a, REG, ETH0CDI_AW>; +impl<'a, REG> ETH0CDI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ETH0CDI_AW::VALUE1) } #[doc = "Disable clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ETH0CDI_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CCUCDI` writer - CCU Clock Disable"] -pub type CCUCDI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKCLR_SPEC, CCUCDI_AW, O>; -impl<'a, const O: u8> CCUCDI_W<'a, O> { +pub type CCUCDI_W<'a, REG> = crate::BitWriter<'a, REG, CCUCDI_AW>; +impl<'a, REG> CCUCDI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCUCDI_AW::VALUE1) } #[doc = "Disable clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCUCDI_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `WDTCDI` writer - WDT Clock Disable"] -pub type WDTCDI_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKCLR_SPEC, WDTCDI_AW, O>; -impl<'a, const O: u8> WDTCDI_W<'a, O> { +pub type WDTCDI_W<'a, REG> = crate::BitWriter<'a, REG, WDTCDI_AW>; +impl<'a, REG> WDTCDI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDTCDI_AW::VALUE1) } #[doc = "Disable clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDTCDI_AW::VALUE2) } } @@ -135,42 +128,45 @@ impl W { #[doc = "Bit 0 - USB Clock Disable"] #[inline(always)] #[must_use] - pub fn usbcdi(&mut self) -> USBCDI_W<0> { - USBCDI_W::new(self) + pub fn usbcdi(&mut self) -> USBCDI_W { + USBCDI_W::new(self, 0) } #[doc = "Bit 2 - Ethernet Clock Disable"] #[inline(always)] #[must_use] - pub fn eth0cdi(&mut self) -> ETH0CDI_W<2> { - ETH0CDI_W::new(self) + pub fn eth0cdi(&mut self) -> ETH0CDI_W { + ETH0CDI_W::new(self, 2) } #[doc = "Bit 4 - CCU Clock Disable"] #[inline(always)] #[must_use] - pub fn ccucdi(&mut self) -> CCUCDI_W<4> { - CCUCDI_W::new(self) + pub fn ccucdi(&mut self) -> CCUCDI_W { + CCUCDI_W::new(self, 4) } #[doc = "Bit 5 - WDT Clock Disable"] #[inline(always)] #[must_use] - pub fn wdtcdi(&mut self) -> WDTCDI_W<5> { - WDTCDI_W::new(self) + pub fn wdtcdi(&mut self) -> WDTCDI_W { + WDTCDI_W::new(self, 5) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CLK Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clkclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CLKCLR_SPEC; impl crate::RegisterSpec for CLKCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [clkclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`clkclr::W`](W) writer structure"] impl crate::Writable for CLKCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/clkset.rs b/src/scu_clk/clkset.rs index 525f1030..28f11f3a 100644 --- a/src/scu_clk/clkset.rs +++ b/src/scu_clk/clkset.rs @@ -1,24 +1,5 @@ #[doc = "Register `CLKSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "USB Clock Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum USBCEN_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `USBCEN` writer - USB Clock Enable"] -pub type USBCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKSET_SPEC, USBCEN_AW, O>; -impl<'a, const O: u8> USBCEN_W<'a, O> { +pub type USBCEN_W<'a, REG> = crate::BitWriter<'a, REG, USBCEN_AW>; +impl<'a, REG> USBCEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBCEN_AW::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBCEN_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `ETH0CEN` writer - Ethernet Clock Enable"] -pub type ETH0CEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKSET_SPEC, ETH0CEN_AW, O>; -impl<'a, const O: u8> ETH0CEN_W<'a, O> { +pub type ETH0CEN_W<'a, REG> = crate::BitWriter<'a, REG, ETH0CEN_AW>; +impl<'a, REG> ETH0CEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ETH0CEN_AW::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ETH0CEN_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CCUCEN` writer - CCU Clock Enable"] -pub type CCUCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKSET_SPEC, CCUCEN_AW, O>; -impl<'a, const O: u8> CCUCEN_W<'a, O> { +pub type CCUCEN_W<'a, REG> = crate::BitWriter<'a, REG, CCUCEN_AW>; +impl<'a, REG> CCUCEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCUCEN_AW::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCUCEN_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `WDTCEN` writer - WDT Clock Enable"] -pub type WDTCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLKSET_SPEC, WDTCEN_AW, O>; -impl<'a, const O: u8> WDTCEN_W<'a, O> { +pub type WDTCEN_W<'a, REG> = crate::BitWriter<'a, REG, WDTCEN_AW>; +impl<'a, REG> WDTCEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDTCEN_AW::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDTCEN_AW::VALUE2) } } @@ -135,42 +128,45 @@ impl W { #[doc = "Bit 0 - USB Clock Enable"] #[inline(always)] #[must_use] - pub fn usbcen(&mut self) -> USBCEN_W<0> { - USBCEN_W::new(self) + pub fn usbcen(&mut self) -> USBCEN_W { + USBCEN_W::new(self, 0) } #[doc = "Bit 2 - Ethernet Clock Enable"] #[inline(always)] #[must_use] - pub fn eth0cen(&mut self) -> ETH0CEN_W<2> { - ETH0CEN_W::new(self) + pub fn eth0cen(&mut self) -> ETH0CEN_W { + ETH0CEN_W::new(self, 2) } #[doc = "Bit 4 - CCU Clock Enable"] #[inline(always)] #[must_use] - pub fn ccucen(&mut self) -> CCUCEN_W<4> { - CCUCEN_W::new(self) + pub fn ccucen(&mut self) -> CCUCEN_W { + CCUCEN_W::new(self, 4) } #[doc = "Bit 5 - WDT Clock Enable"] #[inline(always)] #[must_use] - pub fn wdtcen(&mut self) -> WDTCEN_W<5> { - WDTCEN_W::new(self) + pub fn wdtcen(&mut self) -> WDTCEN_W { + WDTCEN_W::new(self, 5) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CLK Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clkset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CLKSET_SPEC; impl crate::RegisterSpec for CLKSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [clkset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`clkset::W`](W) writer structure"] impl crate::Writable for CLKSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/clkstat.rs b/src/scu_clk/clkstat.rs index 2c37d036..ebf5e6d7 100644 --- a/src/scu_clk/clkstat.rs +++ b/src/scu_clk/clkstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `USBCST` reader - USB Clock Status"] pub type USBCST_R = crate::BitReader; #[doc = "USB Clock Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl USBCST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USBCST_A { + pub const fn variant(&self) -> USBCST_A { match self.bits { false => USBCST_A::VALUE1, true => USBCST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clock disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USBCST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clock enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USBCST_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl ETH0CST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ETH0CST_A { + pub const fn variant(&self) -> ETH0CST_A { match self.bits { false => ETH0CST_A::VALUE1, true => ETH0CST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clock disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ETH0CST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clock enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ETH0CST_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl CCUCST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCUCST_A { + pub const fn variant(&self) -> CCUCST_A { match self.bits { false => CCUCST_A::VALUE1, true => CCUCST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clock disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCUCST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clock enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCUCST_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl WDTCST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WDTCST_A { + pub const fn variant(&self) -> WDTCST_A { match self.bits { false => WDTCST_A::VALUE1, true => WDTCST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Clock disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WDTCST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Clock enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WDTCST_A::VALUE2 @@ -179,15 +166,13 @@ impl R { WDTCST_R::new(((self.bits >> 5) & 1) != 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"] +#[doc = "Clock Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clkstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`clkstat::R`](R) reader structure"] +impl crate::Readable for CLKSTAT_SPEC {} #[doc = "`reset()` method sets CLKSTAT to value 0"] impl crate::Resettable for CLKSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_clk/cpuclkcr.rs b/src/scu_clk/cpuclkcr.rs index 5e7fa879..0a3a61a5 100644 --- a/src/scu_clk/cpuclkcr.rs +++ b/src/scu_clk/cpuclkcr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CPUDIV` reader - CPU Clock Divider Enable"] pub type CPUDIV_R = crate::BitReader; #[doc = "CPU Clock Divider Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CPUDIV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CPUDIV_A { + pub const fn variant(&self) -> CPUDIV_A { match self.bits { false => CPUDIV_A::VALUE1, true => CPUDIV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fCPU = fSYS"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CPUDIV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fCPU = fSYS / 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CPUDIV_A::VALUE2 } } #[doc = "Field `CPUDIV` writer - CPU Clock Divider Enable"] -pub type CPUDIV_W<'a, const O: u8> = crate::BitWriter<'a, u32, CPUCLKCR_SPEC, CPUDIV_A, O>; -impl<'a, const O: u8> CPUDIV_W<'a, O> { +pub type CPUDIV_W<'a, REG> = crate::BitWriter<'a, REG, CPUDIV_A>; +impl<'a, REG> CPUDIV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fCPU = fSYS"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CPUDIV_A::VALUE1) } #[doc = "fCPU = fSYS / 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CPUDIV_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - CPU Clock Divider Enable"] #[inline(always)] #[must_use] - pub fn cpudiv(&mut self) -> CPUDIV_W<0> { - CPUDIV_W::new(self) + pub fn cpudiv(&mut self) -> CPUDIV_W { + CPUDIV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CPU Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cpuclkcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cpuclkcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cpuclkcr::R`](R) reader structure"] +impl crate::Readable for CPUCLKCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cpuclkcr::W`](W) writer structure"] impl crate::Writable for CPUCLKCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/dsleepcr.rs b/src/scu_clk/dsleepcr.rs index 4d7bad30..fd054f30 100644 --- a/src/scu_clk/dsleepcr.rs +++ b/src/scu_clk/dsleepcr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SYSSEL` reader - System Clock Selection Value"] pub type SYSSEL_R = crate::BitReader; #[doc = "System Clock Selection Value\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SYSSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SYSSEL_A { + pub const fn variant(&self) -> SYSSEL_A { match self.bits { false => SYSSEL_A::VALUE1, true => SYSSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOFI clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SYSSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fPLL clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SYSSEL_A::VALUE2 } } #[doc = "Field `SYSSEL` writer - System Clock Selection Value"] -pub type SYSSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DSLEEPCR_SPEC, SYSSEL_A, O>; -impl<'a, const O: u8> SYSSEL_W<'a, O> { +pub type SYSSEL_W<'a, REG> = crate::BitWriter<'a, REG, SYSSEL_A>; +impl<'a, REG> SYSSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fOFI clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SYSSEL_A::VALUE1) } #[doc = "fPLL clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SYSSEL_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl FPDN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FPDN_A { + pub const fn variant(&self) -> FPDN_A { match self.bits { true => FPDN_A::VALUE1, false => FPDN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Flash power down module"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FPDN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No effect"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FPDN_A::VALUE2 } } #[doc = "Field `FPDN` writer - Flash Power Down"] -pub type FPDN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DSLEEPCR_SPEC, FPDN_A, O>; -impl<'a, const O: u8> FPDN_W<'a, O> { +pub type FPDN_W<'a, REG> = crate::BitWriter<'a, REG, FPDN_A>; +impl<'a, REG> FPDN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Flash power down module"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FPDN_A::VALUE1) } #[doc = "No effect"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FPDN_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PLLPDN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PLLPDN_A { + pub const fn variant(&self) -> PLLPDN_A { match self.bits { true => PLLPDN_A::VALUE1, false => PLLPDN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Switch off main PLL"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLLPDN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No effect"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLLPDN_A::VALUE2 } } #[doc = "Field `PLLPDN` writer - PLL Power Down"] -pub type PLLPDN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DSLEEPCR_SPEC, PLLPDN_A, O>; -impl<'a, const O: u8> PLLPDN_W<'a, O> { +pub type PLLPDN_W<'a, REG> = crate::BitWriter<'a, REG, PLLPDN_A>; +impl<'a, REG> PLLPDN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Switch off main PLL"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PLLPDN_A::VALUE1) } #[doc = "No effect"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PLLPDN_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl VCOPDN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOPDN_A { + pub const fn variant(&self) -> VCOPDN_A { match self.bits { true => VCOPDN_A::VALUE1, false => VCOPDN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Switch off VCO of main PLL"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOPDN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No effect"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOPDN_A::VALUE2 } } #[doc = "Field `VCOPDN` writer - VCO Power Down"] -pub type VCOPDN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DSLEEPCR_SPEC, VCOPDN_A, O>; -impl<'a, const O: u8> VCOPDN_W<'a, O> { +pub type VCOPDN_W<'a, REG> = crate::BitWriter<'a, REG, VCOPDN_A>; +impl<'a, REG> VCOPDN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Switch off VCO of main PLL"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VCOPDN_A::VALUE1) } #[doc = "No effect"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VCOPDN_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl USBCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USBCR_A { + pub const fn variant(&self) -> USBCR_A { match self.bits { false => USBCR_A::VALUE1, true => USBCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USBCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USBCR_A::VALUE2 } } #[doc = "Field `USBCR` writer - USB Clock Control"] -pub type USBCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DSLEEPCR_SPEC, USBCR_A, O>; -impl<'a, const O: u8> USBCR_W<'a, O> { +pub type USBCR_W<'a, REG> = crate::BitWriter<'a, REG, USBCR_A>; +impl<'a, REG> USBCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBCR_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBCR_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl ETH0CR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ETH0CR_A { + pub const fn variant(&self) -> ETH0CR_A { match self.bits { false => ETH0CR_A::VALUE1, true => ETH0CR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ETH0CR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ETH0CR_A::VALUE2 } } #[doc = "Field `ETH0CR` writer - Ethernet Clock Control"] -pub type ETH0CR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DSLEEPCR_SPEC, ETH0CR_A, O>; -impl<'a, const O: u8> ETH0CR_W<'a, O> { +pub type ETH0CR_W<'a, REG> = crate::BitWriter<'a, REG, ETH0CR_A>; +impl<'a, REG> ETH0CR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ETH0CR_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ETH0CR_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CCUCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCUCR_A { + pub const fn variant(&self) -> CCUCR_A { match self.bits { false => CCUCR_A::VALUE1, true => CCUCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCUCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCUCR_A::VALUE2 } } #[doc = "Field `CCUCR` writer - CCU Clock Control"] -pub type CCUCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DSLEEPCR_SPEC, CCUCR_A, O>; -impl<'a, const O: u8> CCUCR_W<'a, O> { +pub type CCUCR_W<'a, REG> = crate::BitWriter<'a, REG, CCUCR_A>; +impl<'a, REG> CCUCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCUCR_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCUCR_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl WDTCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WDTCR_A { + pub const fn variant(&self) -> WDTCR_A { match self.bits { false => WDTCR_A::VALUE1, true => WDTCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WDTCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WDTCR_A::VALUE2 } } #[doc = "Field `WDTCR` writer - WDT Clock Control"] -pub type WDTCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DSLEEPCR_SPEC, WDTCR_A, O>; -impl<'a, const O: u8> WDTCR_W<'a, O> { +pub type WDTCR_W<'a, REG> = crate::BitWriter<'a, REG, WDTCR_A>; +impl<'a, REG> WDTCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDTCR_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDTCR_A::VALUE2) } } @@ -480,70 +472,71 @@ impl W { #[doc = "Bit 0 - System Clock Selection Value"] #[inline(always)] #[must_use] - pub fn syssel(&mut self) -> SYSSEL_W<0> { - SYSSEL_W::new(self) + pub fn syssel(&mut self) -> SYSSEL_W { + SYSSEL_W::new(self, 0) } #[doc = "Bit 11 - Flash Power Down"] #[inline(always)] #[must_use] - pub fn fpdn(&mut self) -> FPDN_W<11> { - FPDN_W::new(self) + pub fn fpdn(&mut self) -> FPDN_W { + FPDN_W::new(self, 11) } #[doc = "Bit 12 - PLL Power Down"] #[inline(always)] #[must_use] - pub fn pllpdn(&mut self) -> PLLPDN_W<12> { - PLLPDN_W::new(self) + pub fn pllpdn(&mut self) -> PLLPDN_W { + PLLPDN_W::new(self, 12) } #[doc = "Bit 13 - VCO Power Down"] #[inline(always)] #[must_use] - pub fn vcopdn(&mut self) -> VCOPDN_W<13> { - VCOPDN_W::new(self) + pub fn vcopdn(&mut self) -> VCOPDN_W { + VCOPDN_W::new(self, 13) } #[doc = "Bit 16 - USB Clock Control"] #[inline(always)] #[must_use] - pub fn usbcr(&mut self) -> USBCR_W<16> { - USBCR_W::new(self) + pub fn usbcr(&mut self) -> USBCR_W { + USBCR_W::new(self, 16) } #[doc = "Bit 18 - Ethernet Clock Control"] #[inline(always)] #[must_use] - pub fn eth0cr(&mut self) -> ETH0CR_W<18> { - ETH0CR_W::new(self) + pub fn eth0cr(&mut self) -> ETH0CR_W { + ETH0CR_W::new(self, 18) } #[doc = "Bit 20 - CCU Clock Control"] #[inline(always)] #[must_use] - pub fn ccucr(&mut self) -> CCUCR_W<20> { - CCUCR_W::new(self) + pub fn ccucr(&mut self) -> CCUCR_W { + CCUCR_W::new(self, 20) } #[doc = "Bit 21 - WDT Clock Control"] #[inline(always)] #[must_use] - pub fn wdtcr(&mut self) -> WDTCR_W<21> { - WDTCR_W::new(self) + pub fn wdtcr(&mut self) -> WDTCR_W { + WDTCR_W::new(self, 21) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Deep Sleep Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsleepcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dsleepcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dsleepcr::R`](R) reader structure"] +impl crate::Readable for DSLEEPCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dsleepcr::W`](W) writer structure"] impl crate::Writable for DSLEEPCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/extclkcr.rs b/src/scu_clk/extclkcr.rs index 17a76dda..43ccf0e3 100644 --- a/src/scu_clk/extclkcr.rs +++ b/src/scu_clk/extclkcr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ECKSEL` reader - External Clock Selection Value"] -pub type ECKSEL_R = crate::FieldReader; +pub type ECKSEL_R = crate::FieldReader; #[doc = "External Clock Selection Value\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ECKSEL_A { + type Ux = u8; +} impl ECKSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ECKSEL_A::VALUE1), 2 => Some(ECKSEL_A::VALUE3), @@ -67,55 +38,59 @@ impl ECKSEL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fSYS clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ECKSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fUSB clock"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ECKSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "fPLL clock divided according to ECKDIV bit field configuration"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ECKSEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "fSTDBY clock"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == ECKSEL_A::VALUE5 } } #[doc = "Field `ECKSEL` writer - External Clock Selection Value"] -pub type ECKSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, EXTCLKCR_SPEC, u8, ECKSEL_A, 3, O>; -impl<'a, const O: u8> ECKSEL_W<'a, O> { +pub type ECKSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, ECKSEL_A>; +impl<'a, REG> ECKSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fSYS clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ECKSEL_A::VALUE1) } #[doc = "fUSB clock"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ECKSEL_A::VALUE3) } #[doc = "fPLL clock divided according to ECKDIV bit field configuration"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ECKSEL_A::VALUE4) } #[doc = "fSTDBY clock"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(ECKSEL_A::VALUE5) } } #[doc = "Field `ECKDIV` reader - External Clock Divider Value"] -pub type ECKDIV_R = crate::FieldReader; +pub type ECKDIV_R = crate::FieldReader; #[doc = "Field `ECKDIV` writer - External Clock Divider Value"] -pub type ECKDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, EXTCLKCR_SPEC, u16, u16, 9, O>; +pub type ECKDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16>; impl R { #[doc = "Bits 0:2 - External Clock Selection Value"] #[inline(always)] @@ -132,34 +107,35 @@ impl W { #[doc = "Bits 0:2 - External Clock Selection Value"] #[inline(always)] #[must_use] - pub fn ecksel(&mut self) -> ECKSEL_W<0> { - ECKSEL_W::new(self) + pub fn ecksel(&mut self) -> ECKSEL_W { + ECKSEL_W::new(self, 0) } #[doc = "Bits 16:24 - External Clock Divider Value"] #[inline(always)] #[must_use] - pub fn eckdiv(&mut self) -> ECKDIV_W<16> { - ECKDIV_W::new(self) + pub fn eckdiv(&mut self) -> ECKDIV_W { + ECKDIV_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "External Clock Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`extclkcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`extclkcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`extclkcr::R`](R) reader structure"] +impl crate::Readable for EXTCLKCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`extclkcr::W`](W) writer structure"] impl crate::Writable for EXTCLKCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/mlinkclkcr.rs b/src/scu_clk/mlinkclkcr.rs index 83d50369..6ac4c8c1 100644 --- a/src/scu_clk/mlinkclkcr.rs +++ b/src/scu_clk/mlinkclkcr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SYSDIV` reader - System Clock Division Value"] -pub type SYSDIV_R = crate::FieldReader; +pub type SYSDIV_R = crate::FieldReader; #[doc = "Field `SYSDIV` writer - System Clock Division Value"] -pub type SYSDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MLINKCLKCR_SPEC, u8, u8, 8, O>; +pub type SYSDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `SYSSEL` reader - System Clock Selection Value"] pub type SYSSEL_R = crate::BitReader; #[doc = "System Clock Selection Value\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl SYSSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SYSSEL_A { + pub const fn variant(&self) -> SYSSEL_A { match self.bits { false => SYSSEL_A::VALUE1, true => SYSSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOFI clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SYSSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fPLL clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SYSSEL_A::VALUE2 } } #[doc = "Field `SYSSEL` writer - System Clock Selection Value"] -pub type SYSSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, MLINKCLKCR_SPEC, SYSSEL_A, O>; -impl<'a, const O: u8> SYSSEL_W<'a, O> { +pub type SYSSEL_W<'a, REG> = crate::BitWriter<'a, REG, SYSSEL_A>; +impl<'a, REG> SYSSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fOFI clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SYSSEL_A::VALUE1) } #[doc = "fPLL clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SYSSEL_A::VALUE2) } } @@ -107,34 +78,37 @@ impl From for bool { impl CPUDIV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CPUDIV_A { + pub const fn variant(&self) -> CPUDIV_A { match self.bits { false => CPUDIV_A::VALUE1, true => CPUDIV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fCPU = fSYS"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CPUDIV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fCPU = fSYS / 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CPUDIV_A::VALUE2 } } #[doc = "Field `CPUDIV` writer - CPU Clock Divider Enable"] -pub type CPUDIV_W<'a, const O: u8> = crate::BitWriter<'a, u32, MLINKCLKCR_SPEC, CPUDIV_A, O>; -impl<'a, const O: u8> CPUDIV_W<'a, O> { +pub type CPUDIV_W<'a, REG> = crate::BitWriter<'a, REG, CPUDIV_A>; +impl<'a, REG> CPUDIV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fCPU = fSYS"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CPUDIV_A::VALUE1) } #[doc = "fCPU = fSYS / 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CPUDIV_A::VALUE2) } } @@ -157,34 +131,37 @@ impl From for bool { impl PBDIV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PBDIV_A { + pub const fn variant(&self) -> PBDIV_A { match self.bits { false => PBDIV_A::VALUE1, true => PBDIV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fPERIPH = fCPU"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PBDIV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fPERIPH = fCPU / 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PBDIV_A::VALUE2 } } #[doc = "Field `PBDIV` writer - PB Clock Divider Enable"] -pub type PBDIV_W<'a, const O: u8> = crate::BitWriter<'a, u32, MLINKCLKCR_SPEC, PBDIV_A, O>; -impl<'a, const O: u8> PBDIV_W<'a, O> { +pub type PBDIV_W<'a, REG> = crate::BitWriter<'a, REG, PBDIV_A>; +impl<'a, REG> PBDIV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fPERIPH = fCPU"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PBDIV_A::VALUE1) } #[doc = "fPERIPH = fCPU / 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PBDIV_A::VALUE2) } } @@ -207,43 +184,46 @@ impl From for bool { impl CCUDIV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCUDIV_A { + pub const fn variant(&self) -> CCUDIV_A { match self.bits { false => CCUDIV_A::VALUE1, true => CCUDIV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fCCU = fSYS"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCUDIV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fCCU = fSYS / 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCUDIV_A::VALUE2 } } #[doc = "Field `CCUDIV` writer - CCU Clock Divider Enable"] -pub type CCUDIV_W<'a, const O: u8> = crate::BitWriter<'a, u32, MLINKCLKCR_SPEC, CCUDIV_A, O>; -impl<'a, const O: u8> CCUDIV_W<'a, O> { +pub type CCUDIV_W<'a, REG> = crate::BitWriter<'a, REG, CCUDIV_A>; +impl<'a, REG> CCUDIV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fCCU = fSYS"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCUDIV_A::VALUE1) } #[doc = "fCCU = fSYS / 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCUDIV_A::VALUE2) } } #[doc = "Field `WDTDIV` reader - WDT Clock Divider Value"] -pub type WDTDIV_R = crate::FieldReader; +pub type WDTDIV_R = crate::FieldReader; #[doc = "Field `WDTDIV` writer - WDT Clock Divider Value"] -pub type WDTDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MLINKCLKCR_SPEC, u8, u8, 8, O>; +pub type WDTDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `WDTSEL` reader - WDT Clock Selection Value"] -pub type WDTSEL_R = crate::FieldReader; +pub type WDTSEL_R = crate::FieldReader; #[doc = "WDT Clock Selection Value\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -261,10 +241,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for WDTSEL_A { + type Ux = u8; +} impl WDTSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(WDTSEL_A::VALUE1), 1 => Some(WDTSEL_A::VALUE2), @@ -272,38 +255,42 @@ impl WDTSEL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOFI clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WDTSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fSTDBY clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WDTSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fPLL clock"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == WDTSEL_A::VALUE3 } } #[doc = "Field `WDTSEL` writer - WDT Clock Selection Value"] -pub type WDTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MLINKCLKCR_SPEC, u8, WDTSEL_A, 2, O>; -impl<'a, const O: u8> WDTSEL_W<'a, O> { +pub type WDTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, WDTSEL_A>; +impl<'a, REG> WDTSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fOFI clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDTSEL_A::VALUE1) } #[doc = "fSTDBY clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDTSEL_A::VALUE2) } #[doc = "fPLL clock"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(WDTSEL_A::VALUE3) } } @@ -348,64 +335,65 @@ impl W { #[doc = "Bits 0:7 - System Clock Division Value"] #[inline(always)] #[must_use] - pub fn sysdiv(&mut self) -> SYSDIV_W<0> { - SYSDIV_W::new(self) + pub fn sysdiv(&mut self) -> SYSDIV_W { + SYSDIV_W::new(self, 0) } #[doc = "Bit 8 - System Clock Selection Value"] #[inline(always)] #[must_use] - pub fn syssel(&mut self) -> SYSSEL_W<8> { - SYSSEL_W::new(self) + pub fn syssel(&mut self) -> SYSSEL_W { + SYSSEL_W::new(self, 8) } #[doc = "Bit 10 - CPU Clock Divider Enable"] #[inline(always)] #[must_use] - pub fn cpudiv(&mut self) -> CPUDIV_W<10> { - CPUDIV_W::new(self) + pub fn cpudiv(&mut self) -> CPUDIV_W { + CPUDIV_W::new(self, 10) } #[doc = "Bit 12 - PB Clock Divider Enable"] #[inline(always)] #[must_use] - pub fn pbdiv(&mut self) -> PBDIV_W<12> { - PBDIV_W::new(self) + pub fn pbdiv(&mut self) -> PBDIV_W { + PBDIV_W::new(self, 12) } #[doc = "Bit 14 - CCU Clock Divider Enable"] #[inline(always)] #[must_use] - pub fn ccudiv(&mut self) -> CCUDIV_W<14> { - CCUDIV_W::new(self) + pub fn ccudiv(&mut self) -> CCUDIV_W { + CCUDIV_W::new(self, 14) } #[doc = "Bits 16:23 - WDT Clock Divider Value"] #[inline(always)] #[must_use] - pub fn wdtdiv(&mut self) -> WDTDIV_W<16> { - WDTDIV_W::new(self) + pub fn wdtdiv(&mut self) -> WDTDIV_W { + WDTDIV_W::new(self, 16) } #[doc = "Bits 24:25 - WDT Clock Selection Value"] #[inline(always)] #[must_use] - pub fn wdtsel(&mut self) -> WDTSEL_W<24> { - WDTSEL_W::new(self) + pub fn wdtsel(&mut self) -> WDTSEL_W { + WDTSEL_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Multi-Link Clock Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mlinkclkcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mlinkclkcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mlinkclkcr::R`](R) reader structure"] +impl crate::Readable for MLINKCLKCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mlinkclkcr::W`](W) writer structure"] impl crate::Writable for MLINKCLKCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/pbclkcr.rs b/src/scu_clk/pbclkcr.rs index 431f75cb..bd354c84 100644 --- a/src/scu_clk/pbclkcr.rs +++ b/src/scu_clk/pbclkcr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PBDIV` reader - PB Clock Divider Enable"] pub type PBDIV_R = crate::BitReader; #[doc = "PB Clock Divider Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PBDIV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PBDIV_A { + pub const fn variant(&self) -> PBDIV_A { match self.bits { false => PBDIV_A::VALUE1, true => PBDIV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fPERIPH = fCPU"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PBDIV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fPERIPH = fCPU / 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PBDIV_A::VALUE2 } } #[doc = "Field `PBDIV` writer - PB Clock Divider Enable"] -pub type PBDIV_W<'a, const O: u8> = crate::BitWriter<'a, u32, PBCLKCR_SPEC, PBDIV_A, O>; -impl<'a, const O: u8> PBDIV_W<'a, O> { +pub type PBDIV_W<'a, REG> = crate::BitWriter<'a, REG, PBDIV_A>; +impl<'a, REG> PBDIV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fPERIPH = fCPU"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PBDIV_A::VALUE1) } #[doc = "fPERIPH = fCPU / 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PBDIV_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - PB Clock Divider Enable"] #[inline(always)] #[must_use] - pub fn pbdiv(&mut self) -> PBDIV_W<0> { - PBDIV_W::new(self) + pub fn pbdiv(&mut self) -> PBDIV_W { + PBDIV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Peripheral Bus Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pbclkcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pbclkcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pbclkcr::R`](R) reader structure"] +impl crate::Readable for PBCLKCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pbclkcr::W`](W) writer structure"] impl crate::Writable for PBCLKCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/sleepcr.rs b/src/scu_clk/sleepcr.rs index 9d7fa713..536dd6fe 100644 --- a/src/scu_clk/sleepcr.rs +++ b/src/scu_clk/sleepcr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SYSSEL` reader - System Clock Selection Value"] pub type SYSSEL_R = crate::BitReader; #[doc = "System Clock Selection Value\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SYSSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SYSSEL_A { + pub const fn variant(&self) -> SYSSEL_A { match self.bits { false => SYSSEL_A::VALUE1, true => SYSSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOFI clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SYSSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fPLL clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SYSSEL_A::VALUE2 } } #[doc = "Field `SYSSEL` writer - System Clock Selection Value"] -pub type SYSSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLEEPCR_SPEC, SYSSEL_A, O>; -impl<'a, const O: u8> SYSSEL_W<'a, O> { +pub type SYSSEL_W<'a, REG> = crate::BitWriter<'a, REG, SYSSEL_A>; +impl<'a, REG> SYSSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fOFI clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SYSSEL_A::VALUE1) } #[doc = "fPLL clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SYSSEL_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl USBCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USBCR_A { + pub const fn variant(&self) -> USBCR_A { match self.bits { false => USBCR_A::VALUE1, true => USBCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USBCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USBCR_A::VALUE2 } } #[doc = "Field `USBCR` writer - USB Clock Control"] -pub type USBCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLEEPCR_SPEC, USBCR_A, O>; -impl<'a, const O: u8> USBCR_W<'a, O> { +pub type USBCR_W<'a, REG> = crate::BitWriter<'a, REG, USBCR_A>; +impl<'a, REG> USBCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBCR_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBCR_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl ETH0CR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ETH0CR_A { + pub const fn variant(&self) -> ETH0CR_A { match self.bits { false => ETH0CR_A::VALUE1, true => ETH0CR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ETH0CR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ETH0CR_A::VALUE2 } } #[doc = "Field `ETH0CR` writer - Ethernet Clock Control"] -pub type ETH0CR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLEEPCR_SPEC, ETH0CR_A, O>; -impl<'a, const O: u8> ETH0CR_W<'a, O> { +pub type ETH0CR_W<'a, REG> = crate::BitWriter<'a, REG, ETH0CR_A>; +impl<'a, REG> ETH0CR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ETH0CR_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ETH0CR_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CCUCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCUCR_A { + pub const fn variant(&self) -> CCUCR_A { match self.bits { false => CCUCR_A::VALUE1, true => CCUCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCUCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCUCR_A::VALUE2 } } #[doc = "Field `CCUCR` writer - CCU Clock Control"] -pub type CCUCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLEEPCR_SPEC, CCUCR_A, O>; -impl<'a, const O: u8> CCUCR_W<'a, O> { +pub type CCUCR_W<'a, REG> = crate::BitWriter<'a, REG, CCUCR_A>; +impl<'a, REG> CCUCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCUCR_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCUCR_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl WDTCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WDTCR_A { + pub const fn variant(&self) -> WDTCR_A { match self.bits { false => WDTCR_A::VALUE1, true => WDTCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WDTCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WDTCR_A::VALUE2 } } #[doc = "Field `WDTCR` writer - WDT Clock Control"] -pub type WDTCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SLEEPCR_SPEC, WDTCR_A, O>; -impl<'a, const O: u8> WDTCR_W<'a, O> { +pub type WDTCR_W<'a, REG> = crate::BitWriter<'a, REG, WDTCR_A>; +impl<'a, REG> WDTCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDTCR_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDTCR_A::VALUE2) } } @@ -315,52 +298,53 @@ impl W { #[doc = "Bit 0 - System Clock Selection Value"] #[inline(always)] #[must_use] - pub fn syssel(&mut self) -> SYSSEL_W<0> { - SYSSEL_W::new(self) + pub fn syssel(&mut self) -> SYSSEL_W { + SYSSEL_W::new(self, 0) } #[doc = "Bit 16 - USB Clock Control"] #[inline(always)] #[must_use] - pub fn usbcr(&mut self) -> USBCR_W<16> { - USBCR_W::new(self) + pub fn usbcr(&mut self) -> USBCR_W { + USBCR_W::new(self, 16) } #[doc = "Bit 18 - Ethernet Clock Control"] #[inline(always)] #[must_use] - pub fn eth0cr(&mut self) -> ETH0CR_W<18> { - ETH0CR_W::new(self) + pub fn eth0cr(&mut self) -> ETH0CR_W { + ETH0CR_W::new(self, 18) } #[doc = "Bit 20 - CCU Clock Control"] #[inline(always)] #[must_use] - pub fn ccucr(&mut self) -> CCUCR_W<20> { - CCUCR_W::new(self) + pub fn ccucr(&mut self) -> CCUCR_W { + CCUCR_W::new(self, 20) } #[doc = "Bit 21 - WDT Clock Control"] #[inline(always)] #[must_use] - pub fn wdtcr(&mut self) -> WDTCR_W<21> { - WDTCR_W::new(self) + pub fn wdtcr(&mut self) -> WDTCR_W { + WDTCR_W::new(self, 21) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Sleep Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sleepcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sleepcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sleepcr::R`](R) reader structure"] +impl crate::Readable for SLEEPCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sleepcr::W`](W) writer structure"] impl crate::Writable for SLEEPCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/sysclkcr.rs b/src/scu_clk/sysclkcr.rs index 1d76dc78..16466c79 100644 --- a/src/scu_clk/sysclkcr.rs +++ b/src/scu_clk/sysclkcr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SYSDIV` reader - System Clock Division Value"] -pub type SYSDIV_R = crate::FieldReader; +pub type SYSDIV_R = crate::FieldReader; #[doc = "Field `SYSDIV` writer - System Clock Division Value"] -pub type SYSDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SYSCLKCR_SPEC, u8, u8, 8, O>; +pub type SYSDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `SYSSEL` reader - System Clock Selection Value"] pub type SYSSEL_R = crate::BitReader; #[doc = "System Clock Selection Value\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl SYSSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SYSSEL_A { + pub const fn variant(&self) -> SYSSEL_A { match self.bits { false => SYSSEL_A::VALUE1, true => SYSSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOFI clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SYSSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fPLL clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SYSSEL_A::VALUE2 } } #[doc = "Field `SYSSEL` writer - System Clock Selection Value"] -pub type SYSSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYSCLKCR_SPEC, SYSSEL_A, O>; -impl<'a, const O: u8> SYSSEL_W<'a, O> { +pub type SYSSEL_W<'a, REG> = crate::BitWriter<'a, REG, SYSSEL_A>; +impl<'a, REG> SYSSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fOFI clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SYSSEL_A::VALUE1) } #[doc = "fPLL clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SYSSEL_A::VALUE2) } } @@ -104,34 +75,35 @@ impl W { #[doc = "Bits 0:7 - System Clock Division Value"] #[inline(always)] #[must_use] - pub fn sysdiv(&mut self) -> SYSDIV_W<0> { - SYSDIV_W::new(self) + pub fn sysdiv(&mut self) -> SYSDIV_W { + SYSDIV_W::new(self, 0) } #[doc = "Bit 16 - System Clock Selection Value"] #[inline(always)] #[must_use] - pub fn syssel(&mut self) -> SYSSEL_W<16> { - SYSSEL_W::new(self) + pub fn syssel(&mut self) -> SYSSEL_W { + SYSSEL_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "System Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sysclkcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sysclkcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sysclkcr::R`](R) reader structure"] +impl crate::Readable for SYSCLKCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sysclkcr::W`](W) writer structure"] impl crate::Writable for SYSCLKCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/usbclkcr.rs b/src/scu_clk/usbclkcr.rs index c6dcaa99..16da75b3 100644 --- a/src/scu_clk/usbclkcr.rs +++ b/src/scu_clk/usbclkcr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `USBDIV` reader - USB Clock Divider Value"] -pub type USBDIV_R = crate::FieldReader; +pub type USBDIV_R = crate::FieldReader; #[doc = "Field `USBDIV` writer - USB Clock Divider Value"] -pub type USBDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, USBCLKCR_SPEC, u8, u8, 3, O>; +pub type USBDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `USBSEL` reader - USB Clock Selection Value"] pub type USBSEL_R = crate::BitReader; #[doc = "USB Clock Selection Value\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl USBSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USBSEL_A { + pub const fn variant(&self) -> USBSEL_A { match self.bits { false => USBSEL_A::VALUE1, true => USBSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "USB PLL Clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USBSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "PLL Clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USBSEL_A::VALUE2 } } #[doc = "Field `USBSEL` writer - USB Clock Selection Value"] -pub type USBSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, USBCLKCR_SPEC, USBSEL_A, O>; -impl<'a, const O: u8> USBSEL_W<'a, O> { +pub type USBSEL_W<'a, REG> = crate::BitWriter<'a, REG, USBSEL_A>; +impl<'a, REG> USBSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "USB PLL Clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBSEL_A::VALUE1) } #[doc = "PLL Clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBSEL_A::VALUE2) } } @@ -104,34 +75,35 @@ impl W { #[doc = "Bits 0:2 - USB Clock Divider Value"] #[inline(always)] #[must_use] - pub fn usbdiv(&mut self) -> USBDIV_W<0> { - USBDIV_W::new(self) + pub fn usbdiv(&mut self) -> USBDIV_W { + USBDIV_W::new(self, 0) } #[doc = "Bit 16 - USB Clock Selection Value"] #[inline(always)] #[must_use] - pub fn usbsel(&mut self) -> USBSEL_W<16> { - USBSEL_W::new(self) + pub fn usbsel(&mut self) -> USBSEL_W { + USBSEL_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "USB Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`usbclkcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`usbclkcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`usbclkcr::R`](R) reader structure"] +impl crate::Readable for USBCLKCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`usbclkcr::W`](W) writer structure"] impl crate::Writable for USBCLKCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_clk/wdtclkcr.rs b/src/scu_clk/wdtclkcr.rs index 7b34a9a8..b8ff3207 100644 --- a/src/scu_clk/wdtclkcr.rs +++ b/src/scu_clk/wdtclkcr.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WDTDIV` reader - WDT Clock Divider Value"] -pub type WDTDIV_R = crate::FieldReader; +pub type WDTDIV_R = crate::FieldReader; #[doc = "Field `WDTDIV` writer - WDT Clock Divider Value"] -pub type WDTDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WDTCLKCR_SPEC, u8, u8, 8, O>; +pub type WDTDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `WDTSEL` reader - WDT Clock Selection Value"] -pub type WDTSEL_R = crate::FieldReader; +pub type WDTSEL_R = crate::FieldReader; #[doc = "WDT Clock Selection Value\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for WDTSEL_A { + type Ux = u8; +} impl WDTSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(WDTSEL_A::VALUE1), 1 => Some(WDTSEL_A::VALUE2), @@ -68,38 +39,42 @@ impl WDTSEL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOFI clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WDTSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fSTDBY clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WDTSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fPLL clock"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == WDTSEL_A::VALUE3 } } #[doc = "Field `WDTSEL` writer - WDT Clock Selection Value"] -pub type WDTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WDTCLKCR_SPEC, u8, WDTSEL_A, 2, O>; -impl<'a, const O: u8> WDTSEL_W<'a, O> { +pub type WDTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, WDTSEL_A>; +impl<'a, REG> WDTSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fOFI clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDTSEL_A::VALUE1) } #[doc = "fSTDBY clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDTSEL_A::VALUE2) } #[doc = "fPLL clock"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(WDTSEL_A::VALUE3) } } @@ -119,34 +94,35 @@ impl W { #[doc = "Bits 0:7 - WDT Clock Divider Value"] #[inline(always)] #[must_use] - pub fn wdtdiv(&mut self) -> WDTDIV_W<0> { - WDTDIV_W::new(self) + pub fn wdtdiv(&mut self) -> WDTDIV_W { + WDTDIV_W::new(self, 0) } #[doc = "Bits 16:17 - WDT Clock Selection Value"] #[inline(always)] #[must_use] - pub fn wdtsel(&mut self) -> WDTSEL_W<16> { - WDTSEL_W::new(self) + pub fn wdtsel(&mut self) -> WDTSEL_W { + WDTSEL_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "WDT Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`wdtclkcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`wdtclkcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`wdtclkcr::R`](R) reader structure"] +impl crate::Readable for WDTCLKCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`wdtclkcr::W`](W) writer structure"] impl crate::Writable for WDTCLKCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general.rs b/src/scu_general.rs index 12a11f3b..1376940a 100644 --- a/src/scu_general.rs +++ b/src/scu_general.rs @@ -1,118 +1,210 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + id: ID, + idchip: IDCHIP, + idmanuf: IDMANUF, + _reserved3: [u8; 0x04], + stcon: STCON, + _reserved4: [u8; 0x18], + gpr0: GPR0, + gpr1: GPR1, + _reserved6: [u8; 0x18], + ccucon: CCUCON, + _reserved7: [u8; 0x3c], + dtscon: DTSCON, + dtsstat: DTSSTAT, + _reserved9: [u8; 0x0c], + g0orcen: G0ORCEN, + g1orcen: G1ORCEN, + dtemplim: DTEMPLIM, + dtempalarm: DTEMPALARM, + _reserved13: [u8; 0x14], + mirrsts: MIRRSTS, + rmacr: RMACR, + rmdata: RMDATA, + mirrallstat: MIRRALLSTAT, + mirrallreq: MIRRALLREQ, +} +impl RegisterBlock { #[doc = "0x00 - SCU Module ID Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } #[doc = "0x04 - Chip ID Register"] - pub idchip: IDCHIP, + #[inline(always)] + pub const fn idchip(&self) -> &IDCHIP { + &self.idchip + } #[doc = "0x08 - Manufactory ID Register"] - pub idmanuf: IDMANUF, - _reserved3: [u8; 0x04], + #[inline(always)] + pub const fn idmanuf(&self) -> &IDMANUF { + &self.idmanuf + } #[doc = "0x10 - Startup Configuration Register"] - pub stcon: STCON, - _reserved4: [u8; 0x18], + #[inline(always)] + pub const fn stcon(&self) -> &STCON { + &self.stcon + } #[doc = "0x2c - General Purpose Register 0"] - pub gpr0: GPR0, + #[inline(always)] + pub const fn gpr0(&self) -> &GPR0 { + &self.gpr0 + } #[doc = "0x30 - General Purpose Register 1"] - pub gpr1: GPR1, - _reserved6: [u8; 0x18], + #[inline(always)] + pub const fn gpr1(&self) -> &GPR1 { + &self.gpr1 + } #[doc = "0x4c - CCU Control Register"] - pub ccucon: CCUCON, - _reserved7: [u8; 0x3c], + #[inline(always)] + pub const fn ccucon(&self) -> &CCUCON { + &self.ccucon + } #[doc = "0x8c - Die Temperature Sensor Control Register"] - pub dtscon: DTSCON, + #[inline(always)] + pub const fn dtscon(&self) -> &DTSCON { + &self.dtscon + } #[doc = "0x90 - Die Temperature Sensor Status Register"] - pub dtsstat: DTSSTAT, - _reserved9: [u8; 0x0c], + #[inline(always)] + pub const fn dtsstat(&self) -> &DTSSTAT { + &self.dtsstat + } #[doc = "0xa0 - Out of Range Comparator Enable Register 0"] - pub g0orcen: G0ORCEN, + #[inline(always)] + pub const fn g0orcen(&self) -> &G0ORCEN { + &self.g0orcen + } #[doc = "0xa4 - Out of Range Comparator Enable Register 1"] - pub g1orcen: G1ORCEN, + #[inline(always)] + pub const fn g1orcen(&self) -> &G1ORCEN { + &self.g1orcen + } #[doc = "0xa8 - Die Temperature Sensor Limit Register"] - pub dtemplim: DTEMPLIM, + #[inline(always)] + pub const fn dtemplim(&self) -> &DTEMPLIM { + &self.dtemplim + } #[doc = "0xac - Die Temperature Sensor Alarm Register"] - pub dtempalarm: DTEMPALARM, - _reserved13: [u8; 0x14], + #[inline(always)] + pub const fn dtempalarm(&self) -> &DTEMPALARM { + &self.dtempalarm + } #[doc = "0xc4 - Mirror Write Status Register"] - pub mirrsts: MIRRSTS, + #[inline(always)] + pub const fn mirrsts(&self) -> &MIRRSTS { + &self.mirrsts + } #[doc = "0xc8 - Retention Memory Access Control Register"] - pub rmacr: RMACR, + #[inline(always)] + pub const fn rmacr(&self) -> &RMACR { + &self.rmacr + } #[doc = "0xcc - Retention Memory Access Data Register"] - pub rmdata: RMDATA, + #[inline(always)] + pub const fn rmdata(&self) -> &RMDATA { + &self.rmdata + } #[doc = "0xd0 - Mirror All Status"] - pub mirrallstat: MIRRALLSTAT, + #[inline(always)] + pub const fn mirrallstat(&self) -> &MIRRALLSTAT { + &self.mirrallstat + } #[doc = "0xd4 - Mirror All Request"] - pub mirrallreq: MIRRALLREQ, + #[inline(always)] + pub const fn mirrallreq(&self) -> &MIRRALLREQ { + &self.mirrallreq + } } -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: SCU Module ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "SCU Module ID Register"] pub mod id; -#[doc = "IDCHIP (r) register accessor: an alias for `Reg`"] +#[doc = "IDCHIP (r) register accessor: Chip ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`idchip::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@idchip`] +module"] pub type IDCHIP = crate::Reg; #[doc = "Chip ID Register"] pub mod idchip; -#[doc = "IDMANUF (r) register accessor: an alias for `Reg`"] +#[doc = "IDMANUF (r) register accessor: Manufactory ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`idmanuf::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@idmanuf`] +module"] pub type IDMANUF = crate::Reg; #[doc = "Manufactory ID Register"] pub mod idmanuf; -#[doc = "STCON (rw) register accessor: an alias for `Reg`"] +#[doc = "STCON (rw) register accessor: Startup Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`stcon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`stcon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@stcon`] +module"] pub type STCON = crate::Reg; #[doc = "Startup Configuration Register"] pub mod stcon; -#[doc = "GPR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "GPR0 (rw) register accessor: General Purpose Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gpr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gpr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gpr0`] +module"] pub type GPR0 = crate::Reg; #[doc = "General Purpose Register 0"] pub mod gpr0; -#[doc = "GPR1 (rw) register accessor: an alias for `Reg`"] +#[doc = "GPR1 (rw) register accessor: General Purpose Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gpr1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gpr1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gpr1`] +module"] pub type GPR1 = crate::Reg; #[doc = "General Purpose Register 1"] pub mod gpr1; -#[doc = "CCUCON (rw) register accessor: an alias for `Reg`"] +#[doc = "CCUCON (rw) register accessor: CCU Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccucon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccucon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ccucon`] +module"] pub type CCUCON = crate::Reg; #[doc = "CCU Control Register"] pub mod ccucon; -#[doc = "DTSCON (rw) register accessor: an alias for `Reg`"] +#[doc = "DTSCON (rw) register accessor: Die Temperature Sensor Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtscon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dtscon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dtscon`] +module"] pub type DTSCON = crate::Reg; #[doc = "Die Temperature Sensor Control Register"] pub mod dtscon; -#[doc = "DTSSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "DTSSTAT (r) register accessor: Die Temperature Sensor Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtsstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dtsstat`] +module"] pub type DTSSTAT = crate::Reg; #[doc = "Die Temperature Sensor Status Register"] pub mod dtsstat; -#[doc = "G0ORCEN (rw) register accessor: an alias for `Reg`"] +#[doc = "G0ORCEN (rw) register accessor: Out of Range Comparator Enable Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`g0orcen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`g0orcen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@g0orcen`] +module"] pub type G0ORCEN = crate::Reg; #[doc = "Out of Range Comparator Enable Register 0"] pub mod g0orcen; -#[doc = "G1ORCEN (rw) register accessor: an alias for `Reg`"] +#[doc = "G1ORCEN (rw) register accessor: Out of Range Comparator Enable Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`g1orcen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`g1orcen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@g1orcen`] +module"] pub type G1ORCEN = crate::Reg; #[doc = "Out of Range Comparator Enable Register 1"] pub mod g1orcen; -#[doc = "DTEMPLIM (rw) register accessor: an alias for `Reg`"] +#[doc = "DTEMPLIM (rw) register accessor: Die Temperature Sensor Limit Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtemplim::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dtemplim::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dtemplim`] +module"] pub type DTEMPLIM = crate::Reg; #[doc = "Die Temperature Sensor Limit Register"] pub mod dtemplim; -#[doc = "DTEMPALARM (r) register accessor: an alias for `Reg`"] +#[doc = "DTEMPALARM (r) register accessor: Die Temperature Sensor Alarm Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtempalarm::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dtempalarm`] +module"] pub type DTEMPALARM = crate::Reg; #[doc = "Die Temperature Sensor Alarm Register"] pub mod dtempalarm; -#[doc = "MIRRSTS (r) register accessor: an alias for `Reg`"] +#[doc = "MIRRSTS (r) register accessor: Mirror Write Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mirrsts::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mirrsts`] +module"] pub type MIRRSTS = crate::Reg; #[doc = "Mirror Write Status Register"] pub mod mirrsts; -#[doc = "RMACR (rw) register accessor: an alias for `Reg`"] +#[doc = "RMACR (rw) register accessor: Retention Memory Access Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rmacr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rmacr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rmacr`] +module"] pub type RMACR = crate::Reg; #[doc = "Retention Memory Access Control Register"] pub mod rmacr; -#[doc = "RMDATA (rw) register accessor: an alias for `Reg`"] +#[doc = "RMDATA (rw) register accessor: Retention Memory Access Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rmdata::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rmdata::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rmdata`] +module"] pub type RMDATA = crate::Reg; #[doc = "Retention Memory Access Data Register"] pub mod rmdata; -#[doc = "MIRRALLSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "MIRRALLSTAT (r) register accessor: Mirror All Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mirrallstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mirrallstat`] +module"] pub type MIRRALLSTAT = crate::Reg; #[doc = "Mirror All Status"] pub mod mirrallstat; -#[doc = "MIRRALLREQ (w) register accessor: an alias for `Reg`"] +#[doc = "MIRRALLREQ (w) register accessor: Mirror All Request\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mirrallreq::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mirrallreq`] +module"] 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 9056cb45..bcfb8a63 100644 --- a/src/scu_general/ccucon.rs +++ b/src/scu_general/ccucon.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `GSC40` reader - Global Start Control CCU40"] pub type GSC40_R = crate::BitReader; #[doc = "Global Start Control CCU40\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl GSC40_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GSC40_A { + pub const fn variant(&self) -> GSC40_A { match self.bits { false => GSC40_A::VALUE1, true => GSC40_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GSC40_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GSC40_A::VALUE2 } } #[doc = "Field `GSC40` writer - Global Start Control CCU40"] -pub type GSC40_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCUCON_SPEC, GSC40_A, O>; -impl<'a, const O: u8> GSC40_W<'a, O> { +pub type GSC40_W<'a, REG> = crate::BitWriter<'a, REG, GSC40_A>; +impl<'a, REG> GSC40_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GSC40_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GSC40_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl GSC41_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GSC41_A { + pub const fn variant(&self) -> GSC41_A { match self.bits { false => GSC41_A::VALUE1, true => GSC41_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GSC41_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GSC41_A::VALUE2 } } #[doc = "Field `GSC41` writer - Global Start Control CCU41"] -pub type GSC41_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCUCON_SPEC, GSC41_A, O>; -impl<'a, const O: u8> GSC41_W<'a, O> { +pub type GSC41_W<'a, REG> = crate::BitWriter<'a, REG, GSC41_A>; +impl<'a, REG> GSC41_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GSC41_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GSC41_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl GSC42_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GSC42_A { + pub const fn variant(&self) -> GSC42_A { match self.bits { false => GSC42_A::VALUE1, true => GSC42_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GSC42_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GSC42_A::VALUE2 } } #[doc = "Field `GSC42` writer - Global Start Control CCU42"] -pub type GSC42_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCUCON_SPEC, GSC42_A, O>; -impl<'a, const O: u8> GSC42_W<'a, O> { +pub type GSC42_W<'a, REG> = crate::BitWriter<'a, REG, GSC42_A>; +impl<'a, REG> GSC42_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GSC42_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GSC42_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl GSC43_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GSC43_A { + pub const fn variant(&self) -> GSC43_A { match self.bits { false => GSC43_A::VALUE1, true => GSC43_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GSC43_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GSC43_A::VALUE2 } } #[doc = "Field `GSC43` writer - Global Start Control CCU43"] -pub type GSC43_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCUCON_SPEC, GSC43_A, O>; -impl<'a, const O: u8> GSC43_W<'a, O> { +pub type GSC43_W<'a, REG> = crate::BitWriter<'a, REG, GSC43_A>; +impl<'a, REG> GSC43_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GSC43_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GSC43_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl GSC80_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GSC80_A { + pub const fn variant(&self) -> GSC80_A { match self.bits { false => GSC80_A::VALUE1, true => GSC80_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GSC80_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GSC80_A::VALUE2 } } #[doc = "Field `GSC80` writer - Global Start Control CCU80"] -pub type GSC80_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCUCON_SPEC, GSC80_A, O>; -impl<'a, const O: u8> GSC80_W<'a, O> { +pub type GSC80_W<'a, REG> = crate::BitWriter<'a, REG, GSC80_A>; +impl<'a, REG> GSC80_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GSC80_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GSC80_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl GSC81_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GSC81_A { + pub const fn variant(&self) -> GSC81_A { match self.bits { false => GSC81_A::VALUE1, true => GSC81_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GSC81_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GSC81_A::VALUE2 } } #[doc = "Field `GSC81` writer - Global Start Control CCU81"] -pub type GSC81_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCUCON_SPEC, GSC81_A, O>; -impl<'a, const O: u8> GSC81_W<'a, O> { +pub type GSC81_W<'a, REG> = crate::BitWriter<'a, REG, GSC81_A>; +impl<'a, REG> GSC81_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GSC81_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GSC81_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl GSHR0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GSHR0_A { + pub const fn variant(&self) -> GSHR0_A { match self.bits { false => GSHR0_A::VALUE1, true => GSHR0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GSHR0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GSHR0_A::VALUE2 } } #[doc = "Field `GSHR0` writer - Global Start Control HRPWM0"] -pub type GSHR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCUCON_SPEC, GSHR0_A, O>; -impl<'a, const O: u8> GSHR0_W<'a, O> { +pub type GSHR0_W<'a, REG> = crate::BitWriter<'a, REG, GSHR0_A>; +impl<'a, REG> GSHR0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GSHR0_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GSHR0_A::VALUE2) } } @@ -425,64 +414,65 @@ impl W { #[doc = "Bit 0 - Global Start Control CCU40"] #[inline(always)] #[must_use] - pub fn gsc40(&mut self) -> GSC40_W<0> { - GSC40_W::new(self) + pub fn gsc40(&mut self) -> GSC40_W { + GSC40_W::new(self, 0) } #[doc = "Bit 1 - Global Start Control CCU41"] #[inline(always)] #[must_use] - pub fn gsc41(&mut self) -> GSC41_W<1> { - GSC41_W::new(self) + pub fn gsc41(&mut self) -> GSC41_W { + GSC41_W::new(self, 1) } #[doc = "Bit 2 - Global Start Control CCU42"] #[inline(always)] #[must_use] - pub fn gsc42(&mut self) -> GSC42_W<2> { - GSC42_W::new(self) + pub fn gsc42(&mut self) -> GSC42_W { + GSC42_W::new(self, 2) } #[doc = "Bit 3 - Global Start Control CCU43"] #[inline(always)] #[must_use] - pub fn gsc43(&mut self) -> GSC43_W<3> { - GSC43_W::new(self) + pub fn gsc43(&mut self) -> GSC43_W { + GSC43_W::new(self, 3) } #[doc = "Bit 8 - Global Start Control CCU80"] #[inline(always)] #[must_use] - pub fn gsc80(&mut self) -> GSC80_W<8> { - GSC80_W::new(self) + pub fn gsc80(&mut self) -> GSC80_W { + GSC80_W::new(self, 8) } #[doc = "Bit 9 - Global Start Control CCU81"] #[inline(always)] #[must_use] - pub fn gsc81(&mut self) -> GSC81_W<9> { - GSC81_W::new(self) + pub fn gsc81(&mut self) -> GSC81_W { + GSC81_W::new(self, 9) } #[doc = "Bit 24 - Global Start Control HRPWM0"] #[inline(always)] #[must_use] - pub fn gshr0(&mut self) -> GSHR0_W<24> { - GSHR0_W::new(self) + pub fn gshr0(&mut self) -> GSHR0_W { + GSHR0_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "CCU Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccucon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccucon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ccucon::R`](R) reader structure"] +impl crate::Readable for CCUCON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ccucon::W`](W) writer structure"] impl crate::Writable for CCUCON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/dtempalarm.rs b/src/scu_general/dtempalarm.rs index e2817496..9b7324b4 100644 --- a/src/scu_general/dtempalarm.rs +++ b/src/scu_general/dtempalarm.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `UNDERFL` reader - Lower Limit Underflow"] pub type UNDERFL_R = crate::BitReader; #[doc = "Lower Limit Underflow\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl UNDERFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UNDERFL_A { + pub const fn variant(&self) -> UNDERFL_A { match self.bits { false => UNDERFL_A::VALUE1, true => UNDERFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No temperature underflow was detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UNDERFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A temperature underflow was detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UNDERFL_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl OVERFL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OVERFL_A { + pub const fn variant(&self) -> OVERFL_A { match self.bits { false => OVERFL_A::VALUE1, true => OVERFL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No temperature overflow was detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OVERFL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A temperature overflow was detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OVERFL_A::VALUE2 @@ -97,15 +84,13 @@ impl R { OVERFL_R::new(((self.bits >> 16) & 1) != 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"] +#[doc = "Die Temperature Sensor Alarm Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtempalarm::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dtempalarm::R`](R) reader structure"] +impl crate::Readable for DTEMPALARM_SPEC {} #[doc = "`reset()` method sets DTEMPALARM to value 0"] impl crate::Resettable for DTEMPALARM_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_general/dtemplim.rs b/src/scu_general/dtemplim.rs index ec744a5e..fe428c06 100644 --- a/src/scu_general/dtemplim.rs +++ b/src/scu_general/dtemplim.rs @@ -1,47 +1,15 @@ #[doc = "Register `DTEMPLIM` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `LOWER` reader - Lower Limit"] -pub type LOWER_R = crate::FieldReader; +pub type LOWER_R = crate::FieldReader; #[doc = "Field `LOWER` writer - Lower Limit"] -pub type LOWER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DTEMPLIM_SPEC, u16, u16, 10, O>; +pub type LOWER_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `UPPER` reader - Upper Limit"] -pub type UPPER_R = crate::FieldReader; +pub type UPPER_R = crate::FieldReader; #[doc = "Field `UPPER` writer - Upper Limit"] -pub type UPPER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DTEMPLIM_SPEC, u16, u16, 10, O>; +pub type UPPER_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; impl R { #[doc = "Bits 0:9 - Lower Limit"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:9 - Lower Limit"] #[inline(always)] #[must_use] - pub fn lower(&mut self) -> LOWER_W<0> { - LOWER_W::new(self) + pub fn lower(&mut self) -> LOWER_W { + LOWER_W::new(self, 0) } #[doc = "Bits 16:25 - Upper Limit"] #[inline(always)] #[must_use] - pub fn upper(&mut self) -> UPPER_W<16> { - UPPER_W::new(self) + pub fn upper(&mut self) -> UPPER_W { + UPPER_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Die Temperature Sensor Limit Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtemplim::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dtemplim::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dtemplim::R`](R) reader structure"] +impl crate::Readable for DTEMPLIM_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dtemplim::W`](W) writer structure"] impl crate::Writable for DTEMPLIM_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/dtscon.rs b/src/scu_general/dtscon.rs index 5872c38b..8398bb4b 100644 --- a/src/scu_general/dtscon.rs +++ b/src/scu_general/dtscon.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PWD` reader - Sensor Power Down"] pub type PWD_R = crate::BitReader; #[doc = "Sensor Power Down\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl PWD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PWD_A { + pub const fn variant(&self) -> PWD_A { match self.bits { false => PWD_A::VALUE1, true => PWD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The DTS is powered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PWD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The DTS is not powered"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PWD_A::VALUE2 } } #[doc = "Field `PWD` writer - Sensor Power Down"] -pub type PWD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DTSCON_SPEC, PWD_A, O>; -impl<'a, const O: u8> PWD_W<'a, O> { +pub type PWD_W<'a, REG> = crate::BitWriter<'a, REG, PWD_A>; +impl<'a, REG> PWD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The DTS is powered"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PWD_A::VALUE1) } #[doc = "The DTS is not powered"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PWD_A::VALUE2) } } @@ -99,35 +70,38 @@ impl From for bool { } } #[doc = "Field `START` writer - Sensor Measurement Start"] -pub type START_W<'a, const O: u8> = crate::BitWriter<'a, u32, DTSCON_SPEC, START_AW, O>; -impl<'a, const O: u8> START_W<'a, O> { +pub type START_W<'a, REG> = crate::BitWriter<'a, REG, START_AW>; +impl<'a, REG> START_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No DTS measurement is started"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(START_AW::VALUE1) } #[doc = "A DTS measurement is started"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(START_AW::VALUE2) } } #[doc = "Field `OFFSET` reader - Offset Calibration Value"] -pub type OFFSET_R = crate::FieldReader; +pub type OFFSET_R = crate::FieldReader; #[doc = "Field `OFFSET` writer - Offset Calibration Value"] -pub type OFFSET_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DTSCON_SPEC, u8, u8, 7, O>; +pub type OFFSET_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `GAIN` reader - Gain Calibration Value"] -pub type GAIN_R = crate::FieldReader; +pub type GAIN_R = crate::FieldReader; #[doc = "Field `GAIN` writer - Gain Calibration Value"] -pub type GAIN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DTSCON_SPEC, u8, u8, 6, O>; +pub type GAIN_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `REFTRIM` reader - Reference Trim Calibration Value"] -pub type REFTRIM_R = crate::FieldReader; +pub type REFTRIM_R = crate::FieldReader; #[doc = "Field `REFTRIM` writer - Reference Trim Calibration Value"] -pub type REFTRIM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DTSCON_SPEC, u8, u8, 3, O>; +pub type REFTRIM_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `BGTRIM` reader - Bandgap Trim Calibration Value"] -pub type BGTRIM_R = crate::FieldReader; +pub type BGTRIM_R = crate::FieldReader; #[doc = "Field `BGTRIM` writer - Bandgap Trim Calibration Value"] -pub type BGTRIM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DTSCON_SPEC, u8, u8, 4, O>; +pub type BGTRIM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bit 0 - Sensor Power Down"] #[inline(always)] @@ -159,58 +133,59 @@ impl W { #[doc = "Bit 0 - Sensor Power Down"] #[inline(always)] #[must_use] - pub fn pwd(&mut self) -> PWD_W<0> { - PWD_W::new(self) + pub fn pwd(&mut self) -> PWD_W { + PWD_W::new(self, 0) } #[doc = "Bit 1 - Sensor Measurement Start"] #[inline(always)] #[must_use] - pub fn start(&mut self) -> START_W<1> { - START_W::new(self) + pub fn start(&mut self) -> START_W { + START_W::new(self, 1) } #[doc = "Bits 4:10 - Offset Calibration Value"] #[inline(always)] #[must_use] - pub fn offset(&mut self) -> OFFSET_W<4> { - OFFSET_W::new(self) + pub fn offset(&mut self) -> OFFSET_W { + OFFSET_W::new(self, 4) } #[doc = "Bits 11:16 - Gain Calibration Value"] #[inline(always)] #[must_use] - pub fn gain(&mut self) -> GAIN_W<11> { - GAIN_W::new(self) + pub fn gain(&mut self) -> GAIN_W { + GAIN_W::new(self, 11) } #[doc = "Bits 17:19 - Reference Trim Calibration Value"] #[inline(always)] #[must_use] - pub fn reftrim(&mut self) -> REFTRIM_W<17> { - REFTRIM_W::new(self) + pub fn reftrim(&mut self) -> REFTRIM_W { + REFTRIM_W::new(self, 17) } #[doc = "Bits 20:23 - Bandgap Trim Calibration Value"] #[inline(always)] #[must_use] - pub fn bgtrim(&mut self) -> BGTRIM_W<20> { - BGTRIM_W::new(self) + pub fn bgtrim(&mut self) -> BGTRIM_W { + BGTRIM_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Die Temperature Sensor Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtscon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dtscon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dtscon::R`](R) reader structure"] +impl crate::Readable for DTSCON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dtscon::W`](W) writer structure"] impl crate::Writable for DTSCON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/dtsstat.rs b/src/scu_general/dtsstat.rs index 2ce83a34..db3a8545 100644 --- a/src/scu_general/dtsstat.rs +++ b/src/scu_general/dtsstat.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `RESULT` reader - Result of the DTS Measurement"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; #[doc = "Field `RDY` reader - Sensor Ready Status"] pub type RDY_R = crate::BitReader; #[doc = "Sensor Ready Status\n\nValue on reset: 0"] @@ -34,18 +21,18 @@ impl From for bool { impl RDY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RDY_A { + pub const fn variant(&self) -> RDY_A { match self.bits { false => RDY_A::VALUE1, true => RDY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The DTS is not ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RDY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The DTS is ready"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RDY_A::VALUE2 @@ -70,18 +57,18 @@ impl From for bool { impl BUSY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BUSY_A { + pub const fn variant(&self) -> BUSY_A { match self.bits { false => BUSY_A::VALUE1, true => BUSY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "not busy"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BUSY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BUSY_A::VALUE2 @@ -104,15 +91,13 @@ impl R { BUSY_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Die Temperature Sensor Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtsstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dtsstat::R`](R) reader structure"] +impl crate::Readable for DTSSTAT_SPEC {} #[doc = "`reset()` method sets DTSSTAT to value 0"] impl crate::Resettable for DTSSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_general/g0orcen.rs b/src/scu_general/g0orcen.rs index f1b5320a..aaa9850c 100644 --- a/src/scu_general/g0orcen.rs +++ b/src/scu_general/g0orcen.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENORC6` reader - Enable Out of Range Comparator, Channel 6"] pub type ENORC6_R = crate::BitReader; #[doc = "Enable Out of Range Comparator, Channel 6\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl ENORC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENORC6_A { + pub const fn variant(&self) -> ENORC6_A { match self.bits { false => ENORC6_A::VALUE1, true => ENORC6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENORC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENORC6_A::VALUE2 } } #[doc = "Field `ENORC6` writer - Enable Out of Range Comparator, Channel 6"] -pub type ENORC6_W<'a, const O: u8> = crate::BitWriter<'a, u32, G0ORCEN_SPEC, ENORC6_A, O>; -impl<'a, const O: u8> ENORC6_W<'a, O> { +pub type ENORC6_W<'a, REG> = crate::BitWriter<'a, REG, ENORC6_A>; +impl<'a, REG> ENORC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENORC6_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENORC6_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl ENORC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENORC7_A { + pub const fn variant(&self) -> ENORC7_A { match self.bits { false => ENORC7_A::VALUE1, true => ENORC7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENORC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENORC7_A::VALUE2 } } #[doc = "Field `ENORC7` writer - Enable Out of Range Comparator, Channel 7"] -pub type ENORC7_W<'a, const O: u8> = crate::BitWriter<'a, u32, G0ORCEN_SPEC, ENORC7_A, O>; -impl<'a, const O: u8> ENORC7_W<'a, O> { +pub type ENORC7_W<'a, REG> = crate::BitWriter<'a, REG, ENORC7_A>; +impl<'a, REG> ENORC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENORC7_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENORC7_A::VALUE2) } } @@ -150,34 +124,35 @@ impl W { #[doc = "Bit 6 - Enable Out of Range Comparator, Channel 6"] #[inline(always)] #[must_use] - pub fn enorc6(&mut self) -> ENORC6_W<6> { - ENORC6_W::new(self) + pub fn enorc6(&mut self) -> ENORC6_W { + ENORC6_W::new(self, 6) } #[doc = "Bit 7 - Enable Out of Range Comparator, Channel 7"] #[inline(always)] #[must_use] - pub fn enorc7(&mut self) -> ENORC7_W<7> { - ENORC7_W::new(self) + pub fn enorc7(&mut self) -> ENORC7_W { + ENORC7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Out of Range Comparator Enable Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`g0orcen::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`g0orcen::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`g0orcen::R`](R) reader structure"] +impl crate::Readable for G0ORCEN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`g0orcen::W`](W) writer structure"] impl crate::Writable for G0ORCEN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/g1orcen.rs b/src/scu_general/g1orcen.rs index c3fcee05..aad681e4 100644 --- a/src/scu_general/g1orcen.rs +++ b/src/scu_general/g1orcen.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENORC6` reader - Enable Out of Range Comparator, Channel 6"] pub type ENORC6_R = crate::BitReader; #[doc = "Enable Out of Range Comparator, Channel 6\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl ENORC6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENORC6_A { + pub const fn variant(&self) -> ENORC6_A { match self.bits { false => ENORC6_A::VALUE1, true => ENORC6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENORC6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENORC6_A::VALUE2 } } #[doc = "Field `ENORC6` writer - Enable Out of Range Comparator, Channel 6"] -pub type ENORC6_W<'a, const O: u8> = crate::BitWriter<'a, u32, G1ORCEN_SPEC, ENORC6_A, O>; -impl<'a, const O: u8> ENORC6_W<'a, O> { +pub type ENORC6_W<'a, REG> = crate::BitWriter<'a, REG, ENORC6_A>; +impl<'a, REG> ENORC6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENORC6_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENORC6_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl ENORC7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENORC7_A { + pub const fn variant(&self) -> ENORC7_A { match self.bits { false => ENORC7_A::VALUE1, true => ENORC7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENORC7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENORC7_A::VALUE2 } } #[doc = "Field `ENORC7` writer - Enable Out of Range Comparator, Channel 7"] -pub type ENORC7_W<'a, const O: u8> = crate::BitWriter<'a, u32, G1ORCEN_SPEC, ENORC7_A, O>; -impl<'a, const O: u8> ENORC7_W<'a, O> { +pub type ENORC7_W<'a, REG> = crate::BitWriter<'a, REG, ENORC7_A>; +impl<'a, REG> ENORC7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENORC7_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENORC7_A::VALUE2) } } @@ -150,34 +124,35 @@ impl W { #[doc = "Bit 6 - Enable Out of Range Comparator, Channel 6"] #[inline(always)] #[must_use] - pub fn enorc6(&mut self) -> ENORC6_W<6> { - ENORC6_W::new(self) + pub fn enorc6(&mut self) -> ENORC6_W { + ENORC6_W::new(self, 6) } #[doc = "Bit 7 - Enable Out of Range Comparator, Channel 7"] #[inline(always)] #[must_use] - pub fn enorc7(&mut self) -> ENORC7_W<7> { - ENORC7_W::new(self) + pub fn enorc7(&mut self) -> ENORC7_W { + ENORC7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Out of Range Comparator Enable Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`g1orcen::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`g1orcen::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`g1orcen::R`](R) reader structure"] +impl crate::Readable for G1ORCEN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`g1orcen::W`](W) writer structure"] impl crate::Writable for G1ORCEN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/gpr0.rs b/src/scu_general/gpr0.rs index 331786ef..d3574bbf 100644 --- a/src/scu_general/gpr0.rs +++ b/src/scu_general/gpr0.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DAT` reader - User Data"] -pub type DAT_R = crate::FieldReader; +pub type DAT_R = crate::FieldReader; #[doc = "Field `DAT` writer - User Data"] -pub type DAT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GPR0_SPEC, u32, u32, 32, O>; +pub type DAT_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - User Data"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - User Data"] #[inline(always)] #[must_use] - pub fn dat(&mut self) -> DAT_W<0> { - DAT_W::new(self) + pub fn dat(&mut self) -> DAT_W { + DAT_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "General Purpose Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gpr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gpr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gpr0::R`](R) reader structure"] +impl crate::Readable for GPR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gpr0::W`](W) writer structure"] impl crate::Writable for GPR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/gpr1.rs b/src/scu_general/gpr1.rs index ea2d03bf..d2cf169d 100644 --- a/src/scu_general/gpr1.rs +++ b/src/scu_general/gpr1.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DAT` reader - User Data"] -pub type DAT_R = crate::FieldReader; +pub type DAT_R = crate::FieldReader; #[doc = "Field `DAT` writer - User Data"] -pub type DAT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GPR1_SPEC, u32, u32, 32, O>; +pub type DAT_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - User Data"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - User Data"] #[inline(always)] #[must_use] - pub fn dat(&mut self) -> DAT_W<0> { - DAT_W::new(self) + pub fn dat(&mut self) -> DAT_W { + DAT_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "General Purpose Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gpr1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gpr1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gpr1::R`](R) reader structure"] +impl crate::Readable for GPR1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gpr1::W`](W) writer structure"] impl crate::Writable for GPR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/id.rs b/src/scu_general/id.rs index 1e9dc4fe..126f2ff5 100644 --- a/src/scu_general/id.rs +++ b/src/scu_general/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "SCU Module ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x009d_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x009d_c000; diff --git a/src/scu_general/idchip.rs b/src/scu_general/idchip.rs index f7466005..2e7f601c 100644 --- a/src/scu_general/idchip.rs +++ b/src/scu_general/idchip.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `IDCHIP` reader - Chip ID"] -pub type IDCHIP_R = crate::FieldReader; +pub type IDCHIP_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Chip ID"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { IDCHIP_R::new(self.bits) } } -#[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"] +#[doc = "Chip ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`idchip::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`idchip::R`](R) reader structure"] +impl crate::Readable for IDCHIP_SPEC {} #[doc = "`reset()` method sets IDCHIP to value 0"] impl crate::Resettable for IDCHIP_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_general/idmanuf.rs b/src/scu_general/idmanuf.rs index f3e00766..4e3ea641 100644 --- a/src/scu_general/idmanuf.rs +++ b/src/scu_general/idmanuf.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DEPT` reader - Department Identification Number"] -pub type DEPT_R = crate::FieldReader; +pub type DEPT_R = crate::FieldReader; #[doc = "Field `MANUF` reader - Manufacturer Identification Number"] -pub type MANUF_R = crate::FieldReader; +pub type MANUF_R = crate::FieldReader; impl R { #[doc = "Bits 0:4 - Department Identification Number"] #[inline(always)] @@ -29,15 +16,13 @@ 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"] +#[doc = "Manufactory ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`idmanuf::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`idmanuf::R`](R) reader structure"] +impl crate::Readable for IDMANUF_SPEC {} #[doc = "`reset()` method sets IDMANUF to value 0x1820"] impl crate::Resettable for IDMANUF_SPEC { const RESET_VALUE: Self::Ux = 0x1820; diff --git a/src/scu_general/mirrallreq.rs b/src/scu_general/mirrallreq.rs index 7725758d..ba150776 100644 --- a/src/scu_general/mirrallreq.rs +++ b/src/scu_general/mirrallreq.rs @@ -1,24 +1,5 @@ #[doc = "Register `MIRRALLREQ` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Mirror All Execution Request\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum REQ_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `REQ` writer - Mirror All Execution Request"] -pub type REQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, MIRRALLREQ_SPEC, REQ_AW, O>; -impl<'a, const O: u8> REQ_W<'a, O> { +pub type REQ_W<'a, REG> = crate::BitWriter<'a, REG, REQ_AW>; +impl<'a, REG> REQ_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REQ_AW::VALUE1) } #[doc = "Start mirror update"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REQ_AW::VALUE2) } } @@ -51,24 +35,27 @@ impl W { #[doc = "Bit 0 - Mirror All Execution Request"] #[inline(always)] #[must_use] - pub fn req(&mut self) -> REQ_W<0> { - REQ_W::new(self) + pub fn req(&mut self) -> REQ_W { + REQ_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Mirror All Request\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mirrallreq::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct MIRRALLREQ_SPEC; impl crate::RegisterSpec for MIRRALLREQ_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [mirrallreq::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`mirrallreq::W`](W) writer structure"] impl crate::Writable for MIRRALLREQ_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/mirrallstat.rs b/src/scu_general/mirrallstat.rs index 424e581a..97ca0cfe 100644 --- a/src/scu_general/mirrallstat.rs +++ b/src/scu_general/mirrallstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `BUSY` reader - Mirror All Execution Status"] pub type BUSY_R = crate::BitReader; #[doc = "Mirror All Execution Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl BUSY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BUSY_A { + pub const fn variant(&self) -> BUSY_A { match self.bits { false => BUSY_A::VALUE1, true => BUSY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No update is pening"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BUSY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update is pending"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BUSY_A::VALUE2 @@ -56,15 +43,13 @@ impl R { BUSY_R::new((self.bits & 1) != 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"] +#[doc = "Mirror All Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mirrallstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`mirrallstat::R`](R) reader structure"] +impl crate::Readable for MIRRALLSTAT_SPEC {} #[doc = "`reset()` method sets MIRRALLSTAT to value 0"] impl crate::Resettable for MIRRALLSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_general/mirrsts.rs b/src/scu_general/mirrsts.rs index b088581c..8d29e5ca 100644 --- a/src/scu_general/mirrsts.rs +++ b/src/scu_general/mirrsts.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `HDCLR` reader - HDCLR Mirror Register Write Status"] pub type HDCLR_R = crate::BitReader; #[doc = "HDCLR Mirror Register Write Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl HDCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDCLR_A { + pub const fn variant(&self) -> HDCLR_A { match self.bits { false => HDCLR_A::VALUE1, true => HDCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDCLR_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl HDSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDSET_A { + pub const fn variant(&self) -> HDSET_A { match self.bits { false => HDSET_A::VALUE1, true => HDSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDSET_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl HDCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDCR_A { + pub const fn variant(&self) -> HDCR_A { match self.bits { false => HDCR_A::VALUE1, true => HDCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDCR_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl OSCSICTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCSICTRL_A { + pub const fn variant(&self) -> OSCSICTRL_A { match self.bits { false => OSCSICTRL_A::VALUE1, true => OSCSICTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCSICTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCSICTRL_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl OSCULCTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCULCTRL_A { + pub const fn variant(&self) -> OSCULCTRL_A { match self.bits { false => OSCULCTRL_A::VALUE1, true => OSCULCTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCULCTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCULCTRL_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl RTC_CTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_CTR_A { + pub const fn variant(&self) -> RTC_CTR_A { match self.bits { false => RTC_CTR_A::VALUE1, true => RTC_CTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_CTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_CTR_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl RTC_ATIM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_ATIM0_A { + pub const fn variant(&self) -> RTC_ATIM0_A { match self.bits { false => RTC_ATIM0_A::VALUE1, true => RTC_ATIM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_ATIM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_ATIM0_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl RTC_ATIM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_ATIM1_A { + pub const fn variant(&self) -> RTC_ATIM1_A { match self.bits { false => RTC_ATIM1_A::VALUE1, true => RTC_ATIM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_ATIM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_ATIM1_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl RTC_TIM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_TIM0_A { + pub const fn variant(&self) -> RTC_TIM0_A { match self.bits { false => RTC_TIM0_A::VALUE1, true => RTC_TIM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_TIM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_TIM0_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl RTC_TIM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_TIM1_A { + pub const fn variant(&self) -> RTC_TIM1_A { match self.bits { false => RTC_TIM1_A::VALUE1, true => RTC_TIM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_TIM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_TIM1_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl RMX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RMX_A { + pub const fn variant(&self) -> RMX_A { match self.bits { false => RMX_A::VALUE1, true => RMX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RMX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RMX_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl RTC_MSKSR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_MSKSR_A { + pub const fn variant(&self) -> RTC_MSKSR_A { match self.bits { false => RTC_MSKSR_A::VALUE1, true => RTC_MSKSR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_MSKSR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_MSKSR_A::VALUE2 @@ -464,18 +451,18 @@ impl From for bool { impl RTC_CLRSR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_CLRSR_A { + pub const fn variant(&self) -> RTC_CLRSR_A { match self.bits { false => RTC_CLRSR_A::VALUE1, true => RTC_CLRSR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_CLRSR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_CLRSR_A::VALUE2 @@ -500,18 +487,18 @@ impl From for bool { impl LPACCONF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACCONF_A { + pub const fn variant(&self) -> LPACCONF_A { match self.bits { false => LPACCONF_A::VALUE1, true => LPACCONF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACCONF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACCONF_A::VALUE2 @@ -536,18 +523,18 @@ impl From for bool { impl LPACTH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACTH0_A { + pub const fn variant(&self) -> LPACTH0_A { match self.bits { false => LPACTH0_A::VALUE1, true => LPACTH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACTH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACTH0_A::VALUE2 @@ -572,18 +559,18 @@ impl From for bool { impl LPACTH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACTH1_A { + pub const fn variant(&self) -> LPACTH1_A { match self.bits { false => LPACTH1_A::VALUE1, true => LPACTH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACTH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACTH1_A::VALUE2 @@ -608,18 +595,18 @@ impl From for bool { impl LPACCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACCLR_A { + pub const fn variant(&self) -> LPACCLR_A { match self.bits { false => LPACCLR_A::VALUE1, true => LPACCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACCLR_A::VALUE2 @@ -644,18 +631,18 @@ impl From for bool { impl LPACSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACSET_A { + pub const fn variant(&self) -> LPACSET_A { match self.bits { false => LPACSET_A::VALUE1, true => LPACSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACSET_A::VALUE2 @@ -680,18 +667,18 @@ impl From for bool { impl HINTCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTCLR_A { + pub const fn variant(&self) -> HINTCLR_A { match self.bits { false => HINTCLR_A::VALUE1, true => HINTCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTCLR_A::VALUE2 @@ -716,18 +703,18 @@ impl From for bool { impl HINTSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTSET_A { + pub const fn variant(&self) -> HINTSET_A { match self.bits { false => HINTSET_A::VALUE1, true => HINTSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Busy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTSET_A::VALUE2 @@ -835,15 +822,13 @@ impl R { HINTSET_R::new(((self.bits >> 24) & 1) != 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"] +#[doc = "Mirror Write Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mirrsts::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`mirrsts::R`](R) reader structure"] +impl crate::Readable for MIRRSTS_SPEC {} #[doc = "`reset()` method sets MIRRSTS to value 0"] impl crate::Resettable for MIRRSTS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_general/rmacr.rs b/src/scu_general/rmacr.rs index 167bf59f..f2005490 100644 --- a/src/scu_general/rmacr.rs +++ b/src/scu_general/rmacr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RDWR` reader - Hibernate Retention Memory Register Update Control"] pub type RDWR_R = crate::BitReader; #[doc = "Hibernate Retention Memory Register Update Control\n\nValue on reset: 0"] @@ -53,41 +21,44 @@ impl From for bool { impl RDWR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RDWR_A { + pub const fn variant(&self) -> RDWR_A { match self.bits { false => RDWR_A::VALUE1, true => RDWR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "transfer data from Retention Memory in Hibernate domain to RMDATA register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RDWR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "transfer data from RMDATA into Retention Memory in Hibernate domain"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RDWR_A::VALUE2 } } #[doc = "Field `RDWR` writer - Hibernate Retention Memory Register Update Control"] -pub type RDWR_W<'a, const O: u8> = crate::BitWriter<'a, u32, RMACR_SPEC, RDWR_A, O>; -impl<'a, const O: u8> RDWR_W<'a, O> { +pub type RDWR_W<'a, REG> = crate::BitWriter<'a, REG, RDWR_A>; +impl<'a, REG> RDWR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "transfer data from Retention Memory in Hibernate domain to RMDATA register"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RDWR_A::VALUE1) } #[doc = "transfer data from RMDATA into Retention Memory in Hibernate domain"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RDWR_A::VALUE2) } } #[doc = "Field `ADDR` reader - Hibernate Retention Memory Register Address Select"] -pub type ADDR_R = crate::FieldReader; +pub type ADDR_R = crate::FieldReader; #[doc = "Field `ADDR` writer - Hibernate Retention Memory Register Address Select"] -pub type ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RMACR_SPEC, u8, u8, 4, O>; +pub type ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bit 0 - Hibernate Retention Memory Register Update Control"] #[inline(always)] @@ -104,34 +75,35 @@ impl W { #[doc = "Bit 0 - Hibernate Retention Memory Register Update Control"] #[inline(always)] #[must_use] - pub fn rdwr(&mut self) -> RDWR_W<0> { - RDWR_W::new(self) + pub fn rdwr(&mut self) -> RDWR_W { + RDWR_W::new(self, 0) } #[doc = "Bits 16:19 - Hibernate Retention Memory Register Address Select"] #[inline(always)] #[must_use] - pub fn addr(&mut self) -> ADDR_W<16> { - ADDR_W::new(self) + pub fn addr(&mut self) -> ADDR_W { + ADDR_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Retention Memory Access Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rmacr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rmacr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rmacr::R`](R) reader structure"] +impl crate::Readable for RMACR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rmacr::W`](W) writer structure"] impl crate::Writable for RMACR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/rmdata.rs b/src/scu_general/rmdata.rs index 0c88377d..4319208f 100644 --- a/src/scu_general/rmdata.rs +++ b/src/scu_general/rmdata.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DATA` reader - Hibernate Retention Memory Data"] -pub type DATA_R = crate::FieldReader; +pub type DATA_R = crate::FieldReader; #[doc = "Field `DATA` writer - Hibernate Retention Memory Data"] -pub type DATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RMDATA_SPEC, u32, u32, 32, O>; +pub type DATA_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Hibernate Retention Memory Data"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Hibernate Retention Memory Data"] #[inline(always)] #[must_use] - pub fn data(&mut self) -> DATA_W<0> { - DATA_W::new(self) + pub fn data(&mut self) -> DATA_W { + DATA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Retention Memory Access Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rmdata::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rmdata::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rmdata::R`](R) reader structure"] +impl crate::Readable for RMDATA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rmdata::W`](W) writer structure"] impl crate::Writable for RMDATA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_general/stcon.rs b/src/scu_general/stcon.rs index 82e5b704..c4853e70 100644 --- a/src/scu_general/stcon.rs +++ b/src/scu_general/stcon.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `HWCON` reader - HW Configuration"] -pub type HWCON_R = crate::FieldReader; +pub type HWCON_R = crate::FieldReader; #[doc = "HW Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HWCON_A { + type Ux = u8; +} impl HWCON_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HWCON_A { + pub const fn variant(&self) -> HWCON_A { match self.bits { 0 => HWCON_A::VALUE1, 1 => HWCON_A::VALUE2, @@ -67,29 +38,29 @@ impl HWCON_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal mode, JTAG"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HWCON_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ASC BSL enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HWCON_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "BMI customized boot enabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HWCON_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CAN BSL enabled"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == HWCON_A::VALUE4 } } #[doc = "Field `SWCON` reader - SW Configuration"] -pub type SWCON_R = crate::FieldReader; +pub type SWCON_R = crate::FieldReader; #[doc = "SW Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -117,10 +88,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SWCON_A { + type Ux = u8; +} impl SWCON_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SWCON_A::VALUE1), 1 => Some(SWCON_A::VALUE2), @@ -133,88 +107,92 @@ impl SWCON_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal mode, boot from Boot ROM"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SWCON_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "ASC BSL enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SWCON_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "BMI customized boot enabled"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SWCON_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CAN BSL enabled"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SWCON_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Boot from Code SRAM"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == SWCON_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Boot from alternate Flash Address 0"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == SWCON_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Boot from alternate Flash Address 1"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == SWCON_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Enable fallback Alternate Boot Mode (ABM)"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == SWCON_A::VALUE8 } } #[doc = "Field `SWCON` writer - SW Configuration"] -pub type SWCON_W<'a, const O: u8> = crate::FieldWriter<'a, u32, STCON_SPEC, u8, SWCON_A, 4, O>; -impl<'a, const O: u8> SWCON_W<'a, O> { +pub type SWCON_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SWCON_A>; +impl<'a, REG> SWCON_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Normal mode, boot from Boot ROM"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SWCON_A::VALUE1) } #[doc = "ASC BSL enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SWCON_A::VALUE2) } #[doc = "BMI customized boot enabled"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SWCON_A::VALUE3) } #[doc = "CAN BSL enabled"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SWCON_A::VALUE4) } #[doc = "Boot from Code SRAM"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(SWCON_A::VALUE5) } #[doc = "Boot from alternate Flash Address 0"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(SWCON_A::VALUE6) } #[doc = "Boot from alternate Flash Address 1"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(SWCON_A::VALUE7) } #[doc = "Enable fallback Alternate Boot Mode (ABM)"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(SWCON_A::VALUE8) } } @@ -234,28 +212,29 @@ impl W { #[doc = "Bits 8:11 - SW Configuration"] #[inline(always)] #[must_use] - pub fn swcon(&mut self) -> SWCON_W<8> { - SWCON_W::new(self) + pub fn swcon(&mut self) -> SWCON_W { + SWCON_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Startup Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`stcon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`stcon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`stcon::R`](R) reader structure"] +impl crate::Readable for STCON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`stcon::W`](W) writer structure"] impl crate::Writable for STCON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate.rs b/src/scu_hibernate.rs index c8009740..089823de 100644 --- a/src/scu_hibernate.rs +++ b/src/scu_hibernate.rs @@ -1,101 +1,183 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + hdstat: HDSTAT, + hdclr: HDCLR, + hdset: HDSET, + hdcr: HDCR, + _reserved4: [u8; 0x04], + oscsictrl: OSCSICTRL, + osculstat: OSCULSTAT, + osculctrl: OSCULCTRL, + lpacconf: LPACCONF, + lpacth0: LPACTH0, + lpacth1: LPACTH1, + lpacst: LPACST, + lpacclr: LPACCLR, + lpacset: LPACSET, + hintst: HINTST, + hintclr: HINTCLR, + hintset: HINTSET, +} +impl RegisterBlock { #[doc = "0x00 - Hibernate Domain Status Register"] - pub hdstat: HDSTAT, + #[inline(always)] + pub const fn hdstat(&self) -> &HDSTAT { + &self.hdstat + } #[doc = "0x04 - Hibernate Domain Status Clear Register"] - pub hdclr: HDCLR, + #[inline(always)] + pub const fn hdclr(&self) -> &HDCLR { + &self.hdclr + } #[doc = "0x08 - Hibernate Domain Status Set Register"] - pub hdset: HDSET, + #[inline(always)] + pub const fn hdset(&self) -> &HDSET { + &self.hdset + } #[doc = "0x0c - Hibernate Domain Control Register"] - pub hdcr: HDCR, - _reserved4: [u8; 0x04], + #[inline(always)] + pub const fn hdcr(&self) -> &HDCR { + &self.hdcr + } #[doc = "0x14 - fOSI Control Register"] - pub oscsictrl: OSCSICTRL, + #[inline(always)] + pub const fn oscsictrl(&self) -> &OSCSICTRL { + &self.oscsictrl + } #[doc = "0x18 - OSC_ULP Status Register"] - pub osculstat: OSCULSTAT, + #[inline(always)] + pub const fn osculstat(&self) -> &OSCULSTAT { + &self.osculstat + } #[doc = "0x1c - OSC_ULP Control Register"] - pub osculctrl: OSCULCTRL, + #[inline(always)] + pub const fn osculctrl(&self) -> &OSCULCTRL { + &self.osculctrl + } #[doc = "0x20 - Analog Wake-up Configuration Register"] - pub lpacconf: LPACCONF, + #[inline(always)] + pub const fn lpacconf(&self) -> &LPACCONF { + &self.lpacconf + } #[doc = "0x24 - LPAC Threshold Register 0"] - pub lpacth0: LPACTH0, + #[inline(always)] + pub const fn lpacth0(&self) -> &LPACTH0 { + &self.lpacth0 + } #[doc = "0x28 - LPAC Threshold Register 1"] - pub lpacth1: LPACTH1, + #[inline(always)] + pub const fn lpacth1(&self) -> &LPACTH1 { + &self.lpacth1 + } #[doc = "0x2c - Hibernate Analog Control State Register"] - pub lpacst: LPACST, + #[inline(always)] + pub const fn lpacst(&self) -> &LPACST { + &self.lpacst + } #[doc = "0x30 - LPAC Control Clear Register"] - pub lpacclr: LPACCLR, + #[inline(always)] + pub const fn lpacclr(&self) -> &LPACCLR { + &self.lpacclr + } #[doc = "0x34 - LPAC Control Set Register"] - pub lpacset: LPACSET, + #[inline(always)] + pub const fn lpacset(&self) -> &LPACSET { + &self.lpacset + } #[doc = "0x38 - Hibernate Internal Control State Register"] - pub hintst: HINTST, + #[inline(always)] + pub const fn hintst(&self) -> &HINTST { + &self.hintst + } #[doc = "0x3c - Hibernate Internal Control Clear Register"] - pub hintclr: HINTCLR, + #[inline(always)] + pub const fn hintclr(&self) -> &HINTCLR { + &self.hintclr + } #[doc = "0x40 - Hibernate Internal Control Set Register"] - pub hintset: HINTSET, + #[inline(always)] + pub const fn hintset(&self) -> &HINTSET { + &self.hintset + } } -#[doc = "HDSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "HDSTAT (r) register accessor: Hibernate Domain Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hdstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hdstat`] +module"] pub type HDSTAT = crate::Reg; #[doc = "Hibernate Domain Status Register"] pub mod hdstat; -#[doc = "HDCLR (w) register accessor: an alias for `Reg`"] +#[doc = "HDCLR (w) register accessor: Hibernate Domain Status Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hdclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hdclr`] +module"] pub type HDCLR = crate::Reg; #[doc = "Hibernate Domain Status Clear Register"] pub mod hdclr; -#[doc = "HDSET (w) register accessor: an alias for `Reg`"] +#[doc = "HDSET (w) register accessor: Hibernate Domain Status Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hdset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hdset`] +module"] pub type HDSET = crate::Reg; #[doc = "Hibernate Domain Status Set Register"] pub mod hdset; -#[doc = "HDCR (rw) register accessor: an alias for `Reg`"] +#[doc = "HDCR (rw) register accessor: Hibernate Domain Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hdcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hdcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hdcr`] +module"] pub type HDCR = crate::Reg; #[doc = "Hibernate Domain Control Register"] pub mod hdcr; -#[doc = "OSCSICTRL (rw) register accessor: an alias for `Reg`"] +#[doc = "OSCSICTRL (rw) register accessor: fOSI Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`oscsictrl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`oscsictrl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@oscsictrl`] +module"] pub type OSCSICTRL = crate::Reg; #[doc = "fOSI Control Register"] pub mod oscsictrl; -#[doc = "OSCULSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "OSCULSTAT (r) register accessor: OSC_ULP Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`osculstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@osculstat`] +module"] pub type OSCULSTAT = crate::Reg; #[doc = "OSC_ULP Status Register"] pub mod osculstat; -#[doc = "OSCULCTRL (rw) register accessor: an alias for `Reg`"] +#[doc = "OSCULCTRL (rw) register accessor: OSC_ULP Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`osculctrl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`osculctrl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@osculctrl`] +module"] pub type OSCULCTRL = crate::Reg; #[doc = "OSC_ULP Control Register"] pub mod osculctrl; -#[doc = "LPACCONF (rw) register accessor: an alias for `Reg`"] +#[doc = "LPACCONF (rw) register accessor: Analog Wake-up Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lpacconf::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacconf::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lpacconf`] +module"] pub type LPACCONF = crate::Reg; #[doc = "Analog Wake-up Configuration Register"] pub mod lpacconf; -#[doc = "LPACTH0 (rw) register accessor: an alias for `Reg`"] +#[doc = "LPACTH0 (rw) register accessor: LPAC Threshold Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lpacth0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacth0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lpacth0`] +module"] pub type LPACTH0 = crate::Reg; #[doc = "LPAC Threshold Register 0"] pub mod lpacth0; -#[doc = "LPACTH1 (rw) register accessor: an alias for `Reg`"] +#[doc = "LPACTH1 (rw) register accessor: LPAC Threshold Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lpacth1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacth1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lpacth1`] +module"] pub type LPACTH1 = crate::Reg; #[doc = "LPAC Threshold Register 1"] pub mod lpacth1; -#[doc = "LPACST (r) register accessor: an alias for `Reg`"] +#[doc = "LPACST (r) register accessor: Hibernate Analog Control State Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lpacst::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lpacst`] +module"] pub type LPACST = crate::Reg; #[doc = "Hibernate Analog Control State Register"] pub mod lpacst; -#[doc = "LPACCLR (w) register accessor: an alias for `Reg`"] +#[doc = "LPACCLR (w) register accessor: LPAC Control Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lpacclr`] +module"] pub type LPACCLR = crate::Reg; #[doc = "LPAC Control Clear Register"] pub mod lpacclr; -#[doc = "LPACSET (w) register accessor: an alias for `Reg`"] +#[doc = "LPACSET (w) register accessor: LPAC Control Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@lpacset`] +module"] pub type LPACSET = crate::Reg; #[doc = "LPAC Control Set Register"] pub mod lpacset; -#[doc = "HINTST (r) register accessor: an alias for `Reg`"] +#[doc = "HINTST (r) register accessor: Hibernate Internal Control State Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hintst::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hintst`] +module"] pub type HINTST = crate::Reg; #[doc = "Hibernate Internal Control State Register"] pub mod hintst; -#[doc = "HINTCLR (w) register accessor: an alias for `Reg`"] +#[doc = "HINTCLR (w) register accessor: Hibernate Internal Control Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hintclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hintclr`] +module"] pub type HINTCLR = crate::Reg; #[doc = "Hibernate Internal Control Clear Register"] pub mod hintclr; -#[doc = "HINTSET (w) register accessor: an alias for `Reg`"] +#[doc = "HINTSET (w) register accessor: Hibernate Internal Control Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hintset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hintset`] +module"] 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 3879aad4..ca15b983 100644 --- a/src/scu_hibernate/hdclr.rs +++ b/src/scu_hibernate/hdclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `HDCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Wake-up Pin Event Positive Edge Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum EPEV_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `EPEV` writer - Wake-up Pin Event Positive Edge Clear"] -pub type EPEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, EPEV_AW, O>; -impl<'a, const O: u8> EPEV_W<'a, O> { +pub type EPEV_W<'a, REG> = crate::BitWriter<'a, REG, EPEV_AW>; +impl<'a, REG> EPEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPEV_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `ENEV` writer - Wake-up Pin Event Negative Edge Clear"] -pub type ENEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, ENEV_AW, O>; -impl<'a, const O: u8> ENEV_W<'a, O> { +pub type ENEV_W<'a, REG> = crate::BitWriter<'a, REG, ENEV_AW>; +impl<'a, REG> ENEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENEV_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `RTCEV` writer - RTC Event Clear"] -pub type RTCEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, RTCEV_AW, O>; -impl<'a, const O: u8> RTCEV_W<'a, O> { +pub type RTCEV_W<'a, REG> = crate::BitWriter<'a, REG, RTCEV_AW>; +impl<'a, REG> RTCEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTCEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTCEV_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `ULPWDG` writer - ULP WDG Alarm Clear"] -pub type ULPWDG_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, ULPWDG_AW, O>; -impl<'a, const O: u8> ULPWDG_W<'a, O> { +pub type ULPWDG_W<'a, REG> = crate::BitWriter<'a, REG, ULPWDG_AW>; +impl<'a, REG> ULPWDG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ULPWDG_AW::VALUE1) } #[doc = "Clear watchdog alarm"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ULPWDG_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `VBATPEV` writer - Wake-Up on LPAC Positive Edge of VBAT Threshold Crossing Clear"] -pub type VBATPEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, VBATPEV_AW, O>; -impl<'a, const O: u8> VBATPEV_W<'a, O> { +pub type VBATPEV_W<'a, REG> = crate::BitWriter<'a, REG, VBATPEV_AW>; +impl<'a, REG> VBATPEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATPEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATPEV_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `VBATNEV` writer - Wake-Up on LPAC Negative Edge of VBAT Threshold Crossing Clear"] -pub type VBATNEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, VBATNEV_AW, O>; -impl<'a, const O: u8> VBATNEV_W<'a, O> { +pub type VBATNEV_W<'a, REG> = crate::BitWriter<'a, REG, VBATNEV_AW>; +impl<'a, REG> VBATNEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATNEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATNEV_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO0PEV` writer - Wake-Up on LPAC Positive Edge of HIB_IO_0 Threshold Crossing Clear"] -pub type AHIBIO0PEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, AHIBIO0PEV_AW, O>; -impl<'a, const O: u8> AHIBIO0PEV_W<'a, O> { +pub type AHIBIO0PEV_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0PEV_AW>; +impl<'a, REG> AHIBIO0PEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0PEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0PEV_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO0NEV` writer - Wake-Up on LPAC Negative Edge of HIB_IO_0 Threshold Crossing Clear"] -pub type AHIBIO0NEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, AHIBIO0NEV_AW, O>; -impl<'a, const O: u8> AHIBIO0NEV_W<'a, O> { +pub type AHIBIO0NEV_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0NEV_AW>; +impl<'a, REG> AHIBIO0NEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0NEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0NEV_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO1PEV` writer - Wake-Up on LPAC Positive Edge of HIB_IO_1 Threshold Crossing Clear"] -pub type AHIBIO1PEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, AHIBIO1PEV_AW, O>; -impl<'a, const O: u8> AHIBIO1PEV_W<'a, O> { +pub type AHIBIO1PEV_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1PEV_AW>; +impl<'a, REG> AHIBIO1PEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1PEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1PEV_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO1NEV` writer - Wake-Up on LPAC Negative Edge of HIB_IO_1 Threshold Crossing Clear"] -pub type AHIBIO1NEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCLR_SPEC, AHIBIO1NEV_AW, O>; -impl<'a, const O: u8> AHIBIO1NEV_W<'a, O> { +pub type AHIBIO1NEV_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1NEV_AW>; +impl<'a, REG> AHIBIO1NEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1NEV_AW::VALUE1) } #[doc = "Clear wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1NEV_AW::VALUE2) } } @@ -303,78 +314,81 @@ impl W { #[doc = "Bit 0 - Wake-up Pin Event Positive Edge Clear"] #[inline(always)] #[must_use] - pub fn epev(&mut self) -> EPEV_W<0> { - EPEV_W::new(self) + pub fn epev(&mut self) -> EPEV_W { + EPEV_W::new(self, 0) } #[doc = "Bit 1 - Wake-up Pin Event Negative Edge Clear"] #[inline(always)] #[must_use] - pub fn enev(&mut self) -> ENEV_W<1> { - ENEV_W::new(self) + pub fn enev(&mut self) -> ENEV_W { + ENEV_W::new(self, 1) } #[doc = "Bit 2 - RTC Event Clear"] #[inline(always)] #[must_use] - pub fn rtcev(&mut self) -> RTCEV_W<2> { - RTCEV_W::new(self) + pub fn rtcev(&mut self) -> RTCEV_W { + RTCEV_W::new(self, 2) } #[doc = "Bit 3 - ULP WDG Alarm Clear"] #[inline(always)] #[must_use] - pub fn ulpwdg(&mut self) -> ULPWDG_W<3> { - ULPWDG_W::new(self) + pub fn ulpwdg(&mut self) -> ULPWDG_W { + ULPWDG_W::new(self, 3) } #[doc = "Bit 8 - Wake-Up on LPAC Positive Edge of VBAT Threshold Crossing Clear"] #[inline(always)] #[must_use] - pub fn vbatpev(&mut self) -> VBATPEV_W<8> { - VBATPEV_W::new(self) + pub fn vbatpev(&mut self) -> VBATPEV_W { + VBATPEV_W::new(self, 8) } #[doc = "Bit 9 - Wake-Up on LPAC Negative Edge of VBAT Threshold Crossing Clear"] #[inline(always)] #[must_use] - pub fn vbatnev(&mut self) -> VBATNEV_W<9> { - VBATNEV_W::new(self) + pub fn vbatnev(&mut self) -> VBATNEV_W { + VBATNEV_W::new(self, 9) } #[doc = "Bit 10 - Wake-Up on LPAC Positive Edge of HIB_IO_0 Threshold Crossing Clear"] #[inline(always)] #[must_use] - pub fn ahibio0pev(&mut self) -> AHIBIO0PEV_W<10> { - AHIBIO0PEV_W::new(self) + pub fn ahibio0pev(&mut self) -> AHIBIO0PEV_W { + AHIBIO0PEV_W::new(self, 10) } #[doc = "Bit 11 - Wake-Up on LPAC Negative Edge of HIB_IO_0 Threshold Crossing Clear"] #[inline(always)] #[must_use] - pub fn ahibio0nev(&mut self) -> AHIBIO0NEV_W<11> { - AHIBIO0NEV_W::new(self) + pub fn ahibio0nev(&mut self) -> AHIBIO0NEV_W { + AHIBIO0NEV_W::new(self, 11) } #[doc = "Bit 12 - Wake-Up on LPAC Positive Edge of HIB_IO_1 Threshold Crossing Clear"] #[inline(always)] #[must_use] - pub fn ahibio1pev(&mut self) -> AHIBIO1PEV_W<12> { - AHIBIO1PEV_W::new(self) + pub fn ahibio1pev(&mut self) -> AHIBIO1PEV_W { + AHIBIO1PEV_W::new(self, 12) } #[doc = "Bit 13 - Wake-Up on LPAC Negative Edge of HIB_IO_1 Threshold Crossing Clear"] #[inline(always)] #[must_use] - pub fn ahibio1nev(&mut self) -> AHIBIO1NEV_W<13> { - AHIBIO1NEV_W::new(self) + pub fn ahibio1nev(&mut self) -> AHIBIO1NEV_W { + AHIBIO1NEV_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Hibernate Domain Status Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hdclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HDCLR_SPEC; impl crate::RegisterSpec for HDCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [hdclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`hdclr::W`](W) writer structure"] impl crate::Writable for HDCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/hdcr.rs b/src/scu_hibernate/hdcr.rs index 880a7dfc..b15c9d7a 100644 --- a/src/scu_hibernate/hdcr.rs +++ b/src/scu_hibernate/hdcr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WKPEP` reader - Wake-Up on Pin Event Positive Edge Enable"] pub type WKPEP_R = crate::BitReader; #[doc = "Wake-Up on Pin Event Positive Edge Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl WKPEP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WKPEP_A { + pub const fn variant(&self) -> WKPEP_A { match self.bits { false => WKPEP_A::VALUE1, true => WKPEP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WKPEP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WKPEP_A::VALUE2 } } #[doc = "Field `WKPEP` writer - Wake-Up on Pin Event Positive Edge Enable"] -pub type WKPEP_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, WKPEP_A, O>; -impl<'a, const O: u8> WKPEP_W<'a, O> { +pub type WKPEP_W<'a, REG> = crate::BitWriter<'a, REG, WKPEP_A>; +impl<'a, REG> WKPEP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WKPEP_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WKPEP_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl WKPEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WKPEN_A { + pub const fn variant(&self) -> WKPEN_A { match self.bits { false => WKPEN_A::VALUE1, true => WKPEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WKPEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WKPEN_A::VALUE2 } } #[doc = "Field `WKPEN` writer - Wake-up on Pin Event Negative Edge Enable"] -pub type WKPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, WKPEN_A, O>; -impl<'a, const O: u8> WKPEN_W<'a, O> { +pub type WKPEN_W<'a, REG> = crate::BitWriter<'a, REG, WKPEN_A>; +impl<'a, REG> WKPEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WKPEN_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WKPEN_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl RTCE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTCE_A { + pub const fn variant(&self) -> RTCE_A { match self.bits { false => RTCE_A::VALUE1, true => RTCE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTCE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTCE_A::VALUE2 } } #[doc = "Field `RTCE` writer - Wake-up on RTC Event Enable"] -pub type RTCE_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, RTCE_A, O>; -impl<'a, const O: u8> RTCE_W<'a, O> { +pub type RTCE_W<'a, REG> = crate::BitWriter<'a, REG, RTCE_A>; +impl<'a, REG> RTCE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTCE_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTCE_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl ULPWDGEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ULPWDGEN_A { + pub const fn variant(&self) -> ULPWDGEN_A { match self.bits { false => ULPWDGEN_A::VALUE1, true => ULPWDGEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ULPWDGEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ULPWDGEN_A::VALUE2 } } #[doc = "Field `ULPWDGEN` writer - ULP WDG Alarm Enable"] -pub type ULPWDGEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, ULPWDGEN_A, O>; -impl<'a, const O: u8> ULPWDGEN_W<'a, O> { +pub type ULPWDGEN_W<'a, REG> = crate::BitWriter<'a, REG, ULPWDGEN_A>; +impl<'a, REG> ULPWDGEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ULPWDGEN_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ULPWDGEN_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl HIB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIB_A { + pub const fn variant(&self) -> HIB_A { match self.bits { false => HIB_A::VALUE1, true => HIB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External hibernate request inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "External hibernate request active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIB_A::VALUE2 } } #[doc = "Field `HIB` writer - Hibernate Request Value Set"] -pub type HIB_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, HIB_A, O>; -impl<'a, const O: u8> HIB_W<'a, O> { +pub type HIB_W<'a, REG> = crate::BitWriter<'a, REG, HIB_A>; +impl<'a, REG> HIB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External hibernate request inactive"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIB_A::VALUE1) } #[doc = "External hibernate request active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIB_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl XTALGPI1SEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XTALGPI1SEL_A { + pub const fn variant(&self) -> XTALGPI1SEL_A { match self.bits { false => XTALGPI1SEL_A::VALUE1, true => XTALGPI1SEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "RTC_XTAL_1 input selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XTALGPI1SEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Analog comparator output for HIB_IO_1 or pre-selected digital IO input"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XTALGPI1SEL_A::VALUE2 } } #[doc = "Field `XTALGPI1SEL` writer - Multiplex Control for RTC_XTAL_1 Select as GPI Input"] -pub type XTALGPI1SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, XTALGPI1SEL_A, O>; -impl<'a, const O: u8> XTALGPI1SEL_W<'a, O> { +pub type XTALGPI1SEL_W<'a, REG> = crate::BitWriter<'a, REG, XTALGPI1SEL_A>; +impl<'a, REG> XTALGPI1SEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "RTC_XTAL_1 input selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XTALGPI1SEL_A::VALUE1) } #[doc = "Analog comparator output for HIB_IO_1 or pre-selected digital IO input"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XTALGPI1SEL_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl RCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RCS_A { + pub const fn variant(&self) -> RCS_A { match self.bits { false => RCS_A::VALUE1, true => RCS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOSI selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fULP selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RCS_A::VALUE2 } } #[doc = "Field `RCS` writer - fRTC Clock Selection"] -pub type RCS_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, RCS_A, O>; -impl<'a, const O: u8> RCS_W<'a, O> { +pub type RCS_W<'a, REG> = crate::BitWriter<'a, REG, RCS_A>; +impl<'a, REG> RCS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fOSI selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RCS_A::VALUE1) } #[doc = "fULP selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RCS_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl STDBYSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STDBYSEL_A { + pub const fn variant(&self) -> STDBYSEL_A { match self.bits { false => STDBYSEL_A::VALUE1, true => STDBYSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOSI selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STDBYSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fULP selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STDBYSEL_A::VALUE2 } } #[doc = "Field `STDBYSEL` writer - fSTDBY Clock Selection"] -pub type STDBYSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, STDBYSEL_A, O>; -impl<'a, const O: u8> STDBYSEL_W<'a, O> { +pub type STDBYSEL_W<'a, REG> = crate::BitWriter<'a, REG, STDBYSEL_A>; +impl<'a, REG> STDBYSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "fOSI selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STDBYSEL_A::VALUE1) } #[doc = "fULP selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STDBYSEL_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl WKUPSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WKUPSEL_A { + pub const fn variant(&self) -> WKUPSEL_A { match self.bits { false => WKUPSEL_A::VALUE1, true => WKUPSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HIB_IO_1 pin selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WKUPSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HIB_IO_0 pin selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WKUPSEL_A::VALUE2 } } #[doc = "Field `WKUPSEL` writer - Wake-Up from Hibernate Trigger Input Selection"] -pub type WKUPSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, WKUPSEL_A, O>; -impl<'a, const O: u8> WKUPSEL_W<'a, O> { +pub type WKUPSEL_W<'a, REG> = crate::BitWriter<'a, REG, WKUPSEL_A>; +impl<'a, REG> WKUPSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HIB_IO_1 pin selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WKUPSEL_A::VALUE1) } #[doc = "HIB_IO_0 pin selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WKUPSEL_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl GPI0SEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GPI0SEL_A { + pub const fn variant(&self) -> GPI0SEL_A { match self.bits { false => GPI0SEL_A::VALUE1, true => GPI0SEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HIB_IO_1 pin selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GPI0SEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HIB_IO_0 pin selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GPI0SEL_A::VALUE2 } } #[doc = "Field `GPI0SEL` writer - General Purpose Input 0 Selection"] -pub type GPI0SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, GPI0SEL_A, O>; -impl<'a, const O: u8> GPI0SEL_W<'a, O> { +pub type GPI0SEL_W<'a, REG> = crate::BitWriter<'a, REG, GPI0SEL_A>; +impl<'a, REG> GPI0SEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HIB_IO_1 pin selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GPI0SEL_A::VALUE1) } #[doc = "HIB_IO_0 pin selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GPI0SEL_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl GPI1SEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GPI1SEL_A { + pub const fn variant(&self) -> GPI1SEL_A { match self.bits { false => GPI1SEL_A::VALUE1, true => GPI1SEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HIB_IO_1 pin selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GPI1SEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HIB_IO_0 pin selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GPI1SEL_A::VALUE2 } } #[doc = "Field `GPI1SEL` writer - General Purpose Input 1 Selection"] -pub type GPI1SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, GPI1SEL_A, O>; -impl<'a, const O: u8> GPI1SEL_W<'a, O> { +pub type GPI1SEL_W<'a, REG> = crate::BitWriter<'a, REG, GPI1SEL_A>; +impl<'a, REG> GPI1SEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HIB_IO_1 pin selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GPI1SEL_A::VALUE1) } #[doc = "HIB_IO_0 pin selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GPI1SEL_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl HIBIO0POL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIBIO0POL_A { + pub const fn variant(&self) -> HIBIO0POL_A { match self.bits { false => HIBIO0POL_A::VALUE1, true => HIBIO0POL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Direct value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBIO0POL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Inverted value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBIO0POL_A::VALUE2 } } #[doc = "Field `HIBIO0POL` writer - HIBIO0 Polarity Set"] -pub type HIBIO0POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, HIBIO0POL_A, O>; -impl<'a, const O: u8> HIBIO0POL_W<'a, O> { +pub type HIBIO0POL_W<'a, REG> = crate::BitWriter<'a, REG, HIBIO0POL_A>; +impl<'a, REG> HIBIO0POL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Direct value"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBIO0POL_A::VALUE1) } #[doc = "Inverted value"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBIO0POL_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl HIBIO1POL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIBIO1POL_A { + pub const fn variant(&self) -> HIBIO1POL_A { match self.bits { false => HIBIO1POL_A::VALUE1, true => HIBIO1POL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Direct value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBIO1POL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Inverted value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBIO1POL_A::VALUE2 } } #[doc = "Field `HIBIO1POL` writer - HIBIO1 Polarity Set"] -pub type HIBIO1POL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, HIBIO1POL_A, O>; -impl<'a, const O: u8> HIBIO1POL_W<'a, O> { +pub type HIBIO1POL_W<'a, REG> = crate::BitWriter<'a, REG, HIBIO1POL_A>; +impl<'a, REG> HIBIO1POL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Direct value"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBIO1POL_A::VALUE1) } #[doc = "Inverted value"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBIO1POL_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl ADIG0SEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ADIG0SEL_A { + pub const fn variant(&self) -> ADIG0SEL_A { match self.bits { false => ADIG0SEL_A::VALUE1, true => ADIG0SEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital input"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ADIG0SEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Analog comparator result for HIB_IO_0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ADIG0SEL_A::VALUE2 } } #[doc = "Field `ADIG0SEL` writer - Select Analog Channel 0 or Digital Output Path"] -pub type ADIG0SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, ADIG0SEL_A, O>; -impl<'a, const O: u8> ADIG0SEL_W<'a, O> { +pub type ADIG0SEL_W<'a, REG> = crate::BitWriter<'a, REG, ADIG0SEL_A>; +impl<'a, REG> ADIG0SEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital input"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ADIG0SEL_A::VALUE1) } #[doc = "Analog comparator result for HIB_IO_0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ADIG0SEL_A::VALUE2) } } @@ -753,39 +763,42 @@ impl From for bool { impl ADIG1SEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ADIG1SEL_A { + pub const fn variant(&self) -> ADIG1SEL_A { match self.bits { false => ADIG1SEL_A::VALUE1, true => ADIG1SEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Digital input"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ADIG1SEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Analog comparator result for HIB_IO_1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ADIG1SEL_A::VALUE2 } } #[doc = "Field `ADIG1SEL` writer - Select Analog Channel 1 or Digital Output Path"] -pub type ADIG1SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, ADIG1SEL_A, O>; -impl<'a, const O: u8> ADIG1SEL_W<'a, O> { +pub type ADIG1SEL_W<'a, REG> = crate::BitWriter<'a, REG, ADIG1SEL_A>; +impl<'a, REG> ADIG1SEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Digital input"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ADIG1SEL_A::VALUE1) } #[doc = "Analog comparator result for HIB_IO_1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ADIG1SEL_A::VALUE2) } } #[doc = "Field `HIBIO0SEL` reader - HIB_IO_0 Pin I/O Control (default HIBOUT)"] -pub type HIBIO0SEL_R = crate::FieldReader; +pub type HIBIO0SEL_R = crate::FieldReader; #[doc = "HIB_IO_0 Pin I/O Control (default HIBOUT)\n\nValue on reset: 12"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -817,10 +830,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HIBIO0SEL_A { + type Ux = u8; +} impl HIBIO0SEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HIBIO0SEL_A::VALUE1), 1 => Some(HIBIO0SEL_A::VALUE2), @@ -835,113 +851,117 @@ impl HIBIO0SEL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Direct input, No input pull device connected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBIO0SEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Direct input, Input pull-down device connected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBIO0SEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Direct input, Input pull-up device connected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HIBIO0SEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Push-pull HIB Control output"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == HIBIO0SEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Push-pull WDT service output"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == HIBIO0SEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Push-pull GPIO output"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == HIBIO0SEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Open-drain HIB Control output"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == HIBIO0SEL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Open-drain WDT service output"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == HIBIO0SEL_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Open-drain GPIO output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == HIBIO0SEL_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Analog input"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == HIBIO0SEL_A::VALUE10 } } #[doc = "Field `HIBIO0SEL` writer - HIB_IO_0 Pin I/O Control (default HIBOUT)"] -pub type HIBIO0SEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HDCR_SPEC, u8, HIBIO0SEL_A, 4, O>; -impl<'a, const O: u8> HIBIO0SEL_W<'a, O> { +pub type HIBIO0SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4, HIBIO0SEL_A>; +impl<'a, REG> HIBIO0SEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Direct input, No input pull device connected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE1) } #[doc = "Direct input, Input pull-down device connected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE2) } #[doc = "Direct input, Input pull-up device connected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE3) } #[doc = "Push-pull HIB Control output"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE4) } #[doc = "Push-pull WDT service output"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE5) } #[doc = "Push-pull GPIO output"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE6) } #[doc = "Open-drain HIB Control output"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE7) } #[doc = "Open-drain WDT service output"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE8) } #[doc = "Open-drain GPIO output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE9) } #[doc = "Analog input"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(HIBIO0SEL_A::VALUE10) } } #[doc = "Field `HIBIO1SEL` reader - HIB_IO_1 Pin I/O Control (Default WKUP)"] -pub type HIBIO1SEL_R = crate::FieldReader; +pub type HIBIO1SEL_R = crate::FieldReader; #[doc = "HIB_IO_1 Pin I/O Control (Default WKUP)\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -973,10 +993,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HIBIO1SEL_A { + type Ux = u8; +} impl HIBIO1SEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HIBIO1SEL_A::VALUE1), 1 => Some(HIBIO1SEL_A::VALUE2), @@ -991,108 +1014,112 @@ impl HIBIO1SEL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Direct input, No input pull device connected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBIO1SEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Direct input, Input pull-down device connected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBIO1SEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Direct input, Input pull-up device connected"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HIBIO1SEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Push-pull HIB Control output"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == HIBIO1SEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Push-pull WDT service output"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == HIBIO1SEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Push-pull GPIO output"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == HIBIO1SEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Open-drain HIB Control output"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == HIBIO1SEL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Open-drain WDT service output"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == HIBIO1SEL_A::VALUE8 } - #[doc = "Checks if the value of the field is `VALUE9`"] + #[doc = "Open-drain GPIO output"] #[inline(always)] pub fn is_value9(&self) -> bool { *self == HIBIO1SEL_A::VALUE9 } - #[doc = "Checks if the value of the field is `VALUE10`"] + #[doc = "Analog input"] #[inline(always)] pub fn is_value10(&self) -> bool { *self == HIBIO1SEL_A::VALUE10 } } #[doc = "Field `HIBIO1SEL` writer - HIB_IO_1 Pin I/O Control (Default WKUP)"] -pub type HIBIO1SEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HDCR_SPEC, u8, HIBIO1SEL_A, 4, O>; -impl<'a, const O: u8> HIBIO1SEL_W<'a, O> { +pub type HIBIO1SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4, HIBIO1SEL_A>; +impl<'a, REG> HIBIO1SEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Direct input, No input pull device connected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE1) } #[doc = "Direct input, Input pull-down device connected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE2) } #[doc = "Direct input, Input pull-up device connected"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE3) } #[doc = "Push-pull HIB Control output"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE4) } #[doc = "Push-pull WDT service output"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE5) } #[doc = "Push-pull GPIO output"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE6) } #[doc = "Open-drain HIB Control output"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE7) } #[doc = "Open-drain WDT service output"] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE8) } #[doc = "Open-drain GPIO output"] #[inline(always)] - pub fn value9(self) -> &'a mut W { + pub fn value9(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE9) } #[doc = "Analog input"] #[inline(always)] - pub fn value10(self) -> &'a mut W { + pub fn value10(self) -> &'a mut crate::W { self.variant(HIBIO1SEL_A::VALUE10) } } @@ -1115,34 +1142,37 @@ impl From for bool { impl VBATLO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VBATLO_A { + pub const fn variant(&self) -> VBATLO_A { match self.bits { false => VBATLO_A::VALUE1, true => VBATLO_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VBATLO_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VBATLO_A::VALUE2 } } #[doc = "Field `VBATLO` writer - Wake-Up on VBAT Falling Below Threshold Enable"] -pub type VBATLO_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, VBATLO_A, O>; -impl<'a, const O: u8> VBATLO_W<'a, O> { +pub type VBATLO_W<'a, REG> = crate::BitWriter<'a, REG, VBATLO_A>; +impl<'a, REG> VBATLO_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATLO_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATLO_A::VALUE2) } } @@ -1165,34 +1195,37 @@ impl From for bool { impl VBATHI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VBATHI_A { + pub const fn variant(&self) -> VBATHI_A { match self.bits { false => VBATHI_A::VALUE1, true => VBATHI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VBATHI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VBATHI_A::VALUE2 } } #[doc = "Field `VBATHI` writer - Wake-Up on VBAT Rising Above Threshold Enable"] -pub type VBATHI_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, VBATHI_A, O>; -impl<'a, const O: u8> VBATHI_W<'a, O> { +pub type VBATHI_W<'a, REG> = crate::BitWriter<'a, REG, VBATHI_A>; +impl<'a, REG> VBATHI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATHI_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATHI_A::VALUE2) } } @@ -1215,34 +1248,37 @@ impl From for bool { impl AHIBIO0LO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO0LO_A { + pub const fn variant(&self) -> AHIBIO0LO_A { match self.bits { false => AHIBIO0LO_A::VALUE1, true => AHIBIO0LO_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO0LO_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO0LO_A::VALUE2 } } #[doc = "Field `AHIBIO0LO` writer - Wake-Up on Analog HIB_IO_0 Falling Below Threshold Enable"] -pub type AHIBIO0LO_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, AHIBIO0LO_A, O>; -impl<'a, const O: u8> AHIBIO0LO_W<'a, O> { +pub type AHIBIO0LO_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0LO_A>; +impl<'a, REG> AHIBIO0LO_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0LO_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0LO_A::VALUE2) } } @@ -1265,34 +1301,37 @@ impl From for bool { impl AHIBIO0HI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO0HI_A { + pub const fn variant(&self) -> AHIBIO0HI_A { match self.bits { false => AHIBIO0HI_A::VALUE1, true => AHIBIO0HI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO0HI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO0HI_A::VALUE2 } } #[doc = "Field `AHIBIO0HI` writer - Wake-Up on Analog HIB_IO_0 Rising Above Threshold Enable"] -pub type AHIBIO0HI_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, AHIBIO0HI_A, O>; -impl<'a, const O: u8> AHIBIO0HI_W<'a, O> { +pub type AHIBIO0HI_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0HI_A>; +impl<'a, REG> AHIBIO0HI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0HI_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0HI_A::VALUE2) } } @@ -1315,34 +1354,37 @@ impl From for bool { impl AHIBIO1LO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO1LO_A { + pub const fn variant(&self) -> AHIBIO1LO_A { match self.bits { false => AHIBIO1LO_A::VALUE1, true => AHIBIO1LO_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO1LO_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO1LO_A::VALUE2 } } #[doc = "Field `AHIBIO1LO` writer - Wake-Up on Analog HIB_IO_1 Falling Below Threshold Enable"] -pub type AHIBIO1LO_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, AHIBIO1LO_A, O>; -impl<'a, const O: u8> AHIBIO1LO_W<'a, O> { +pub type AHIBIO1LO_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1LO_A>; +impl<'a, REG> AHIBIO1LO_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1LO_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1LO_A::VALUE2) } } @@ -1365,34 +1407,37 @@ impl From for bool { impl AHIBIO1HI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO1HI_A { + pub const fn variant(&self) -> AHIBIO1HI_A { match self.bits { false => AHIBIO1HI_A::VALUE1, true => AHIBIO1HI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up event disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO1HI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO1HI_A::VALUE2 } } #[doc = "Field `AHIBIO1HI` writer - Wake-Up on Analog HIB_IO_1 Rising Above Threshold Enable"] -pub type AHIBIO1HI_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDCR_SPEC, AHIBIO1HI_A, O>; -impl<'a, const O: u8> AHIBIO1HI_W<'a, O> { +pub type AHIBIO1HI_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1HI_A>; +impl<'a, REG> AHIBIO1HI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wake-up event disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1HI_A::VALUE1) } #[doc = "Wake-up event enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1HI_A::VALUE2) } } @@ -1517,160 +1562,161 @@ impl W { #[doc = "Bit 0 - Wake-Up on Pin Event Positive Edge Enable"] #[inline(always)] #[must_use] - pub fn wkpep(&mut self) -> WKPEP_W<0> { - WKPEP_W::new(self) + pub fn wkpep(&mut self) -> WKPEP_W { + WKPEP_W::new(self, 0) } #[doc = "Bit 1 - Wake-up on Pin Event Negative Edge Enable"] #[inline(always)] #[must_use] - pub fn wkpen(&mut self) -> WKPEN_W<1> { - WKPEN_W::new(self) + pub fn wkpen(&mut self) -> WKPEN_W { + WKPEN_W::new(self, 1) } #[doc = "Bit 2 - Wake-up on RTC Event Enable"] #[inline(always)] #[must_use] - pub fn rtce(&mut self) -> RTCE_W<2> { - RTCE_W::new(self) + pub fn rtce(&mut self) -> RTCE_W { + RTCE_W::new(self, 2) } #[doc = "Bit 3 - ULP WDG Alarm Enable"] #[inline(always)] #[must_use] - pub fn ulpwdgen(&mut self) -> ULPWDGEN_W<3> { - ULPWDGEN_W::new(self) + pub fn ulpwdgen(&mut self) -> ULPWDGEN_W { + ULPWDGEN_W::new(self, 3) } #[doc = "Bit 4 - Hibernate Request Value Set"] #[inline(always)] #[must_use] - pub fn hib(&mut self) -> HIB_W<4> { - HIB_W::new(self) + pub fn hib(&mut self) -> HIB_W { + HIB_W::new(self, 4) } #[doc = "Bit 5 - Multiplex Control for RTC_XTAL_1 Select as GPI Input"] #[inline(always)] #[must_use] - pub fn xtalgpi1sel(&mut self) -> XTALGPI1SEL_W<5> { - XTALGPI1SEL_W::new(self) + pub fn xtalgpi1sel(&mut self) -> XTALGPI1SEL_W { + XTALGPI1SEL_W::new(self, 5) } #[doc = "Bit 6 - fRTC Clock Selection"] #[inline(always)] #[must_use] - pub fn rcs(&mut self) -> RCS_W<6> { - RCS_W::new(self) + pub fn rcs(&mut self) -> RCS_W { + RCS_W::new(self, 6) } #[doc = "Bit 7 - fSTDBY Clock Selection"] #[inline(always)] #[must_use] - pub fn stdbysel(&mut self) -> STDBYSEL_W<7> { - STDBYSEL_W::new(self) + pub fn stdbysel(&mut self) -> STDBYSEL_W { + STDBYSEL_W::new(self, 7) } #[doc = "Bit 8 - Wake-Up from Hibernate Trigger Input Selection"] #[inline(always)] #[must_use] - pub fn wkupsel(&mut self) -> WKUPSEL_W<8> { - WKUPSEL_W::new(self) + pub fn wkupsel(&mut self) -> WKUPSEL_W { + WKUPSEL_W::new(self, 8) } #[doc = "Bit 10 - General Purpose Input 0 Selection"] #[inline(always)] #[must_use] - pub fn gpi0sel(&mut self) -> GPI0SEL_W<10> { - GPI0SEL_W::new(self) + pub fn gpi0sel(&mut self) -> GPI0SEL_W { + GPI0SEL_W::new(self, 10) } #[doc = "Bit 11 - General Purpose Input 1 Selection"] #[inline(always)] #[must_use] - pub fn gpi1sel(&mut self) -> GPI1SEL_W<11> { - GPI1SEL_W::new(self) + pub fn gpi1sel(&mut self) -> GPI1SEL_W { + GPI1SEL_W::new(self, 11) } #[doc = "Bit 12 - HIBIO0 Polarity Set"] #[inline(always)] #[must_use] - pub fn hibio0pol(&mut self) -> HIBIO0POL_W<12> { - HIBIO0POL_W::new(self) + pub fn hibio0pol(&mut self) -> HIBIO0POL_W { + HIBIO0POL_W::new(self, 12) } #[doc = "Bit 13 - HIBIO1 Polarity Set"] #[inline(always)] #[must_use] - pub fn hibio1pol(&mut self) -> HIBIO1POL_W<13> { - HIBIO1POL_W::new(self) + pub fn hibio1pol(&mut self) -> HIBIO1POL_W { + HIBIO1POL_W::new(self, 13) } #[doc = "Bit 14 - Select Analog Channel 0 or Digital Output Path"] #[inline(always)] #[must_use] - pub fn adig0sel(&mut self) -> ADIG0SEL_W<14> { - ADIG0SEL_W::new(self) + pub fn adig0sel(&mut self) -> ADIG0SEL_W { + ADIG0SEL_W::new(self, 14) } #[doc = "Bit 15 - Select Analog Channel 1 or Digital Output Path"] #[inline(always)] #[must_use] - pub fn adig1sel(&mut self) -> ADIG1SEL_W<15> { - ADIG1SEL_W::new(self) + pub fn adig1sel(&mut self) -> ADIG1SEL_W { + ADIG1SEL_W::new(self, 15) } #[doc = "Bits 16:19 - HIB_IO_0 Pin I/O Control (default HIBOUT)"] #[inline(always)] #[must_use] - pub fn hibio0sel(&mut self) -> HIBIO0SEL_W<16> { - HIBIO0SEL_W::new(self) + pub fn hibio0sel(&mut self) -> HIBIO0SEL_W { + HIBIO0SEL_W::new(self, 16) } #[doc = "Bits 20:23 - HIB_IO_1 Pin I/O Control (Default WKUP)"] #[inline(always)] #[must_use] - pub fn hibio1sel(&mut self) -> HIBIO1SEL_W<20> { - HIBIO1SEL_W::new(self) + pub fn hibio1sel(&mut self) -> HIBIO1SEL_W { + HIBIO1SEL_W::new(self, 20) } #[doc = "Bit 24 - Wake-Up on VBAT Falling Below Threshold Enable"] #[inline(always)] #[must_use] - pub fn vbatlo(&mut self) -> VBATLO_W<24> { - VBATLO_W::new(self) + pub fn vbatlo(&mut self) -> VBATLO_W { + VBATLO_W::new(self, 24) } #[doc = "Bit 25 - Wake-Up on VBAT Rising Above Threshold Enable"] #[inline(always)] #[must_use] - pub fn vbathi(&mut self) -> VBATHI_W<25> { - VBATHI_W::new(self) + pub fn vbathi(&mut self) -> VBATHI_W { + VBATHI_W::new(self, 25) } #[doc = "Bit 26 - Wake-Up on Analog HIB_IO_0 Falling Below Threshold Enable"] #[inline(always)] #[must_use] - pub fn ahibio0lo(&mut self) -> AHIBIO0LO_W<26> { - AHIBIO0LO_W::new(self) + pub fn ahibio0lo(&mut self) -> AHIBIO0LO_W { + AHIBIO0LO_W::new(self, 26) } #[doc = "Bit 27 - Wake-Up on Analog HIB_IO_0 Rising Above Threshold Enable"] #[inline(always)] #[must_use] - pub fn ahibio0hi(&mut self) -> AHIBIO0HI_W<27> { - AHIBIO0HI_W::new(self) + pub fn ahibio0hi(&mut self) -> AHIBIO0HI_W { + AHIBIO0HI_W::new(self, 27) } #[doc = "Bit 28 - Wake-Up on Analog HIB_IO_1 Falling Below Threshold Enable"] #[inline(always)] #[must_use] - pub fn ahibio1lo(&mut self) -> AHIBIO1LO_W<28> { - AHIBIO1LO_W::new(self) + pub fn ahibio1lo(&mut self) -> AHIBIO1LO_W { + AHIBIO1LO_W::new(self, 28) } #[doc = "Bit 29 - Wake-Up on Analog HIB_IO_1 Rising Above Threshold Enable"] #[inline(always)] #[must_use] - pub fn ahibio1hi(&mut self) -> AHIBIO1HI_W<29> { - AHIBIO1HI_W::new(self) + pub fn ahibio1hi(&mut self) -> AHIBIO1HI_W { + AHIBIO1HI_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Hibernate Domain Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hdcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hdcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`hdcr::R`](R) reader structure"] +impl crate::Readable for HDCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hdcr::W`](W) writer structure"] impl crate::Writable for HDCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/hdset.rs b/src/scu_hibernate/hdset.rs index c33f8f81..7181a73e 100644 --- a/src/scu_hibernate/hdset.rs +++ b/src/scu_hibernate/hdset.rs @@ -1,24 +1,5 @@ #[doc = "Register `HDSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Wake-up Pin Event Positive Edge Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum EPEV_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `EPEV` writer - Wake-up Pin Event Positive Edge Set"] -pub type EPEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, EPEV_AW, O>; -impl<'a, const O: u8> EPEV_W<'a, O> { +pub type EPEV_W<'a, REG> = crate::BitWriter<'a, REG, EPEV_AW>; +impl<'a, REG> EPEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPEV_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `ENEV` writer - Wake-up Pin Event Negative Edge Set"] -pub type ENEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, ENEV_AW, O>; -impl<'a, const O: u8> ENEV_W<'a, O> { +pub type ENEV_W<'a, REG> = crate::BitWriter<'a, REG, ENEV_AW>; +impl<'a, REG> ENEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENEV_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `RTCEV` writer - RTC Event Set"] -pub type RTCEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, RTCEV_AW, O>; -impl<'a, const O: u8> RTCEV_W<'a, O> { +pub type RTCEV_W<'a, REG> = crate::BitWriter<'a, REG, RTCEV_AW>; +impl<'a, REG> RTCEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTCEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTCEV_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `ULPWDG` writer - ULP WDG Alarm Set"] -pub type ULPWDG_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, ULPWDG_AW, O>; -impl<'a, const O: u8> ULPWDG_W<'a, O> { +pub type ULPWDG_W<'a, REG> = crate::BitWriter<'a, REG, ULPWDG_AW>; +impl<'a, REG> ULPWDG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ULPWDG_AW::VALUE1) } #[doc = "Set watchdog alarm"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ULPWDG_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `VBATPEV` writer - Wake-Up on LPAC Positive Edge of VBAT Threshold Crossing Set"] -pub type VBATPEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, VBATPEV_AW, O>; -impl<'a, const O: u8> VBATPEV_W<'a, O> { +pub type VBATPEV_W<'a, REG> = crate::BitWriter<'a, REG, VBATPEV_AW>; +impl<'a, REG> VBATPEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATPEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATPEV_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `VBATNEV` writer - Wake-Up on LPAC Negative Edge of VBAT Threshold Crossing Set"] -pub type VBATNEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, VBATNEV_AW, O>; -impl<'a, const O: u8> VBATNEV_W<'a, O> { +pub type VBATNEV_W<'a, REG> = crate::BitWriter<'a, REG, VBATNEV_AW>; +impl<'a, REG> VBATNEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATNEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATNEV_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO0PEV` writer - Wake-Up on LPAC Positive Edge of HIB_IO_0 Threshold Crossing Set"] -pub type AHIBIO0PEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, AHIBIO0PEV_AW, O>; -impl<'a, const O: u8> AHIBIO0PEV_W<'a, O> { +pub type AHIBIO0PEV_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0PEV_AW>; +impl<'a, REG> AHIBIO0PEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0PEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0PEV_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO0NEV` writer - Wake-Up on LPAC Negative Edge of HIB_IO_0 Threshold Crossing Set"] -pub type AHIBIO0NEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, AHIBIO0NEV_AW, O>; -impl<'a, const O: u8> AHIBIO0NEV_W<'a, O> { +pub type AHIBIO0NEV_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0NEV_AW>; +impl<'a, REG> AHIBIO0NEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0NEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0NEV_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO1PEV` writer - Wake-Up on LPAC Positive Edge of HIB_IO_1 Threshold Crossing Set"] -pub type AHIBIO1PEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, AHIBIO1PEV_AW, O>; -impl<'a, const O: u8> AHIBIO1PEV_W<'a, O> { +pub type AHIBIO1PEV_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1PEV_AW>; +impl<'a, REG> AHIBIO1PEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1PEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1PEV_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO1NEV` writer - Wake-Up on LPAC Negative Edge of HIB_IO_1 Threshold Crossing Set"] -pub type AHIBIO1NEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, HDSET_SPEC, AHIBIO1NEV_AW, O>; -impl<'a, const O: u8> AHIBIO1NEV_W<'a, O> { +pub type AHIBIO1NEV_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1NEV_AW>; +impl<'a, REG> AHIBIO1NEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1NEV_AW::VALUE1) } #[doc = "Set wake-up event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1NEV_AW::VALUE2) } } @@ -303,78 +314,81 @@ impl W { #[doc = "Bit 0 - Wake-up Pin Event Positive Edge Set"] #[inline(always)] #[must_use] - pub fn epev(&mut self) -> EPEV_W<0> { - EPEV_W::new(self) + pub fn epev(&mut self) -> EPEV_W { + EPEV_W::new(self, 0) } #[doc = "Bit 1 - Wake-up Pin Event Negative Edge Set"] #[inline(always)] #[must_use] - pub fn enev(&mut self) -> ENEV_W<1> { - ENEV_W::new(self) + pub fn enev(&mut self) -> ENEV_W { + ENEV_W::new(self, 1) } #[doc = "Bit 2 - RTC Event Set"] #[inline(always)] #[must_use] - pub fn rtcev(&mut self) -> RTCEV_W<2> { - RTCEV_W::new(self) + pub fn rtcev(&mut self) -> RTCEV_W { + RTCEV_W::new(self, 2) } #[doc = "Bit 3 - ULP WDG Alarm Set"] #[inline(always)] #[must_use] - pub fn ulpwdg(&mut self) -> ULPWDG_W<3> { - ULPWDG_W::new(self) + pub fn ulpwdg(&mut self) -> ULPWDG_W { + ULPWDG_W::new(self, 3) } #[doc = "Bit 8 - Wake-Up on LPAC Positive Edge of VBAT Threshold Crossing Set"] #[inline(always)] #[must_use] - pub fn vbatpev(&mut self) -> VBATPEV_W<8> { - VBATPEV_W::new(self) + pub fn vbatpev(&mut self) -> VBATPEV_W { + VBATPEV_W::new(self, 8) } #[doc = "Bit 9 - Wake-Up on LPAC Negative Edge of VBAT Threshold Crossing Set"] #[inline(always)] #[must_use] - pub fn vbatnev(&mut self) -> VBATNEV_W<9> { - VBATNEV_W::new(self) + pub fn vbatnev(&mut self) -> VBATNEV_W { + VBATNEV_W::new(self, 9) } #[doc = "Bit 10 - Wake-Up on LPAC Positive Edge of HIB_IO_0 Threshold Crossing Set"] #[inline(always)] #[must_use] - pub fn ahibio0pev(&mut self) -> AHIBIO0PEV_W<10> { - AHIBIO0PEV_W::new(self) + pub fn ahibio0pev(&mut self) -> AHIBIO0PEV_W { + AHIBIO0PEV_W::new(self, 10) } #[doc = "Bit 11 - Wake-Up on LPAC Negative Edge of HIB_IO_0 Threshold Crossing Set"] #[inline(always)] #[must_use] - pub fn ahibio0nev(&mut self) -> AHIBIO0NEV_W<11> { - AHIBIO0NEV_W::new(self) + pub fn ahibio0nev(&mut self) -> AHIBIO0NEV_W { + AHIBIO0NEV_W::new(self, 11) } #[doc = "Bit 12 - Wake-Up on LPAC Positive Edge of HIB_IO_1 Threshold Crossing Set"] #[inline(always)] #[must_use] - pub fn ahibio1pev(&mut self) -> AHIBIO1PEV_W<12> { - AHIBIO1PEV_W::new(self) + pub fn ahibio1pev(&mut self) -> AHIBIO1PEV_W { + AHIBIO1PEV_W::new(self, 12) } #[doc = "Bit 13 - Wake-Up on LPAC Negative Edge of HIB_IO_1 Threshold Crossing Set"] #[inline(always)] #[must_use] - pub fn ahibio1nev(&mut self) -> AHIBIO1NEV_W<13> { - AHIBIO1NEV_W::new(self) + pub fn ahibio1nev(&mut self) -> AHIBIO1NEV_W { + AHIBIO1NEV_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Hibernate Domain Status Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hdset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HDSET_SPEC; impl crate::RegisterSpec for HDSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [hdset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`hdset::W`](W) writer structure"] impl crate::Writable for HDSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/hdstat.rs b/src/scu_hibernate/hdstat.rs index 8e198849..4f775c14 100644 --- a/src/scu_hibernate/hdstat.rs +++ b/src/scu_hibernate/hdstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `EPEV` reader - Wake-up Pin Event Positive Edge"] pub type EPEV_R = crate::BitReader; #[doc = "Wake-up Pin Event Positive Edge\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl EPEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPEV_A { + pub const fn variant(&self) -> EPEV_A { match self.bits { false => EPEV_A::VALUE1, true => EPEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on positive edge pin event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on positive edge pin event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPEV_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl ENEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENEV_A { + pub const fn variant(&self) -> ENEV_A { match self.bits { false => ENEV_A::VALUE1, true => ENEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on negative edge pin event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on negative edge pin event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENEV_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl RTCEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTCEV_A { + pub const fn variant(&self) -> RTCEV_A { match self.bits { false => RTCEV_A::VALUE1, true => RTCEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on RTC event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTCEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on RTC event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTCEV_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl ULPWDG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ULPWDG_A { + pub const fn variant(&self) -> ULPWDG_A { match self.bits { false => ULPWDG_A::VALUE1, true => ULPWDG_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Watchdog alarm did not occur"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ULPWDG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Watchdog alarm occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ULPWDG_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl HIBNOUT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIBNOUT_A { + pub const fn variant(&self) -> HIBNOUT_A { match self.bits { false => HIBNOUT_A::VALUE1, true => HIBNOUT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Hibernate not driven active to pads"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBNOUT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Hibernate driven active to pads"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBNOUT_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl VBATPEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VBATPEV_A { + pub const fn variant(&self) -> VBATPEV_A { match self.bits { false => VBATPEV_A::VALUE1, true => VBATPEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on rising above threshold event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VBATPEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on rising above threshold event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VBATPEV_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl VBATNEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VBATNEV_A { + pub const fn variant(&self) -> VBATNEV_A { match self.bits { false => VBATNEV_A::VALUE1, true => VBATNEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on falling below threshold event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VBATNEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on falling below threshold event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VBATNEV_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl AHIBIO0PEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO0PEV_A { + pub const fn variant(&self) -> AHIBIO0PEV_A { match self.bits { false => AHIBIO0PEV_A::VALUE1, true => AHIBIO0PEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on rising above threshold event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO0PEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on rising above threshold event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO0PEV_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl AHIBIO0NEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO0NEV_A { + pub const fn variant(&self) -> AHIBIO0NEV_A { match self.bits { false => AHIBIO0NEV_A::VALUE1, true => AHIBIO0NEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on falling below threshold event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO0NEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on falling below threshold event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO0NEV_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl AHIBIO1PEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO1PEV_A { + pub const fn variant(&self) -> AHIBIO1PEV_A { match self.bits { false => AHIBIO1PEV_A::VALUE1, true => AHIBIO1PEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on rising above threshold event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO1PEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on rising above threshold event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO1PEV_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl AHIBIO1NEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO1NEV_A { + pub const fn variant(&self) -> AHIBIO1NEV_A { match self.bits { false => AHIBIO1NEV_A::VALUE1, true => AHIBIO1NEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wake-up on falling below threshold event inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO1NEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up on falling below threshold event active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO1NEV_A::VALUE2 @@ -466,15 +453,13 @@ impl R { AHIBIO1NEV_R::new(((self.bits >> 13) & 1) != 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"] +#[doc = "Hibernate Domain Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hdstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`hdstat::R`](R) reader structure"] +impl crate::Readable for HDSTAT_SPEC {} #[doc = "`reset()` method sets HDSTAT to value 0"] impl crate::Resettable for HDSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_hibernate/hintclr.rs b/src/scu_hibernate/hintclr.rs index c3ec0f0b..83284ebd 100644 --- a/src/scu_hibernate/hintclr.rs +++ b/src/scu_hibernate/hintclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `HINTCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Internally Controlled Hibernate Sequence Request Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum HIBNINT_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `HIBNINT` writer - Internally Controlled Hibernate Sequence Request Clear"] -pub type HIBNINT_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTCLR_SPEC, HIBNINT_AW, O>; -impl<'a, const O: u8> HIBNINT_W<'a, O> { +pub type HIBNINT_W<'a, REG> = crate::BitWriter<'a, REG, HIBNINT_AW>; +impl<'a, REG> HIBNINT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBNINT_AW::VALUE1) } #[doc = "Hibernate bit clear"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBNINT_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `FLASHOFF` writer - VDDP Supply Switch of Flash Clear"] -pub type FLASHOFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTCLR_SPEC, FLASHOFF_AW, O>; -impl<'a, const O: u8> FLASHOFF_W<'a, O> { +pub type FLASHOFF_W<'a, REG> = crate::BitWriter<'a, REG, FLASHOFF_AW>; +impl<'a, REG> FLASHOFF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FLASHOFF_AW::VALUE1) } #[doc = "Switch on VDDP supply of Flash"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FLASHOFF_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `FLASHPD` writer - Flash Power Down Clear"] -pub type FLASHPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTCLR_SPEC, FLASHPD_AW, O>; -impl<'a, const O: u8> FLASHPD_W<'a, O> { +pub type FLASHPD_W<'a, REG> = crate::BitWriter<'a, REG, FLASHPD_AW>; +impl<'a, REG> FLASHPD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FLASHPD_AW::VALUE1) } #[doc = "Flash power down mode leave request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FLASHPD_AW::VALUE2) } } @@ -118,21 +108,24 @@ impl From for bool { } } #[doc = "Field `POFFD` writer - PORST Pull-up OFF Direct Control Clear"] -pub type POFFD_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTCLR_SPEC, POFFD_AW, O>; -impl<'a, const O: u8> POFFD_W<'a, O> { +pub type POFFD_W<'a, REG> = crate::BitWriter<'a, REG, POFFD_AW>; +impl<'a, REG> POFFD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POFFD_AW::VALUE1) } #[doc = "Pull-up on"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POFFD_AW::VALUE2) } } #[doc = "Field `PPODEL` writer - Delay on PORTS Pull-up Switching OFF on Hibernate Request Clear"] -pub type PPODEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HINTCLR_SPEC, u8, u8, 2, O>; +pub type PPODEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "PORST Pull-up OFF in Hibernate Mode Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum POFFH_AW { @@ -148,16 +141,19 @@ impl From for bool { } } #[doc = "Field `POFFH` writer - PORST Pull-up OFF in Hibernate Mode Clear"] -pub type POFFH_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTCLR_SPEC, POFFH_AW, O>; -impl<'a, const O: u8> POFFH_W<'a, O> { +pub type POFFH_W<'a, REG> = crate::BitWriter<'a, REG, POFFH_AW>; +impl<'a, REG> POFFH_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POFFH_AW::VALUE1) } #[doc = "Pull-up on"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POFFH_AW::VALUE2) } } @@ -165,54 +161,57 @@ impl W { #[doc = "Bit 0 - Internally Controlled Hibernate Sequence Request Clear"] #[inline(always)] #[must_use] - pub fn hibnint(&mut self) -> HIBNINT_W<0> { - HIBNINT_W::new(self) + pub fn hibnint(&mut self) -> HIBNINT_W { + HIBNINT_W::new(self, 0) } #[doc = "Bit 2 - VDDP Supply Switch of Flash Clear"] #[inline(always)] #[must_use] - pub fn flashoff(&mut self) -> FLASHOFF_W<2> { - FLASHOFF_W::new(self) + pub fn flashoff(&mut self) -> FLASHOFF_W { + FLASHOFF_W::new(self, 2) } #[doc = "Bit 3 - Flash Power Down Clear"] #[inline(always)] #[must_use] - pub fn flashpd(&mut self) -> FLASHPD_W<3> { - FLASHPD_W::new(self) + pub fn flashpd(&mut self) -> FLASHPD_W { + FLASHPD_W::new(self, 3) } #[doc = "Bit 4 - PORST Pull-up OFF Direct Control Clear"] #[inline(always)] #[must_use] - pub fn poffd(&mut self) -> POFFD_W<4> { - POFFD_W::new(self) + pub fn poffd(&mut self) -> POFFD_W { + POFFD_W::new(self, 4) } #[doc = "Bits 16:17 - Delay on PORTS Pull-up Switching OFF on Hibernate Request Clear"] #[inline(always)] #[must_use] - pub fn ppodel(&mut self) -> PPODEL_W<16> { - PPODEL_W::new(self) + pub fn ppodel(&mut self) -> PPODEL_W { + PPODEL_W::new(self, 16) } #[doc = "Bit 20 - PORST Pull-up OFF in Hibernate Mode Clear"] #[inline(always)] #[must_use] - pub fn poffh(&mut self) -> POFFH_W<20> { - POFFH_W::new(self) + pub fn poffh(&mut self) -> POFFH_W { + POFFH_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Hibernate Internal Control Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hintclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HINTCLR_SPEC; impl crate::RegisterSpec for HINTCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [hintclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`hintclr::W`](W) writer structure"] impl crate::Writable for HINTCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/hintset.rs b/src/scu_hibernate/hintset.rs index 24a9692b..b063a3b1 100644 --- a/src/scu_hibernate/hintset.rs +++ b/src/scu_hibernate/hintset.rs @@ -1,24 +1,5 @@ #[doc = "Register `HINTSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Internally Controlled Hibernate Sequence Request Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum HIBNINT_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `HIBNINT` writer - Internally Controlled Hibernate Sequence Request Set"] -pub type HIBNINT_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTSET_SPEC, HIBNINT_AW, O>; -impl<'a, const O: u8> HIBNINT_W<'a, O> { +pub type HIBNINT_W<'a, REG> = crate::BitWriter<'a, REG, HIBNINT_AW>; +impl<'a, REG> HIBNINT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBNINT_AW::VALUE1) } #[doc = "Hardware controlled hibernate sequence request active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBNINT_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `VCOREOFF` writer - VDDC Generation off on EVR Set"] -pub type VCOREOFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTSET_SPEC, VCOREOFF_AW, O>; -impl<'a, const O: u8> VCOREOFF_W<'a, O> { +pub type VCOREOFF_W<'a, REG> = crate::BitWriter<'a, REG, VCOREOFF_AW>; +impl<'a, REG> VCOREOFF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VCOREOFF_AW::VALUE1) } #[doc = "VDDC off to EVR set"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VCOREOFF_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `FLASHOFF` writer - VDDP Supply Switch of Flash Set"] -pub type FLASHOFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTSET_SPEC, FLASHOFF_AW, O>; -impl<'a, const O: u8> FLASHOFF_W<'a, O> { +pub type FLASHOFF_W<'a, REG> = crate::BitWriter<'a, REG, FLASHOFF_AW>; +impl<'a, REG> FLASHOFF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FLASHOFF_AW::VALUE1) } #[doc = "Switch off VDDP supply of Flash"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FLASHOFF_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `FLASHPD` writer - Flash Power Down Set"] -pub type FLASHPD_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTSET_SPEC, FLASHPD_AW, O>; -impl<'a, const O: u8> FLASHPD_W<'a, O> { +pub type FLASHPD_W<'a, REG> = crate::BitWriter<'a, REG, FLASHPD_AW>; +impl<'a, REG> FLASHPD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FLASHPD_AW::VALUE1) } #[doc = "Flash power down mode request set"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FLASHPD_AW::VALUE2) } } @@ -146,21 +139,24 @@ impl From for bool { } } #[doc = "Field `POFFD` writer - PORST Pull-up OFF Direct Control Set"] -pub type POFFD_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTSET_SPEC, POFFD_AW, O>; -impl<'a, const O: u8> POFFD_W<'a, O> { +pub type POFFD_W<'a, REG> = crate::BitWriter<'a, REG, POFFD_AW>; +impl<'a, REG> POFFD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POFFD_AW::VALUE1) } #[doc = "Pull-up off"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POFFD_AW::VALUE2) } } #[doc = "Field `PPODEL` writer - Delay on PORTS Pull-up Switching OFF on Hibernate Request Set"] -pub type PPODEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HINTSET_SPEC, u8, u8, 2, O>; +pub type PPODEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "PORST Pull-up OFF in Hibernate Mode Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum POFFH_AW { @@ -176,16 +172,19 @@ impl From for bool { } } #[doc = "Field `POFFH` writer - PORST Pull-up OFF in Hibernate Mode Set"] -pub type POFFH_W<'a, const O: u8> = crate::BitWriter<'a, u32, HINTSET_SPEC, POFFH_AW, O>; -impl<'a, const O: u8> POFFH_W<'a, O> { +pub type POFFH_W<'a, REG> = crate::BitWriter<'a, REG, POFFH_AW>; +impl<'a, REG> POFFH_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POFFH_AW::VALUE1) } #[doc = "Pull-up off"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POFFH_AW::VALUE2) } } @@ -193,60 +192,63 @@ impl W { #[doc = "Bit 0 - Internally Controlled Hibernate Sequence Request Set"] #[inline(always)] #[must_use] - pub fn hibnint(&mut self) -> HIBNINT_W<0> { - HIBNINT_W::new(self) + pub fn hibnint(&mut self) -> HIBNINT_W { + HIBNINT_W::new(self, 0) } #[doc = "Bit 1 - VDDC Generation off on EVR Set"] #[inline(always)] #[must_use] - pub fn vcoreoff(&mut self) -> VCOREOFF_W<1> { - VCOREOFF_W::new(self) + pub fn vcoreoff(&mut self) -> VCOREOFF_W { + VCOREOFF_W::new(self, 1) } #[doc = "Bit 2 - VDDP Supply Switch of Flash Set"] #[inline(always)] #[must_use] - pub fn flashoff(&mut self) -> FLASHOFF_W<2> { - FLASHOFF_W::new(self) + pub fn flashoff(&mut self) -> FLASHOFF_W { + FLASHOFF_W::new(self, 2) } #[doc = "Bit 3 - Flash Power Down Set"] #[inline(always)] #[must_use] - pub fn flashpd(&mut self) -> FLASHPD_W<3> { - FLASHPD_W::new(self) + pub fn flashpd(&mut self) -> FLASHPD_W { + FLASHPD_W::new(self, 3) } #[doc = "Bit 4 - PORST Pull-up OFF Direct Control Set"] #[inline(always)] #[must_use] - pub fn poffd(&mut self) -> POFFD_W<4> { - POFFD_W::new(self) + pub fn poffd(&mut self) -> POFFD_W { + POFFD_W::new(self, 4) } #[doc = "Bits 16:17 - Delay on PORTS Pull-up Switching OFF on Hibernate Request Set"] #[inline(always)] #[must_use] - pub fn ppodel(&mut self) -> PPODEL_W<16> { - PPODEL_W::new(self) + pub fn ppodel(&mut self) -> PPODEL_W { + PPODEL_W::new(self, 16) } #[doc = "Bit 20 - PORST Pull-up OFF in Hibernate Mode Set"] #[inline(always)] #[must_use] - pub fn poffh(&mut self) -> POFFH_W<20> { - POFFH_W::new(self) + pub fn poffh(&mut self) -> POFFH_W { + POFFH_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Hibernate Internal Control Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hintset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HINTSET_SPEC; impl crate::RegisterSpec for HINTSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [hintset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`hintset::W`](W) writer structure"] impl crate::Writable for HINTSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/hintst.rs b/src/scu_hibernate/hintst.rs index b13ece55..d0d44f4b 100644 --- a/src/scu_hibernate/hintst.rs +++ b/src/scu_hibernate/hintst.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `HIBNINT` reader - Internally Controlled Hibernate Sequence Request State"] pub type HIBNINT_R = crate::BitReader; #[doc = "Internally Controlled Hibernate Sequence Request State\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl HIBNINT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIBNINT_A { + pub const fn variant(&self) -> HIBNINT_A { match self.bits { false => HIBNINT_A::VALUE1, true => HIBNINT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Hibernate not entered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBNINT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Hibernate entered"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBNINT_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl FLASHOFF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FLASHOFF_A { + pub const fn variant(&self) -> FLASHOFF_A { match self.bits { false => FLASHOFF_A::VALUE1, true => FLASHOFF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "VDDP supply of Flash switched on"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FLASHOFF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "VDDP supply of Flash switched off"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FLASHOFF_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl FLASHPD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FLASHPD_A { + pub const fn variant(&self) -> FLASHPD_A { match self.bits { false => FLASHPD_A::VALUE1, true => FLASHPD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FLASHPD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Power down mode effectively entered"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FLASHPD_A::VALUE2 @@ -140,25 +127,25 @@ impl From for bool { impl POFFD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> POFFD_A { + pub const fn variant(&self) -> POFFD_A { match self.bits { false => POFFD_A::VALUE1, true => POFFD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pull-up on"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == POFFD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pull-up off"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == POFFD_A::VALUE2 } } #[doc = "Field `PPODEL` reader - Delay on PORTS Pull-up Switching OFF on Hibernate Request"] -pub type PPODEL_R = crate::FieldReader; +pub type PPODEL_R = crate::FieldReader; #[doc = "Field `POFFH` reader - PORST Pull-up OFF in Hibernate Mode State"] pub type POFFH_R = crate::BitReader; #[doc = "PORST Pull-up OFF in Hibernate Mode State\n\nValue on reset: 0"] @@ -178,18 +165,18 @@ impl From for bool { impl POFFH_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> POFFH_A { + pub const fn variant(&self) -> POFFH_A { match self.bits { false => POFFH_A::VALUE1, true => POFFH_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pull-up on"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == POFFH_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pull-up off"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == POFFH_A::VALUE2 @@ -227,15 +214,13 @@ impl R { POFFH_R::new(((self.bits >> 20) & 1) != 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"] +#[doc = "Hibernate Internal Control State Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hintst::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`hintst::R`](R) reader structure"] +impl crate::Readable for HINTST_SPEC {} #[doc = "`reset()` method sets HINTST to value 0"] impl crate::Resettable for HINTST_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_hibernate/lpacclr.rs b/src/scu_hibernate/lpacclr.rs index 90d9282b..2dd45b4a 100644 --- a/src/scu_hibernate/lpacclr.rs +++ b/src/scu_hibernate/lpacclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `LPACCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Trigger VBAT Single Compare Operation Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum VBATSCMP_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `VBATSCMP` writer - Trigger VBAT Single Compare Operation Clear"] -pub type VBATSCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACCLR_SPEC, VBATSCMP_AW, O>; -impl<'a, const O: u8> VBATSCMP_W<'a, O> { +pub type VBATSCMP_W<'a, REG> = crate::BitWriter<'a, REG, VBATSCMP_AW>; +impl<'a, REG> VBATSCMP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATSCMP_AW::VALUE1) } #[doc = "Clear the sticky bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATSCMP_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO0SCMP` writer - Trigger HIB_IO_0 Input Single Compare Operation Clear"] -pub type AHIBIO0SCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACCLR_SPEC, AHIBIO0SCMP_AW, O>; -impl<'a, const O: u8> AHIBIO0SCMP_W<'a, O> { +pub type AHIBIO0SCMP_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0SCMP_AW>; +impl<'a, REG> AHIBIO0SCMP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0SCMP_AW::VALUE1) } #[doc = "Clear the sticky bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0SCMP_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO1SCMP` writer - Trigger HIB_IO_1 Input Single Compare Operation Clear"] -pub type AHIBIO1SCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACCLR_SPEC, AHIBIO1SCMP_AW, O>; -impl<'a, const O: u8> AHIBIO1SCMP_W<'a, O> { +pub type AHIBIO1SCMP_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1SCMP_AW>; +impl<'a, REG> AHIBIO1SCMP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1SCMP_AW::VALUE1) } #[doc = "Clear the sticky bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1SCMP_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `VBATVAL` writer - VBAT Compare Operation Initial Value Clear"] -pub type VBATVAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACCLR_SPEC, VBATVAL_AW, O>; -impl<'a, const O: u8> VBATVAL_W<'a, O> { +pub type VBATVAL_W<'a, REG> = crate::BitWriter<'a, REG, VBATVAL_AW>; +impl<'a, REG> VBATVAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATVAL_AW::VALUE1) } #[doc = "Below programmed threshold"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATVAL_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO0VAL` writer - HIB_IO_0 Input Compare Initial Value Clear"] -pub type AHIBIO0VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACCLR_SPEC, AHIBIO0VAL_AW, O>; -impl<'a, const O: u8> AHIBIO0VAL_W<'a, O> { +pub type AHIBIO0VAL_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0VAL_AW>; +impl<'a, REG> AHIBIO0VAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0VAL_AW::VALUE1) } #[doc = "Below programmed threshold"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0VAL_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO1VAL` writer - HIB_IO_1 Input Compare Initial Value Clear"] -pub type AHIBIO1VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACCLR_SPEC, AHIBIO1VAL_AW, O>; -impl<'a, const O: u8> AHIBIO1VAL_W<'a, O> { +pub type AHIBIO1VAL_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1VAL_AW>; +impl<'a, REG> AHIBIO1VAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1VAL_AW::VALUE1) } #[doc = "Below programmed threshold"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1VAL_AW::VALUE2) } } @@ -191,54 +190,57 @@ impl W { #[doc = "Bit 0 - Trigger VBAT Single Compare Operation Clear"] #[inline(always)] #[must_use] - pub fn vbatscmp(&mut self) -> VBATSCMP_W<0> { - VBATSCMP_W::new(self) + pub fn vbatscmp(&mut self) -> VBATSCMP_W { + VBATSCMP_W::new(self, 0) } #[doc = "Bit 1 - Trigger HIB_IO_0 Input Single Compare Operation Clear"] #[inline(always)] #[must_use] - pub fn ahibio0scmp(&mut self) -> AHIBIO0SCMP_W<1> { - AHIBIO0SCMP_W::new(self) + pub fn ahibio0scmp(&mut self) -> AHIBIO0SCMP_W { + AHIBIO0SCMP_W::new(self, 1) } #[doc = "Bit 2 - Trigger HIB_IO_1 Input Single Compare Operation Clear"] #[inline(always)] #[must_use] - pub fn ahibio1scmp(&mut self) -> AHIBIO1SCMP_W<2> { - AHIBIO1SCMP_W::new(self) + pub fn ahibio1scmp(&mut self) -> AHIBIO1SCMP_W { + AHIBIO1SCMP_W::new(self, 2) } #[doc = "Bit 16 - VBAT Compare Operation Initial Value Clear"] #[inline(always)] #[must_use] - pub fn vbatval(&mut self) -> VBATVAL_W<16> { - VBATVAL_W::new(self) + pub fn vbatval(&mut self) -> VBATVAL_W { + VBATVAL_W::new(self, 16) } #[doc = "Bit 17 - HIB_IO_0 Input Compare Initial Value Clear"] #[inline(always)] #[must_use] - pub fn ahibio0val(&mut self) -> AHIBIO0VAL_W<17> { - AHIBIO0VAL_W::new(self) + pub fn ahibio0val(&mut self) -> AHIBIO0VAL_W { + AHIBIO0VAL_W::new(self, 17) } #[doc = "Bit 18 - HIB_IO_1 Input Compare Initial Value Clear"] #[inline(always)] #[must_use] - pub fn ahibio1val(&mut self) -> AHIBIO1VAL_W<18> { - AHIBIO1VAL_W::new(self) + pub fn ahibio1val(&mut self) -> AHIBIO1VAL_W { + AHIBIO1VAL_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "LPAC Control Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct LPACCLR_SPEC; impl crate::RegisterSpec for LPACCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [lpacclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`lpacclr::W`](W) writer structure"] impl crate::Writable for LPACCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/lpacconf.rs b/src/scu_hibernate/lpacconf.rs index aacf2b75..790200a9 100644 --- a/src/scu_hibernate/lpacconf.rs +++ b/src/scu_hibernate/lpacconf.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CMPEN` reader - Compare Enable for Input Selection"] -pub type CMPEN_R = crate::FieldReader; +pub type CMPEN_R = crate::FieldReader; #[doc = "Compare Enable for Input Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CMPEN_A { + type Ux = u8; +} impl CMPEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CMPEN_A::VALUE1), 1 => Some(CMPEN_A::VALUE2), @@ -67,53 +38,57 @@ impl CMPEN_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Comparator permanently in power down"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMPEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Comparator activated for VBAT input"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMPEN_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Comparator activated for HIB_IO_0 input"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CMPEN_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Comparator activated for HIB_IO_1 input"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CMPEN_A::VALUE4 } } #[doc = "Field `CMPEN` writer - Compare Enable for Input Selection"] -pub type CMPEN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACCONF_SPEC, u8, CMPEN_A, 3, O>; -impl<'a, const O: u8> CMPEN_W<'a, O> { +pub type CMPEN_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CMPEN_A>; +impl<'a, REG> CMPEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Comparator permanently in power down"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMPEN_A::VALUE1) } #[doc = "Comparator activated for VBAT input"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMPEN_A::VALUE2) } #[doc = "Comparator activated for HIB_IO_0 input"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CMPEN_A::VALUE3) } #[doc = "Comparator activated for HIB_IO_1 input"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CMPEN_A::VALUE4) } } #[doc = "Field `TRIGSEL` reader - Analog Compare Trigger Select"] -pub type TRIGSEL_R = crate::FieldReader; +pub type TRIGSEL_R = crate::FieldReader; #[doc = "Analog Compare Trigger Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -139,10 +114,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TRIGSEL_A { + type Ux = u8; +} impl TRIGSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TRIGSEL_A::VALUE1), 1 => Some(TRIGSEL_A::VALUE2), @@ -154,93 +132,97 @@ impl TRIGSEL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Sub-second interval counter"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRIGSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "RTC alarm event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRIGSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "RTC periodic event"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TRIGSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "On digital WKUP input positive edge event"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TRIGSEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "On digital WKUP input negative edge event"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == TRIGSEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Continuous measurement"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == TRIGSEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "Single-shot on software request"] #[inline(always)] pub fn is_value7(&self) -> bool { *self == TRIGSEL_A::VALUE7 } } #[doc = "Field `TRIGSEL` writer - Analog Compare Trigger Select"] -pub type TRIGSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACCONF_SPEC, u8, TRIGSEL_A, 3, O>; -impl<'a, const O: u8> TRIGSEL_W<'a, O> { +pub type TRIGSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TRIGSEL_A>; +impl<'a, REG> TRIGSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Sub-second interval counter"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRIGSEL_A::VALUE1) } #[doc = "RTC alarm event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRIGSEL_A::VALUE2) } #[doc = "RTC periodic event"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TRIGSEL_A::VALUE3) } #[doc = "On digital WKUP input positive edge event"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TRIGSEL_A::VALUE4) } #[doc = "On digital WKUP input negative edge event"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(TRIGSEL_A::VALUE5) } #[doc = "Continuous measurement"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(TRIGSEL_A::VALUE6) } #[doc = "Single-shot on software request"] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(TRIGSEL_A::VALUE7) } } #[doc = "Field `CONVDEL` reader - Conversion Delay"] -pub type CONVDEL_R = crate::BitReader; +pub type CONVDEL_R = crate::BitReader; #[doc = "Field `CONVDEL` writer - Conversion Delay"] -pub type CONVDEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACCONF_SPEC, bool, O>; +pub type CONVDEL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `INTERVCNT` reader - Sub-second Interval Counter"] -pub type INTERVCNT_R = crate::FieldReader; +pub type INTERVCNT_R = crate::FieldReader; #[doc = "Field `INTERVCNT` writer - Sub-second Interval Counter"] -pub type INTERVCNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACCONF_SPEC, u16, u16, 12, O>; +pub type INTERVCNT_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; #[doc = "Field `SETTLECNT` reader - LPAC Settle Time Counter"] -pub type SETTLECNT_R = crate::FieldReader; +pub type SETTLECNT_R = crate::FieldReader; #[doc = "Field `SETTLECNT` writer - LPAC Settle Time Counter"] -pub type SETTLECNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACCONF_SPEC, u8, u8, 4, O>; +pub type SETTLECNT_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:2 - Compare Enable for Input Selection"] #[inline(always)] @@ -272,52 +254,53 @@ impl W { #[doc = "Bits 0:2 - Compare Enable for Input Selection"] #[inline(always)] #[must_use] - pub fn cmpen(&mut self) -> CMPEN_W<0> { - CMPEN_W::new(self) + pub fn cmpen(&mut self) -> CMPEN_W { + CMPEN_W::new(self, 0) } #[doc = "Bits 4:6 - Analog Compare Trigger Select"] #[inline(always)] #[must_use] - pub fn trigsel(&mut self) -> TRIGSEL_W<4> { - TRIGSEL_W::new(self) + pub fn trigsel(&mut self) -> TRIGSEL_W { + TRIGSEL_W::new(self, 4) } #[doc = "Bit 12 - Conversion Delay"] #[inline(always)] #[must_use] - pub fn convdel(&mut self) -> CONVDEL_W<12> { - CONVDEL_W::new(self) + pub fn convdel(&mut self) -> CONVDEL_W { + CONVDEL_W::new(self, 12) } #[doc = "Bits 16:27 - Sub-second Interval Counter"] #[inline(always)] #[must_use] - pub fn intervcnt(&mut self) -> INTERVCNT_W<16> { - INTERVCNT_W::new(self) + pub fn intervcnt(&mut self) -> INTERVCNT_W { + INTERVCNT_W::new(self, 16) } #[doc = "Bits 28:31 - LPAC Settle Time Counter"] #[inline(always)] #[must_use] - pub fn settlecnt(&mut self) -> SETTLECNT_W<28> { - SETTLECNT_W::new(self) + pub fn settlecnt(&mut self) -> SETTLECNT_W { + SETTLECNT_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Analog Wake-up Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lpacconf::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacconf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`lpacconf::R`](R) reader structure"] +impl crate::Readable for LPACCONF_SPEC {} +#[doc = "`write(|w| ..)` method takes [`lpacconf::W`](W) writer structure"] impl crate::Writable for LPACCONF_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/lpacset.rs b/src/scu_hibernate/lpacset.rs index 5dae8bc6..d1edcd7b 100644 --- a/src/scu_hibernate/lpacset.rs +++ b/src/scu_hibernate/lpacset.rs @@ -1,24 +1,5 @@ #[doc = "Register `LPACSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Trigger VBAT Single Compare Operation Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum VBATSCMP_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `VBATSCMP` writer - Trigger VBAT Single Compare Operation Set"] -pub type VBATSCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACSET_SPEC, VBATSCMP_AW, O>; -impl<'a, const O: u8> VBATSCMP_W<'a, O> { +pub type VBATSCMP_W<'a, REG> = crate::BitWriter<'a, REG, VBATSCMP_AW>; +impl<'a, REG> VBATSCMP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATSCMP_AW::VALUE1) } #[doc = "Start compare operation"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATSCMP_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO0SCMP` writer - Trigger HIB_IO_0 Input Single Compare Operation Set"] -pub type AHIBIO0SCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACSET_SPEC, AHIBIO0SCMP_AW, O>; -impl<'a, const O: u8> AHIBIO0SCMP_W<'a, O> { +pub type AHIBIO0SCMP_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0SCMP_AW>; +impl<'a, REG> AHIBIO0SCMP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0SCMP_AW::VALUE1) } #[doc = "Start compare operation"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0SCMP_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO1SCMP` writer - Trigger HIB_IO_1 Input Single Compare Operation Set"] -pub type AHIBIO1SCMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACSET_SPEC, AHIBIO1SCMP_AW, O>; -impl<'a, const O: u8> AHIBIO1SCMP_W<'a, O> { +pub type AHIBIO1SCMP_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1SCMP_AW>; +impl<'a, REG> AHIBIO1SCMP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1SCMP_AW::VALUE1) } #[doc = "Start compare operation"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1SCMP_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `VBATVAL` writer - VBAT Compare Operation Initial Value Set"] -pub type VBATVAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACSET_SPEC, VBATVAL_AW, O>; -impl<'a, const O: u8> VBATVAL_W<'a, O> { +pub type VBATVAL_W<'a, REG> = crate::BitWriter<'a, REG, VBATVAL_AW>; +impl<'a, REG> VBATVAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBATVAL_AW::VALUE1) } #[doc = "Above programmed threshold"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBATVAL_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO0VAL` writer - HIB_IO_0 Input Compare Initial Value Set"] -pub type AHIBIO0VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACSET_SPEC, AHIBIO0VAL_AW, O>; -impl<'a, const O: u8> AHIBIO0VAL_W<'a, O> { +pub type AHIBIO0VAL_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO0VAL_AW>; +impl<'a, REG> AHIBIO0VAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO0VAL_AW::VALUE1) } #[doc = "Above programmed threshold"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO0VAL_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `AHIBIO1VAL` writer - HIB_IO_1 Input Compare Initial Value Set"] -pub type AHIBIO1VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LPACSET_SPEC, AHIBIO1VAL_AW, O>; -impl<'a, const O: u8> AHIBIO1VAL_W<'a, O> { +pub type AHIBIO1VAL_W<'a, REG> = crate::BitWriter<'a, REG, AHIBIO1VAL_AW>; +impl<'a, REG> AHIBIO1VAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHIBIO1VAL_AW::VALUE1) } #[doc = "Above programmed threshold"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHIBIO1VAL_AW::VALUE2) } } @@ -191,54 +190,57 @@ impl W { #[doc = "Bit 0 - Trigger VBAT Single Compare Operation Set"] #[inline(always)] #[must_use] - pub fn vbatscmp(&mut self) -> VBATSCMP_W<0> { - VBATSCMP_W::new(self) + pub fn vbatscmp(&mut self) -> VBATSCMP_W { + VBATSCMP_W::new(self, 0) } #[doc = "Bit 1 - Trigger HIB_IO_0 Input Single Compare Operation Set"] #[inline(always)] #[must_use] - pub fn ahibio0scmp(&mut self) -> AHIBIO0SCMP_W<1> { - AHIBIO0SCMP_W::new(self) + pub fn ahibio0scmp(&mut self) -> AHIBIO0SCMP_W { + AHIBIO0SCMP_W::new(self, 1) } #[doc = "Bit 2 - Trigger HIB_IO_1 Input Single Compare Operation Set"] #[inline(always)] #[must_use] - pub fn ahibio1scmp(&mut self) -> AHIBIO1SCMP_W<2> { - AHIBIO1SCMP_W::new(self) + pub fn ahibio1scmp(&mut self) -> AHIBIO1SCMP_W { + AHIBIO1SCMP_W::new(self, 2) } #[doc = "Bit 16 - VBAT Compare Operation Initial Value Set"] #[inline(always)] #[must_use] - pub fn vbatval(&mut self) -> VBATVAL_W<16> { - VBATVAL_W::new(self) + pub fn vbatval(&mut self) -> VBATVAL_W { + VBATVAL_W::new(self, 16) } #[doc = "Bit 17 - HIB_IO_0 Input Compare Initial Value Set"] #[inline(always)] #[must_use] - pub fn ahibio0val(&mut self) -> AHIBIO0VAL_W<17> { - AHIBIO0VAL_W::new(self) + pub fn ahibio0val(&mut self) -> AHIBIO0VAL_W { + AHIBIO0VAL_W::new(self, 17) } #[doc = "Bit 18 - HIB_IO_1 Input Compare Initial Value Set"] #[inline(always)] #[must_use] - pub fn ahibio1val(&mut self) -> AHIBIO1VAL_W<18> { - AHIBIO1VAL_W::new(self) + pub fn ahibio1val(&mut self) -> AHIBIO1VAL_W { + AHIBIO1VAL_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "LPAC Control Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct LPACSET_SPEC; impl crate::RegisterSpec for LPACSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [lpacset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`lpacset::W`](W) writer structure"] impl crate::Writable for LPACSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/lpacst.rs b/src/scu_hibernate/lpacst.rs index 4d71ed94..a6578319 100644 --- a/src/scu_hibernate/lpacst.rs +++ b/src/scu_hibernate/lpacst.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VBATSCMP` reader - Trigger VBAT Single Compare Operation Status"] pub type VBATSCMP_R = crate::BitReader; #[doc = "Trigger VBAT Single Compare Operation Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl VBATSCMP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VBATSCMP_A { + pub const fn variant(&self) -> VBATSCMP_A { match self.bits { false => VBATSCMP_A::VALUE1, true => VBATSCMP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready to start new compare operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VBATSCMP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare operation completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VBATSCMP_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl AHIBIO0SCMP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO0SCMP_A { + pub const fn variant(&self) -> AHIBIO0SCMP_A { match self.bits { false => AHIBIO0SCMP_A::VALUE1, true => AHIBIO0SCMP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready to start new compare operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO0SCMP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare operation completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO0SCMP_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl AHIBIO1SCMP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO1SCMP_A { + pub const fn variant(&self) -> AHIBIO1SCMP_A { match self.bits { false => AHIBIO1SCMP_A::VALUE1, true => AHIBIO1SCMP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ready to start new compare operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO1SCMP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Compare operation completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO1SCMP_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl VBATVAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VBATVAL_A { + pub const fn variant(&self) -> VBATVAL_A { match self.bits { false => VBATVAL_A::VALUE1, true => VBATVAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Below programmed threshold"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VBATVAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Above programmed threshold"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VBATVAL_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl AHIBIO0VAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO0VAL_A { + pub const fn variant(&self) -> AHIBIO0VAL_A { match self.bits { false => AHIBIO0VAL_A::VALUE1, true => AHIBIO0VAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Below programmed threshold"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO0VAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Above programmed threshold"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO0VAL_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl AHIBIO1VAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHIBIO1VAL_A { + pub const fn variant(&self) -> AHIBIO1VAL_A { match self.bits { false => AHIBIO1VAL_A::VALUE1, true => AHIBIO1VAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Below programmed threshold"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHIBIO1VAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Above programmed threshold"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHIBIO1VAL_A::VALUE2 @@ -261,15 +248,13 @@ impl R { AHIBIO1VAL_R::new(((self.bits >> 18) & 1) != 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"] +#[doc = "Hibernate Analog Control State Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lpacst::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`lpacst::R`](R) reader structure"] +impl crate::Readable for LPACST_SPEC {} #[doc = "`reset()` method sets LPACST to value 0"] impl crate::Resettable for LPACST_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_hibernate/lpacth0.rs b/src/scu_hibernate/lpacth0.rs index d0b5ac69..1386340c 100644 --- a/src/scu_hibernate/lpacth0.rs +++ b/src/scu_hibernate/lpacth0.rs @@ -1,47 +1,15 @@ #[doc = "Register `LPACTH0` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VBATLO` reader - VBAT Lower Threshold Value"] -pub type VBATLO_R = crate::FieldReader; +pub type VBATLO_R = crate::FieldReader; #[doc = "Field `VBATLO` writer - VBAT Lower Threshold Value"] -pub type VBATLO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACTH0_SPEC, u8, u8, 6, O>; +pub type VBATLO_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `VBATHI` reader - VBAT Upper Threshold Value"] -pub type VBATHI_R = crate::FieldReader; +pub type VBATHI_R = crate::FieldReader; #[doc = "Field `VBATHI` writer - VBAT Upper Threshold Value"] -pub type VBATHI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACTH0_SPEC, u8, u8, 6, O>; +pub type VBATHI_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; impl R { #[doc = "Bits 0:5 - VBAT Lower Threshold Value"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:5 - VBAT Lower Threshold Value"] #[inline(always)] #[must_use] - pub fn vbatlo(&mut self) -> VBATLO_W<0> { - VBATLO_W::new(self) + pub fn vbatlo(&mut self) -> VBATLO_W { + VBATLO_W::new(self, 0) } #[doc = "Bits 8:13 - VBAT Upper Threshold Value"] #[inline(always)] #[must_use] - pub fn vbathi(&mut self) -> VBATHI_W<8> { - VBATHI_W::new(self) + pub fn vbathi(&mut self) -> VBATHI_W { + VBATHI_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "LPAC Threshold Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lpacth0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacth0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`lpacth0::R`](R) reader structure"] +impl crate::Readable for LPACTH0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`lpacth0::W`](W) writer structure"] impl crate::Writable for LPACTH0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/lpacth1.rs b/src/scu_hibernate/lpacth1.rs index f936ba60..3c551484 100644 --- a/src/scu_hibernate/lpacth1.rs +++ b/src/scu_hibernate/lpacth1.rs @@ -1,55 +1,23 @@ #[doc = "Register `LPACTH1` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `AHIBIO0LO` reader - Analog HIB_IO_0 Lower Threshold Value"] -pub type AHIBIO0LO_R = crate::FieldReader; +pub type AHIBIO0LO_R = crate::FieldReader; #[doc = "Field `AHIBIO0LO` writer - Analog HIB_IO_0 Lower Threshold Value"] -pub type AHIBIO0LO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACTH1_SPEC, u8, u8, 6, O>; +pub type AHIBIO0LO_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `AHIBIO0HI` reader - Analog HIB_IO_0 Upper Threshold Value"] -pub type AHIBIO0HI_R = crate::FieldReader; +pub type AHIBIO0HI_R = crate::FieldReader; #[doc = "Field `AHIBIO0HI` writer - Analog HIB_IO_0 Upper Threshold Value"] -pub type AHIBIO0HI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACTH1_SPEC, u8, u8, 6, O>; +pub type AHIBIO0HI_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `AHIBIO1LO` reader - Analog HIB_IO_1 Lower Threshold Value"] -pub type AHIBIO1LO_R = crate::FieldReader; +pub type AHIBIO1LO_R = crate::FieldReader; #[doc = "Field `AHIBIO1LO` writer - Analog HIB_IO_1 Lower Threshold Value"] -pub type AHIBIO1LO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACTH1_SPEC, u8, u8, 6, O>; +pub type AHIBIO1LO_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `AHIBIO1HI` reader - Analog HIB_IO_1 Upper Threshold Value"] -pub type AHIBIO1HI_R = crate::FieldReader; +pub type AHIBIO1HI_R = crate::FieldReader; #[doc = "Field `AHIBIO1HI` writer - Analog HIB_IO_1 Upper Threshold Value"] -pub type AHIBIO1HI_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LPACTH1_SPEC, u8, u8, 6, O>; +pub type AHIBIO1HI_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; impl R { #[doc = "Bits 0:5 - Analog HIB_IO_0 Lower Threshold Value"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:5 - Analog HIB_IO_0 Lower Threshold Value"] #[inline(always)] #[must_use] - pub fn ahibio0lo(&mut self) -> AHIBIO0LO_W<0> { - AHIBIO0LO_W::new(self) + pub fn ahibio0lo(&mut self) -> AHIBIO0LO_W { + AHIBIO0LO_W::new(self, 0) } #[doc = "Bits 8:13 - Analog HIB_IO_0 Upper Threshold Value"] #[inline(always)] #[must_use] - pub fn ahibio0hi(&mut self) -> AHIBIO0HI_W<8> { - AHIBIO0HI_W::new(self) + pub fn ahibio0hi(&mut self) -> AHIBIO0HI_W { + AHIBIO0HI_W::new(self, 8) } #[doc = "Bits 16:21 - Analog HIB_IO_1 Lower Threshold Value"] #[inline(always)] #[must_use] - pub fn ahibio1lo(&mut self) -> AHIBIO1LO_W<16> { - AHIBIO1LO_W::new(self) + pub fn ahibio1lo(&mut self) -> AHIBIO1LO_W { + AHIBIO1LO_W::new(self, 16) } #[doc = "Bits 24:29 - Analog HIB_IO_1 Upper Threshold Value"] #[inline(always)] #[must_use] - pub fn ahibio1hi(&mut self) -> AHIBIO1HI_W<24> { - AHIBIO1HI_W::new(self) + pub fn ahibio1hi(&mut self) -> AHIBIO1HI_W { + AHIBIO1HI_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "LPAC Threshold Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`lpacth1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`lpacth1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`lpacth1::R`](R) reader structure"] +impl crate::Readable for LPACTH1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`lpacth1::W`](W) writer structure"] impl crate::Writable for LPACTH1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/oscsictrl.rs b/src/scu_hibernate/oscsictrl.rs index 3618abe9..4be7c569 100644 --- a/src/scu_hibernate/oscsictrl.rs +++ b/src/scu_hibernate/oscsictrl.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PWD` reader - Turn OFF the fOSI Clock Source"] pub type PWD_R = crate::BitReader; #[doc = "Turn OFF the fOSI Clock Source\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl PWD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PWD_A { + pub const fn variant(&self) -> PWD_A { match self.bits { false => PWD_A::VALUE1, true => PWD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PWD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PWD_A::VALUE2 } } #[doc = "Field `PWD` writer - Turn OFF the fOSI Clock Source"] -pub type PWD_W<'a, const O: u8> = crate::BitWriter<'a, u32, OSCSICTRL_SPEC, PWD_A, O>; -impl<'a, const O: u8> PWD_W<'a, O> { +pub type PWD_W<'a, REG> = crate::BitWriter<'a, REG, PWD_A>; +impl<'a, REG> PWD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PWD_A::VALUE1) } #[doc = "Disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PWD_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - Turn OFF the fOSI Clock Source"] #[inline(always)] #[must_use] - pub fn pwd(&mut self) -> PWD_W<0> { - PWD_W::new(self) + pub fn pwd(&mut self) -> PWD_W { + PWD_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "fOSI Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`oscsictrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`oscsictrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`oscsictrl::R`](R) reader structure"] +impl crate::Readable for OSCSICTRL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`oscsictrl::W`](W) writer structure"] impl crate::Writable for OSCSICTRL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/osculctrl.rs b/src/scu_hibernate/osculctrl.rs index 03d0e27f..41a233f8 100644 --- a/src/scu_hibernate/osculctrl.rs +++ b/src/scu_hibernate/osculctrl.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `X1DEN` reader - XTAL1 Data General Purpose Input Enable"] pub type X1DEN_R = crate::BitReader; #[doc = "XTAL1 Data General Purpose Input Enable\n\nValue on reset: 0"] @@ -53,39 +21,42 @@ impl From for bool { impl X1DEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> X1DEN_A { + pub const fn variant(&self) -> X1DEN_A { match self.bits { false => X1DEN_A::VALUE1, true => X1DEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data input inactivated, power down"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == X1DEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Data input active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == X1DEN_A::VALUE2 } } #[doc = "Field `X1DEN` writer - XTAL1 Data General Purpose Input Enable"] -pub type X1DEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, OSCULCTRL_SPEC, X1DEN_A, O>; -impl<'a, const O: u8> X1DEN_W<'a, O> { +pub type X1DEN_W<'a, REG> = crate::BitWriter<'a, REG, X1DEN_A>; +impl<'a, REG> X1DEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Data input inactivated, power down"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(X1DEN_A::VALUE1) } #[doc = "Data input active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(X1DEN_A::VALUE2) } } #[doc = "Field `MODE` reader - Oscillator Mode"] -pub type MODE_R = crate::FieldReader; +pub type MODE_R = crate::FieldReader; #[doc = "Oscillator Mode\n\nValue on reset: 2"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -105,10 +76,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MODE_A { + type Ux = u8; +} impl MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MODE_A { + pub const fn variant(&self) -> MODE_A { match self.bits { 0 => MODE_A::VALUE1, 1 => MODE_A::VALUE2, @@ -117,48 +91,52 @@ impl MODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Oscillator is enabled, in operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Oscillator is enabled, in bypass mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Oscillator in power down"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Oscillator in power down, can be used as GPI"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MODE_A::VALUE4 } } #[doc = "Field `MODE` writer - Oscillator Mode"] -pub type MODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, OSCULCTRL_SPEC, u8, MODE_A, 2, O>; -impl<'a, const O: u8> MODE_W<'a, O> { +pub type MODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, MODE_A>; +impl<'a, REG> MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Oscillator is enabled, in operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE1) } #[doc = "Oscillator is enabled, in bypass mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE2) } #[doc = "Oscillator in power down"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE3) } #[doc = "Oscillator in power down, can be used as GPI"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE4) } } @@ -178,34 +156,35 @@ impl W { #[doc = "Bit 0 - XTAL1 Data General Purpose Input Enable"] #[inline(always)] #[must_use] - pub fn x1den(&mut self) -> X1DEN_W<0> { - X1DEN_W::new(self) + pub fn x1den(&mut self) -> X1DEN_W { + X1DEN_W::new(self, 0) } #[doc = "Bits 4:5 - Oscillator Mode"] #[inline(always)] #[must_use] - pub fn mode(&mut self) -> MODE_W<4> { - MODE_W::new(self) + pub fn mode(&mut self) -> MODE_W { + MODE_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "OSC_ULP Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`osculctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`osculctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`osculctrl::R`](R) reader structure"] +impl crate::Readable for OSCULCTRL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`osculctrl::W`](W) writer structure"] impl crate::Writable for OSCULCTRL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_hibernate/osculstat.rs b/src/scu_hibernate/osculstat.rs index 2f70f114..47bcb886 100644 --- a/src/scu_hibernate/osculstat.rs +++ b/src/scu_hibernate/osculstat.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `X1D` reader - XTAL1 Data Value"] -pub type X1D_R = crate::BitReader; +pub type X1D_R = crate::BitReader; impl R { #[doc = "Bit 0 - XTAL1 Data Value"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { X1D_R::new((self.bits & 1) != 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"] +#[doc = "OSC_ULP Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`osculstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`osculstat::R`](R) reader structure"] +impl crate::Readable for OSCULSTAT_SPEC {} #[doc = "`reset()` method sets OSCULSTAT to value 0"] impl crate::Resettable for OSCULSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_interrupt.rs b/src/scu_interrupt.rs index cef5abd1..16ee1304 100644 --- a/src/scu_interrupt.rs +++ b/src/scu_interrupt.rs @@ -1,40 +1,72 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + srstat: SRSTAT, + srraw: SRRAW, + srmsk: SRMSK, + srclr: SRCLR, + srset: SRSET, + nmireqen: NMIREQEN, +} +impl RegisterBlock { #[doc = "0x00 - SCU Service Request Status"] - pub srstat: SRSTAT, + #[inline(always)] + pub const fn srstat(&self) -> &SRSTAT { + &self.srstat + } #[doc = "0x04 - SCU Raw Service Request Status"] - pub srraw: SRRAW, + #[inline(always)] + pub const fn srraw(&self) -> &SRRAW { + &self.srraw + } #[doc = "0x08 - SCU Service Request Mask"] - pub srmsk: SRMSK, + #[inline(always)] + pub const fn srmsk(&self) -> &SRMSK { + &self.srmsk + } #[doc = "0x0c - SCU Service Request Clear"] - pub srclr: SRCLR, + #[inline(always)] + pub const fn srclr(&self) -> &SRCLR { + &self.srclr + } #[doc = "0x10 - SCU Service Request Set"] - pub srset: SRSET, + #[inline(always)] + pub const fn srset(&self) -> &SRSET { + &self.srset + } #[doc = "0x14 - SCU Service Request Mask"] - pub nmireqen: NMIREQEN, + #[inline(always)] + pub const fn nmireqen(&self) -> &NMIREQEN { + &self.nmireqen + } } -#[doc = "SRSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "SRSTAT (r) register accessor: SCU Service Request Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srstat`] +module"] pub type SRSTAT = crate::Reg; #[doc = "SCU Service Request Status"] pub mod srstat; -#[doc = "SRRAW (r) register accessor: an alias for `Reg`"] +#[doc = "SRRAW (r) register accessor: SCU Raw Service Request Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srraw::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srraw`] +module"] pub type SRRAW = crate::Reg; #[doc = "SCU Raw Service Request Status"] pub mod srraw; -#[doc = "SRMSK (rw) register accessor: an alias for `Reg`"] +#[doc = "SRMSK (rw) register accessor: SCU Service Request Mask\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srmsk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srmsk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srmsk`] +module"] pub type SRMSK = crate::Reg; #[doc = "SCU Service Request Mask"] pub mod srmsk; -#[doc = "SRCLR (w) register accessor: an alias for `Reg`"] +#[doc = "SRCLR (w) register accessor: SCU Service Request Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srclr`] +module"] pub type SRCLR = crate::Reg; #[doc = "SCU Service Request Clear"] pub mod srclr; -#[doc = "SRSET (w) register accessor: an alias for `Reg`"] +#[doc = "SRSET (w) register accessor: SCU Service Request Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srset`] +module"] pub type SRSET = crate::Reg; #[doc = "SCU Service Request Set"] pub mod srset; -#[doc = "NMIREQEN (rw) register accessor: an alias for `Reg`"] +#[doc = "NMIREQEN (rw) register accessor: SCU Service Request Mask\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nmireqen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nmireqen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@nmireqen`] +module"] 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 bfea9ffb..ade8cc43 100644 --- a/src/scu_interrupt/nmireqen.rs +++ b/src/scu_interrupt/nmireqen.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRWARN` reader - Promote Pre-Warning Interrupt Request to NMI Request"] pub type PRWARN_R = crate::BitReader; #[doc = "Promote Pre-Warning Interrupt Request to NMI Request\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PRWARN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRWARN_A { + pub const fn variant(&self) -> PRWARN_A { match self.bits { false => PRWARN_A::VALUE1, true => PRWARN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRWARN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRWARN_A::VALUE2 } } #[doc = "Field `PRWARN` writer - Promote Pre-Warning Interrupt Request to NMI Request"] -pub type PRWARN_W<'a, const O: u8> = crate::BitWriter<'a, u32, NMIREQEN_SPEC, PRWARN_A, O>; -impl<'a, const O: u8> PRWARN_W<'a, O> { +pub type PRWARN_W<'a, REG> = crate::BitWriter<'a, REG, PRWARN_A>; +impl<'a, REG> PRWARN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRWARN_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRWARN_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PI_A { + pub const fn variant(&self) -> PI_A { match self.bits { false => PI_A::VALUE1, true => PI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PI_A::VALUE2 } } #[doc = "Field `PI` writer - Promote RTC Periodic Interrupt request to NMI Request"] -pub type PI_W<'a, const O: u8> = crate::BitWriter<'a, u32, NMIREQEN_SPEC, PI_A, O>; -impl<'a, const O: u8> PI_W<'a, O> { +pub type PI_W<'a, REG> = crate::BitWriter<'a, REG, PI_A>; +impl<'a, REG> PI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PI_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PI_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl AI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AI_A { + pub const fn variant(&self) -> AI_A { match self.bits { false => AI_A::VALUE1, true => AI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AI_A::VALUE2 } } #[doc = "Field `AI` writer - Promote RTC Alarm Interrupt Request to NMI Request"] -pub type AI_W<'a, const O: u8> = crate::BitWriter<'a, u32, NMIREQEN_SPEC, AI_A, O>; -impl<'a, const O: u8> AI_W<'a, O> { +pub type AI_W<'a, REG> = crate::BitWriter<'a, REG, AI_A>; +impl<'a, REG> AI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AI_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AI_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl ERU00_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERU00_A { + pub const fn variant(&self) -> ERU00_A { match self.bits { false => ERU00_A::VALUE1, true => ERU00_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERU00_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERU00_A::VALUE2 } } #[doc = "Field `ERU00` writer - Promote Channel 0 Interrupt of ERU0 Request to NMI Request"] -pub type ERU00_W<'a, const O: u8> = crate::BitWriter<'a, u32, NMIREQEN_SPEC, ERU00_A, O>; -impl<'a, const O: u8> ERU00_W<'a, O> { +pub type ERU00_W<'a, REG> = crate::BitWriter<'a, REG, ERU00_A>; +impl<'a, REG> ERU00_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERU00_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERU00_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl ERU01_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERU01_A { + pub const fn variant(&self) -> ERU01_A { match self.bits { false => ERU01_A::VALUE1, true => ERU01_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERU01_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERU01_A::VALUE2 } } #[doc = "Field `ERU01` writer - Promote Channel 1 Interrupt of ERU0 Request to NMI Request"] -pub type ERU01_W<'a, const O: u8> = crate::BitWriter<'a, u32, NMIREQEN_SPEC, ERU01_A, O>; -impl<'a, const O: u8> ERU01_W<'a, O> { +pub type ERU01_W<'a, REG> = crate::BitWriter<'a, REG, ERU01_A>; +impl<'a, REG> ERU01_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERU01_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERU01_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl ERU02_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERU02_A { + pub const fn variant(&self) -> ERU02_A { match self.bits { false => ERU02_A::VALUE1, true => ERU02_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERU02_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERU02_A::VALUE2 } } #[doc = "Field `ERU02` writer - Promote Channel 2 Interrupt of ERU0 Request to NMI Request"] -pub type ERU02_W<'a, const O: u8> = crate::BitWriter<'a, u32, NMIREQEN_SPEC, ERU02_A, O>; -impl<'a, const O: u8> ERU02_W<'a, O> { +pub type ERU02_W<'a, REG> = crate::BitWriter<'a, REG, ERU02_A>; +impl<'a, REG> ERU02_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERU02_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERU02_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl ERU03_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERU03_A { + pub const fn variant(&self) -> ERU03_A { match self.bits { false => ERU03_A::VALUE1, true => ERU03_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERU03_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERU03_A::VALUE2 } } #[doc = "Field `ERU03` writer - Promote Channel 3 Interrupt of ERU0 Request to NMI Request"] -pub type ERU03_W<'a, const O: u8> = crate::BitWriter<'a, u32, NMIREQEN_SPEC, ERU03_A, O>; -impl<'a, const O: u8> ERU03_W<'a, O> { +pub type ERU03_W<'a, REG> = crate::BitWriter<'a, REG, ERU03_A>; +impl<'a, REG> ERU03_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERU03_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERU03_A::VALUE2) } } @@ -425,64 +414,65 @@ impl W { #[doc = "Bit 0 - Promote Pre-Warning Interrupt Request to NMI Request"] #[inline(always)] #[must_use] - pub fn prwarn(&mut self) -> PRWARN_W<0> { - PRWARN_W::new(self) + pub fn prwarn(&mut self) -> PRWARN_W { + PRWARN_W::new(self, 0) } #[doc = "Bit 1 - Promote RTC Periodic Interrupt request to NMI Request"] #[inline(always)] #[must_use] - pub fn pi(&mut self) -> PI_W<1> { - PI_W::new(self) + pub fn pi(&mut self) -> PI_W { + PI_W::new(self, 1) } #[doc = "Bit 2 - Promote RTC Alarm Interrupt Request to NMI Request"] #[inline(always)] #[must_use] - pub fn ai(&mut self) -> AI_W<2> { - AI_W::new(self) + pub fn ai(&mut self) -> AI_W { + AI_W::new(self, 2) } #[doc = "Bit 16 - Promote Channel 0 Interrupt of ERU0 Request to NMI Request"] #[inline(always)] #[must_use] - pub fn eru00(&mut self) -> ERU00_W<16> { - ERU00_W::new(self) + pub fn eru00(&mut self) -> ERU00_W { + ERU00_W::new(self, 16) } #[doc = "Bit 17 - Promote Channel 1 Interrupt of ERU0 Request to NMI Request"] #[inline(always)] #[must_use] - pub fn eru01(&mut self) -> ERU01_W<17> { - ERU01_W::new(self) + pub fn eru01(&mut self) -> ERU01_W { + ERU01_W::new(self, 17) } #[doc = "Bit 18 - Promote Channel 2 Interrupt of ERU0 Request to NMI Request"] #[inline(always)] #[must_use] - pub fn eru02(&mut self) -> ERU02_W<18> { - ERU02_W::new(self) + pub fn eru02(&mut self) -> ERU02_W { + ERU02_W::new(self, 18) } #[doc = "Bit 19 - Promote Channel 3 Interrupt of ERU0 Request to NMI Request"] #[inline(always)] #[must_use] - pub fn eru03(&mut self) -> ERU03_W<19> { - ERU03_W::new(self) + pub fn eru03(&mut self) -> ERU03_W { + ERU03_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "SCU Service Request Mask\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`nmireqen::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`nmireqen::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`nmireqen::R`](R) reader structure"] +impl crate::Readable for NMIREQEN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`nmireqen::W`](W) writer structure"] impl crate::Writable for NMIREQEN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_interrupt/srclr.rs b/src/scu_interrupt/srclr.rs index cce0ea73..8d1aa842 100644 --- a/src/scu_interrupt/srclr.rs +++ b/src/scu_interrupt/srclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `SRCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "WDT pre-warning Interrupt Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum PRWARN_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `PRWARN` writer - WDT pre-warning Interrupt Clear"] -pub type PRWARN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, PRWARN_AW, O>; -impl<'a, const O: u8> PRWARN_W<'a, O> { +pub type PRWARN_W<'a, REG> = crate::BitWriter<'a, REG, PRWARN_AW>; +impl<'a, REG> PRWARN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRWARN_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRWARN_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `PI` writer - RTC Periodic Interrupt Clear"] -pub type PI_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, PI_AW, O>; -impl<'a, const O: u8> PI_W<'a, O> { +pub type PI_W<'a, REG> = crate::BitWriter<'a, REG, PI_AW>; +impl<'a, REG> PI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PI_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PI_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `AI` writer - RTC Alarm Interrupt Clear"] -pub type AI_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, AI_AW, O>; -impl<'a, const O: u8> AI_W<'a, O> { +pub type AI_W<'a, REG> = crate::BitWriter<'a, REG, AI_AW>; +impl<'a, REG> AI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AI_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AI_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `DLROVR` writer - DLR Request Overrun Interrupt clear"] -pub type DLROVR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, DLROVR_AW, O>; -impl<'a, const O: u8> DLROVR_W<'a, O> { +pub type DLROVR_W<'a, REG> = crate::BitWriter<'a, REG, DLROVR_AW>; +impl<'a, REG> DLROVR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLROVR_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLROVR_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `LPACCR` writer - LPACLR Mirror Register Update Interrupt Clear"] -pub type LPACCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, LPACCR_AW, O>; -impl<'a, const O: u8> LPACCR_W<'a, O> { +pub type LPACCR_W<'a, REG> = crate::BitWriter<'a, REG, LPACCR_AW>; +impl<'a, REG> LPACCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACCR_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACCR_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `LPACTH0` writer - LPACTH0 Mirror Register Update Interrupt Clear"] -pub type LPACTH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, LPACTH0_AW, O>; -impl<'a, const O: u8> LPACTH0_W<'a, O> { +pub type LPACTH0_W<'a, REG> = crate::BitWriter<'a, REG, LPACTH0_AW>; +impl<'a, REG> LPACTH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACTH0_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACTH0_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `LPACTH1` writer - LPACTH1 Mirror Register Update Interrupt Clear"] -pub type LPACTH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, LPACTH1_AW, O>; -impl<'a, const O: u8> LPACTH1_W<'a, O> { +pub type LPACTH1_W<'a, REG> = crate::BitWriter<'a, REG, LPACTH1_AW>; +impl<'a, REG> LPACTH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACTH1_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACTH1_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `LPACST` writer - LPACST Mirror Register Update Interrupt Clear"] -pub type LPACST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, LPACST_AW, O>; -impl<'a, const O: u8> LPACST_W<'a, O> { +pub type LPACST_W<'a, REG> = crate::BitWriter<'a, REG, LPACST_AW>; +impl<'a, REG> LPACST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACST_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACST_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `LPACCLR` writer - LPACCLR Mirror Register Update Interrupt Clear"] -pub type LPACCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, LPACCLR_AW, O>; -impl<'a, const O: u8> LPACCLR_W<'a, O> { +pub type LPACCLR_W<'a, REG> = crate::BitWriter<'a, REG, LPACCLR_AW>; +impl<'a, REG> LPACCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACCLR_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACCLR_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `LPACSET` writer - LPACSET Mirror Register Update Interrupt Clear"] -pub type LPACSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, LPACSET_AW, O>; -impl<'a, const O: u8> LPACSET_W<'a, O> { +pub type LPACSET_W<'a, REG> = crate::BitWriter<'a, REG, LPACSET_AW>; +impl<'a, REG> LPACSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACSET_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACSET_AW::VALUE2) } } @@ -314,16 +325,19 @@ impl From for bool { } } #[doc = "Field `HINTST` writer - HINTST Mirror Register Update Interrupt Clear"] -pub type HINTST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, HINTST_AW, O>; -impl<'a, const O: u8> HINTST_W<'a, O> { +pub type HINTST_W<'a, REG> = crate::BitWriter<'a, REG, HINTST_AW>; +impl<'a, REG> HINTST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTST_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTST_AW::VALUE2) } } @@ -342,16 +356,19 @@ impl From for bool { } } #[doc = "Field `HINTCLR` writer - HINTCLR Mirror Register Update Interrupt Clear"] -pub type HINTCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, HINTCLR_AW, O>; -impl<'a, const O: u8> HINTCLR_W<'a, O> { +pub type HINTCLR_W<'a, REG> = crate::BitWriter<'a, REG, HINTCLR_AW>; +impl<'a, REG> HINTCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTCLR_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTCLR_AW::VALUE2) } } @@ -370,16 +387,19 @@ impl From for bool { } } #[doc = "Field `HINTSET` writer - HINTSET Mirror Register Update Interrupt Clear"] -pub type HINTSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, HINTSET_AW, O>; -impl<'a, const O: u8> HINTSET_W<'a, O> { +pub type HINTSET_W<'a, REG> = crate::BitWriter<'a, REG, HINTSET_AW>; +impl<'a, REG> HINTSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTSET_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTSET_AW::VALUE2) } } @@ -398,16 +418,19 @@ impl From for bool { } } #[doc = "Field `HDCLR` writer - HDCLR Mirror Register Update Clear"] -pub type HDCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, HDCLR_AW, O>; -impl<'a, const O: u8> HDCLR_W<'a, O> { +pub type HDCLR_W<'a, REG> = crate::BitWriter<'a, REG, HDCLR_AW>; +impl<'a, REG> HDCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDCLR_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDCLR_AW::VALUE2) } } @@ -426,16 +449,19 @@ impl From for bool { } } #[doc = "Field `HDSET` writer - HDSET Mirror Register Update Clear"] -pub type HDSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, HDSET_AW, O>; -impl<'a, const O: u8> HDSET_W<'a, O> { +pub type HDSET_W<'a, REG> = crate::BitWriter<'a, REG, HDSET_AW>; +impl<'a, REG> HDSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDSET_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDSET_AW::VALUE2) } } @@ -454,16 +480,19 @@ impl From for bool { } } #[doc = "Field `HDCR` writer - HDCR Mirror Register Update Clear"] -pub type HDCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, HDCR_AW, O>; -impl<'a, const O: u8> HDCR_W<'a, O> { +pub type HDCR_W<'a, REG> = crate::BitWriter<'a, REG, HDCR_AW>; +impl<'a, REG> HDCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDCR_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDCR_AW::VALUE2) } } @@ -482,16 +511,19 @@ impl From for bool { } } #[doc = "Field `OSCSICTRL` writer - OSCSICTRL Mirror Register Update Clear"] -pub type OSCSICTRL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, OSCSICTRL_AW, O>; -impl<'a, const O: u8> OSCSICTRL_W<'a, O> { +pub type OSCSICTRL_W<'a, REG> = crate::BitWriter<'a, REG, OSCSICTRL_AW>; +impl<'a, REG> OSCSICTRL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCSICTRL_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCSICTRL_AW::VALUE2) } } @@ -510,16 +542,19 @@ impl From for bool { } } #[doc = "Field `OSCULCTRL` writer - OSCULCTRL Mirror Register Update Clear"] -pub type OSCULCTRL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, OSCULCTRL_AW, O>; -impl<'a, const O: u8> OSCULCTRL_W<'a, O> { +pub type OSCULCTRL_W<'a, REG> = crate::BitWriter<'a, REG, OSCULCTRL_AW>; +impl<'a, REG> OSCULCTRL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCULCTRL_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCULCTRL_AW::VALUE2) } } @@ -538,16 +573,19 @@ impl From for bool { } } #[doc = "Field `RTC_CTR` writer - RTC CTR Mirror Register Update Clear"] -pub type RTC_CTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, RTC_CTR_AW, O>; -impl<'a, const O: u8> RTC_CTR_W<'a, O> { +pub type RTC_CTR_W<'a, REG> = crate::BitWriter<'a, REG, RTC_CTR_AW>; +impl<'a, REG> RTC_CTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_CTR_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_CTR_AW::VALUE2) } } @@ -566,16 +604,19 @@ impl From for bool { } } #[doc = "Field `RTC_ATIM0` writer - RTC ATIM0 Mirror Register Update Clear"] -pub type RTC_ATIM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, RTC_ATIM0_AW, O>; -impl<'a, const O: u8> RTC_ATIM0_W<'a, O> { +pub type RTC_ATIM0_W<'a, REG> = crate::BitWriter<'a, REG, RTC_ATIM0_AW>; +impl<'a, REG> RTC_ATIM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_ATIM0_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_ATIM0_AW::VALUE2) } } @@ -594,16 +635,19 @@ impl From for bool { } } #[doc = "Field `RTC_ATIM1` writer - RTC ATIM1 Mirror Register Update Clear"] -pub type RTC_ATIM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, RTC_ATIM1_AW, O>; -impl<'a, const O: u8> RTC_ATIM1_W<'a, O> { +pub type RTC_ATIM1_W<'a, REG> = crate::BitWriter<'a, REG, RTC_ATIM1_AW>; +impl<'a, REG> RTC_ATIM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_ATIM1_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_ATIM1_AW::VALUE2) } } @@ -622,16 +666,19 @@ impl From for bool { } } #[doc = "Field `RTC_TIM0` writer - RTC TIM0 Mirror Register Update Clear"] -pub type RTC_TIM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, RTC_TIM0_AW, O>; -impl<'a, const O: u8> RTC_TIM0_W<'a, O> { +pub type RTC_TIM0_W<'a, REG> = crate::BitWriter<'a, REG, RTC_TIM0_AW>; +impl<'a, REG> RTC_TIM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_TIM0_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_TIM0_AW::VALUE2) } } @@ -650,16 +697,19 @@ impl From for bool { } } #[doc = "Field `RTC_TIM1` writer - RTC TIM1 Mirror Register Update Clear"] -pub type RTC_TIM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, RTC_TIM1_AW, O>; -impl<'a, const O: u8> RTC_TIM1_W<'a, O> { +pub type RTC_TIM1_W<'a, REG> = crate::BitWriter<'a, REG, RTC_TIM1_AW>; +impl<'a, REG> RTC_TIM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_TIM1_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_TIM1_AW::VALUE2) } } @@ -678,16 +728,19 @@ impl From for bool { } } #[doc = "Field `RMX` writer - Retention Memory Mirror Register Update Clear"] -pub type RMX_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRCLR_SPEC, RMX_AW, O>; -impl<'a, const O: u8> RMX_W<'a, O> { +pub type RMX_W<'a, REG> = crate::BitWriter<'a, REG, RMX_AW>; +impl<'a, REG> RMX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RMX_AW::VALUE1) } #[doc = "Clear the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RMX_AW::VALUE2) } } @@ -695,162 +748,165 @@ impl W { #[doc = "Bit 0 - WDT pre-warning Interrupt Clear"] #[inline(always)] #[must_use] - pub fn prwarn(&mut self) -> PRWARN_W<0> { - PRWARN_W::new(self) + pub fn prwarn(&mut self) -> PRWARN_W { + PRWARN_W::new(self, 0) } #[doc = "Bit 1 - RTC Periodic Interrupt Clear"] #[inline(always)] #[must_use] - pub fn pi(&mut self) -> PI_W<1> { - PI_W::new(self) + pub fn pi(&mut self) -> PI_W { + PI_W::new(self, 1) } #[doc = "Bit 2 - RTC Alarm Interrupt Clear"] #[inline(always)] #[must_use] - pub fn ai(&mut self) -> AI_W<2> { - AI_W::new(self) + pub fn ai(&mut self) -> AI_W { + AI_W::new(self, 2) } #[doc = "Bit 3 - DLR Request Overrun Interrupt clear"] #[inline(always)] #[must_use] - pub fn dlrovr(&mut self) -> DLROVR_W<3> { - DLROVR_W::new(self) + pub fn dlrovr(&mut self) -> DLROVR_W { + DLROVR_W::new(self, 3) } #[doc = "Bit 6 - LPACLR Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn lpaccr(&mut self) -> LPACCR_W<6> { - LPACCR_W::new(self) + pub fn lpaccr(&mut self) -> LPACCR_W { + LPACCR_W::new(self, 6) } #[doc = "Bit 7 - LPACTH0 Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn lpacth0(&mut self) -> LPACTH0_W<7> { - LPACTH0_W::new(self) + pub fn lpacth0(&mut self) -> LPACTH0_W { + LPACTH0_W::new(self, 7) } #[doc = "Bit 8 - LPACTH1 Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn lpacth1(&mut self) -> LPACTH1_W<8> { - LPACTH1_W::new(self) + pub fn lpacth1(&mut self) -> LPACTH1_W { + LPACTH1_W::new(self, 8) } #[doc = "Bit 9 - LPACST Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn lpacst(&mut self) -> LPACST_W<9> { - LPACST_W::new(self) + pub fn lpacst(&mut self) -> LPACST_W { + LPACST_W::new(self, 9) } #[doc = "Bit 10 - LPACCLR Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn lpacclr(&mut self) -> LPACCLR_W<10> { - LPACCLR_W::new(self) + pub fn lpacclr(&mut self) -> LPACCLR_W { + LPACCLR_W::new(self, 10) } #[doc = "Bit 11 - LPACSET Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn lpacset(&mut self) -> LPACSET_W<11> { - LPACSET_W::new(self) + pub fn lpacset(&mut self) -> LPACSET_W { + LPACSET_W::new(self, 11) } #[doc = "Bit 12 - HINTST Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn hintst(&mut self) -> HINTST_W<12> { - HINTST_W::new(self) + pub fn hintst(&mut self) -> HINTST_W { + HINTST_W::new(self, 12) } #[doc = "Bit 13 - HINTCLR Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn hintclr(&mut self) -> HINTCLR_W<13> { - HINTCLR_W::new(self) + pub fn hintclr(&mut self) -> HINTCLR_W { + HINTCLR_W::new(self, 13) } #[doc = "Bit 14 - HINTSET Mirror Register Update Interrupt Clear"] #[inline(always)] #[must_use] - pub fn hintset(&mut self) -> HINTSET_W<14> { - HINTSET_W::new(self) + pub fn hintset(&mut self) -> HINTSET_W { + HINTSET_W::new(self, 14) } #[doc = "Bit 17 - HDCLR Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn hdclr(&mut self) -> HDCLR_W<17> { - HDCLR_W::new(self) + pub fn hdclr(&mut self) -> HDCLR_W { + HDCLR_W::new(self, 17) } #[doc = "Bit 18 - HDSET Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn hdset(&mut self) -> HDSET_W<18> { - HDSET_W::new(self) + pub fn hdset(&mut self) -> HDSET_W { + HDSET_W::new(self, 18) } #[doc = "Bit 19 - HDCR Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn hdcr(&mut self) -> HDCR_W<19> { - HDCR_W::new(self) + pub fn hdcr(&mut self) -> HDCR_W { + HDCR_W::new(self, 19) } #[doc = "Bit 21 - OSCSICTRL Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn oscsictrl(&mut self) -> OSCSICTRL_W<21> { - OSCSICTRL_W::new(self) + pub fn oscsictrl(&mut self) -> OSCSICTRL_W { + OSCSICTRL_W::new(self, 21) } #[doc = "Bit 23 - OSCULCTRL Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn osculctrl(&mut self) -> OSCULCTRL_W<23> { - OSCULCTRL_W::new(self) + pub fn osculctrl(&mut self) -> OSCULCTRL_W { + OSCULCTRL_W::new(self, 23) } #[doc = "Bit 24 - RTC CTR Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn rtc_ctr(&mut self) -> RTC_CTR_W<24> { - RTC_CTR_W::new(self) + pub fn rtc_ctr(&mut self) -> RTC_CTR_W { + RTC_CTR_W::new(self, 24) } #[doc = "Bit 25 - RTC ATIM0 Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn rtc_atim0(&mut self) -> RTC_ATIM0_W<25> { - RTC_ATIM0_W::new(self) + pub fn rtc_atim0(&mut self) -> RTC_ATIM0_W { + RTC_ATIM0_W::new(self, 25) } #[doc = "Bit 26 - RTC ATIM1 Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn rtc_atim1(&mut self) -> RTC_ATIM1_W<26> { - RTC_ATIM1_W::new(self) + pub fn rtc_atim1(&mut self) -> RTC_ATIM1_W { + RTC_ATIM1_W::new(self, 26) } #[doc = "Bit 27 - RTC TIM0 Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn rtc_tim0(&mut self) -> RTC_TIM0_W<27> { - RTC_TIM0_W::new(self) + pub fn rtc_tim0(&mut self) -> RTC_TIM0_W { + RTC_TIM0_W::new(self, 27) } #[doc = "Bit 28 - RTC TIM1 Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn rtc_tim1(&mut self) -> RTC_TIM1_W<28> { - RTC_TIM1_W::new(self) + pub fn rtc_tim1(&mut self) -> RTC_TIM1_W { + RTC_TIM1_W::new(self, 28) } #[doc = "Bit 29 - Retention Memory Mirror Register Update Clear"] #[inline(always)] #[must_use] - pub fn rmx(&mut self) -> RMX_W<29> { - RMX_W::new(self) + pub fn rmx(&mut self) -> RMX_W { + RMX_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "SCU Service Request Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SRCLR_SPEC; impl crate::RegisterSpec for SRCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [srclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`srclr::W`](W) writer structure"] impl crate::Writable for SRCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_interrupt/srmsk.rs b/src/scu_interrupt/srmsk.rs index 676f6614..e2627b4c 100644 --- a/src/scu_interrupt/srmsk.rs +++ b/src/scu_interrupt/srmsk.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRWARN` reader - WDT pre-warning Interrupt Mask"] pub type PRWARN_R = crate::BitReader; #[doc = "WDT pre-warning Interrupt Mask\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PRWARN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRWARN_A { + pub const fn variant(&self) -> PRWARN_A { match self.bits { false => PRWARN_A::VALUE1, true => PRWARN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRWARN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRWARN_A::VALUE2 } } #[doc = "Field `PRWARN` writer - WDT pre-warning Interrupt Mask"] -pub type PRWARN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, PRWARN_A, O>; -impl<'a, const O: u8> PRWARN_W<'a, O> { +pub type PRWARN_W<'a, REG> = crate::BitWriter<'a, REG, PRWARN_A>; +impl<'a, REG> PRWARN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRWARN_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRWARN_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PI_A { + pub const fn variant(&self) -> PI_A { match self.bits { false => PI_A::VALUE1, true => PI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PI_A::VALUE2 } } #[doc = "Field `PI` writer - RTC Periodic Interrupt Mask"] -pub type PI_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, PI_A, O>; -impl<'a, const O: u8> PI_W<'a, O> { +pub type PI_W<'a, REG> = crate::BitWriter<'a, REG, PI_A>; +impl<'a, REG> PI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PI_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PI_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl AI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AI_A { + pub const fn variant(&self) -> AI_A { match self.bits { false => AI_A::VALUE1, true => AI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AI_A::VALUE2 } } #[doc = "Field `AI` writer - RTC Alarm Interrupt Mask"] -pub type AI_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, AI_A, O>; -impl<'a, const O: u8> AI_W<'a, O> { +pub type AI_W<'a, REG> = crate::BitWriter<'a, REG, AI_A>; +impl<'a, REG> AI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AI_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AI_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl DLROVR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DLROVR_A { + pub const fn variant(&self) -> DLROVR_A { match self.bits { false => DLROVR_A::VALUE1, true => DLROVR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DLROVR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DLROVR_A::VALUE2 } } #[doc = "Field `DLROVR` writer - DLR Request Overrun Interrupt Mask"] -pub type DLROVR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, DLROVR_A, O>; -impl<'a, const O: u8> DLROVR_W<'a, O> { +pub type DLROVR_W<'a, REG> = crate::BitWriter<'a, REG, DLROVR_A>; +impl<'a, REG> DLROVR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLROVR_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLROVR_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl LPACCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACCR_A { + pub const fn variant(&self) -> LPACCR_A { match self.bits { false => LPACCR_A::VALUE1, true => LPACCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACCR_A::VALUE2 } } #[doc = "Field `LPACCR` writer - LPACLR Mirror Register Update Interrupt Mask"] -pub type LPACCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, LPACCR_A, O>; -impl<'a, const O: u8> LPACCR_W<'a, O> { +pub type LPACCR_W<'a, REG> = crate::BitWriter<'a, REG, LPACCR_A>; +impl<'a, REG> LPACCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACCR_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACCR_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl LPACTH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACTH0_A { + pub const fn variant(&self) -> LPACTH0_A { match self.bits { false => LPACTH0_A::VALUE1, true => LPACTH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACTH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACTH0_A::VALUE2 } } #[doc = "Field `LPACTH0` writer - LPACTH0 Mirror Register Update Interrupt Mask"] -pub type LPACTH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, LPACTH0_A, O>; -impl<'a, const O: u8> LPACTH0_W<'a, O> { +pub type LPACTH0_W<'a, REG> = crate::BitWriter<'a, REG, LPACTH0_A>; +impl<'a, REG> LPACTH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACTH0_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACTH0_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl LPACTH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACTH1_A { + pub const fn variant(&self) -> LPACTH1_A { match self.bits { false => LPACTH1_A::VALUE1, true => LPACTH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACTH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACTH1_A::VALUE2 } } #[doc = "Field `LPACTH1` writer - LPACTH1 Mirror Register Update Interrupt Mask"] -pub type LPACTH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, LPACTH1_A, O>; -impl<'a, const O: u8> LPACTH1_W<'a, O> { +pub type LPACTH1_W<'a, REG> = crate::BitWriter<'a, REG, LPACTH1_A>; +impl<'a, REG> LPACTH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACTH1_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACTH1_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl LPACST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACST_A { + pub const fn variant(&self) -> LPACST_A { match self.bits { false => LPACST_A::VALUE1, true => LPACST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACST_A::VALUE2 } } #[doc = "Field `LPACST` writer - LPACST Mirror Register Update Interrupt Mask"] -pub type LPACST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, LPACST_A, O>; -impl<'a, const O: u8> LPACST_W<'a, O> { +pub type LPACST_W<'a, REG> = crate::BitWriter<'a, REG, LPACST_A>; +impl<'a, REG> LPACST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACST_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACST_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl LPACCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACCLR_A { + pub const fn variant(&self) -> LPACCLR_A { match self.bits { false => LPACCLR_A::VALUE1, true => LPACCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACCLR_A::VALUE2 } } #[doc = "Field `LPACCLR` writer - LPACCLR Mirror Register Update Interrupt Mask"] -pub type LPACCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, LPACCLR_A, O>; -impl<'a, const O: u8> LPACCLR_W<'a, O> { +pub type LPACCLR_W<'a, REG> = crate::BitWriter<'a, REG, LPACCLR_A>; +impl<'a, REG> LPACCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACCLR_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACCLR_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl LPACSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACSET_A { + pub const fn variant(&self) -> LPACSET_A { match self.bits { false => LPACSET_A::VALUE1, true => LPACSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACSET_A::VALUE2 } } #[doc = "Field `LPACSET` writer - LPACSET Mirror Register Update Interrupt Mask"] -pub type LPACSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, LPACSET_A, O>; -impl<'a, const O: u8> LPACSET_W<'a, O> { +pub type LPACSET_W<'a, REG> = crate::BitWriter<'a, REG, LPACSET_A>; +impl<'a, REG> LPACSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACSET_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACSET_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl HINTST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTST_A { + pub const fn variant(&self) -> HINTST_A { match self.bits { false => HINTST_A::VALUE1, true => HINTST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTST_A::VALUE2 } } #[doc = "Field `HINTST` writer - HINTST Mirror Register Update Interrupt Mask"] -pub type HINTST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, HINTST_A, O>; -impl<'a, const O: u8> HINTST_W<'a, O> { +pub type HINTST_W<'a, REG> = crate::BitWriter<'a, REG, HINTST_A>; +impl<'a, REG> HINTST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTST_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTST_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl HINTCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTCLR_A { + pub const fn variant(&self) -> HINTCLR_A { match self.bits { false => HINTCLR_A::VALUE1, true => HINTCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTCLR_A::VALUE2 } } #[doc = "Field `HINTCLR` writer - HINTCLR Mirror Register Update Interrupt Mask"] -pub type HINTCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, HINTCLR_A, O>; -impl<'a, const O: u8> HINTCLR_W<'a, O> { +pub type HINTCLR_W<'a, REG> = crate::BitWriter<'a, REG, HINTCLR_A>; +impl<'a, REG> HINTCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTCLR_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTCLR_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl HINTSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTSET_A { + pub const fn variant(&self) -> HINTSET_A { match self.bits { false => HINTSET_A::VALUE1, true => HINTSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTSET_A::VALUE2 } } #[doc = "Field `HINTSET` writer - HINTSET Mirror Register Update Interrupt Mask"] -pub type HINTSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, HINTSET_A, O>; -impl<'a, const O: u8> HINTSET_W<'a, O> { +pub type HINTSET_W<'a, REG> = crate::BitWriter<'a, REG, HINTSET_A>; +impl<'a, REG> HINTSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTSET_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTSET_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl HDCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDCLR_A { + pub const fn variant(&self) -> HDCLR_A { match self.bits { false => HDCLR_A::VALUE1, true => HDCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDCLR_A::VALUE2 } } #[doc = "Field `HDCLR` writer - HDCLR Mirror Register Update Mask"] -pub type HDCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, HDCLR_A, O>; -impl<'a, const O: u8> HDCLR_W<'a, O> { +pub type HDCLR_W<'a, REG> = crate::BitWriter<'a, REG, HDCLR_A>; +impl<'a, REG> HDCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDCLR_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDCLR_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl HDSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDSET_A { + pub const fn variant(&self) -> HDSET_A { match self.bits { false => HDSET_A::VALUE1, true => HDSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDSET_A::VALUE2 } } #[doc = "Field `HDSET` writer - HDSET Mirror Register Update Mask"] -pub type HDSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, HDSET_A, O>; -impl<'a, const O: u8> HDSET_W<'a, O> { +pub type HDSET_W<'a, REG> = crate::BitWriter<'a, REG, HDSET_A>; +impl<'a, REG> HDSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDSET_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDSET_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl HDCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDCR_A { + pub const fn variant(&self) -> HDCR_A { match self.bits { false => HDCR_A::VALUE1, true => HDCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDCR_A::VALUE2 } } #[doc = "Field `HDCR` writer - HDCR Mirror Register Update Mask"] -pub type HDCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, HDCR_A, O>; -impl<'a, const O: u8> HDCR_W<'a, O> { +pub type HDCR_W<'a, REG> = crate::BitWriter<'a, REG, HDCR_A>; +impl<'a, REG> HDCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDCR_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDCR_A::VALUE2) } } @@ -853,34 +869,37 @@ impl From for bool { impl OSCSICTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCSICTRL_A { + pub const fn variant(&self) -> OSCSICTRL_A { match self.bits { false => OSCSICTRL_A::VALUE1, true => OSCSICTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCSICTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCSICTRL_A::VALUE2 } } #[doc = "Field `OSCSICTRL` writer - OSCSICTRL Mirror Register Update Mask"] -pub type OSCSICTRL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, OSCSICTRL_A, O>; -impl<'a, const O: u8> OSCSICTRL_W<'a, O> { +pub type OSCSICTRL_W<'a, REG> = crate::BitWriter<'a, REG, OSCSICTRL_A>; +impl<'a, REG> OSCSICTRL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCSICTRL_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCSICTRL_A::VALUE2) } } @@ -903,34 +922,37 @@ impl From for bool { impl OSCULCTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCULCTRL_A { + pub const fn variant(&self) -> OSCULCTRL_A { match self.bits { false => OSCULCTRL_A::VALUE1, true => OSCULCTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCULCTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCULCTRL_A::VALUE2 } } #[doc = "Field `OSCULCTRL` writer - OSCULCTRL Mirror Register Update Mask"] -pub type OSCULCTRL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, OSCULCTRL_A, O>; -impl<'a, const O: u8> OSCULCTRL_W<'a, O> { +pub type OSCULCTRL_W<'a, REG> = crate::BitWriter<'a, REG, OSCULCTRL_A>; +impl<'a, REG> OSCULCTRL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCULCTRL_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCULCTRL_A::VALUE2) } } @@ -953,34 +975,37 @@ impl From for bool { impl RTC_CTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_CTR_A { + pub const fn variant(&self) -> RTC_CTR_A { match self.bits { false => RTC_CTR_A::VALUE1, true => RTC_CTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_CTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_CTR_A::VALUE2 } } #[doc = "Field `RTC_CTR` writer - RTC CTR Mirror Register Update Mask"] -pub type RTC_CTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, RTC_CTR_A, O>; -impl<'a, const O: u8> RTC_CTR_W<'a, O> { +pub type RTC_CTR_W<'a, REG> = crate::BitWriter<'a, REG, RTC_CTR_A>; +impl<'a, REG> RTC_CTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_CTR_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_CTR_A::VALUE2) } } @@ -1003,34 +1028,37 @@ impl From for bool { impl RTC_ATIM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_ATIM0_A { + pub const fn variant(&self) -> RTC_ATIM0_A { match self.bits { false => RTC_ATIM0_A::VALUE1, true => RTC_ATIM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_ATIM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_ATIM0_A::VALUE2 } } #[doc = "Field `RTC_ATIM0` writer - RTC ATIM0 Mirror Register Update Mask"] -pub type RTC_ATIM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, RTC_ATIM0_A, O>; -impl<'a, const O: u8> RTC_ATIM0_W<'a, O> { +pub type RTC_ATIM0_W<'a, REG> = crate::BitWriter<'a, REG, RTC_ATIM0_A>; +impl<'a, REG> RTC_ATIM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_ATIM0_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_ATIM0_A::VALUE2) } } @@ -1053,34 +1081,37 @@ impl From for bool { impl RTC_ATIM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_ATIM1_A { + pub const fn variant(&self) -> RTC_ATIM1_A { match self.bits { false => RTC_ATIM1_A::VALUE1, true => RTC_ATIM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_ATIM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_ATIM1_A::VALUE2 } } #[doc = "Field `RTC_ATIM1` writer - RTC ATIM1 Mirror Register Update Mask"] -pub type RTC_ATIM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, RTC_ATIM1_A, O>; -impl<'a, const O: u8> RTC_ATIM1_W<'a, O> { +pub type RTC_ATIM1_W<'a, REG> = crate::BitWriter<'a, REG, RTC_ATIM1_A>; +impl<'a, REG> RTC_ATIM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_ATIM1_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_ATIM1_A::VALUE2) } } @@ -1103,34 +1134,37 @@ impl From for bool { impl RTC_TIM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_TIM0_A { + pub const fn variant(&self) -> RTC_TIM0_A { match self.bits { false => RTC_TIM0_A::VALUE1, true => RTC_TIM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_TIM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_TIM0_A::VALUE2 } } #[doc = "Field `RTC_TIM0` writer - RTC TIM0 Mirror Register Update Mask"] -pub type RTC_TIM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, RTC_TIM0_A, O>; -impl<'a, const O: u8> RTC_TIM0_W<'a, O> { +pub type RTC_TIM0_W<'a, REG> = crate::BitWriter<'a, REG, RTC_TIM0_A>; +impl<'a, REG> RTC_TIM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_TIM0_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_TIM0_A::VALUE2) } } @@ -1153,34 +1187,37 @@ impl From for bool { impl RTC_TIM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_TIM1_A { + pub const fn variant(&self) -> RTC_TIM1_A { match self.bits { false => RTC_TIM1_A::VALUE1, true => RTC_TIM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_TIM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_TIM1_A::VALUE2 } } #[doc = "Field `RTC_TIM1` writer - RTC TIM1 Mirror Register Update Mask"] -pub type RTC_TIM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, RTC_TIM1_A, O>; -impl<'a, const O: u8> RTC_TIM1_W<'a, O> { +pub type RTC_TIM1_W<'a, REG> = crate::BitWriter<'a, REG, RTC_TIM1_A>; +impl<'a, REG> RTC_TIM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_TIM1_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_TIM1_A::VALUE2) } } @@ -1203,34 +1240,37 @@ impl From for bool { impl RMX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RMX_A { + pub const fn variant(&self) -> RMX_A { match self.bits { false => RMX_A::VALUE1, true => RMX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RMX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RMX_A::VALUE2 } } #[doc = "Field `RMX` writer - Retention Memory Mirror Register Update Mask"] -pub type RMX_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRMSK_SPEC, RMX_A, O>; -impl<'a, const O: u8> RMX_W<'a, O> { +pub type RMX_W<'a, REG> = crate::BitWriter<'a, REG, RMX_A>; +impl<'a, REG> RMX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RMX_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RMX_A::VALUE2) } } @@ -1360,166 +1400,167 @@ impl W { #[doc = "Bit 0 - WDT pre-warning Interrupt Mask"] #[inline(always)] #[must_use] - pub fn prwarn(&mut self) -> PRWARN_W<0> { - PRWARN_W::new(self) + pub fn prwarn(&mut self) -> PRWARN_W { + PRWARN_W::new(self, 0) } #[doc = "Bit 1 - RTC Periodic Interrupt Mask"] #[inline(always)] #[must_use] - pub fn pi(&mut self) -> PI_W<1> { - PI_W::new(self) + pub fn pi(&mut self) -> PI_W { + PI_W::new(self, 1) } #[doc = "Bit 2 - RTC Alarm Interrupt Mask"] #[inline(always)] #[must_use] - pub fn ai(&mut self) -> AI_W<2> { - AI_W::new(self) + pub fn ai(&mut self) -> AI_W { + AI_W::new(self, 2) } #[doc = "Bit 3 - DLR Request Overrun Interrupt Mask"] #[inline(always)] #[must_use] - pub fn dlrovr(&mut self) -> DLROVR_W<3> { - DLROVR_W::new(self) + pub fn dlrovr(&mut self) -> DLROVR_W { + DLROVR_W::new(self, 3) } #[doc = "Bit 6 - LPACLR Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn lpaccr(&mut self) -> LPACCR_W<6> { - LPACCR_W::new(self) + pub fn lpaccr(&mut self) -> LPACCR_W { + LPACCR_W::new(self, 6) } #[doc = "Bit 7 - LPACTH0 Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn lpacth0(&mut self) -> LPACTH0_W<7> { - LPACTH0_W::new(self) + pub fn lpacth0(&mut self) -> LPACTH0_W { + LPACTH0_W::new(self, 7) } #[doc = "Bit 8 - LPACTH1 Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn lpacth1(&mut self) -> LPACTH1_W<8> { - LPACTH1_W::new(self) + pub fn lpacth1(&mut self) -> LPACTH1_W { + LPACTH1_W::new(self, 8) } #[doc = "Bit 9 - LPACST Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn lpacst(&mut self) -> LPACST_W<9> { - LPACST_W::new(self) + pub fn lpacst(&mut self) -> LPACST_W { + LPACST_W::new(self, 9) } #[doc = "Bit 10 - LPACCLR Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn lpacclr(&mut self) -> LPACCLR_W<10> { - LPACCLR_W::new(self) + pub fn lpacclr(&mut self) -> LPACCLR_W { + LPACCLR_W::new(self, 10) } #[doc = "Bit 11 - LPACSET Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn lpacset(&mut self) -> LPACSET_W<11> { - LPACSET_W::new(self) + pub fn lpacset(&mut self) -> LPACSET_W { + LPACSET_W::new(self, 11) } #[doc = "Bit 12 - HINTST Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn hintst(&mut self) -> HINTST_W<12> { - HINTST_W::new(self) + pub fn hintst(&mut self) -> HINTST_W { + HINTST_W::new(self, 12) } #[doc = "Bit 13 - HINTCLR Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn hintclr(&mut self) -> HINTCLR_W<13> { - HINTCLR_W::new(self) + pub fn hintclr(&mut self) -> HINTCLR_W { + HINTCLR_W::new(self, 13) } #[doc = "Bit 14 - HINTSET Mirror Register Update Interrupt Mask"] #[inline(always)] #[must_use] - pub fn hintset(&mut self) -> HINTSET_W<14> { - HINTSET_W::new(self) + pub fn hintset(&mut self) -> HINTSET_W { + HINTSET_W::new(self, 14) } #[doc = "Bit 17 - HDCLR Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn hdclr(&mut self) -> HDCLR_W<17> { - HDCLR_W::new(self) + pub fn hdclr(&mut self) -> HDCLR_W { + HDCLR_W::new(self, 17) } #[doc = "Bit 18 - HDSET Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn hdset(&mut self) -> HDSET_W<18> { - HDSET_W::new(self) + pub fn hdset(&mut self) -> HDSET_W { + HDSET_W::new(self, 18) } #[doc = "Bit 19 - HDCR Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn hdcr(&mut self) -> HDCR_W<19> { - HDCR_W::new(self) + pub fn hdcr(&mut self) -> HDCR_W { + HDCR_W::new(self, 19) } #[doc = "Bit 21 - OSCSICTRL Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn oscsictrl(&mut self) -> OSCSICTRL_W<21> { - OSCSICTRL_W::new(self) + pub fn oscsictrl(&mut self) -> OSCSICTRL_W { + OSCSICTRL_W::new(self, 21) } #[doc = "Bit 23 - OSCULCTRL Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn osculctrl(&mut self) -> OSCULCTRL_W<23> { - OSCULCTRL_W::new(self) + pub fn osculctrl(&mut self) -> OSCULCTRL_W { + OSCULCTRL_W::new(self, 23) } #[doc = "Bit 24 - RTC CTR Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn rtc_ctr(&mut self) -> RTC_CTR_W<24> { - RTC_CTR_W::new(self) + pub fn rtc_ctr(&mut self) -> RTC_CTR_W { + RTC_CTR_W::new(self, 24) } #[doc = "Bit 25 - RTC ATIM0 Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn rtc_atim0(&mut self) -> RTC_ATIM0_W<25> { - RTC_ATIM0_W::new(self) + pub fn rtc_atim0(&mut self) -> RTC_ATIM0_W { + RTC_ATIM0_W::new(self, 25) } #[doc = "Bit 26 - RTC ATIM1 Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn rtc_atim1(&mut self) -> RTC_ATIM1_W<26> { - RTC_ATIM1_W::new(self) + pub fn rtc_atim1(&mut self) -> RTC_ATIM1_W { + RTC_ATIM1_W::new(self, 26) } #[doc = "Bit 27 - RTC TIM0 Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn rtc_tim0(&mut self) -> RTC_TIM0_W<27> { - RTC_TIM0_W::new(self) + pub fn rtc_tim0(&mut self) -> RTC_TIM0_W { + RTC_TIM0_W::new(self, 27) } #[doc = "Bit 28 - RTC TIM1 Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn rtc_tim1(&mut self) -> RTC_TIM1_W<28> { - RTC_TIM1_W::new(self) + pub fn rtc_tim1(&mut self) -> RTC_TIM1_W { + RTC_TIM1_W::new(self, 28) } #[doc = "Bit 29 - Retention Memory Mirror Register Update Mask"] #[inline(always)] #[must_use] - pub fn rmx(&mut self) -> RMX_W<29> { - RMX_W::new(self) + pub fn rmx(&mut self) -> RMX_W { + RMX_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "SCU Service Request Mask\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srmsk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srmsk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`srmsk::R`](R) reader structure"] +impl crate::Readable for SRMSK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`srmsk::W`](W) writer structure"] impl crate::Writable for SRMSK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_interrupt/srraw.rs b/src/scu_interrupt/srraw.rs index c7a63a34..c68369f2 100644 --- a/src/scu_interrupt/srraw.rs +++ b/src/scu_interrupt/srraw.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PRWARN` reader - WDT pre-warning Interrupt Status Before Masking"] pub type PRWARN_R = crate::BitReader; #[doc = "WDT pre-warning Interrupt Status Before Masking\n\nValue on reset: 0"] @@ -32,29 +19,29 @@ impl From for bool { impl PRWARN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRWARN_A { + pub const fn variant(&self) -> PRWARN_A { match self.bits { false => PRWARN_A::VALUE1, true => PRWARN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRWARN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRWARN_A::VALUE2 } } #[doc = "Field `PI` reader - RTC Raw Periodic Interrupt Status Before Masking"] -pub type PI_R = crate::BitReader; +pub type PI_R = crate::BitReader; #[doc = "Field `AI` reader - RTC Raw Alarm Interrupt Status Before Masking"] -pub type AI_R = crate::BitReader; +pub type AI_R = crate::BitReader; #[doc = "Field `DLROVR` reader - DLR Request Overrun Interrupt Status Before Masking"] -pub type DLROVR_R = crate::BitReader; +pub type DLROVR_R = crate::BitReader; #[doc = "Field `LPACCR` reader - LPACLR Mirror Register Update Status Before Masking"] pub type LPACCR_R = crate::BitReader; #[doc = "LPACLR Mirror Register Update Status Before Masking\n\nValue on reset: 0"] @@ -74,18 +61,18 @@ impl From for bool { impl LPACCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACCR_A { + pub const fn variant(&self) -> LPACCR_A { match self.bits { false => LPACCR_A::VALUE1, true => LPACCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACCR_A::VALUE2 @@ -110,18 +97,18 @@ impl From for bool { impl LPACTH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACTH0_A { + pub const fn variant(&self) -> LPACTH0_A { match self.bits { false => LPACTH0_A::VALUE1, true => LPACTH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACTH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACTH0_A::VALUE2 @@ -146,18 +133,18 @@ impl From for bool { impl LPACTH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACTH1_A { + pub const fn variant(&self) -> LPACTH1_A { match self.bits { false => LPACTH1_A::VALUE1, true => LPACTH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACTH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACTH1_A::VALUE2 @@ -182,18 +169,18 @@ impl From for bool { impl LPACST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACST_A { + pub const fn variant(&self) -> LPACST_A { match self.bits { false => LPACST_A::VALUE1, true => LPACST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACST_A::VALUE2 @@ -218,18 +205,18 @@ impl From for bool { impl LPACCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACCLR_A { + pub const fn variant(&self) -> LPACCLR_A { match self.bits { false => LPACCLR_A::VALUE1, true => LPACCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACCLR_A::VALUE2 @@ -254,18 +241,18 @@ impl From for bool { impl LPACSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACSET_A { + pub const fn variant(&self) -> LPACSET_A { match self.bits { false => LPACSET_A::VALUE1, true => LPACSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACSET_A::VALUE2 @@ -290,18 +277,18 @@ impl From for bool { impl HINTST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTST_A { + pub const fn variant(&self) -> HINTST_A { match self.bits { false => HINTST_A::VALUE1, true => HINTST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTST_A::VALUE2 @@ -326,18 +313,18 @@ impl From for bool { impl HINTCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTCLR_A { + pub const fn variant(&self) -> HINTCLR_A { match self.bits { false => HINTCLR_A::VALUE1, true => HINTCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTCLR_A::VALUE2 @@ -362,18 +349,18 @@ impl From for bool { impl HINTSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTSET_A { + pub const fn variant(&self) -> HINTSET_A { match self.bits { false => HINTSET_A::VALUE1, true => HINTSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTSET_A::VALUE2 @@ -398,18 +385,18 @@ impl From for bool { impl HDCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDCLR_A { + pub const fn variant(&self) -> HDCLR_A { match self.bits { false => HDCLR_A::VALUE1, true => HDCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDCLR_A::VALUE2 @@ -434,18 +421,18 @@ impl From for bool { impl HDSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDSET_A { + pub const fn variant(&self) -> HDSET_A { match self.bits { false => HDSET_A::VALUE1, true => HDSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDSET_A::VALUE2 @@ -470,18 +457,18 @@ impl From for bool { impl HDCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDCR_A { + pub const fn variant(&self) -> HDCR_A { match self.bits { false => HDCR_A::VALUE1, true => HDCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDCR_A::VALUE2 @@ -506,18 +493,18 @@ impl From for bool { impl OSCSICTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCSICTRL_A { + pub const fn variant(&self) -> OSCSICTRL_A { match self.bits { false => OSCSICTRL_A::VALUE1, true => OSCSICTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCSICTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCSICTRL_A::VALUE2 @@ -542,18 +529,18 @@ impl From for bool { impl OSCULCTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCULCTRL_A { + pub const fn variant(&self) -> OSCULCTRL_A { match self.bits { false => OSCULCTRL_A::VALUE1, true => OSCULCTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCULCTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCULCTRL_A::VALUE2 @@ -578,18 +565,18 @@ impl From for bool { impl RTC_CTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_CTR_A { + pub const fn variant(&self) -> RTC_CTR_A { match self.bits { false => RTC_CTR_A::VALUE1, true => RTC_CTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_CTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_CTR_A::VALUE2 @@ -614,18 +601,18 @@ impl From for bool { impl RTC_ATIM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_ATIM0_A { + pub const fn variant(&self) -> RTC_ATIM0_A { match self.bits { false => RTC_ATIM0_A::VALUE1, true => RTC_ATIM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_ATIM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_ATIM0_A::VALUE2 @@ -650,18 +637,18 @@ impl From for bool { impl RTC_ATIM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_ATIM1_A { + pub const fn variant(&self) -> RTC_ATIM1_A { match self.bits { false => RTC_ATIM1_A::VALUE1, true => RTC_ATIM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_ATIM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_ATIM1_A::VALUE2 @@ -686,18 +673,18 @@ impl From for bool { impl RTC_TIM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_TIM0_A { + pub const fn variant(&self) -> RTC_TIM0_A { match self.bits { false => RTC_TIM0_A::VALUE1, true => RTC_TIM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_TIM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_TIM0_A::VALUE2 @@ -722,18 +709,18 @@ impl From for bool { impl RTC_TIM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_TIM1_A { + pub const fn variant(&self) -> RTC_TIM1_A { match self.bits { false => RTC_TIM1_A::VALUE1, true => RTC_TIM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_TIM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_TIM1_A::VALUE2 @@ -758,18 +745,18 @@ impl From for bool { impl RMX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RMX_A { + pub const fn variant(&self) -> RMX_A { match self.bits { false => RMX_A::VALUE1, true => RMX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RMX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RMX_A::VALUE2 @@ -897,15 +884,13 @@ impl R { RMX_R::new(((self.bits >> 29) & 1) != 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"] +#[doc = "SCU Raw Service Request Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srraw::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`srraw::R`](R) reader structure"] +impl crate::Readable for SRRAW_SPEC {} #[doc = "`reset()` method sets SRRAW to value 0"] impl crate::Resettable for SRRAW_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_interrupt/srset.rs b/src/scu_interrupt/srset.rs index 0a847e40..465cb347 100644 --- a/src/scu_interrupt/srset.rs +++ b/src/scu_interrupt/srset.rs @@ -1,24 +1,5 @@ #[doc = "Register `SRSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "WDT pre-warning Interrupt Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum PRWARN_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `PRWARN` writer - WDT pre-warning Interrupt Set"] -pub type PRWARN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, PRWARN_AW, O>; -impl<'a, const O: u8> PRWARN_W<'a, O> { +pub type PRWARN_W<'a, REG> = crate::BitWriter<'a, REG, PRWARN_AW>; +impl<'a, REG> PRWARN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRWARN_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRWARN_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `PI` writer - RTC Periodic Interrupt Set"] -pub type PI_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, PI_AW, O>; -impl<'a, const O: u8> PI_W<'a, O> { +pub type PI_W<'a, REG> = crate::BitWriter<'a, REG, PI_AW>; +impl<'a, REG> PI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PI_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PI_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `AI` writer - RTC Alarm Interrupt Set"] -pub type AI_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, AI_AW, O>; -impl<'a, const O: u8> AI_W<'a, O> { +pub type AI_W<'a, REG> = crate::BitWriter<'a, REG, AI_AW>; +impl<'a, REG> AI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AI_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AI_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `DLROVR` writer - DLR Request Overrun Interrupt Set"] -pub type DLROVR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, DLROVR_AW, O>; -impl<'a, const O: u8> DLROVR_W<'a, O> { +pub type DLROVR_W<'a, REG> = crate::BitWriter<'a, REG, DLROVR_AW>; +impl<'a, REG> DLROVR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLROVR_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLROVR_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `LPACCR` writer - LPACLR Mirror Register Update Interrupt Set"] -pub type LPACCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, LPACCR_AW, O>; -impl<'a, const O: u8> LPACCR_W<'a, O> { +pub type LPACCR_W<'a, REG> = crate::BitWriter<'a, REG, LPACCR_AW>; +impl<'a, REG> LPACCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACCR_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACCR_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `LPACTH0` writer - LPACTH0 Mirror Register Update Interrupt Set"] -pub type LPACTH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, LPACTH0_AW, O>; -impl<'a, const O: u8> LPACTH0_W<'a, O> { +pub type LPACTH0_W<'a, REG> = crate::BitWriter<'a, REG, LPACTH0_AW>; +impl<'a, REG> LPACTH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACTH0_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACTH0_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `LPACTH1` writer - LPACTH1 Mirror Register Update Interrupt Set"] -pub type LPACTH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, LPACTH1_AW, O>; -impl<'a, const O: u8> LPACTH1_W<'a, O> { +pub type LPACTH1_W<'a, REG> = crate::BitWriter<'a, REG, LPACTH1_AW>; +impl<'a, REG> LPACTH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACTH1_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACTH1_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `LPACST` writer - LPACST Mirror Register Update Interrupt Set"] -pub type LPACST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, LPACST_AW, O>; -impl<'a, const O: u8> LPACST_W<'a, O> { +pub type LPACST_W<'a, REG> = crate::BitWriter<'a, REG, LPACST_AW>; +impl<'a, REG> LPACST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACST_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACST_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `LPACCLR` writer - LPACCLR Mirror Register Update Interrupt Set"] -pub type LPACCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, LPACCLR_AW, O>; -impl<'a, const O: u8> LPACCLR_W<'a, O> { +pub type LPACCLR_W<'a, REG> = crate::BitWriter<'a, REG, LPACCLR_AW>; +impl<'a, REG> LPACCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACCLR_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACCLR_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `LPACSET` writer - LPACSET Mirror Register Update Interrupt Set"] -pub type LPACSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, LPACSET_AW, O>; -impl<'a, const O: u8> LPACSET_W<'a, O> { +pub type LPACSET_W<'a, REG> = crate::BitWriter<'a, REG, LPACSET_AW>; +impl<'a, REG> LPACSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LPACSET_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LPACSET_AW::VALUE2) } } @@ -314,16 +325,19 @@ impl From for bool { } } #[doc = "Field `HINTST` writer - HINTST Mirror Register Update Interrupt Set"] -pub type HINTST_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, HINTST_AW, O>; -impl<'a, const O: u8> HINTST_W<'a, O> { +pub type HINTST_W<'a, REG> = crate::BitWriter<'a, REG, HINTST_AW>; +impl<'a, REG> HINTST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTST_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTST_AW::VALUE2) } } @@ -342,16 +356,19 @@ impl From for bool { } } #[doc = "Field `HINTCLR` writer - HINTCLR Mirror Register Update Interrupt Set"] -pub type HINTCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, HINTCLR_AW, O>; -impl<'a, const O: u8> HINTCLR_W<'a, O> { +pub type HINTCLR_W<'a, REG> = crate::BitWriter<'a, REG, HINTCLR_AW>; +impl<'a, REG> HINTCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTCLR_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTCLR_AW::VALUE2) } } @@ -370,16 +387,19 @@ impl From for bool { } } #[doc = "Field `HINTSET` writer - HINTSET Mirror Register Update Interrupt Set"] -pub type HINTSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, HINTSET_AW, O>; -impl<'a, const O: u8> HINTSET_W<'a, O> { +pub type HINTSET_W<'a, REG> = crate::BitWriter<'a, REG, HINTSET_AW>; +impl<'a, REG> HINTSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HINTSET_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HINTSET_AW::VALUE2) } } @@ -398,16 +418,19 @@ impl From for bool { } } #[doc = "Field `HDCRCLR` writer - HDCRCLR Mirror Register Update Set"] -pub type HDCRCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, HDCRCLR_AW, O>; -impl<'a, const O: u8> HDCRCLR_W<'a, O> { +pub type HDCRCLR_W<'a, REG> = crate::BitWriter<'a, REG, HDCRCLR_AW>; +impl<'a, REG> HDCRCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDCRCLR_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDCRCLR_AW::VALUE2) } } @@ -426,16 +449,19 @@ impl From for bool { } } #[doc = "Field `HDCRSET` writer - HDCRSET Mirror Register Update Set"] -pub type HDCRSET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, HDCRSET_AW, O>; -impl<'a, const O: u8> HDCRSET_W<'a, O> { +pub type HDCRSET_W<'a, REG> = crate::BitWriter<'a, REG, HDCRSET_AW>; +impl<'a, REG> HDCRSET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDCRSET_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDCRSET_AW::VALUE2) } } @@ -454,16 +480,19 @@ impl From for bool { } } #[doc = "Field `HDCR` writer - HDCR Mirror Register Update Set"] -pub type HDCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, HDCR_AW, O>; -impl<'a, const O: u8> HDCR_W<'a, O> { +pub type HDCR_W<'a, REG> = crate::BitWriter<'a, REG, HDCR_AW>; +impl<'a, REG> HDCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HDCR_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HDCR_AW::VALUE2) } } @@ -482,16 +511,19 @@ impl From for bool { } } #[doc = "Field `OSCSICTRL` writer - OSCSICTRL Mirror Register Update Set"] -pub type OSCSICTRL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, OSCSICTRL_AW, O>; -impl<'a, const O: u8> OSCSICTRL_W<'a, O> { +pub type OSCSICTRL_W<'a, REG> = crate::BitWriter<'a, REG, OSCSICTRL_AW>; +impl<'a, REG> OSCSICTRL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCSICTRL_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCSICTRL_AW::VALUE2) } } @@ -510,16 +542,19 @@ impl From for bool { } } #[doc = "Field `OSCULCTRL` writer - OSCULCTRL Mirror Register Update Set"] -pub type OSCULCTRL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, OSCULCTRL_AW, O>; -impl<'a, const O: u8> OSCULCTRL_W<'a, O> { +pub type OSCULCTRL_W<'a, REG> = crate::BitWriter<'a, REG, OSCULCTRL_AW>; +impl<'a, REG> OSCULCTRL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCULCTRL_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCULCTRL_AW::VALUE2) } } @@ -538,16 +573,19 @@ impl From for bool { } } #[doc = "Field `RTC_CTR` writer - RTC CTR Mirror Register Update Set"] -pub type RTC_CTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, RTC_CTR_AW, O>; -impl<'a, const O: u8> RTC_CTR_W<'a, O> { +pub type RTC_CTR_W<'a, REG> = crate::BitWriter<'a, REG, RTC_CTR_AW>; +impl<'a, REG> RTC_CTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_CTR_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_CTR_AW::VALUE2) } } @@ -566,16 +604,19 @@ impl From for bool { } } #[doc = "Field `RTC_ATIM0` writer - RTC ATIM0 Mirror Register Update Set"] -pub type RTC_ATIM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, RTC_ATIM0_AW, O>; -impl<'a, const O: u8> RTC_ATIM0_W<'a, O> { +pub type RTC_ATIM0_W<'a, REG> = crate::BitWriter<'a, REG, RTC_ATIM0_AW>; +impl<'a, REG> RTC_ATIM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_ATIM0_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_ATIM0_AW::VALUE2) } } @@ -594,16 +635,19 @@ impl From for bool { } } #[doc = "Field `RTC_ATIM1` writer - RTC ATIM1 Mirror Register Update Set"] -pub type RTC_ATIM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, RTC_ATIM1_AW, O>; -impl<'a, const O: u8> RTC_ATIM1_W<'a, O> { +pub type RTC_ATIM1_W<'a, REG> = crate::BitWriter<'a, REG, RTC_ATIM1_AW>; +impl<'a, REG> RTC_ATIM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_ATIM1_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_ATIM1_AW::VALUE2) } } @@ -622,16 +666,19 @@ impl From for bool { } } #[doc = "Field `RTC_TIM0` writer - RTC TIM0 Mirror Register Update Set"] -pub type RTC_TIM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, RTC_TIM0_AW, O>; -impl<'a, const O: u8> RTC_TIM0_W<'a, O> { +pub type RTC_TIM0_W<'a, REG> = crate::BitWriter<'a, REG, RTC_TIM0_AW>; +impl<'a, REG> RTC_TIM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_TIM0_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_TIM0_AW::VALUE2) } } @@ -650,16 +697,19 @@ impl From for bool { } } #[doc = "Field `RTC_TIM1` writer - RTC TIM1 Mirror Register Update Set"] -pub type RTC_TIM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, RTC_TIM1_AW, O>; -impl<'a, const O: u8> RTC_TIM1_W<'a, O> { +pub type RTC_TIM1_W<'a, REG> = crate::BitWriter<'a, REG, RTC_TIM1_AW>; +impl<'a, REG> RTC_TIM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RTC_TIM1_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RTC_TIM1_AW::VALUE2) } } @@ -678,16 +728,19 @@ impl From for bool { } } #[doc = "Field `RMX` writer - Retention Memory Mirror Register Update Set"] -pub type RMX_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRSET_SPEC, RMX_AW, O>; -impl<'a, const O: u8> RMX_W<'a, O> { +pub type RMX_W<'a, REG> = crate::BitWriter<'a, REG, RMX_AW>; +impl<'a, REG> RMX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RMX_AW::VALUE1) } #[doc = "set the status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RMX_AW::VALUE2) } } @@ -695,162 +748,165 @@ impl W { #[doc = "Bit 0 - WDT pre-warning Interrupt Set"] #[inline(always)] #[must_use] - pub fn prwarn(&mut self) -> PRWARN_W<0> { - PRWARN_W::new(self) + pub fn prwarn(&mut self) -> PRWARN_W { + PRWARN_W::new(self, 0) } #[doc = "Bit 1 - RTC Periodic Interrupt Set"] #[inline(always)] #[must_use] - pub fn pi(&mut self) -> PI_W<1> { - PI_W::new(self) + pub fn pi(&mut self) -> PI_W { + PI_W::new(self, 1) } #[doc = "Bit 2 - RTC Alarm Interrupt Set"] #[inline(always)] #[must_use] - pub fn ai(&mut self) -> AI_W<2> { - AI_W::new(self) + pub fn ai(&mut self) -> AI_W { + AI_W::new(self, 2) } #[doc = "Bit 3 - DLR Request Overrun Interrupt Set"] #[inline(always)] #[must_use] - pub fn dlrovr(&mut self) -> DLROVR_W<3> { - DLROVR_W::new(self) + pub fn dlrovr(&mut self) -> DLROVR_W { + DLROVR_W::new(self, 3) } #[doc = "Bit 6 - LPACLR Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn lpaccr(&mut self) -> LPACCR_W<6> { - LPACCR_W::new(self) + pub fn lpaccr(&mut self) -> LPACCR_W { + LPACCR_W::new(self, 6) } #[doc = "Bit 7 - LPACTH0 Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn lpacth0(&mut self) -> LPACTH0_W<7> { - LPACTH0_W::new(self) + pub fn lpacth0(&mut self) -> LPACTH0_W { + LPACTH0_W::new(self, 7) } #[doc = "Bit 8 - LPACTH1 Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn lpacth1(&mut self) -> LPACTH1_W<8> { - LPACTH1_W::new(self) + pub fn lpacth1(&mut self) -> LPACTH1_W { + LPACTH1_W::new(self, 8) } #[doc = "Bit 9 - LPACST Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn lpacst(&mut self) -> LPACST_W<9> { - LPACST_W::new(self) + pub fn lpacst(&mut self) -> LPACST_W { + LPACST_W::new(self, 9) } #[doc = "Bit 10 - LPACCLR Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn lpacclr(&mut self) -> LPACCLR_W<10> { - LPACCLR_W::new(self) + pub fn lpacclr(&mut self) -> LPACCLR_W { + LPACCLR_W::new(self, 10) } #[doc = "Bit 11 - LPACSET Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn lpacset(&mut self) -> LPACSET_W<11> { - LPACSET_W::new(self) + pub fn lpacset(&mut self) -> LPACSET_W { + LPACSET_W::new(self, 11) } #[doc = "Bit 12 - HINTST Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn hintst(&mut self) -> HINTST_W<12> { - HINTST_W::new(self) + pub fn hintst(&mut self) -> HINTST_W { + HINTST_W::new(self, 12) } #[doc = "Bit 13 - HINTCLR Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn hintclr(&mut self) -> HINTCLR_W<13> { - HINTCLR_W::new(self) + pub fn hintclr(&mut self) -> HINTCLR_W { + HINTCLR_W::new(self, 13) } #[doc = "Bit 14 - HINTSET Mirror Register Update Interrupt Set"] #[inline(always)] #[must_use] - pub fn hintset(&mut self) -> HINTSET_W<14> { - HINTSET_W::new(self) + pub fn hintset(&mut self) -> HINTSET_W { + HINTSET_W::new(self, 14) } #[doc = "Bit 17 - HDCRCLR Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn hdcrclr(&mut self) -> HDCRCLR_W<17> { - HDCRCLR_W::new(self) + pub fn hdcrclr(&mut self) -> HDCRCLR_W { + HDCRCLR_W::new(self, 17) } #[doc = "Bit 18 - HDCRSET Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn hdcrset(&mut self) -> HDCRSET_W<18> { - HDCRSET_W::new(self) + pub fn hdcrset(&mut self) -> HDCRSET_W { + HDCRSET_W::new(self, 18) } #[doc = "Bit 19 - HDCR Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn hdcr(&mut self) -> HDCR_W<19> { - HDCR_W::new(self) + pub fn hdcr(&mut self) -> HDCR_W { + HDCR_W::new(self, 19) } #[doc = "Bit 21 - OSCSICTRL Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn oscsictrl(&mut self) -> OSCSICTRL_W<21> { - OSCSICTRL_W::new(self) + pub fn oscsictrl(&mut self) -> OSCSICTRL_W { + OSCSICTRL_W::new(self, 21) } #[doc = "Bit 23 - OSCULCTRL Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn osculctrl(&mut self) -> OSCULCTRL_W<23> { - OSCULCTRL_W::new(self) + pub fn osculctrl(&mut self) -> OSCULCTRL_W { + OSCULCTRL_W::new(self, 23) } #[doc = "Bit 24 - RTC CTR Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn rtc_ctr(&mut self) -> RTC_CTR_W<24> { - RTC_CTR_W::new(self) + pub fn rtc_ctr(&mut self) -> RTC_CTR_W { + RTC_CTR_W::new(self, 24) } #[doc = "Bit 25 - RTC ATIM0 Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn rtc_atim0(&mut self) -> RTC_ATIM0_W<25> { - RTC_ATIM0_W::new(self) + pub fn rtc_atim0(&mut self) -> RTC_ATIM0_W { + RTC_ATIM0_W::new(self, 25) } #[doc = "Bit 26 - RTC ATIM1 Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn rtc_atim1(&mut self) -> RTC_ATIM1_W<26> { - RTC_ATIM1_W::new(self) + pub fn rtc_atim1(&mut self) -> RTC_ATIM1_W { + RTC_ATIM1_W::new(self, 26) } #[doc = "Bit 27 - RTC TIM0 Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn rtc_tim0(&mut self) -> RTC_TIM0_W<27> { - RTC_TIM0_W::new(self) + pub fn rtc_tim0(&mut self) -> RTC_TIM0_W { + RTC_TIM0_W::new(self, 27) } #[doc = "Bit 28 - RTC TIM1 Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn rtc_tim1(&mut self) -> RTC_TIM1_W<28> { - RTC_TIM1_W::new(self) + pub fn rtc_tim1(&mut self) -> RTC_TIM1_W { + RTC_TIM1_W::new(self, 28) } #[doc = "Bit 29 - Retention Memory Mirror Register Update Set"] #[inline(always)] #[must_use] - pub fn rmx(&mut self) -> RMX_W<29> { - RMX_W::new(self) + pub fn rmx(&mut self) -> RMX_W { + RMX_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "SCU Service Request Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SRSET_SPEC; impl crate::RegisterSpec for SRSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [srset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`srset::W`](W) writer structure"] impl crate::Writable for SRSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_interrupt/srstat.rs b/src/scu_interrupt/srstat.rs index b38d4da0..0be3abff 100644 --- a/src/scu_interrupt/srstat.rs +++ b/src/scu_interrupt/srstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `PRWARN` reader - WDT pre-warning Interrupt Status"] pub type PRWARN_R = crate::BitReader; #[doc = "WDT pre-warning Interrupt Status\n\nValue on reset: 0"] @@ -32,29 +19,29 @@ impl From for bool { impl PRWARN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRWARN_A { + pub const fn variant(&self) -> PRWARN_A { match self.bits { false => PRWARN_A::VALUE1, true => PRWARN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRWARN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRWARN_A::VALUE2 } } #[doc = "Field `PI` reader - RTC Periodic Interrupt Status"] -pub type PI_R = crate::BitReader; +pub type PI_R = crate::BitReader; #[doc = "Field `AI` reader - Alarm Interrupt Status"] -pub type AI_R = crate::BitReader; +pub type AI_R = crate::BitReader; #[doc = "Field `DLROVR` reader - DLR Request Overrun Interrupt Status"] -pub type DLROVR_R = crate::BitReader; +pub type DLROVR_R = crate::BitReader; #[doc = "Field `LPACCR` reader - LPACLR Mirror Register Update Status"] pub type LPACCR_R = crate::BitReader; #[doc = "LPACLR Mirror Register Update Status\n\nValue on reset: 0"] @@ -74,18 +61,18 @@ impl From for bool { impl LPACCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACCR_A { + pub const fn variant(&self) -> LPACCR_A { match self.bits { false => LPACCR_A::VALUE1, true => LPACCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACCR_A::VALUE2 @@ -110,18 +97,18 @@ impl From for bool { impl LPACTH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACTH0_A { + pub const fn variant(&self) -> LPACTH0_A { match self.bits { false => LPACTH0_A::VALUE1, true => LPACTH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACTH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACTH0_A::VALUE2 @@ -146,18 +133,18 @@ impl From for bool { impl LPACTH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACTH1_A { + pub const fn variant(&self) -> LPACTH1_A { match self.bits { false => LPACTH1_A::VALUE1, true => LPACTH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACTH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACTH1_A::VALUE2 @@ -182,18 +169,18 @@ impl From for bool { impl LPACST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACST_A { + pub const fn variant(&self) -> LPACST_A { match self.bits { false => LPACST_A::VALUE1, true => LPACST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACST_A::VALUE2 @@ -218,18 +205,18 @@ impl From for bool { impl LPACCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACCLR_A { + pub const fn variant(&self) -> LPACCLR_A { match self.bits { false => LPACCLR_A::VALUE1, true => LPACCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACCLR_A::VALUE2 @@ -254,18 +241,18 @@ impl From for bool { impl LPACSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LPACSET_A { + pub const fn variant(&self) -> LPACSET_A { match self.bits { false => LPACSET_A::VALUE1, true => LPACSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LPACSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LPACSET_A::VALUE2 @@ -290,18 +277,18 @@ impl From for bool { impl HINTST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTST_A { + pub const fn variant(&self) -> HINTST_A { match self.bits { false => HINTST_A::VALUE1, true => HINTST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTST_A::VALUE2 @@ -326,18 +313,18 @@ impl From for bool { impl HINTCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTCLR_A { + pub const fn variant(&self) -> HINTCLR_A { match self.bits { false => HINTCLR_A::VALUE1, true => HINTCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTCLR_A::VALUE2 @@ -362,18 +349,18 @@ impl From for bool { impl HINTSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HINTSET_A { + pub const fn variant(&self) -> HINTSET_A { match self.bits { false => HINTSET_A::VALUE1, true => HINTSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HINTSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HINTSET_A::VALUE2 @@ -398,18 +385,18 @@ impl From for bool { impl HDCLR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDCLR_A { + pub const fn variant(&self) -> HDCLR_A { match self.bits { false => HDCLR_A::VALUE1, true => HDCLR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDCLR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDCLR_A::VALUE2 @@ -434,18 +421,18 @@ impl From for bool { impl HDSET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDSET_A { + pub const fn variant(&self) -> HDSET_A { match self.bits { false => HDSET_A::VALUE1, true => HDSET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDSET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDSET_A::VALUE2 @@ -470,18 +457,18 @@ impl From for bool { impl HDCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HDCR_A { + pub const fn variant(&self) -> HDCR_A { match self.bits { false => HDCR_A::VALUE1, true => HDCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HDCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HDCR_A::VALUE2 @@ -506,18 +493,18 @@ impl From for bool { impl OSCSICTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCSICTRL_A { + pub const fn variant(&self) -> OSCSICTRL_A { match self.bits { false => OSCSICTRL_A::VALUE1, true => OSCSICTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCSICTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCSICTRL_A::VALUE2 @@ -542,18 +529,18 @@ impl From for bool { impl OSCULCTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCULCTRL_A { + pub const fn variant(&self) -> OSCULCTRL_A { match self.bits { false => OSCULCTRL_A::VALUE1, true => OSCULCTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCULCTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCULCTRL_A::VALUE2 @@ -578,18 +565,18 @@ impl From for bool { impl RTC_CTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_CTR_A { + pub const fn variant(&self) -> RTC_CTR_A { match self.bits { false => RTC_CTR_A::VALUE1, true => RTC_CTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_CTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_CTR_A::VALUE2 @@ -614,18 +601,18 @@ impl From for bool { impl RTC_ATIM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_ATIM0_A { + pub const fn variant(&self) -> RTC_ATIM0_A { match self.bits { false => RTC_ATIM0_A::VALUE1, true => RTC_ATIM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_ATIM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_ATIM0_A::VALUE2 @@ -650,18 +637,18 @@ impl From for bool { impl RTC_ATIM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_ATIM1_A { + pub const fn variant(&self) -> RTC_ATIM1_A { match self.bits { false => RTC_ATIM1_A::VALUE1, true => RTC_ATIM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_ATIM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_ATIM1_A::VALUE2 @@ -686,18 +673,18 @@ impl From for bool { impl RTC_TIM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_TIM0_A { + pub const fn variant(&self) -> RTC_TIM0_A { match self.bits { false => RTC_TIM0_A::VALUE1, true => RTC_TIM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_TIM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_TIM0_A::VALUE2 @@ -722,18 +709,18 @@ impl From for bool { impl RTC_TIM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RTC_TIM1_A { + pub const fn variant(&self) -> RTC_TIM1_A { match self.bits { false => RTC_TIM1_A::VALUE1, true => RTC_TIM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RTC_TIM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RTC_TIM1_A::VALUE2 @@ -758,18 +745,18 @@ impl From for bool { impl RMX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RMX_A { + pub const fn variant(&self) -> RMX_A { match self.bits { false => RMX_A::VALUE1, true => RMX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RMX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Update completed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RMX_A::VALUE2 @@ -897,15 +884,13 @@ impl R { RMX_R::new(((self.bits >> 29) & 1) != 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"] +#[doc = "SCU Service Request Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`srstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`srstat::R`](R) reader structure"] +impl crate::Readable for SRSTAT_SPEC {} #[doc = "`reset()` method sets SRSTAT to value 0"] impl crate::Resettable for SRSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_osc.rs b/src/scu_osc.rs index d68ed6cd..297ee1e9 100644 --- a/src/scu_osc.rs +++ b/src/scu_osc.rs @@ -1,23 +1,40 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + oschpstat: OSCHPSTAT, + oschpctrl: OSCHPCTRL, + _reserved2: [u8; 0x04], + clkcalconst: CLKCALCONST, +} +impl RegisterBlock { #[doc = "0x00 - OSC_HP Status Register"] - pub oschpstat: OSCHPSTAT, + #[inline(always)] + pub const fn oschpstat(&self) -> &OSCHPSTAT { + &self.oschpstat + } #[doc = "0x04 - OSC_HP Control Register"] - pub oschpctrl: OSCHPCTRL, - _reserved2: [u8; 0x04], + #[inline(always)] + pub const fn oschpctrl(&self) -> &OSCHPCTRL { + &self.oschpctrl + } #[doc = "0x0c - Clock Calibration Constant Register"] - pub clkcalconst: CLKCALCONST, + #[inline(always)] + pub const fn clkcalconst(&self) -> &CLKCALCONST { + &self.clkcalconst + } } -#[doc = "OSCHPSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "OSCHPSTAT (r) register accessor: OSC_HP Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`oschpstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@oschpstat`] +module"] pub type OSCHPSTAT = crate::Reg; #[doc = "OSC_HP Status Register"] pub mod oschpstat; -#[doc = "OSCHPCTRL (rw) register accessor: an alias for `Reg`"] +#[doc = "OSCHPCTRL (rw) register accessor: OSC_HP Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`oschpctrl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`oschpctrl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@oschpctrl`] +module"] pub type OSCHPCTRL = crate::Reg; #[doc = "OSC_HP Control Register"] pub mod oschpctrl; -#[doc = "CLKCALCONST (rw) register accessor: an alias for `Reg`"] +#[doc = "CLKCALCONST (rw) register accessor: Clock Calibration Constant Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clkcalconst::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clkcalconst::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clkcalconst`] +module"] 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 8d4da26f..c2bbda21 100644 --- a/src/scu_osc/clkcalconst.rs +++ b/src/scu_osc/clkcalconst.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CALIBCONST` reader - Clock Calibration Constant Value"] -pub type CALIBCONST_R = crate::FieldReader; +pub type CALIBCONST_R = crate::FieldReader; #[doc = "Field `CALIBCONST` writer - Clock Calibration Constant Value"] -pub type CALIBCONST_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CLKCALCONST_SPEC, u8, u8, 4, O>; +pub type CALIBCONST_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - Clock Calibration Constant Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:3 - Clock Calibration Constant Value"] #[inline(always)] #[must_use] - pub fn calibconst(&mut self) -> CALIBCONST_W<0> { - CALIBCONST_W::new(self) + pub fn calibconst(&mut self) -> CALIBCONST_W { + CALIBCONST_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Clock Calibration Constant Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clkcalconst::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clkcalconst::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`clkcalconst::R`](R) reader structure"] +impl crate::Readable for CLKCALCONST_SPEC {} +#[doc = "`write(|w| ..)` method takes [`clkcalconst::W`](W) writer structure"] impl crate::Writable for CLKCALCONST_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_osc/oschpctrl.rs b/src/scu_osc/oschpctrl.rs index 676df762..0556c060 100644 --- a/src/scu_osc/oschpctrl.rs +++ b/src/scu_osc/oschpctrl.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `X1DEN` reader - XTAL1 Data Enable"] pub type X1DEN_R = crate::BitReader; #[doc = "XTAL1 Data Enable\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl X1DEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> X1DEN_A { + pub const fn variant(&self) -> X1DEN_A { match self.bits { false => X1DEN_A::VALUE1, true => X1DEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Bit X1D is not updated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == X1DEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bit X1D can be updated"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == X1DEN_A::VALUE2 } } #[doc = "Field `X1DEN` writer - XTAL1 Data Enable"] -pub type X1DEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, OSCHPCTRL_SPEC, X1DEN_A, O>; -impl<'a, const O: u8> X1DEN_W<'a, O> { +pub type X1DEN_W<'a, REG> = crate::BitWriter<'a, REG, X1DEN_A>; +impl<'a, REG> X1DEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Bit X1D is not updated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(X1DEN_A::VALUE1) } #[doc = "Bit X1D can be updated"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(X1DEN_A::VALUE2) } } @@ -103,39 +74,42 @@ impl From for bool { impl SHBY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SHBY_A { + pub const fn variant(&self) -> SHBY_A { match self.bits { false => SHBY_A::VALUE1, true => SHBY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The shaper is not bypassed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SHBY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The shaper is bypassed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SHBY_A::VALUE2 } } #[doc = "Field `SHBY` writer - Shaper Bypass"] -pub type SHBY_W<'a, const O: u8> = crate::BitWriter<'a, u32, OSCHPCTRL_SPEC, SHBY_A, O>; -impl<'a, const O: u8> SHBY_W<'a, O> { +pub type SHBY_W<'a, REG> = crate::BitWriter<'a, REG, SHBY_A>; +impl<'a, REG> SHBY_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The shaper is not bypassed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SHBY_A::VALUE1) } #[doc = "The shaper is bypassed"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SHBY_A::VALUE2) } } #[doc = "Field `MODE` reader - Oscillator Mode"] -pub type MODE_R = crate::FieldReader; +pub type MODE_R = crate::FieldReader; #[doc = "Oscillator Mode\n\nValue on reset: 3"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -155,10 +129,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MODE_A { + type Ux = u8; +} impl MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MODE_A { + pub const fn variant(&self) -> MODE_A { match self.bits { 0 => MODE_A::VALUE1, 1 => MODE_A::VALUE2, @@ -167,55 +144,59 @@ impl MODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External Crystal Mode and External Input Clock Mode. The oscillator Power-Saving Mode is not entered."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "OSC is disabled. The oscillator Power-Saving Mode is not entered."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "External Input Clock Mode and the oscillator Power-Saving Mode is entered"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "OSC is disabled. The oscillator Power-Saving Mode is entered."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MODE_A::VALUE4 } } #[doc = "Field `MODE` writer - Oscillator Mode"] -pub type MODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, OSCHPCTRL_SPEC, u8, MODE_A, 2, O>; -impl<'a, const O: u8> MODE_W<'a, O> { +pub type MODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, MODE_A>; +impl<'a, REG> MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "External Crystal Mode and External Input Clock Mode. The oscillator Power-Saving Mode is not entered."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE1) } #[doc = "OSC is disabled. The oscillator Power-Saving Mode is not entered."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE2) } #[doc = "External Input Clock Mode and the oscillator Power-Saving Mode is entered"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE3) } #[doc = "OSC is disabled. The oscillator Power-Saving Mode is entered."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE4) } } #[doc = "Field `OSCVAL` reader - OSC Frequency Value"] -pub type OSCVAL_R = crate::FieldReader; +pub type OSCVAL_R = crate::FieldReader; #[doc = "Field `OSCVAL` writer - OSC Frequency Value"] -pub type OSCVAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OSCHPCTRL_SPEC, u8, u8, 4, O>; +pub type OSCVAL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bit 0 - XTAL1 Data Enable"] #[inline(always)] @@ -242,46 +223,47 @@ impl W { #[doc = "Bit 0 - XTAL1 Data Enable"] #[inline(always)] #[must_use] - pub fn x1den(&mut self) -> X1DEN_W<0> { - X1DEN_W::new(self) + pub fn x1den(&mut self) -> X1DEN_W { + X1DEN_W::new(self, 0) } #[doc = "Bit 1 - Shaper Bypass"] #[inline(always)] #[must_use] - pub fn shby(&mut self) -> SHBY_W<1> { - SHBY_W::new(self) + pub fn shby(&mut self) -> SHBY_W { + SHBY_W::new(self, 1) } #[doc = "Bits 4:5 - Oscillator Mode"] #[inline(always)] #[must_use] - pub fn mode(&mut self) -> MODE_W<4> { - MODE_W::new(self) + pub fn mode(&mut self) -> MODE_W { + MODE_W::new(self, 4) } #[doc = "Bits 16:19 - OSC Frequency Value"] #[inline(always)] #[must_use] - pub fn oscval(&mut self) -> OSCVAL_W<16> { - OSCVAL_W::new(self) + pub fn oscval(&mut self) -> OSCVAL_W { + OSCVAL_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "OSC_HP Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`oschpctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`oschpctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`oschpctrl::R`](R) reader structure"] +impl crate::Readable for OSCHPCTRL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`oschpctrl::W`](W) writer structure"] impl crate::Writable for OSCHPCTRL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_osc/oschpstat.rs b/src/scu_osc/oschpstat.rs index c53fd25d..5c718c0c 100644 --- a/src/scu_osc/oschpstat.rs +++ b/src/scu_osc/oschpstat.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `X1D` reader - XTAL1 Data Value"] -pub type X1D_R = crate::BitReader; +pub type X1D_R = crate::BitReader; impl R { #[doc = "Bit 0 - XTAL1 Data Value"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { X1D_R::new((self.bits & 1) != 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"] +#[doc = "OSC_HP Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`oschpstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`oschpstat::R`](R) reader structure"] +impl crate::Readable for OSCHPSTAT_SPEC {} #[doc = "`reset()` method sets OSCHPSTAT to value 0"] impl crate::Resettable for OSCHPSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_parity.rs b/src/scu_parity.rs index 58273826..23dc920e 100644 --- a/src/scu_parity.rs +++ b/src/scu_parity.rs @@ -1,47 +1,84 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + peen: PEEN, + mchkcon: MCHKCON, + pete: PETE, + persten: PERSTEN, + _reserved4: [u8; 0x04], + peflag: PEFLAG, + pmtpr: PMTPR, + pmtsr: PMTSR, +} +impl RegisterBlock { #[doc = "0x00 - Parity Error Enable Register"] - pub peen: PEEN, + #[inline(always)] + pub const fn peen(&self) -> &PEEN { + &self.peen + } #[doc = "0x04 - Memory Checking Control Register"] - pub mchkcon: MCHKCON, + #[inline(always)] + pub const fn mchkcon(&self) -> &MCHKCON { + &self.mchkcon + } #[doc = "0x08 - Parity Error Trap Enable Register"] - pub pete: PETE, + #[inline(always)] + pub const fn pete(&self) -> &PETE { + &self.pete + } #[doc = "0x0c - Parity Error Reset Enable Register"] - pub persten: PERSTEN, - _reserved4: [u8; 0x04], + #[inline(always)] + pub const fn persten(&self) -> &PERSTEN { + &self.persten + } #[doc = "0x14 - Parity Error Flag Register"] - pub peflag: PEFLAG, + #[inline(always)] + pub const fn peflag(&self) -> &PEFLAG { + &self.peflag + } #[doc = "0x18 - Parity Memory Test Pattern Register"] - pub pmtpr: PMTPR, + #[inline(always)] + pub const fn pmtpr(&self) -> &PMTPR { + &self.pmtpr + } #[doc = "0x1c - Parity Memory Test Select Register"] - pub pmtsr: PMTSR, + #[inline(always)] + pub const fn pmtsr(&self) -> &PMTSR { + &self.pmtsr + } } -#[doc = "PEEN (rw) register accessor: an alias for `Reg`"] +#[doc = "PEEN (rw) register accessor: Parity Error Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`peen::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`peen::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@peen`] +module"] pub type PEEN = crate::Reg; #[doc = "Parity Error Enable Register"] pub mod peen; -#[doc = "MCHKCON (rw) register accessor: an alias for `Reg`"] +#[doc = "MCHKCON (rw) register accessor: Memory Checking Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mchkcon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mchkcon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mchkcon`] +module"] pub type MCHKCON = crate::Reg; #[doc = "Memory Checking Control Register"] pub mod mchkcon; -#[doc = "PETE (rw) register accessor: an alias for `Reg`"] +#[doc = "PETE (rw) register accessor: Parity Error Trap Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pete::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pete::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pete`] +module"] pub type PETE = crate::Reg; #[doc = "Parity Error Trap Enable Register"] pub mod pete; -#[doc = "PERSTEN (rw) register accessor: an alias for `Reg`"] +#[doc = "PERSTEN (rw) register accessor: Parity Error Reset Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`persten::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`persten::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@persten`] +module"] pub type PERSTEN = crate::Reg; #[doc = "Parity Error Reset Enable Register"] pub mod persten; -#[doc = "PEFLAG (rw) register accessor: an alias for `Reg`"] +#[doc = "PEFLAG (rw) register accessor: Parity Error Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`peflag::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`peflag::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@peflag`] +module"] pub type PEFLAG = crate::Reg; #[doc = "Parity Error Flag Register"] pub mod peflag; -#[doc = "PMTPR (rw) register accessor: an alias for `Reg`"] +#[doc = "PMTPR (rw) register accessor: Parity Memory Test Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pmtpr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pmtpr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmtpr`] +module"] pub type PMTPR = crate::Reg; #[doc = "Parity Memory Test Pattern Register"] pub mod pmtpr; -#[doc = "PMTSR (rw) register accessor: an alias for `Reg`"] +#[doc = "PMTSR (rw) register accessor: Parity Memory Test Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pmtsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pmtsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pmtsr`] +module"] 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 7d6b102a..582cc83b 100644 --- a/src/scu_parity/mchkcon.rs +++ b/src/scu_parity/mchkcon.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SELPS` reader - Select Memory Check for PSRAM"] pub type SELPS_R = crate::BitReader; #[doc = "Select Memory Check for PSRAM\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SELPS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELPS_A { + pub const fn variant(&self) -> SELPS_A { match self.bits { false => SELPS_A::VALUE1, true => SELPS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELPS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELPS_A::VALUE2 } } #[doc = "Field `SELPS` writer - Select Memory Check for PSRAM"] -pub type SELPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, SELPS_A, O>; -impl<'a, const O: u8> SELPS_W<'a, O> { +pub type SELPS_W<'a, REG> = crate::BitWriter<'a, REG, SELPS_A>; +impl<'a, REG> SELPS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELPS_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELPS_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl SELDS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELDS1_A { + pub const fn variant(&self) -> SELDS1_A { match self.bits { false => SELDS1_A::VALUE1, true => SELDS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELDS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELDS1_A::VALUE2 } } #[doc = "Field `SELDS1` writer - Select Memory Check for DSRAM1"] -pub type SELDS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, SELDS1_A, O>; -impl<'a, const O: u8> SELDS1_W<'a, O> { +pub type SELDS1_W<'a, REG> = crate::BitWriter<'a, REG, SELDS1_A>; +impl<'a, REG> SELDS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELDS1_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELDS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl SELDS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELDS2_A { + pub const fn variant(&self) -> SELDS2_A { match self.bits { false => SELDS2_A::VALUE1, true => SELDS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELDS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELDS2_A::VALUE2 } } #[doc = "Field `SELDS2` writer - Select Memory Check for DSRAM2"] -pub type SELDS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, SELDS2_A, O>; -impl<'a, const O: u8> SELDS2_W<'a, O> { +pub type SELDS2_W<'a, REG> = crate::BitWriter<'a, REG, SELDS2_A>; +impl<'a, REG> SELDS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELDS2_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELDS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl USIC0DRA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USIC0DRA_A { + pub const fn variant(&self) -> USIC0DRA_A { match self.bits { false => USIC0DRA_A::VALUE1, true => USIC0DRA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USIC0DRA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USIC0DRA_A::VALUE2 } } #[doc = "Field `USIC0DRA` writer - Select Memory Check for USIC0"] -pub type USIC0DRA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, USIC0DRA_A, O>; -impl<'a, const O: u8> USIC0DRA_W<'a, O> { +pub type USIC0DRA_W<'a, REG> = crate::BitWriter<'a, REG, USIC0DRA_A>; +impl<'a, REG> USIC0DRA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC0DRA_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC0DRA_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl USIC1DRA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USIC1DRA_A { + pub const fn variant(&self) -> USIC1DRA_A { match self.bits { false => USIC1DRA_A::VALUE1, true => USIC1DRA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USIC1DRA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USIC1DRA_A::VALUE2 } } #[doc = "Field `USIC1DRA` writer - Select Memory Check for USIC1"] -pub type USIC1DRA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, USIC1DRA_A, O>; -impl<'a, const O: u8> USIC1DRA_W<'a, O> { +pub type USIC1DRA_W<'a, REG> = crate::BitWriter<'a, REG, USIC1DRA_A>; +impl<'a, REG> USIC1DRA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC1DRA_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC1DRA_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl MCANDRA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCANDRA_A { + pub const fn variant(&self) -> MCANDRA_A { match self.bits { false => MCANDRA_A::VALUE1, true => MCANDRA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCANDRA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCANDRA_A::VALUE2 } } #[doc = "Field `MCANDRA` writer - Select Memory Check for MultiCAN"] -pub type MCANDRA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, MCANDRA_A, O>; -impl<'a, const O: u8> MCANDRA_W<'a, O> { +pub type MCANDRA_W<'a, REG> = crate::BitWriter<'a, REG, MCANDRA_A>; +impl<'a, REG> MCANDRA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCANDRA_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCANDRA_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PPRFDRA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPRFDRA_A { + pub const fn variant(&self) -> PPRFDRA_A { match self.bits { false => PPRFDRA_A::VALUE1, true => PPRFDRA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPRFDRA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPRFDRA_A::VALUE2 } } #[doc = "Field `PPRFDRA` writer - Select Memory Check for PMU"] -pub type PPRFDRA_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, PPRFDRA_A, O>; -impl<'a, const O: u8> PPRFDRA_W<'a, O> { +pub type PPRFDRA_W<'a, REG> = crate::BitWriter<'a, REG, PPRFDRA_A>; +impl<'a, REG> PPRFDRA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPRFDRA_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPRFDRA_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl SELUSB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELUSB_A { + pub const fn variant(&self) -> SELUSB_A { match self.bits { false => SELUSB_A::VALUE1, true => SELUSB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELUSB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELUSB_A::VALUE2 } } #[doc = "Field `SELUSB` writer - Select Memory Check for USB SRAM"] -pub type SELUSB_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, SELUSB_A, O>; -impl<'a, const O: u8> SELUSB_W<'a, O> { +pub type SELUSB_W<'a, REG> = crate::BitWriter<'a, REG, SELUSB_A>; +impl<'a, REG> SELUSB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELUSB_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELUSB_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl SELETH0TX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELETH0TX_A { + pub const fn variant(&self) -> SELETH0TX_A { match self.bits { false => SELETH0TX_A::VALUE1, true => SELETH0TX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELETH0TX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELETH0TX_A::VALUE2 } } #[doc = "Field `SELETH0TX` writer - Select Memory Check for ETH0 TX SRAM"] -pub type SELETH0TX_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, SELETH0TX_A, O>; -impl<'a, const O: u8> SELETH0TX_W<'a, O> { +pub type SELETH0TX_W<'a, REG> = crate::BitWriter<'a, REG, SELETH0TX_A>; +impl<'a, REG> SELETH0TX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELETH0TX_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELETH0TX_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl SELETH0RX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELETH0RX_A { + pub const fn variant(&self) -> SELETH0RX_A { match self.bits { false => SELETH0RX_A::VALUE1, true => SELETH0RX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELETH0RX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELETH0RX_A::VALUE2 } } #[doc = "Field `SELETH0RX` writer - Select Memory Check for ETH0 RX SRAM"] -pub type SELETH0RX_W<'a, const O: u8> = crate::BitWriter<'a, u32, MCHKCON_SPEC, SELETH0RX_A, O>; -impl<'a, const O: u8> SELETH0RX_W<'a, O> { +pub type SELETH0RX_W<'a, REG> = crate::BitWriter<'a, REG, SELETH0RX_A>; +impl<'a, REG> SELETH0RX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Not selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELETH0RX_A::VALUE1) } #[doc = "Selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELETH0RX_A::VALUE2) } } @@ -590,82 +588,83 @@ impl W { #[doc = "Bit 0 - Select Memory Check for PSRAM"] #[inline(always)] #[must_use] - pub fn selps(&mut self) -> SELPS_W<0> { - SELPS_W::new(self) + pub fn selps(&mut self) -> SELPS_W { + SELPS_W::new(self, 0) } #[doc = "Bit 1 - Select Memory Check for DSRAM1"] #[inline(always)] #[must_use] - pub fn selds1(&mut self) -> SELDS1_W<1> { - SELDS1_W::new(self) + pub fn selds1(&mut self) -> SELDS1_W { + SELDS1_W::new(self, 1) } #[doc = "Bit 2 - Select Memory Check for DSRAM2"] #[inline(always)] #[must_use] - pub fn selds2(&mut self) -> SELDS2_W<2> { - SELDS2_W::new(self) + pub fn selds2(&mut self) -> SELDS2_W { + SELDS2_W::new(self, 2) } #[doc = "Bit 8 - Select Memory Check for USIC0"] #[inline(always)] #[must_use] - pub fn usic0dra(&mut self) -> USIC0DRA_W<8> { - USIC0DRA_W::new(self) + pub fn usic0dra(&mut self) -> USIC0DRA_W { + USIC0DRA_W::new(self, 8) } #[doc = "Bit 9 - Select Memory Check for USIC1"] #[inline(always)] #[must_use] - pub fn usic1dra(&mut self) -> USIC1DRA_W<9> { - USIC1DRA_W::new(self) + pub fn usic1dra(&mut self) -> USIC1DRA_W { + USIC1DRA_W::new(self, 9) } #[doc = "Bit 12 - Select Memory Check for MultiCAN"] #[inline(always)] #[must_use] - pub fn mcandra(&mut self) -> MCANDRA_W<12> { - MCANDRA_W::new(self) + pub fn mcandra(&mut self) -> MCANDRA_W { + MCANDRA_W::new(self, 12) } #[doc = "Bit 13 - Select Memory Check for PMU"] #[inline(always)] #[must_use] - pub fn pprfdra(&mut self) -> PPRFDRA_W<13> { - PPRFDRA_W::new(self) + pub fn pprfdra(&mut self) -> PPRFDRA_W { + PPRFDRA_W::new(self, 13) } #[doc = "Bit 16 - Select Memory Check for USB SRAM"] #[inline(always)] #[must_use] - pub fn selusb(&mut self) -> SELUSB_W<16> { - SELUSB_W::new(self) + pub fn selusb(&mut self) -> SELUSB_W { + SELUSB_W::new(self, 16) } #[doc = "Bit 17 - Select Memory Check for ETH0 TX SRAM"] #[inline(always)] #[must_use] - pub fn seleth0tx(&mut self) -> SELETH0TX_W<17> { - SELETH0TX_W::new(self) + pub fn seleth0tx(&mut self) -> SELETH0TX_W { + SELETH0TX_W::new(self, 17) } #[doc = "Bit 18 - Select Memory Check for ETH0 RX SRAM"] #[inline(always)] #[must_use] - pub fn seleth0rx(&mut self) -> SELETH0RX_W<18> { - SELETH0RX_W::new(self) + pub fn seleth0rx(&mut self) -> SELETH0RX_W { + SELETH0RX_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Memory Checking Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mchkcon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`mchkcon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`mchkcon::R`](R) reader structure"] +impl crate::Readable for MCHKCON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`mchkcon::W`](W) writer structure"] impl crate::Writable for MCHKCON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_parity/peen.rs b/src/scu_parity/peen.rs index a28b72c5..ccc6af35 100644 --- a/src/scu_parity/peen.rs +++ b/src/scu_parity/peen.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PEENPS` reader - Parity Error Enable for PSRAM"] pub type PEENPS_R = crate::BitReader; #[doc = "Parity Error Enable for PSRAM\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PEENPS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENPS_A { + pub const fn variant(&self) -> PEENPS_A { match self.bits { false => PEENPS_A::VALUE1, true => PEENPS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENPS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENPS_A::VALUE2 } } #[doc = "Field `PEENPS` writer - Parity Error Enable for PSRAM"] -pub type PEENPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENPS_A, O>; -impl<'a, const O: u8> PEENPS_W<'a, O> { +pub type PEENPS_W<'a, REG> = crate::BitWriter<'a, REG, PEENPS_A>; +impl<'a, REG> PEENPS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENPS_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENPS_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PEENDS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENDS1_A { + pub const fn variant(&self) -> PEENDS1_A { match self.bits { false => PEENDS1_A::VALUE1, true => PEENDS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENDS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENDS1_A::VALUE2 } } #[doc = "Field `PEENDS1` writer - Parity Error Enable for DSRAM1"] -pub type PEENDS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENDS1_A, O>; -impl<'a, const O: u8> PEENDS1_W<'a, O> { +pub type PEENDS1_W<'a, REG> = crate::BitWriter<'a, REG, PEENDS1_A>; +impl<'a, REG> PEENDS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENDS1_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENDS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PEENDS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENDS2_A { + pub const fn variant(&self) -> PEENDS2_A { match self.bits { false => PEENDS2_A::VALUE1, true => PEENDS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENDS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENDS2_A::VALUE2 } } #[doc = "Field `PEENDS2` writer - Parity Error Enable for DSRAM2"] -pub type PEENDS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENDS2_A, O>; -impl<'a, const O: u8> PEENDS2_W<'a, O> { +pub type PEENDS2_W<'a, REG> = crate::BitWriter<'a, REG, PEENDS2_A>; +impl<'a, REG> PEENDS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENDS2_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENDS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PEENU0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENU0_A { + pub const fn variant(&self) -> PEENU0_A { match self.bits { false => PEENU0_A::VALUE1, true => PEENU0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENU0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENU0_A::VALUE2 } } #[doc = "Field `PEENU0` writer - Parity Error Enable for USIC0 Memory"] -pub type PEENU0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENU0_A, O>; -impl<'a, const O: u8> PEENU0_W<'a, O> { +pub type PEENU0_W<'a, REG> = crate::BitWriter<'a, REG, PEENU0_A>; +impl<'a, REG> PEENU0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENU0_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENU0_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PEENU1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENU1_A { + pub const fn variant(&self) -> PEENU1_A { match self.bits { false => PEENU1_A::VALUE1, true => PEENU1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENU1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENU1_A::VALUE2 } } #[doc = "Field `PEENU1` writer - Parity Error Enable for USIC1 Memory"] -pub type PEENU1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENU1_A, O>; -impl<'a, const O: u8> PEENU1_W<'a, O> { +pub type PEENU1_W<'a, REG> = crate::BitWriter<'a, REG, PEENU1_A>; +impl<'a, REG> PEENU1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENU1_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENU1_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PEENMC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENMC_A { + pub const fn variant(&self) -> PEENMC_A { match self.bits { false => PEENMC_A::VALUE1, true => PEENMC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENMC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENMC_A::VALUE2 } } #[doc = "Field `PEENMC` writer - Parity Error Enable for MultiCAN Memory"] -pub type PEENMC_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENMC_A, O>; -impl<'a, const O: u8> PEENMC_W<'a, O> { +pub type PEENMC_W<'a, REG> = crate::BitWriter<'a, REG, PEENMC_A>; +impl<'a, REG> PEENMC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENMC_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENMC_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PEENPPRF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENPPRF_A { + pub const fn variant(&self) -> PEENPPRF_A { match self.bits { false => PEENPPRF_A::VALUE1, true => PEENPPRF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENPPRF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENPPRF_A::VALUE2 } } #[doc = "Field `PEENPPRF` writer - Parity Error Enable for PMU Prefetch Memory"] -pub type PEENPPRF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENPPRF_A, O>; -impl<'a, const O: u8> PEENPPRF_W<'a, O> { +pub type PEENPPRF_W<'a, REG> = crate::BitWriter<'a, REG, PEENPPRF_A>; +impl<'a, REG> PEENPPRF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENPPRF_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENPPRF_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PEENUSB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENUSB_A { + pub const fn variant(&self) -> PEENUSB_A { match self.bits { false => PEENUSB_A::VALUE1, true => PEENUSB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENUSB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENUSB_A::VALUE2 } } #[doc = "Field `PEENUSB` writer - Parity Error Enable for USB Memory"] -pub type PEENUSB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENUSB_A, O>; -impl<'a, const O: u8> PEENUSB_W<'a, O> { +pub type PEENUSB_W<'a, REG> = crate::BitWriter<'a, REG, PEENUSB_A>; +impl<'a, REG> PEENUSB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENUSB_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENUSB_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PEENETH0TX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENETH0TX_A { + pub const fn variant(&self) -> PEENETH0TX_A { match self.bits { false => PEENETH0TX_A::VALUE1, true => PEENETH0TX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENETH0TX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENETH0TX_A::VALUE2 } } #[doc = "Field `PEENETH0TX` writer - Parity Error Enable for ETH TX Memory"] -pub type PEENETH0TX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENETH0TX_A, O>; -impl<'a, const O: u8> PEENETH0TX_W<'a, O> { +pub type PEENETH0TX_W<'a, REG> = crate::BitWriter<'a, REG, PEENETH0TX_A>; +impl<'a, REG> PEENETH0TX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENETH0TX_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENETH0TX_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PEENETH0RX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEENETH0RX_A { + pub const fn variant(&self) -> PEENETH0RX_A { match self.bits { false => PEENETH0RX_A::VALUE1, true => PEENETH0RX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEENETH0RX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEENETH0RX_A::VALUE2 } } #[doc = "Field `PEENETH0RX` writer - Parity Error Enable for ETH RX Memory"] -pub type PEENETH0RX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEEN_SPEC, PEENETH0RX_A, O>; -impl<'a, const O: u8> PEENETH0RX_W<'a, O> { +pub type PEENETH0RX_W<'a, REG> = crate::BitWriter<'a, REG, PEENETH0RX_A>; +impl<'a, REG> PEENETH0RX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEENETH0RX_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEENETH0RX_A::VALUE2) } } @@ -590,82 +588,83 @@ impl W { #[doc = "Bit 0 - Parity Error Enable for PSRAM"] #[inline(always)] #[must_use] - pub fn peenps(&mut self) -> PEENPS_W<0> { - PEENPS_W::new(self) + pub fn peenps(&mut self) -> PEENPS_W { + PEENPS_W::new(self, 0) } #[doc = "Bit 1 - Parity Error Enable for DSRAM1"] #[inline(always)] #[must_use] - pub fn peends1(&mut self) -> PEENDS1_W<1> { - PEENDS1_W::new(self) + pub fn peends1(&mut self) -> PEENDS1_W { + PEENDS1_W::new(self, 1) } #[doc = "Bit 2 - Parity Error Enable for DSRAM2"] #[inline(always)] #[must_use] - pub fn peends2(&mut self) -> PEENDS2_W<2> { - PEENDS2_W::new(self) + pub fn peends2(&mut self) -> PEENDS2_W { + PEENDS2_W::new(self, 2) } #[doc = "Bit 8 - Parity Error Enable for USIC0 Memory"] #[inline(always)] #[must_use] - pub fn peenu0(&mut self) -> PEENU0_W<8> { - PEENU0_W::new(self) + pub fn peenu0(&mut self) -> PEENU0_W { + PEENU0_W::new(self, 8) } #[doc = "Bit 9 - Parity Error Enable for USIC1 Memory"] #[inline(always)] #[must_use] - pub fn peenu1(&mut self) -> PEENU1_W<9> { - PEENU1_W::new(self) + pub fn peenu1(&mut self) -> PEENU1_W { + PEENU1_W::new(self, 9) } #[doc = "Bit 12 - Parity Error Enable for MultiCAN Memory"] #[inline(always)] #[must_use] - pub fn peenmc(&mut self) -> PEENMC_W<12> { - PEENMC_W::new(self) + pub fn peenmc(&mut self) -> PEENMC_W { + PEENMC_W::new(self, 12) } #[doc = "Bit 13 - Parity Error Enable for PMU Prefetch Memory"] #[inline(always)] #[must_use] - pub fn peenpprf(&mut self) -> PEENPPRF_W<13> { - PEENPPRF_W::new(self) + pub fn peenpprf(&mut self) -> PEENPPRF_W { + PEENPPRF_W::new(self, 13) } #[doc = "Bit 16 - Parity Error Enable for USB Memory"] #[inline(always)] #[must_use] - pub fn peenusb(&mut self) -> PEENUSB_W<16> { - PEENUSB_W::new(self) + pub fn peenusb(&mut self) -> PEENUSB_W { + PEENUSB_W::new(self, 16) } #[doc = "Bit 17 - Parity Error Enable for ETH TX Memory"] #[inline(always)] #[must_use] - pub fn peeneth0tx(&mut self) -> PEENETH0TX_W<17> { - PEENETH0TX_W::new(self) + pub fn peeneth0tx(&mut self) -> PEENETH0TX_W { + PEENETH0TX_W::new(self, 17) } #[doc = "Bit 18 - Parity Error Enable for ETH RX Memory"] #[inline(always)] #[must_use] - pub fn peeneth0rx(&mut self) -> PEENETH0RX_W<18> { - PEENETH0RX_W::new(self) + pub fn peeneth0rx(&mut self) -> PEENETH0RX_W { + PEENETH0RX_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Parity Error Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`peen::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`peen::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`peen::R`](R) reader structure"] +impl crate::Readable for PEEN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`peen::W`](W) writer structure"] impl crate::Writable for PEEN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_parity/peflag.rs b/src/scu_parity/peflag.rs index 66eb8760..60128d72 100644 --- a/src/scu_parity/peflag.rs +++ b/src/scu_parity/peflag.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PEFPS` reader - Parity Error Flag for PSRAM"] pub type PEFPS_R = crate::BitReader; #[doc = "Parity Error Flag for PSRAM\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PEFPS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEFPS_A { + pub const fn variant(&self) -> PEFPS_A { match self.bits { false => PEFPS_A::VALUE1, true => PEFPS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEFPS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEFPS_A::VALUE2 } } #[doc = "Field `PEFPS` writer - Parity Error Flag for PSRAM"] -pub type PEFPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEFPS_A, O>; -impl<'a, const O: u8> PEFPS_W<'a, O> { +pub type PEFPS_W<'a, REG> = crate::BitWriter<'a, REG, PEFPS_A>; +impl<'a, REG> PEFPS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEFPS_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEFPS_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PEFDS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEFDS1_A { + pub const fn variant(&self) -> PEFDS1_A { match self.bits { false => PEFDS1_A::VALUE1, true => PEFDS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEFDS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEFDS1_A::VALUE2 } } #[doc = "Field `PEFDS1` writer - Parity Error Flag for DSRAM1"] -pub type PEFDS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEFDS1_A, O>; -impl<'a, const O: u8> PEFDS1_W<'a, O> { +pub type PEFDS1_W<'a, REG> = crate::BitWriter<'a, REG, PEFDS1_A>; +impl<'a, REG> PEFDS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEFDS1_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEFDS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PEFDS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEFDS2_A { + pub const fn variant(&self) -> PEFDS2_A { match self.bits { false => PEFDS2_A::VALUE1, true => PEFDS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEFDS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEFDS2_A::VALUE2 } } #[doc = "Field `PEFDS2` writer - Parity Error Flag for DSRAM2"] -pub type PEFDS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEFDS2_A, O>; -impl<'a, const O: u8> PEFDS2_W<'a, O> { +pub type PEFDS2_W<'a, REG> = crate::BitWriter<'a, REG, PEFDS2_A>; +impl<'a, REG> PEFDS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEFDS2_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEFDS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PEFU0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEFU0_A { + pub const fn variant(&self) -> PEFU0_A { match self.bits { false => PEFU0_A::VALUE1, true => PEFU0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEFU0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEFU0_A::VALUE2 } } #[doc = "Field `PEFU0` writer - Parity Error Flag for USIC0 Memory"] -pub type PEFU0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEFU0_A, O>; -impl<'a, const O: u8> PEFU0_W<'a, O> { +pub type PEFU0_W<'a, REG> = crate::BitWriter<'a, REG, PEFU0_A>; +impl<'a, REG> PEFU0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEFU0_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEFU0_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PEFU1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEFU1_A { + pub const fn variant(&self) -> PEFU1_A { match self.bits { false => PEFU1_A::VALUE1, true => PEFU1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEFU1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEFU1_A::VALUE2 } } #[doc = "Field `PEFU1` writer - Parity Error Flag for USIC1 Memory"] -pub type PEFU1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEFU1_A, O>; -impl<'a, const O: u8> PEFU1_W<'a, O> { +pub type PEFU1_W<'a, REG> = crate::BitWriter<'a, REG, PEFU1_A>; +impl<'a, REG> PEFU1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEFU1_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEFU1_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PEFMC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEFMC_A { + pub const fn variant(&self) -> PEFMC_A { match self.bits { false => PEFMC_A::VALUE1, true => PEFMC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEFMC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEFMC_A::VALUE2 } } #[doc = "Field `PEFMC` writer - Parity Error Flag for MultiCAN Memory"] -pub type PEFMC_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEFMC_A, O>; -impl<'a, const O: u8> PEFMC_W<'a, O> { +pub type PEFMC_W<'a, REG> = crate::BitWriter<'a, REG, PEFMC_A>; +impl<'a, REG> PEFMC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEFMC_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEFMC_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PEFPPRF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEFPPRF_A { + pub const fn variant(&self) -> PEFPPRF_A { match self.bits { false => PEFPPRF_A::VALUE1, true => PEFPPRF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEFPPRF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEFPPRF_A::VALUE2 } } #[doc = "Field `PEFPPRF` writer - Parity Error Flag for PMU Prefetch Memory"] -pub type PEFPPRF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEFPPRF_A, O>; -impl<'a, const O: u8> PEFPPRF_W<'a, O> { +pub type PEFPPRF_W<'a, REG> = crate::BitWriter<'a, REG, PEFPPRF_A>; +impl<'a, REG> PEFPPRF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEFPPRF_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEFPPRF_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PEUSB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEUSB_A { + pub const fn variant(&self) -> PEUSB_A { match self.bits { false => PEUSB_A::VALUE1, true => PEUSB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEUSB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEUSB_A::VALUE2 } } #[doc = "Field `PEUSB` writer - Parity Error Flag for USB Memory"] -pub type PEUSB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEUSB_A, O>; -impl<'a, const O: u8> PEUSB_W<'a, O> { +pub type PEUSB_W<'a, REG> = crate::BitWriter<'a, REG, PEUSB_A>; +impl<'a, REG> PEUSB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEUSB_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEUSB_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PEETH0TX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEETH0TX_A { + pub const fn variant(&self) -> PEETH0TX_A { match self.bits { false => PEETH0TX_A::VALUE1, true => PEETH0TX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEETH0TX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEETH0TX_A::VALUE2 } } #[doc = "Field `PEETH0TX` writer - Parity Error Flag for ETH TX Memory"] -pub type PEETH0TX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEETH0TX_A, O>; -impl<'a, const O: u8> PEETH0TX_W<'a, O> { +pub type PEETH0TX_W<'a, REG> = crate::BitWriter<'a, REG, PEETH0TX_A>; +impl<'a, REG> PEETH0TX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEETH0TX_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEETH0TX_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PEETH0RX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PEETH0RX_A { + pub const fn variant(&self) -> PEETH0RX_A { match self.bits { false => PEETH0RX_A::VALUE1, true => PEETH0RX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No parity error detected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PEETH0RX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity error detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PEETH0RX_A::VALUE2 } } #[doc = "Field `PEETH0RX` writer - Parity Error Flag for ETH RX Memory"] -pub type PEETH0RX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PEFLAG_SPEC, PEETH0RX_A, O>; -impl<'a, const O: u8> PEETH0RX_W<'a, O> { +pub type PEETH0RX_W<'a, REG> = crate::BitWriter<'a, REG, PEETH0RX_A>; +impl<'a, REG> PEETH0RX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No parity error detected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PEETH0RX_A::VALUE1) } #[doc = "Parity error detected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PEETH0RX_A::VALUE2) } } @@ -590,82 +588,83 @@ impl W { #[doc = "Bit 0 - Parity Error Flag for PSRAM"] #[inline(always)] #[must_use] - pub fn pefps(&mut self) -> PEFPS_W<0> { - PEFPS_W::new(self) + pub fn pefps(&mut self) -> PEFPS_W { + PEFPS_W::new(self, 0) } #[doc = "Bit 1 - Parity Error Flag for DSRAM1"] #[inline(always)] #[must_use] - pub fn pefds1(&mut self) -> PEFDS1_W<1> { - PEFDS1_W::new(self) + pub fn pefds1(&mut self) -> PEFDS1_W { + PEFDS1_W::new(self, 1) } #[doc = "Bit 2 - Parity Error Flag for DSRAM2"] #[inline(always)] #[must_use] - pub fn pefds2(&mut self) -> PEFDS2_W<2> { - PEFDS2_W::new(self) + pub fn pefds2(&mut self) -> PEFDS2_W { + PEFDS2_W::new(self, 2) } #[doc = "Bit 8 - Parity Error Flag for USIC0 Memory"] #[inline(always)] #[must_use] - pub fn pefu0(&mut self) -> PEFU0_W<8> { - PEFU0_W::new(self) + pub fn pefu0(&mut self) -> PEFU0_W { + PEFU0_W::new(self, 8) } #[doc = "Bit 9 - Parity Error Flag for USIC1 Memory"] #[inline(always)] #[must_use] - pub fn pefu1(&mut self) -> PEFU1_W<9> { - PEFU1_W::new(self) + pub fn pefu1(&mut self) -> PEFU1_W { + PEFU1_W::new(self, 9) } #[doc = "Bit 12 - Parity Error Flag for MultiCAN Memory"] #[inline(always)] #[must_use] - pub fn pefmc(&mut self) -> PEFMC_W<12> { - PEFMC_W::new(self) + pub fn pefmc(&mut self) -> PEFMC_W { + PEFMC_W::new(self, 12) } #[doc = "Bit 13 - Parity Error Flag for PMU Prefetch Memory"] #[inline(always)] #[must_use] - pub fn pefpprf(&mut self) -> PEFPPRF_W<13> { - PEFPPRF_W::new(self) + pub fn pefpprf(&mut self) -> PEFPPRF_W { + PEFPPRF_W::new(self, 13) } #[doc = "Bit 16 - Parity Error Flag for USB Memory"] #[inline(always)] #[must_use] - pub fn peusb(&mut self) -> PEUSB_W<16> { - PEUSB_W::new(self) + pub fn peusb(&mut self) -> PEUSB_W { + PEUSB_W::new(self, 16) } #[doc = "Bit 17 - Parity Error Flag for ETH TX Memory"] #[inline(always)] #[must_use] - pub fn peeth0tx(&mut self) -> PEETH0TX_W<17> { - PEETH0TX_W::new(self) + pub fn peeth0tx(&mut self) -> PEETH0TX_W { + PEETH0TX_W::new(self, 17) } #[doc = "Bit 18 - Parity Error Flag for ETH RX Memory"] #[inline(always)] #[must_use] - pub fn peeth0rx(&mut self) -> PEETH0RX_W<18> { - PEETH0RX_W::new(self) + pub fn peeth0rx(&mut self) -> PEETH0RX_W { + PEETH0RX_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Parity Error Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`peflag::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`peflag::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`peflag::R`](R) reader structure"] +impl crate::Readable for PEFLAG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`peflag::W`](W) writer structure"] impl crate::Writable for PEFLAG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_parity/persten.rs b/src/scu_parity/persten.rs index 3e4e8cbd..1857e1fb 100644 --- a/src/scu_parity/persten.rs +++ b/src/scu_parity/persten.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RSEN` reader - System Reset Enable upon Parity Error Trap"] pub type RSEN_R = crate::BitReader; #[doc = "System Reset Enable upon Parity Error Trap\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl RSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSEN_A { + pub const fn variant(&self) -> RSEN_A { match self.bits { false => RSEN_A::VALUE1, true => RSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset request disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset request enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSEN_A::VALUE2 } } #[doc = "Field `RSEN` writer - System Reset Enable upon Parity Error Trap"] -pub type RSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PERSTEN_SPEC, RSEN_A, O>; -impl<'a, const O: u8> RSEN_W<'a, O> { +pub type RSEN_W<'a, REG> = crate::BitWriter<'a, REG, RSEN_A>; +impl<'a, REG> RSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Reset request disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSEN_A::VALUE1) } #[doc = "Reset request enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSEN_A::VALUE2) } } @@ -95,28 +66,29 @@ impl W { #[doc = "Bit 0 - System Reset Enable upon Parity Error Trap"] #[inline(always)] #[must_use] - pub fn rsen(&mut self) -> RSEN_W<0> { - RSEN_W::new(self) + pub fn rsen(&mut self) -> RSEN_W { + RSEN_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Parity Error Reset Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`persten::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`persten::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`persten::R`](R) reader structure"] +impl crate::Readable for PERSTEN_SPEC {} +#[doc = "`write(|w| ..)` method takes [`persten::W`](W) writer structure"] impl crate::Writable for PERSTEN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_parity/pete.rs b/src/scu_parity/pete.rs index 1322d331..aab3e61c 100644 --- a/src/scu_parity/pete.rs +++ b/src/scu_parity/pete.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PETEPS` reader - Parity Error Trap Enable for PSRAM"] pub type PETEPS_R = crate::BitReader; #[doc = "Parity Error Trap Enable for PSRAM\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl PETEPS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEPS_A { + pub const fn variant(&self) -> PETEPS_A { match self.bits { false => PETEPS_A::VALUE1, true => PETEPS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEPS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEPS_A::VALUE2 } } #[doc = "Field `PETEPS` writer - Parity Error Trap Enable for PSRAM"] -pub type PETEPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEPS_A, O>; -impl<'a, const O: u8> PETEPS_W<'a, O> { +pub type PETEPS_W<'a, REG> = crate::BitWriter<'a, REG, PETEPS_A>; +impl<'a, REG> PETEPS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEPS_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEPS_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl PETEDS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEDS1_A { + pub const fn variant(&self) -> PETEDS1_A { match self.bits { false => PETEDS1_A::VALUE1, true => PETEDS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEDS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEDS1_A::VALUE2 } } #[doc = "Field `PETEDS1` writer - Parity Error Trap Enable for DSRAM1"] -pub type PETEDS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEDS1_A, O>; -impl<'a, const O: u8> PETEDS1_W<'a, O> { +pub type PETEDS1_W<'a, REG> = crate::BitWriter<'a, REG, PETEDS1_A>; +impl<'a, REG> PETEDS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEDS1_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEDS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl PETEDS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEDS2_A { + pub const fn variant(&self) -> PETEDS2_A { match self.bits { false => PETEDS2_A::VALUE1, true => PETEDS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEDS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEDS2_A::VALUE2 } } #[doc = "Field `PETEDS2` writer - Parity Error Trap Enable for DSRAM2"] -pub type PETEDS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEDS2_A, O>; -impl<'a, const O: u8> PETEDS2_W<'a, O> { +pub type PETEDS2_W<'a, REG> = crate::BitWriter<'a, REG, PETEDS2_A>; +impl<'a, REG> PETEDS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEDS2_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEDS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PETEU0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEU0_A { + pub const fn variant(&self) -> PETEU0_A { match self.bits { false => PETEU0_A::VALUE1, true => PETEU0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEU0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEU0_A::VALUE2 } } #[doc = "Field `PETEU0` writer - Parity Error Trap Enable for USIC0 Memory"] -pub type PETEU0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEU0_A, O>; -impl<'a, const O: u8> PETEU0_W<'a, O> { +pub type PETEU0_W<'a, REG> = crate::BitWriter<'a, REG, PETEU0_A>; +impl<'a, REG> PETEU0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEU0_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEU0_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PETEU1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEU1_A { + pub const fn variant(&self) -> PETEU1_A { match self.bits { false => PETEU1_A::VALUE1, true => PETEU1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEU1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEU1_A::VALUE2 } } #[doc = "Field `PETEU1` writer - Parity Error Trap Enable for USIC1 Memory"] -pub type PETEU1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEU1_A, O>; -impl<'a, const O: u8> PETEU1_W<'a, O> { +pub type PETEU1_W<'a, REG> = crate::BitWriter<'a, REG, PETEU1_A>; +impl<'a, REG> PETEU1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEU1_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEU1_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PETEMC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEMC_A { + pub const fn variant(&self) -> PETEMC_A { match self.bits { false => PETEMC_A::VALUE1, true => PETEMC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEMC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEMC_A::VALUE2 } } #[doc = "Field `PETEMC` writer - Parity Error Trap Enable for MultiCAN Memory"] -pub type PETEMC_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEMC_A, O>; -impl<'a, const O: u8> PETEMC_W<'a, O> { +pub type PETEMC_W<'a, REG> = crate::BitWriter<'a, REG, PETEMC_A>; +impl<'a, REG> PETEMC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEMC_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEMC_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl PETEPPRF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEPPRF_A { + pub const fn variant(&self) -> PETEPPRF_A { match self.bits { false => PETEPPRF_A::VALUE1, true => PETEPPRF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEPPRF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEPPRF_A::VALUE2 } } #[doc = "Field `PETEPPRF` writer - Parity Error Trap Enable for PMU Prefetch Memory"] -pub type PETEPPRF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEPPRF_A, O>; -impl<'a, const O: u8> PETEPPRF_W<'a, O> { +pub type PETEPPRF_W<'a, REG> = crate::BitWriter<'a, REG, PETEPPRF_A>; +impl<'a, REG> PETEPPRF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEPPRF_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEPPRF_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl PETEUSB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEUSB_A { + pub const fn variant(&self) -> PETEUSB_A { match self.bits { false => PETEUSB_A::VALUE1, true => PETEUSB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEUSB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEUSB_A::VALUE2 } } #[doc = "Field `PETEUSB` writer - Parity Error Trap Enable for USB Memory"] -pub type PETEUSB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEUSB_A, O>; -impl<'a, const O: u8> PETEUSB_W<'a, O> { +pub type PETEUSB_W<'a, REG> = crate::BitWriter<'a, REG, PETEUSB_A>; +impl<'a, REG> PETEUSB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEUSB_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEUSB_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl PETEETH0TX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEETH0TX_A { + pub const fn variant(&self) -> PETEETH0TX_A { match self.bits { false => PETEETH0TX_A::VALUE1, true => PETEETH0TX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEETH0TX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEETH0TX_A::VALUE2 } } #[doc = "Field `PETEETH0TX` writer - Parity Error Trap Enable for ETH 0TX Memory"] -pub type PETEETH0TX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEETH0TX_A, O>; -impl<'a, const O: u8> PETEETH0TX_W<'a, O> { +pub type PETEETH0TX_W<'a, REG> = crate::BitWriter<'a, REG, PETEETH0TX_A>; +impl<'a, REG> PETEETH0TX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEETH0TX_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEETH0TX_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl PETEETH0RX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PETEETH0RX_A { + pub const fn variant(&self) -> PETEETH0RX_A { match self.bits { false => PETEETH0RX_A::VALUE1, true => PETEETH0RX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PETEETH0RX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PETEETH0RX_A::VALUE2 } } #[doc = "Field `PETEETH0RX` writer - Parity Error Trap Enable for ETH0 RX Memory"] -pub type PETEETH0RX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PETE_SPEC, PETEETH0RX_A, O>; -impl<'a, const O: u8> PETEETH0RX_W<'a, O> { +pub type PETEETH0RX_W<'a, REG> = crate::BitWriter<'a, REG, PETEETH0RX_A>; +impl<'a, REG> PETEETH0RX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PETEETH0RX_A::VALUE1) } #[doc = "Enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PETEETH0RX_A::VALUE2) } } @@ -590,82 +588,83 @@ impl W { #[doc = "Bit 0 - Parity Error Trap Enable for PSRAM"] #[inline(always)] #[must_use] - pub fn peteps(&mut self) -> PETEPS_W<0> { - PETEPS_W::new(self) + pub fn peteps(&mut self) -> PETEPS_W { + PETEPS_W::new(self, 0) } #[doc = "Bit 1 - Parity Error Trap Enable for DSRAM1"] #[inline(always)] #[must_use] - pub fn peteds1(&mut self) -> PETEDS1_W<1> { - PETEDS1_W::new(self) + pub fn peteds1(&mut self) -> PETEDS1_W { + PETEDS1_W::new(self, 1) } #[doc = "Bit 2 - Parity Error Trap Enable for DSRAM2"] #[inline(always)] #[must_use] - pub fn peteds2(&mut self) -> PETEDS2_W<2> { - PETEDS2_W::new(self) + pub fn peteds2(&mut self) -> PETEDS2_W { + PETEDS2_W::new(self, 2) } #[doc = "Bit 8 - Parity Error Trap Enable for USIC0 Memory"] #[inline(always)] #[must_use] - pub fn peteu0(&mut self) -> PETEU0_W<8> { - PETEU0_W::new(self) + pub fn peteu0(&mut self) -> PETEU0_W { + PETEU0_W::new(self, 8) } #[doc = "Bit 9 - Parity Error Trap Enable for USIC1 Memory"] #[inline(always)] #[must_use] - pub fn peteu1(&mut self) -> PETEU1_W<9> { - PETEU1_W::new(self) + pub fn peteu1(&mut self) -> PETEU1_W { + PETEU1_W::new(self, 9) } #[doc = "Bit 12 - Parity Error Trap Enable for MultiCAN Memory"] #[inline(always)] #[must_use] - pub fn petemc(&mut self) -> PETEMC_W<12> { - PETEMC_W::new(self) + pub fn petemc(&mut self) -> PETEMC_W { + PETEMC_W::new(self, 12) } #[doc = "Bit 13 - Parity Error Trap Enable for PMU Prefetch Memory"] #[inline(always)] #[must_use] - pub fn petepprf(&mut self) -> PETEPPRF_W<13> { - PETEPPRF_W::new(self) + pub fn petepprf(&mut self) -> PETEPPRF_W { + PETEPPRF_W::new(self, 13) } #[doc = "Bit 16 - Parity Error Trap Enable for USB Memory"] #[inline(always)] #[must_use] - pub fn peteusb(&mut self) -> PETEUSB_W<16> { - PETEUSB_W::new(self) + pub fn peteusb(&mut self) -> PETEUSB_W { + PETEUSB_W::new(self, 16) } #[doc = "Bit 17 - Parity Error Trap Enable for ETH 0TX Memory"] #[inline(always)] #[must_use] - pub fn peteeth0tx(&mut self) -> PETEETH0TX_W<17> { - PETEETH0TX_W::new(self) + pub fn peteeth0tx(&mut self) -> PETEETH0TX_W { + PETEETH0TX_W::new(self, 17) } #[doc = "Bit 18 - Parity Error Trap Enable for ETH0 RX Memory"] #[inline(always)] #[must_use] - pub fn peteeth0rx(&mut self) -> PETEETH0RX_W<18> { - PETEETH0RX_W::new(self) + pub fn peteeth0rx(&mut self) -> PETEETH0RX_W { + PETEETH0RX_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Parity Error Trap Enable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pete::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pete::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pete::R`](R) reader structure"] +impl crate::Readable for PETE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pete::W`](W) writer structure"] impl crate::Writable for PETE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_parity/pmtpr.rs b/src/scu_parity/pmtpr.rs index 44700a60..206f569c 100644 --- a/src/scu_parity/pmtpr.rs +++ b/src/scu_parity/pmtpr.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PWR` reader - Parity Write Values for Memory Test"] -pub type PWR_R = crate::FieldReader; +pub type PWR_R = crate::FieldReader; #[doc = "Field `PWR` writer - Parity Write Values for Memory Test"] -pub type PWR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PMTPR_SPEC, u8, u8, 8, O>; +pub type PWR_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `PRD` reader - Parity Read Values for Memory Test"] -pub type PRD_R = crate::FieldReader; +pub type PRD_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Parity Write Values for Memory Test"] #[inline(always)] @@ -56,28 +24,29 @@ impl W { #[doc = "Bits 0:7 - Parity Write Values for Memory Test"] #[inline(always)] #[must_use] - pub fn pwr(&mut self) -> PWR_W<0> { - PWR_W::new(self) + pub fn pwr(&mut self) -> PWR_W { + PWR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Parity Memory Test Pattern Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pmtpr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pmtpr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pmtpr::R`](R) reader structure"] +impl crate::Readable for PMTPR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pmtpr::W`](W) writer structure"] impl crate::Writable for PMTPR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_parity/pmtsr.rs b/src/scu_parity/pmtsr.rs index 4f01ed13..e65153f6 100644 --- a/src/scu_parity/pmtsr.rs +++ b/src/scu_parity/pmtsr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MTENPS` reader - Test Enable Control for PSRAM"] pub type MTENPS_R = crate::BitReader; #[doc = "Test Enable Control for PSRAM\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl MTENPS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTENPS_A { + pub const fn variant(&self) -> MTENPS_A { match self.bits { false => MTENPS_A::VALUE1, true => MTENPS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTENPS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTENPS_A::VALUE2 } } #[doc = "Field `MTENPS` writer - Test Enable Control for PSRAM"] -pub type MTENPS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTENPS_A, O>; -impl<'a, const O: u8> MTENPS_W<'a, O> { +pub type MTENPS_W<'a, REG> = crate::BitWriter<'a, REG, MTENPS_A>; +impl<'a, REG> MTENPS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTENPS_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTENPS_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl MTENDS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTENDS1_A { + pub const fn variant(&self) -> MTENDS1_A { match self.bits { false => MTENDS1_A::VALUE1, true => MTENDS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTENDS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTENDS1_A::VALUE2 } } #[doc = "Field `MTENDS1` writer - Test Enable Control for DSRAM1"] -pub type MTENDS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTENDS1_A, O>; -impl<'a, const O: u8> MTENDS1_W<'a, O> { +pub type MTENDS1_W<'a, REG> = crate::BitWriter<'a, REG, MTENDS1_A>; +impl<'a, REG> MTENDS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTENDS1_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTENDS1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl MTENDS2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTENDS2_A { + pub const fn variant(&self) -> MTENDS2_A { match self.bits { false => MTENDS2_A::VALUE1, true => MTENDS2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTENDS2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTENDS2_A::VALUE2 } } #[doc = "Field `MTENDS2` writer - Test Enable Control for DSRAM2"] -pub type MTENDS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTENDS2_A, O>; -impl<'a, const O: u8> MTENDS2_W<'a, O> { +pub type MTENDS2_W<'a, REG> = crate::BitWriter<'a, REG, MTENDS2_A>; +impl<'a, REG> MTENDS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTENDS2_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTENDS2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl MTEU0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTEU0_A { + pub const fn variant(&self) -> MTEU0_A { match self.bits { false => MTEU0_A::VALUE1, true => MTEU0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTEU0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTEU0_A::VALUE2 } } #[doc = "Field `MTEU0` writer - Test Enable Control for USIC0 Memory"] -pub type MTEU0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTEU0_A, O>; -impl<'a, const O: u8> MTEU0_W<'a, O> { +pub type MTEU0_W<'a, REG> = crate::BitWriter<'a, REG, MTEU0_A>; +impl<'a, REG> MTEU0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTEU0_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTEU0_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl MTEU1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTEU1_A { + pub const fn variant(&self) -> MTEU1_A { match self.bits { false => MTEU1_A::VALUE1, true => MTEU1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTEU1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTEU1_A::VALUE2 } } #[doc = "Field `MTEU1` writer - Test Enable Control for USIC1 Memory"] -pub type MTEU1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTEU1_A, O>; -impl<'a, const O: u8> MTEU1_W<'a, O> { +pub type MTEU1_W<'a, REG> = crate::BitWriter<'a, REG, MTEU1_A>; +impl<'a, REG> MTEU1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTEU1_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTEU1_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl MTEMC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTEMC_A { + pub const fn variant(&self) -> MTEMC_A { match self.bits { false => MTEMC_A::VALUE1, true => MTEMC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTEMC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTEMC_A::VALUE2 } } #[doc = "Field `MTEMC` writer - Test Enable Control for MultiCAN Memory"] -pub type MTEMC_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTEMC_A, O>; -impl<'a, const O: u8> MTEMC_W<'a, O> { +pub type MTEMC_W<'a, REG> = crate::BitWriter<'a, REG, MTEMC_A>; +impl<'a, REG> MTEMC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTEMC_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTEMC_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl MTEPPRF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTEPPRF_A { + pub const fn variant(&self) -> MTEPPRF_A { match self.bits { false => MTEPPRF_A::VALUE1, true => MTEPPRF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTEPPRF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTEPPRF_A::VALUE2 } } #[doc = "Field `MTEPPRF` writer - Test Enable Control for PMU Prefetch Memory"] -pub type MTEPPRF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTEPPRF_A, O>; -impl<'a, const O: u8> MTEPPRF_W<'a, O> { +pub type MTEPPRF_W<'a, REG> = crate::BitWriter<'a, REG, MTEPPRF_A>; +impl<'a, REG> MTEPPRF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTEPPRF_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTEPPRF_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl MTUSB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTUSB_A { + pub const fn variant(&self) -> MTUSB_A { match self.bits { false => MTUSB_A::VALUE1, true => MTUSB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTUSB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTUSB_A::VALUE2 } } #[doc = "Field `MTUSB` writer - Test Enable Control for USB Memory"] -pub type MTUSB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTUSB_A, O>; -impl<'a, const O: u8> MTUSB_W<'a, O> { +pub type MTUSB_W<'a, REG> = crate::BitWriter<'a, REG, MTUSB_A>; +impl<'a, REG> MTUSB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTUSB_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTUSB_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl MTETH0TX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTETH0TX_A { + pub const fn variant(&self) -> MTETH0TX_A { match self.bits { false => MTETH0TX_A::VALUE1, true => MTETH0TX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTETH0TX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTETH0TX_A::VALUE2 } } #[doc = "Field `MTETH0TX` writer - Test Enable Control for ETH TX Memory"] -pub type MTETH0TX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTETH0TX_A, O>; -impl<'a, const O: u8> MTETH0TX_W<'a, O> { +pub type MTETH0TX_W<'a, REG> = crate::BitWriter<'a, REG, MTETH0TX_A>; +impl<'a, REG> MTETH0TX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTETH0TX_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTETH0TX_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl MTETH0RX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MTETH0RX_A { + pub const fn variant(&self) -> MTETH0RX_A { match self.bits { false => MTETH0RX_A::VALUE1, true => MTETH0RX_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MTETH0RX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Parity bits under test"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MTETH0RX_A::VALUE2 } } #[doc = "Field `MTETH0RX` writer - Test Enable Control for ETH RX Memory"] -pub type MTETH0RX_W<'a, const O: u8> = crate::BitWriter<'a, u32, PMTSR_SPEC, MTETH0RX_A, O>; -impl<'a, const O: u8> MTETH0RX_W<'a, O> { +pub type MTETH0RX_W<'a, REG> = crate::BitWriter<'a, REG, MTETH0RX_A>; +impl<'a, REG> MTETH0RX_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTETH0RX_A::VALUE1) } #[doc = "Parity bits under test"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTETH0RX_A::VALUE2) } } @@ -590,82 +588,83 @@ impl W { #[doc = "Bit 0 - Test Enable Control for PSRAM"] #[inline(always)] #[must_use] - pub fn mtenps(&mut self) -> MTENPS_W<0> { - MTENPS_W::new(self) + pub fn mtenps(&mut self) -> MTENPS_W { + MTENPS_W::new(self, 0) } #[doc = "Bit 1 - Test Enable Control for DSRAM1"] #[inline(always)] #[must_use] - pub fn mtends1(&mut self) -> MTENDS1_W<1> { - MTENDS1_W::new(self) + pub fn mtends1(&mut self) -> MTENDS1_W { + MTENDS1_W::new(self, 1) } #[doc = "Bit 2 - Test Enable Control for DSRAM2"] #[inline(always)] #[must_use] - pub fn mtends2(&mut self) -> MTENDS2_W<2> { - MTENDS2_W::new(self) + pub fn mtends2(&mut self) -> MTENDS2_W { + MTENDS2_W::new(self, 2) } #[doc = "Bit 8 - Test Enable Control for USIC0 Memory"] #[inline(always)] #[must_use] - pub fn mteu0(&mut self) -> MTEU0_W<8> { - MTEU0_W::new(self) + pub fn mteu0(&mut self) -> MTEU0_W { + MTEU0_W::new(self, 8) } #[doc = "Bit 9 - Test Enable Control for USIC1 Memory"] #[inline(always)] #[must_use] - pub fn mteu1(&mut self) -> MTEU1_W<9> { - MTEU1_W::new(self) + pub fn mteu1(&mut self) -> MTEU1_W { + MTEU1_W::new(self, 9) } #[doc = "Bit 12 - Test Enable Control for MultiCAN Memory"] #[inline(always)] #[must_use] - pub fn mtemc(&mut self) -> MTEMC_W<12> { - MTEMC_W::new(self) + pub fn mtemc(&mut self) -> MTEMC_W { + MTEMC_W::new(self, 12) } #[doc = "Bit 13 - Test Enable Control for PMU Prefetch Memory"] #[inline(always)] #[must_use] - pub fn mtepprf(&mut self) -> MTEPPRF_W<13> { - MTEPPRF_W::new(self) + pub fn mtepprf(&mut self) -> MTEPPRF_W { + MTEPPRF_W::new(self, 13) } #[doc = "Bit 16 - Test Enable Control for USB Memory"] #[inline(always)] #[must_use] - pub fn mtusb(&mut self) -> MTUSB_W<16> { - MTUSB_W::new(self) + pub fn mtusb(&mut self) -> MTUSB_W { + MTUSB_W::new(self, 16) } #[doc = "Bit 17 - Test Enable Control for ETH TX Memory"] #[inline(always)] #[must_use] - pub fn mteth0tx(&mut self) -> MTETH0TX_W<17> { - MTETH0TX_W::new(self) + pub fn mteth0tx(&mut self) -> MTETH0TX_W { + MTETH0TX_W::new(self, 17) } #[doc = "Bit 18 - Test Enable Control for ETH RX Memory"] #[inline(always)] #[must_use] - pub fn mteth0rx(&mut self) -> MTETH0RX_W<18> { - MTETH0RX_W::new(self) + pub fn mteth0rx(&mut self) -> MTETH0RX_W { + MTETH0RX_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Parity Memory Test Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pmtsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pmtsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pmtsr::R`](R) reader structure"] +impl crate::Readable for PMTSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pmtsr::W`](W) writer structure"] impl crate::Writable for PMTSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_pll.rs b/src/scu_pll.rs index 2c0b7038..01bd6ee0 100644 --- a/src/scu_pll.rs +++ b/src/scu_pll.rs @@ -1,47 +1,84 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + pllstat: PLLSTAT, + pllcon0: PLLCON0, + pllcon1: PLLCON1, + pllcon2: PLLCON2, + usbpllstat: USBPLLSTAT, + usbpllcon: USBPLLCON, + _reserved6: [u8; 0x10], + clkmxstat: CLKMXSTAT, +} +impl RegisterBlock { #[doc = "0x00 - PLL Status Register"] - pub pllstat: PLLSTAT, + #[inline(always)] + pub const fn pllstat(&self) -> &PLLSTAT { + &self.pllstat + } #[doc = "0x04 - PLL Configuration 0 Register"] - pub pllcon0: PLLCON0, + #[inline(always)] + pub const fn pllcon0(&self) -> &PLLCON0 { + &self.pllcon0 + } #[doc = "0x08 - PLL Configuration 1 Register"] - pub pllcon1: PLLCON1, + #[inline(always)] + pub const fn pllcon1(&self) -> &PLLCON1 { + &self.pllcon1 + } #[doc = "0x0c - PLL Configuration 2 Register"] - pub pllcon2: PLLCON2, + #[inline(always)] + pub const fn pllcon2(&self) -> &PLLCON2 { + &self.pllcon2 + } #[doc = "0x10 - USB PLL Status Register"] - pub usbpllstat: USBPLLSTAT, + #[inline(always)] + pub const fn usbpllstat(&self) -> &USBPLLSTAT { + &self.usbpllstat + } #[doc = "0x14 - USB PLL Configuration Register"] - pub usbpllcon: USBPLLCON, - _reserved6: [u8; 0x10], + #[inline(always)] + pub const fn usbpllcon(&self) -> &USBPLLCON { + &self.usbpllcon + } #[doc = "0x28 - Clock Multiplexing Status Register"] - pub clkmxstat: CLKMXSTAT, + #[inline(always)] + pub const fn clkmxstat(&self) -> &CLKMXSTAT { + &self.clkmxstat + } } -#[doc = "PLLSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "PLLSTAT (r) register accessor: PLL Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pllstat`] +module"] pub type PLLSTAT = crate::Reg; #[doc = "PLL Status Register"] pub mod pllstat; -#[doc = "PLLCON0 (rw) register accessor: an alias for `Reg`"] +#[doc = "PLLCON0 (rw) register accessor: PLL Configuration 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllcon0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pllcon0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pllcon0`] +module"] pub type PLLCON0 = crate::Reg; #[doc = "PLL Configuration 0 Register"] pub mod pllcon0; -#[doc = "PLLCON1 (rw) register accessor: an alias for `Reg`"] +#[doc = "PLLCON1 (rw) register accessor: PLL Configuration 1 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllcon1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pllcon1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pllcon1`] +module"] pub type PLLCON1 = crate::Reg; #[doc = "PLL Configuration 1 Register"] pub mod pllcon1; -#[doc = "PLLCON2 (rw) register accessor: an alias for `Reg`"] +#[doc = "PLLCON2 (rw) register accessor: PLL Configuration 2 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllcon2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pllcon2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pllcon2`] +module"] pub type PLLCON2 = crate::Reg; #[doc = "PLL Configuration 2 Register"] pub mod pllcon2; -#[doc = "USBPLLSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "USBPLLSTAT (r) register accessor: USB PLL Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`usbpllstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@usbpllstat`] +module"] pub type USBPLLSTAT = crate::Reg; #[doc = "USB PLL Status Register"] pub mod usbpllstat; -#[doc = "USBPLLCON (rw) register accessor: an alias for `Reg`"] +#[doc = "USBPLLCON (rw) register accessor: USB PLL Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`usbpllcon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`usbpllcon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@usbpllcon`] +module"] pub type USBPLLCON = crate::Reg; #[doc = "USB PLL Configuration Register"] pub mod usbpllcon; -#[doc = "CLKMXSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "CLKMXSTAT (r) register accessor: Clock Multiplexing Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clkmxstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clkmxstat`] +module"] 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 310d4f50..5fa23a33 100644 --- a/src/scu_pll/clkmxstat.rs +++ b/src/scu_pll/clkmxstat.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `SYSCLKMUX` reader - Status of System clock multiplexing upon source switching"] -pub type SYSCLKMUX_R = crate::FieldReader; +pub type SYSCLKMUX_R = crate::FieldReader; #[doc = "Status of System clock multiplexing upon source switching\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -30,22 +17,25 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SYSCLKMUX_A { + type Ux = u8; +} impl SYSCLKMUX_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(SYSCLKMUX_A::VALUE1), 2 => Some(SYSCLKMUX_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fOFI clock active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SYSCLKMUX_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fPLL clock active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SYSCLKMUX_A::VALUE2 @@ -58,15 +48,13 @@ impl R { SYSCLKMUX_R::new((self.bits & 3) 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"] +#[doc = "Clock Multiplexing Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clkmxstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`clkmxstat::R`](R) reader structure"] +impl crate::Readable for CLKMXSTAT_SPEC {} #[doc = "`reset()` method sets CLKMXSTAT to value 0"] impl crate::Resettable for CLKMXSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_pll/pllcon0.rs b/src/scu_pll/pllcon0.rs index 51fcd5e3..6d323115 100644 --- a/src/scu_pll/pllcon0.rs +++ b/src/scu_pll/pllcon0.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VCOBYP` reader - VCO Bypass"] pub type VCOBYP_R = crate::BitReader; #[doc = "VCO Bypass\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl VCOBYP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOBYP_A { + pub const fn variant(&self) -> VCOBYP_A { match self.bits { false => VCOBYP_A::VALUE1, true => VCOBYP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal operation, VCO is not bypassed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOBYP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler Mode, VCO is bypassed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOBYP_A::VALUE2 } } #[doc = "Field `VCOBYP` writer - VCO Bypass"] -pub type VCOBYP_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, VCOBYP_A, O>; -impl<'a, const O: u8> VCOBYP_W<'a, O> { +pub type VCOBYP_W<'a, REG> = crate::BitWriter<'a, REG, VCOBYP_A>; +impl<'a, REG> VCOBYP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal operation, VCO is not bypassed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VCOBYP_A::VALUE1) } #[doc = "Prescaler Mode, VCO is bypassed"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VCOBYP_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl VCOPWD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOPWD_A { + pub const fn variant(&self) -> VCOPWD_A { match self.bits { false => VCOPWD_A::VALUE1, true => VCOPWD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal behavior"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOPWD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The VCO is put into a Power Saving Mode and can no longer be used. Only the Bypass and Prescaler Mode are active if previously selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOPWD_A::VALUE2 } } #[doc = "Field `VCOPWD` writer - VCO Power Saving Mode"] -pub type VCOPWD_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, VCOPWD_A, O>; -impl<'a, const O: u8> VCOPWD_W<'a, O> { +pub type VCOPWD_W<'a, REG> = crate::BitWriter<'a, REG, VCOPWD_A>; +impl<'a, REG> VCOPWD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal behavior"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VCOPWD_A::VALUE1) } #[doc = "The VCO is put into a Power Saving Mode and can no longer be used. Only the Bypass and Prescaler Mode are active if previously selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VCOPWD_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl VCOTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOTR_A { + pub const fn variant(&self) -> VCOTR_A { match self.bits { false => VCOTR_A::VALUE1, true => VCOTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == VCOTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "VCO bandwidth is operation in the test range. VCO output frequency is between 260 and 520 MHz for a input frequency between 8 and 16 MHz."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOTR_A::VALUE2 } } #[doc = "Field `VCOTR` writer - VCO Trim Control"] -pub type VCOTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, VCOTR_A, O>; -impl<'a, const O: u8> VCOTR_W<'a, O> { +pub type VCOTR_W<'a, REG> = crate::BitWriter<'a, REG, VCOTR_A>; +impl<'a, REG> VCOTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VCOTR_A::VALUE1) } #[doc = "VCO bandwidth is operation in the test range. VCO output frequency is between 260 and 520 MHz for a input frequency between 8 and 16 MHz."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VCOTR_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl FINDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FINDIS_A { + pub const fn variant(&self) -> FINDIS_A { match self.bits { false => FINDIS_A::VALUE1, true => FINDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "connect oscillator to the VCO part"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FINDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "disconnect oscillator from the VCO part."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FINDIS_A::VALUE2 } } #[doc = "Field `FINDIS` writer - Disconnect Oscillator from VCO"] -pub type FINDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, FINDIS_A, O>; -impl<'a, const O: u8> FINDIS_W<'a, O> { +pub type FINDIS_W<'a, REG> = crate::BitWriter<'a, REG, FINDIS_A>; +impl<'a, REG> FINDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "connect oscillator to the VCO part"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FINDIS_A::VALUE1) } #[doc = "disconnect oscillator from the VCO part."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FINDIS_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl OSCDISCDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCDISCDIS_A { + pub const fn variant(&self) -> OSCDISCDIS_A { match self.bits { false => OSCDISCDIS_A::VALUE1, true => OSCDISCDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "In case of a PLL loss-of-lock bit FINDIS is set"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCDISCDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "In case of a PLL loss-of-lock bit FINDIS is cleared"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCDISCDIS_A::VALUE2 } } #[doc = "Field `OSCDISCDIS` writer - Oscillator Disconnect Disable"] -pub type OSCDISCDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, OSCDISCDIS_A, O>; -impl<'a, const O: u8> OSCDISCDIS_W<'a, O> { +pub type OSCDISCDIS_W<'a, REG> = crate::BitWriter<'a, REG, OSCDISCDIS_A>; +impl<'a, REG> OSCDISCDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "In case of a PLL loss-of-lock bit FINDIS is set"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCDISCDIS_A::VALUE1) } #[doc = "In case of a PLL loss-of-lock bit FINDIS is cleared"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCDISCDIS_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl PLLPWD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PLLPWD_A { + pub const fn variant(&self) -> PLLPWD_A { match self.bits { false => PLLPWD_A::VALUE1, true => PLLPWD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal behavior"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLLPWD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The complete PLL block is put into a Power Saving Mode and can no longer be used. Only the Bypass Mode is active if previously selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLLPWD_A::VALUE2 } } #[doc = "Field `PLLPWD` writer - PLL Power Saving Mode"] -pub type PLLPWD_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, PLLPWD_A, O>; -impl<'a, const O: u8> PLLPWD_W<'a, O> { +pub type PLLPWD_W<'a, REG> = crate::BitWriter<'a, REG, PLLPWD_A>; +impl<'a, REG> PLLPWD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal behavior"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PLLPWD_A::VALUE1) } #[doc = "The complete PLL block is put into a Power Saving Mode and can no longer be used. Only the Bypass Mode is active if previously selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PLLPWD_A::VALUE2) } } @@ -353,39 +339,42 @@ impl From for bool { impl OSCRES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCRES_A { + pub const fn variant(&self) -> OSCRES_A { match self.bits { false => OSCRES_A::VALUE1, true => OSCRES_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The Oscillator Watchdog of the PLL is not cleared and remains active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCRES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The Oscillator Watchdog of the PLL is cleared and restarted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCRES_A::VALUE2 } } #[doc = "Field `OSCRES` writer - Oscillator Watchdog Reset"] -pub type OSCRES_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, OSCRES_A, O>; -impl<'a, const O: u8> OSCRES_W<'a, O> { +pub type OSCRES_W<'a, REG> = crate::BitWriter<'a, REG, OSCRES_A>; +impl<'a, REG> OSCRES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The Oscillator Watchdog of the PLL is not cleared and remains active"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCRES_A::VALUE1) } #[doc = "The Oscillator Watchdog of the PLL is cleared and restarted"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCRES_A::VALUE2) } } #[doc = "Field `RESLD` writer - Restart VCO Lock Detection"] -pub type RESLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, bool, O>; +pub type RESLD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AOTREN` reader - Automatic Oscillator Calibration Enable"] pub type AOTREN_R = crate::BitReader; #[doc = "Automatic Oscillator Calibration Enable\n\nValue on reset: 0"] @@ -405,34 +394,37 @@ impl From for bool { impl AOTREN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AOTREN_A { + pub const fn variant(&self) -> AOTREN_A { match self.bits { false => AOTREN_A::VALUE1, true => AOTREN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AOTREN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Enable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AOTREN_A::VALUE2 } } #[doc = "Field `AOTREN` writer - Automatic Oscillator Calibration Enable"] -pub type AOTREN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, AOTREN_A, O>; -impl<'a, const O: u8> AOTREN_W<'a, O> { +pub type AOTREN_W<'a, REG> = crate::BitWriter<'a, REG, AOTREN_A>; +impl<'a, REG> AOTREN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disable"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AOTREN_A::VALUE1) } #[doc = "Enable"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AOTREN_A::VALUE2) } } @@ -455,34 +447,37 @@ impl From for bool { impl FOTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FOTR_A { + pub const fn variant(&self) -> FOTR_A { match self.bits { false => FOTR_A::VALUE1, true => FOTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FOTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Force fixed-value trimming"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FOTR_A::VALUE2 } } #[doc = "Field `FOTR` writer - Factory Oscillator Calibration"] -pub type FOTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON0_SPEC, FOTR_A, O>; -impl<'a, const O: u8> FOTR_W<'a, O> { +pub type FOTR_W<'a, REG> = crate::BitWriter<'a, REG, FOTR_A>; +impl<'a, REG> FOTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FOTR_A::VALUE1) } #[doc = "Force fixed-value trimming"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FOTR_A::VALUE2) } } @@ -537,82 +532,83 @@ impl W { #[doc = "Bit 0 - VCO Bypass"] #[inline(always)] #[must_use] - pub fn vcobyp(&mut self) -> VCOBYP_W<0> { - VCOBYP_W::new(self) + pub fn vcobyp(&mut self) -> VCOBYP_W { + VCOBYP_W::new(self, 0) } #[doc = "Bit 1 - VCO Power Saving Mode"] #[inline(always)] #[must_use] - pub fn vcopwd(&mut self) -> VCOPWD_W<1> { - VCOPWD_W::new(self) + pub fn vcopwd(&mut self) -> VCOPWD_W { + VCOPWD_W::new(self, 1) } #[doc = "Bit 2 - VCO Trim Control"] #[inline(always)] #[must_use] - pub fn vcotr(&mut self) -> VCOTR_W<2> { - VCOTR_W::new(self) + pub fn vcotr(&mut self) -> VCOTR_W { + VCOTR_W::new(self, 2) } #[doc = "Bit 4 - Disconnect Oscillator from VCO"] #[inline(always)] #[must_use] - pub fn findis(&mut self) -> FINDIS_W<4> { - FINDIS_W::new(self) + pub fn findis(&mut self) -> FINDIS_W { + FINDIS_W::new(self, 4) } #[doc = "Bit 6 - Oscillator Disconnect Disable"] #[inline(always)] #[must_use] - pub fn oscdiscdis(&mut self) -> OSCDISCDIS_W<6> { - OSCDISCDIS_W::new(self) + pub fn oscdiscdis(&mut self) -> OSCDISCDIS_W { + OSCDISCDIS_W::new(self, 6) } #[doc = "Bit 16 - PLL Power Saving Mode"] #[inline(always)] #[must_use] - pub fn pllpwd(&mut self) -> PLLPWD_W<16> { - PLLPWD_W::new(self) + pub fn pllpwd(&mut self) -> PLLPWD_W { + PLLPWD_W::new(self, 16) } #[doc = "Bit 17 - Oscillator Watchdog Reset"] #[inline(always)] #[must_use] - pub fn oscres(&mut self) -> OSCRES_W<17> { - OSCRES_W::new(self) + pub fn oscres(&mut self) -> OSCRES_W { + OSCRES_W::new(self, 17) } #[doc = "Bit 18 - Restart VCO Lock Detection"] #[inline(always)] #[must_use] - pub fn resld(&mut self) -> RESLD_W<18> { - RESLD_W::new(self) + pub fn resld(&mut self) -> RESLD_W { + RESLD_W::new(self, 18) } #[doc = "Bit 19 - Automatic Oscillator Calibration Enable"] #[inline(always)] #[must_use] - pub fn aotren(&mut self) -> AOTREN_W<19> { - AOTREN_W::new(self) + pub fn aotren(&mut self) -> AOTREN_W { + AOTREN_W::new(self, 19) } #[doc = "Bit 20 - Factory Oscillator Calibration"] #[inline(always)] #[must_use] - pub fn fotr(&mut self) -> FOTR_W<20> { - FOTR_W::new(self) + pub fn fotr(&mut self) -> FOTR_W { + FOTR_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "PLL Configuration 0 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllcon0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pllcon0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pllcon0::R`](R) reader structure"] +impl crate::Readable for PLLCON0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pllcon0::W`](W) writer structure"] impl crate::Writable for PLLCON0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_pll/pllcon1.rs b/src/scu_pll/pllcon1.rs index fccdc19c..90c14383 100644 --- a/src/scu_pll/pllcon1.rs +++ b/src/scu_pll/pllcon1.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `K1DIV` reader - K1-Divider Value"] -pub type K1DIV_R = crate::FieldReader; +pub type K1DIV_R = crate::FieldReader; #[doc = "Field `K1DIV` writer - K1-Divider Value"] -pub type K1DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLLCON1_SPEC, u8, u8, 7, O>; +pub type K1DIV_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `NDIV` reader - N-Divider Value"] -pub type NDIV_R = crate::FieldReader; +pub type NDIV_R = crate::FieldReader; #[doc = "Field `NDIV` writer - N-Divider Value"] -pub type NDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLLCON1_SPEC, u8, u8, 7, O>; +pub type NDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `K2DIV` reader - K2-Divider Value"] -pub type K2DIV_R = crate::FieldReader; +pub type K2DIV_R = crate::FieldReader; #[doc = "Field `K2DIV` writer - K2-Divider Value"] -pub type K2DIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLLCON1_SPEC, u8, u8, 7, O>; +pub type K2DIV_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `PDIV` reader - P-Divider Value"] -pub type PDIV_R = crate::FieldReader; +pub type PDIV_R = crate::FieldReader; #[doc = "Field `PDIV` writer - P-Divider Value"] -pub type PDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PLLCON1_SPEC, u8, u8, 4, O>; +pub type PDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:6 - K1-Divider Value"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bits 0:6 - K1-Divider Value"] #[inline(always)] #[must_use] - pub fn k1div(&mut self) -> K1DIV_W<0> { - K1DIV_W::new(self) + pub fn k1div(&mut self) -> K1DIV_W { + K1DIV_W::new(self, 0) } #[doc = "Bits 8:14 - N-Divider Value"] #[inline(always)] #[must_use] - pub fn ndiv(&mut self) -> NDIV_W<8> { - NDIV_W::new(self) + pub fn ndiv(&mut self) -> NDIV_W { + NDIV_W::new(self, 8) } #[doc = "Bits 16:22 - K2-Divider Value"] #[inline(always)] #[must_use] - pub fn k2div(&mut self) -> K2DIV_W<16> { - K2DIV_W::new(self) + pub fn k2div(&mut self) -> K2DIV_W { + K2DIV_W::new(self, 16) } #[doc = "Bits 24:27 - P-Divider Value"] #[inline(always)] #[must_use] - pub fn pdiv(&mut self) -> PDIV_W<24> { - PDIV_W::new(self) + pub fn pdiv(&mut self) -> PDIV_W { + PDIV_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "PLL Configuration 1 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllcon1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pllcon1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pllcon1::R`](R) reader structure"] +impl crate::Readable for PLLCON1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pllcon1::W`](W) writer structure"] impl crate::Writable for PLLCON1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_pll/pllcon2.rs b/src/scu_pll/pllcon2.rs index 3d822e61..342c510d 100644 --- a/src/scu_pll/pllcon2.rs +++ b/src/scu_pll/pllcon2.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PINSEL` reader - P-Divider Input Selection"] pub type PINSEL_R = crate::BitReader; #[doc = "P-Divider Input Selection\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl PINSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PINSEL_A { + pub const fn variant(&self) -> PINSEL_A { match self.bits { false => PINSEL_A::VALUE1, true => PINSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PLL external oscillator selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PINSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Backup clock fofi selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PINSEL_A::VALUE2 } } #[doc = "Field `PINSEL` writer - P-Divider Input Selection"] -pub type PINSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON2_SPEC, PINSEL_A, O>; -impl<'a, const O: u8> PINSEL_W<'a, O> { +pub type PINSEL_W<'a, REG> = crate::BitWriter<'a, REG, PINSEL_A>; +impl<'a, REG> PINSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "PLL external oscillator selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PINSEL_A::VALUE1) } #[doc = "Backup clock fofi selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PINSEL_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl K1INSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> K1INSEL_A { + pub const fn variant(&self) -> K1INSEL_A { match self.bits { false => K1INSEL_A::VALUE1, true => K1INSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PLL external oscillator selected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == K1INSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Backup clock fofi selected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == K1INSEL_A::VALUE2 } } #[doc = "Field `K1INSEL` writer - K1-Divider Input Selection"] -pub type K1INSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PLLCON2_SPEC, K1INSEL_A, O>; -impl<'a, const O: u8> K1INSEL_W<'a, O> { +pub type K1INSEL_W<'a, REG> = crate::BitWriter<'a, REG, K1INSEL_A>; +impl<'a, REG> K1INSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "PLL external oscillator selected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(K1INSEL_A::VALUE1) } #[doc = "Backup clock fofi selected"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(K1INSEL_A::VALUE2) } } @@ -150,34 +124,35 @@ impl W { #[doc = "Bit 0 - P-Divider Input Selection"] #[inline(always)] #[must_use] - pub fn pinsel(&mut self) -> PINSEL_W<0> { - PINSEL_W::new(self) + pub fn pinsel(&mut self) -> PINSEL_W { + PINSEL_W::new(self, 0) } #[doc = "Bit 8 - K1-Divider Input Selection"] #[inline(always)] #[must_use] - pub fn k1insel(&mut self) -> K1INSEL_W<8> { - K1INSEL_W::new(self) + pub fn k1insel(&mut self) -> K1INSEL_W { + K1INSEL_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "PLL Configuration 2 Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllcon2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pllcon2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pllcon2::R`](R) reader structure"] +impl crate::Readable for PLLCON2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pllcon2::W`](W) writer structure"] impl crate::Writable for PLLCON2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_pll/pllstat.rs b/src/scu_pll/pllstat.rs index e3a430ad..a790af4e 100644 --- a/src/scu_pll/pllstat.rs +++ b/src/scu_pll/pllstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VCOBYST` reader - VCO Bypass Status"] pub type VCOBYST_R = crate::BitReader; #[doc = "VCO Bypass Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl VCOBYST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOBYST_A { + pub const fn variant(&self) -> VCOBYST_A { match self.bits { false => VCOBYST_A::VALUE1, true => VCOBYST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Free-running / Normal Mode is entered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOBYST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler Mode is entered"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOBYST_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl PWDSTAT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PWDSTAT_A { + pub const fn variant(&self) -> PWDSTAT_A { match self.bits { false => PWDSTAT_A::VALUE1, true => PWDSTAT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PLL Power-saving Mode was not entered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PWDSTAT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "PLL Power-saving Mode was entered"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PWDSTAT_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl VCOLOCK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOLOCK_A { + pub const fn variant(&self) -> VCOLOCK_A { match self.bits { false => VCOLOCK_A::VALUE1, true => VCOLOCK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PLL not locked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOLOCK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "PLL locked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOLOCK_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl K1RDY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> K1RDY_A { + pub const fn variant(&self) -> K1RDY_A { match self.bits { false => K1RDY_A::VALUE1, true => K1RDY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "K1-Divider does not operate with the new value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == K1RDY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "K1-Divider operate with the new value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == K1RDY_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl K2RDY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> K2RDY_A { + pub const fn variant(&self) -> K2RDY_A { match self.bits { false => K2RDY_A::VALUE1, true => K2RDY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "K2-Divider does not operate with the new value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == K2RDY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "K2-Divider operate with the new value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == K2RDY_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl BY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BY_A { + pub const fn variant(&self) -> BY_A { match self.bits { false => BY_A::VALUE1, true => BY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Bypass Mode is not entered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bypass Mode is entered. Input fOSC is selected as output fPLL."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BY_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl PLLLV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PLLLV_A { + pub const fn variant(&self) -> PLLLV_A { match self.bits { false => PLLLV_A::VALUE1, true => PLLLV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The OSC frequency is not usable. Frequency fREF is too low."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLLLV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The OSC frequency is usable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLLLV_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl PLLHV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PLLHV_A { + pub const fn variant(&self) -> PLLHV_A { match self.bits { false => PLLHV_A::VALUE1, true => PLLHV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The OSC frequency is not usable. Frequency fOSC is too high."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLLHV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The OSC frequency is usable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLLHV_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl PLLSP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PLLSP_A { + pub const fn variant(&self) -> PLLSP_A { match self.bits { false => PLLSP_A::VALUE1, true => PLLSP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The OSC frequency is not usable. Spikes are detected that disturb a locked operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLLSP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The OSC frequency is usable"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLLSP_A::VALUE2 @@ -384,15 +371,13 @@ impl R { PLLSP_R::new(((self.bits >> 9) & 1) != 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"] +#[doc = "PLL Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pllstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pllstat::R`](R) reader structure"] +impl crate::Readable for PLLSTAT_SPEC {} #[doc = "`reset()` method sets PLLSTAT to value 0x02"] impl crate::Resettable for PLLSTAT_SPEC { const RESET_VALUE: Self::Ux = 0x02; diff --git a/src/scu_pll/usbpllcon.rs b/src/scu_pll/usbpllcon.rs index f7081fae..ce729208 100644 --- a/src/scu_pll/usbpllcon.rs +++ b/src/scu_pll/usbpllcon.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VCOBYP` reader - VCO Bypass"] pub type VCOBYP_R = crate::BitReader; #[doc = "VCO Bypass\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl VCOBYP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOBYP_A { + pub const fn variant(&self) -> VCOBYP_A { match self.bits { false => VCOBYP_A::VALUE1, true => VCOBYP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal operation, VCO is not bypassed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOBYP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler Mode, VCO is bypassed"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOBYP_A::VALUE2 } } #[doc = "Field `VCOBYP` writer - VCO Bypass"] -pub type VCOBYP_W<'a, const O: u8> = crate::BitWriter<'a, u32, USBPLLCON_SPEC, VCOBYP_A, O>; -impl<'a, const O: u8> VCOBYP_W<'a, O> { +pub type VCOBYP_W<'a, REG> = crate::BitWriter<'a, REG, VCOBYP_A>; +impl<'a, REG> VCOBYP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal operation, VCO is not bypassed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VCOBYP_A::VALUE1) } #[doc = "Prescaler Mode, VCO is bypassed"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VCOBYP_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl VCOPWD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOPWD_A { + pub const fn variant(&self) -> VCOPWD_A { match self.bits { false => VCOPWD_A::VALUE1, true => VCOPWD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal behavior"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOPWD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The VCO is put into a Power Saving Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOPWD_A::VALUE2 } } #[doc = "Field `VCOPWD` writer - VCO Power Saving Mode"] -pub type VCOPWD_W<'a, const O: u8> = crate::BitWriter<'a, u32, USBPLLCON_SPEC, VCOPWD_A, O>; -impl<'a, const O: u8> VCOPWD_W<'a, O> { +pub type VCOPWD_W<'a, REG> = crate::BitWriter<'a, REG, VCOPWD_A>; +impl<'a, REG> VCOPWD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal behavior"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VCOPWD_A::VALUE1) } #[doc = "The VCO is put into a Power Saving Mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VCOPWD_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl VCOTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOTR_A { + pub const fn variant(&self) -> VCOTR_A { match self.bits { false => VCOTR_A::VALUE1, true => VCOTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == VCOTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "VCO bandwidth is operating in the test range. VCO output frequency is between 260 and 520 MHz for a input frequency between 8 and 16 MHz."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOTR_A::VALUE2 } } #[doc = "Field `VCOTR` writer - VCO Trim Control"] -pub type VCOTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, USBPLLCON_SPEC, VCOTR_A, O>; -impl<'a, const O: u8> VCOTR_W<'a, O> { +pub type VCOTR_W<'a, REG> = crate::BitWriter<'a, REG, VCOTR_A>; +impl<'a, REG> VCOTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VCOTR_A::VALUE1) } #[doc = "VCO bandwidth is operating in the test range. VCO output frequency is between 260 and 520 MHz for a input frequency between 8 and 16 MHz."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VCOTR_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl FINDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FINDIS_A { + pub const fn variant(&self) -> FINDIS_A { match self.bits { false => FINDIS_A::VALUE1, true => FINDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Connect oscillator to the VCO part"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FINDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Disconnect oscillator from the VCO part."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FINDIS_A::VALUE2 } } #[doc = "Field `FINDIS` writer - Disconnect Oscillator from VCO"] -pub type FINDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, USBPLLCON_SPEC, FINDIS_A, O>; -impl<'a, const O: u8> FINDIS_W<'a, O> { +pub type FINDIS_W<'a, REG> = crate::BitWriter<'a, REG, FINDIS_A>; +impl<'a, REG> FINDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Connect oscillator to the VCO part"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FINDIS_A::VALUE1) } #[doc = "Disconnect oscillator from the VCO part."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FINDIS_A::VALUE2) } } @@ -253,41 +233,44 @@ impl From for bool { impl OSCDISCDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OSCDISCDIS_A { + pub const fn variant(&self) -> OSCDISCDIS_A { match self.bits { false => OSCDISCDIS_A::VALUE1, true => OSCDISCDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "In case of a PLL loss-of-lock bit FINDIS is set"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OSCDISCDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "In case of a PLL loss-of-lock bit FINDIS is cleared"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OSCDISCDIS_A::VALUE2 } } #[doc = "Field `OSCDISCDIS` writer - Oscillator Disconnect Disable"] -pub type OSCDISCDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, USBPLLCON_SPEC, OSCDISCDIS_A, O>; -impl<'a, const O: u8> OSCDISCDIS_W<'a, O> { +pub type OSCDISCDIS_W<'a, REG> = crate::BitWriter<'a, REG, OSCDISCDIS_A>; +impl<'a, REG> OSCDISCDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "In case of a PLL loss-of-lock bit FINDIS is set"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OSCDISCDIS_A::VALUE1) } #[doc = "In case of a PLL loss-of-lock bit FINDIS is cleared"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OSCDISCDIS_A::VALUE2) } } #[doc = "Field `NDIV` reader - N-Divider Value"] -pub type NDIV_R = crate::FieldReader; +pub type NDIV_R = crate::FieldReader; #[doc = "Field `NDIV` writer - N-Divider Value"] -pub type NDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, USBPLLCON_SPEC, u8, u8, 7, O>; +pub type NDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `PLLPWD` reader - PLL Power Saving Mode"] pub type PLLPWD_R = crate::BitReader; #[doc = "PLL Power Saving Mode\n\nValue on reset: 1"] @@ -307,43 +290,46 @@ impl From for bool { impl PLLPWD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PLLPWD_A { + pub const fn variant(&self) -> PLLPWD_A { match self.bits { false => PLLPWD_A::VALUE1, true => PLLPWD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal behavior"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PLLPWD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The complete PLL block is put into a Power Saving Mode. Only the Bypass Mode is active if previously selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PLLPWD_A::VALUE2 } } #[doc = "Field `PLLPWD` writer - PLL Power Saving Mode"] -pub type PLLPWD_W<'a, const O: u8> = crate::BitWriter<'a, u32, USBPLLCON_SPEC, PLLPWD_A, O>; -impl<'a, const O: u8> PLLPWD_W<'a, O> { +pub type PLLPWD_W<'a, REG> = crate::BitWriter<'a, REG, PLLPWD_A>; +impl<'a, REG> PLLPWD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal behavior"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PLLPWD_A::VALUE1) } #[doc = "The complete PLL block is put into a Power Saving Mode. Only the Bypass Mode is active if previously selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PLLPWD_A::VALUE2) } } #[doc = "Field `RESLD` writer - Restart VCO Lock Detection"] -pub type RESLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, USBPLLCON_SPEC, bool, O>; +pub type RESLD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PDIV` reader - P-Divider Value"] -pub type PDIV_R = crate::FieldReader; +pub type PDIV_R = crate::FieldReader; #[doc = "Field `PDIV` writer - P-Divider Value"] -pub type PDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, USBPLLCON_SPEC, u8, u8, 4, O>; +pub type PDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bit 0 - VCO Bypass"] #[inline(always)] @@ -390,76 +376,77 @@ impl W { #[doc = "Bit 0 - VCO Bypass"] #[inline(always)] #[must_use] - pub fn vcobyp(&mut self) -> VCOBYP_W<0> { - VCOBYP_W::new(self) + pub fn vcobyp(&mut self) -> VCOBYP_W { + VCOBYP_W::new(self, 0) } #[doc = "Bit 1 - VCO Power Saving Mode"] #[inline(always)] #[must_use] - pub fn vcopwd(&mut self) -> VCOPWD_W<1> { - VCOPWD_W::new(self) + pub fn vcopwd(&mut self) -> VCOPWD_W { + VCOPWD_W::new(self, 1) } #[doc = "Bit 2 - VCO Trim Control"] #[inline(always)] #[must_use] - pub fn vcotr(&mut self) -> VCOTR_W<2> { - VCOTR_W::new(self) + pub fn vcotr(&mut self) -> VCOTR_W { + VCOTR_W::new(self, 2) } #[doc = "Bit 4 - Disconnect Oscillator from VCO"] #[inline(always)] #[must_use] - pub fn findis(&mut self) -> FINDIS_W<4> { - FINDIS_W::new(self) + pub fn findis(&mut self) -> FINDIS_W { + FINDIS_W::new(self, 4) } #[doc = "Bit 6 - Oscillator Disconnect Disable"] #[inline(always)] #[must_use] - pub fn oscdiscdis(&mut self) -> OSCDISCDIS_W<6> { - OSCDISCDIS_W::new(self) + pub fn oscdiscdis(&mut self) -> OSCDISCDIS_W { + OSCDISCDIS_W::new(self, 6) } #[doc = "Bits 8:14 - N-Divider Value"] #[inline(always)] #[must_use] - pub fn ndiv(&mut self) -> NDIV_W<8> { - NDIV_W::new(self) + pub fn ndiv(&mut self) -> NDIV_W { + NDIV_W::new(self, 8) } #[doc = "Bit 16 - PLL Power Saving Mode"] #[inline(always)] #[must_use] - pub fn pllpwd(&mut self) -> PLLPWD_W<16> { - PLLPWD_W::new(self) + pub fn pllpwd(&mut self) -> PLLPWD_W { + PLLPWD_W::new(self, 16) } #[doc = "Bit 18 - Restart VCO Lock Detection"] #[inline(always)] #[must_use] - pub fn resld(&mut self) -> RESLD_W<18> { - RESLD_W::new(self) + pub fn resld(&mut self) -> RESLD_W { + RESLD_W::new(self, 18) } #[doc = "Bits 24:27 - P-Divider Value"] #[inline(always)] #[must_use] - pub fn pdiv(&mut self) -> PDIV_W<24> { - PDIV_W::new(self) + pub fn pdiv(&mut self) -> PDIV_W { + PDIV_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "USB PLL Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`usbpllcon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`usbpllcon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`usbpllcon::R`](R) reader structure"] +impl crate::Readable for USBPLLCON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`usbpllcon::W`](W) writer structure"] impl crate::Writable for USBPLLCON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_pll/usbpllstat.rs b/src/scu_pll/usbpllstat.rs index e83ac628..44ad7e10 100644 --- a/src/scu_pll/usbpllstat.rs +++ b/src/scu_pll/usbpllstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VCOBYST` reader - VCO Bypass Status"] pub type VCOBYST_R = crate::BitReader; #[doc = "VCO Bypass Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl VCOBYST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOBYST_A { + pub const fn variant(&self) -> VCOBYST_A { match self.bits { false => VCOBYST_A::VALUE1, true => VCOBYST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal Mode is entered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOBYST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Prescaler Mode is entered"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOBYST_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl PWDSTAT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PWDSTAT_A { + pub const fn variant(&self) -> PWDSTAT_A { match self.bits { false => PWDSTAT_A::VALUE1, true => PWDSTAT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PLL Power-saving Mode was not entered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PWDSTAT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "PLL Power-saving Mode was entered"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PWDSTAT_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl VCOLOCK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOLOCK_A { + pub const fn variant(&self) -> VCOLOCK_A { match self.bits { false => VCOLOCK_A::VALUE1, true => VCOLOCK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The frequency difference of fREF and fDIV is greater than allowed. The VCO part of the PLL can not lock on a target frequency."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOLOCK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The frequency difference of fREF and fDIV is small enough to enable a stable VCO operation"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOLOCK_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl BY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BY_A { + pub const fn variant(&self) -> BY_A { match self.bits { false => BY_A::VALUE1, true => BY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Bypass Mode is not entered"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bypass Mode is entered. Input fOSC is selected as output fPLL."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BY_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl VCOLOCKED_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VCOLOCKED_A { + pub const fn variant(&self) -> VCOLOCKED_A { match self.bits { false => VCOLOCKED_A::VALUE1, true => VCOLOCKED_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PLL not locked"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VCOLOCKED_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "PLL locked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VCOLOCKED_A::VALUE2 @@ -220,15 +207,13 @@ impl R { VCOLOCKED_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "USB PLL Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`usbpllstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`usbpllstat::R`](R) reader structure"] +impl crate::Readable for USBPLLSTAT_SPEC {} #[doc = "`reset()` method sets USBPLLSTAT to value 0x02"] impl crate::Resettable for USBPLLSTAT_SPEC { const RESET_VALUE: Self::Ux = 0x02; diff --git a/src/scu_power.rs b/src/scu_power.rs index 33e261ad..2bdf06e8 100644 --- a/src/scu_power.rs +++ b/src/scu_power.rs @@ -1,42 +1,74 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + pwrstat: PWRSTAT, + pwrset: PWRSET, + pwrclr: PWRCLR, + _reserved3: [u8; 0x04], + evrstat: EVRSTAT, + evrvadcstat: EVRVADCSTAT, + _reserved5: [u8; 0x14], + pwrmon: PWRMON, +} +impl RegisterBlock { #[doc = "0x00 - PCU Status Register"] - pub pwrstat: PWRSTAT, + #[inline(always)] + pub const fn pwrstat(&self) -> &PWRSTAT { + &self.pwrstat + } #[doc = "0x04 - PCU Set Control Register"] - pub pwrset: PWRSET, + #[inline(always)] + pub const fn pwrset(&self) -> &PWRSET { + &self.pwrset + } #[doc = "0x08 - PCU Clear Control Register"] - pub pwrclr: PWRCLR, - _reserved3: [u8; 0x04], + #[inline(always)] + pub const fn pwrclr(&self) -> &PWRCLR { + &self.pwrclr + } #[doc = "0x10 - EVR Status Register"] - pub evrstat: EVRSTAT, + #[inline(always)] + pub const fn evrstat(&self) -> &EVRSTAT { + &self.evrstat + } #[doc = "0x14 - EVR VADC Status Register"] - pub evrvadcstat: EVRVADCSTAT, - _reserved5: [u8; 0x14], + #[inline(always)] + pub const fn evrvadcstat(&self) -> &EVRVADCSTAT { + &self.evrvadcstat + } #[doc = "0x2c - Power Monitor Control"] - pub pwrmon: PWRMON, + #[inline(always)] + pub const fn pwrmon(&self) -> &PWRMON { + &self.pwrmon + } } -#[doc = "PWRSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "PWRSTAT (r) register accessor: PCU Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pwrstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pwrstat`] +module"] pub type PWRSTAT = crate::Reg; #[doc = "PCU Status Register"] pub mod pwrstat; -#[doc = "PWRSET (w) register accessor: an alias for `Reg`"] +#[doc = "PWRSET (w) register accessor: PCU Set Control Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pwrset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pwrset`] +module"] pub type PWRSET = crate::Reg; #[doc = "PCU Set Control Register"] pub mod pwrset; -#[doc = "PWRCLR (w) register accessor: an alias for `Reg`"] +#[doc = "PWRCLR (w) register accessor: PCU Clear Control Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pwrclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pwrclr`] +module"] pub type PWRCLR = crate::Reg; #[doc = "PCU Clear Control Register"] pub mod pwrclr; -#[doc = "EVRSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "EVRSTAT (r) register accessor: EVR Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`evrstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@evrstat`] +module"] pub type EVRSTAT = crate::Reg; #[doc = "EVR Status Register"] pub mod evrstat; -#[doc = "EVRVADCSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "EVRVADCSTAT (r) register accessor: EVR VADC Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`evrvadcstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@evrvadcstat`] +module"] pub type EVRVADCSTAT = crate::Reg; #[doc = "EVR VADC Status Register"] pub mod evrvadcstat; -#[doc = "PWRMON (rw) register accessor: an alias for `Reg`"] +#[doc = "PWRMON (rw) register accessor: Power Monitor Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pwrmon::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pwrmon::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pwrmon`] +module"] 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 50610acd..852da7be 100644 --- a/src/scu_power/evrstat.rs +++ b/src/scu_power/evrstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `OV13` reader - Regulator Overvoltage for 1.3 V"] pub type OV13_R = crate::BitReader; #[doc = "Regulator Overvoltage for 1.3 V\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl OV13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OV13_A { + pub const fn variant(&self) -> OV13_A { match self.bits { false => OV13_A::VALUE1, true => OV13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No overvoltage condition"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OV13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Regulator is in overvoltage"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OV13_A::VALUE2 @@ -56,15 +43,13 @@ impl R { OV13_R::new(((self.bits >> 1) & 1) != 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"] +#[doc = "EVR Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`evrstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`evrstat::R`](R) reader structure"] +impl crate::Readable for EVRSTAT_SPEC {} #[doc = "`reset()` method sets EVRSTAT to value 0"] impl crate::Resettable for EVRSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_power/evrvadcstat.rs b/src/scu_power/evrvadcstat.rs index 37f164b6..0a26ca84 100644 --- a/src/scu_power/evrvadcstat.rs +++ b/src/scu_power/evrvadcstat.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VADC13V` reader - VADC 1.3 V Conversion Result"] -pub type VADC13V_R = crate::FieldReader; +pub type VADC13V_R = crate::FieldReader; #[doc = "Field `VADC33V` reader - VADC 3.3 V Conversion Result"] -pub type VADC33V_R = crate::FieldReader; +pub type VADC33V_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - VADC 1.3 V Conversion Result"] #[inline(always)] @@ -29,15 +16,13 @@ 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"] +#[doc = "EVR VADC Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`evrvadcstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`evrvadcstat::R`](R) reader structure"] +impl crate::Readable for EVRVADCSTAT_SPEC {} #[doc = "`reset()` method sets EVRVADCSTAT to value 0"] impl crate::Resettable for EVRVADCSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_power/pwrclr.rs b/src/scu_power/pwrclr.rs index 03894a6e..cab0232d 100644 --- a/src/scu_power/pwrclr.rs +++ b/src/scu_power/pwrclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `PWRCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Disable Hibernate Domain\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum HIB_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `HIB` writer - Clear Disable Hibernate Domain"] -pub type HIB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRCLR_SPEC, HIB_AW, O>; -impl<'a, const O: u8> HIB_W<'a, O> { +pub type HIB_W<'a, REG> = crate::BitWriter<'a, REG, HIB_AW>; +impl<'a, REG> HIB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIB_AW::VALUE1) } #[doc = "Disable Hibernate domain"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIB_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `USBPHYPDQ` writer - Clear USB PHY Transceiver Disable"] -pub type USBPHYPDQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRCLR_SPEC, USBPHYPDQ_AW, O>; -impl<'a, const O: u8> USBPHYPDQ_W<'a, O> { +pub type USBPHYPDQ_W<'a, REG> = crate::BitWriter<'a, REG, USBPHYPDQ_AW>; +impl<'a, REG> USBPHYPDQ_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBPHYPDQ_AW::VALUE1) } #[doc = "Power-down"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBPHYPDQ_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `USBOTGEN` writer - Clear USB On-The-Go Comparators Enable"] -pub type USBOTGEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRCLR_SPEC, USBOTGEN_AW, O>; -impl<'a, const O: u8> USBOTGEN_W<'a, O> { +pub type USBOTGEN_W<'a, REG> = crate::BitWriter<'a, REG, USBOTGEN_AW>; +impl<'a, REG> USBOTGEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBOTGEN_AW::VALUE1) } #[doc = "Power-down"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBOTGEN_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `USBPUWQ` writer - Clear USB Weak Pull-Up at PADN Enable"] -pub type USBPUWQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRCLR_SPEC, USBPUWQ_AW, O>; -impl<'a, const O: u8> USBPUWQ_W<'a, O> { +pub type USBPUWQ_W<'a, REG> = crate::BitWriter<'a, REG, USBPUWQ_AW>; +impl<'a, REG> USBPUWQ_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBPUWQ_AW::VALUE1) } #[doc = "Pull-up active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBPUWQ_AW::VALUE2) } } @@ -135,42 +128,45 @@ impl W { #[doc = "Bit 0 - Clear Disable Hibernate Domain"] #[inline(always)] #[must_use] - pub fn hib(&mut self) -> HIB_W<0> { - HIB_W::new(self) + pub fn hib(&mut self) -> HIB_W { + HIB_W::new(self, 0) } #[doc = "Bit 16 - Clear USB PHY Transceiver Disable"] #[inline(always)] #[must_use] - pub fn usbphypdq(&mut self) -> USBPHYPDQ_W<16> { - USBPHYPDQ_W::new(self) + pub fn usbphypdq(&mut self) -> USBPHYPDQ_W { + USBPHYPDQ_W::new(self, 16) } #[doc = "Bit 17 - Clear USB On-The-Go Comparators Enable"] #[inline(always)] #[must_use] - pub fn usbotgen(&mut self) -> USBOTGEN_W<17> { - USBOTGEN_W::new(self) + pub fn usbotgen(&mut self) -> USBOTGEN_W { + USBOTGEN_W::new(self, 17) } #[doc = "Bit 18 - Clear USB Weak Pull-Up at PADN Enable"] #[inline(always)] #[must_use] - pub fn usbpuwq(&mut self) -> USBPUWQ_W<18> { - USBPUWQ_W::new(self) + pub fn usbpuwq(&mut self) -> USBPUWQ_W { + USBPUWQ_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "PCU Clear Control Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pwrclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PWRCLR_SPEC; impl crate::RegisterSpec for PWRCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [pwrclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`pwrclr::W`](W) writer structure"] impl crate::Writable for PWRCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_power/pwrmon.rs b/src/scu_power/pwrmon.rs index d0816909..0f2f913d 100644 --- a/src/scu_power/pwrmon.rs +++ b/src/scu_power/pwrmon.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `THRS` reader - Threshold"] -pub type THRS_R = crate::FieldReader; +pub type THRS_R = crate::FieldReader; #[doc = "Field `THRS` writer - Threshold"] -pub type THRS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PWRMON_SPEC, u8, u8, 8, O>; +pub type THRS_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `INTV` reader - Interval"] -pub type INTV_R = crate::FieldReader; +pub type INTV_R = crate::FieldReader; #[doc = "Field `INTV` writer - Interval"] -pub type INTV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PWRMON_SPEC, u8, u8, 8, O>; +pub type INTV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `ENB` reader - Enable"] -pub type ENB_R = crate::BitReader; +pub type ENB_R = crate::BitReader; #[doc = "Field `ENB` writer - Enable"] -pub type ENB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRMON_SPEC, bool, O>; +pub type ENB_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:7 - Threshold"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bits 0:7 - Threshold"] #[inline(always)] #[must_use] - pub fn thrs(&mut self) -> THRS_W<0> { - THRS_W::new(self) + pub fn thrs(&mut self) -> THRS_W { + THRS_W::new(self, 0) } #[doc = "Bits 8:15 - Interval"] #[inline(always)] #[must_use] - pub fn intv(&mut self) -> INTV_W<8> { - INTV_W::new(self) + pub fn intv(&mut self) -> INTV_W { + INTV_W::new(self, 8) } #[doc = "Bit 16 - Enable"] #[inline(always)] #[must_use] - pub fn enb(&mut self) -> ENB_W<16> { - ENB_W::new(self) + pub fn enb(&mut self) -> ENB_W { + ENB_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Power Monitor Control\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pwrmon::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pwrmon::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pwrmon::R`](R) reader structure"] +impl crate::Readable for PWRMON_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pwrmon::W`](W) writer structure"] impl crate::Writable for PWRMON_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_power/pwrset.rs b/src/scu_power/pwrset.rs index 13d69866..db26d378 100644 --- a/src/scu_power/pwrset.rs +++ b/src/scu_power/pwrset.rs @@ -1,24 +1,5 @@ #[doc = "Register `PWRSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Set Hibernate Domain Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum HIB_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `HIB` writer - Set Hibernate Domain Enable"] -pub type HIB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRSET_SPEC, HIB_AW, O>; -impl<'a, const O: u8> HIB_W<'a, O> { +pub type HIB_W<'a, REG> = crate::BitWriter<'a, REG, HIB_AW>; +impl<'a, REG> HIB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIB_AW::VALUE1) } #[doc = "Enable Hibernate domain"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIB_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `USBPHYPDQ` writer - Set USB PHY Transceiver Disable"] -pub type USBPHYPDQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRSET_SPEC, USBPHYPDQ_AW, O>; -impl<'a, const O: u8> USBPHYPDQ_W<'a, O> { +pub type USBPHYPDQ_W<'a, REG> = crate::BitWriter<'a, REG, USBPHYPDQ_AW>; +impl<'a, REG> USBPHYPDQ_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBPHYPDQ_AW::VALUE1) } #[doc = "Active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBPHYPDQ_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `USBOTGEN` writer - Set USB On-The-Go Comparators Enable"] -pub type USBOTGEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRSET_SPEC, USBOTGEN_AW, O>; -impl<'a, const O: u8> USBOTGEN_W<'a, O> { +pub type USBOTGEN_W<'a, REG> = crate::BitWriter<'a, REG, USBOTGEN_AW>; +impl<'a, REG> USBOTGEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBOTGEN_AW::VALUE1) } #[doc = "Active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBOTGEN_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `USBPUWQ` writer - Set USB Weak Pull-Up at PADN Enable"] -pub type USBPUWQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, PWRSET_SPEC, USBPUWQ_AW, O>; -impl<'a, const O: u8> USBPUWQ_W<'a, O> { +pub type USBPUWQ_W<'a, REG> = crate::BitWriter<'a, REG, USBPUWQ_AW>; +impl<'a, REG> USBPUWQ_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBPUWQ_AW::VALUE1) } #[doc = "Pull-up not active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBPUWQ_AW::VALUE2) } } @@ -135,42 +128,45 @@ impl W { #[doc = "Bit 0 - Set Hibernate Domain Enable"] #[inline(always)] #[must_use] - pub fn hib(&mut self) -> HIB_W<0> { - HIB_W::new(self) + pub fn hib(&mut self) -> HIB_W { + HIB_W::new(self, 0) } #[doc = "Bit 16 - Set USB PHY Transceiver Disable"] #[inline(always)] #[must_use] - pub fn usbphypdq(&mut self) -> USBPHYPDQ_W<16> { - USBPHYPDQ_W::new(self) + pub fn usbphypdq(&mut self) -> USBPHYPDQ_W { + USBPHYPDQ_W::new(self, 16) } #[doc = "Bit 17 - Set USB On-The-Go Comparators Enable"] #[inline(always)] #[must_use] - pub fn usbotgen(&mut self) -> USBOTGEN_W<17> { - USBOTGEN_W::new(self) + pub fn usbotgen(&mut self) -> USBOTGEN_W { + USBOTGEN_W::new(self, 17) } #[doc = "Bit 18 - Set USB Weak Pull-Up at PADN Enable"] #[inline(always)] #[must_use] - pub fn usbpuwq(&mut self) -> USBPUWQ_W<18> { - USBPUWQ_W::new(self) + pub fn usbpuwq(&mut self) -> USBPUWQ_W { + USBPUWQ_W::new(self, 18) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "PCU Set Control Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pwrset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PWRSET_SPEC; impl crate::RegisterSpec for PWRSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [pwrset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`pwrset::W`](W) writer structure"] impl crate::Writable for PWRSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_power/pwrstat.rs b/src/scu_power/pwrstat.rs index c5515318..88b09063 100644 --- a/src/scu_power/pwrstat.rs +++ b/src/scu_power/pwrstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `HIBEN` reader - Hibernate Domain Enable Status"] pub type HIBEN_R = crate::BitReader; #[doc = "Hibernate Domain Enable Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl HIBEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIBEN_A { + pub const fn variant(&self) -> HIBEN_A { match self.bits { false => HIBEN_A::VALUE1, true => HIBEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Inactive"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBEN_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl USBPHYPDQ_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USBPHYPDQ_A { + pub const fn variant(&self) -> USBPHYPDQ_A { match self.bits { false => USBPHYPDQ_A::VALUE1, true => USBPHYPDQ_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Power-down"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USBPHYPDQ_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USBPHYPDQ_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl USBOTGEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USBOTGEN_A { + pub const fn variant(&self) -> USBOTGEN_A { match self.bits { false => USBOTGEN_A::VALUE1, true => USBOTGEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Power-down"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USBOTGEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USBOTGEN_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl USBPUWQ_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USBPUWQ_A { + pub const fn variant(&self) -> USBPUWQ_A { match self.bits { false => USBPUWQ_A::VALUE1, true => USBPUWQ_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Pull-up active"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USBPUWQ_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pull-up not active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USBPUWQ_A::VALUE2 @@ -179,15 +166,13 @@ impl R { USBPUWQ_R::new(((self.bits >> 18) & 1) != 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"] +#[doc = "PCU Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pwrstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`pwrstat::R`](R) reader structure"] +impl crate::Readable for PWRSTAT_SPEC {} #[doc = "`reset()` method sets PWRSTAT to value 0"] impl crate::Resettable for PWRSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_reset.rs b/src/scu_reset.rs index 89290035..2d20023d 100644 --- a/src/scu_reset.rs +++ b/src/scu_reset.rs @@ -1,76 +1,138 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + rststat: RSTSTAT, + rstset: RSTSET, + rstclr: RSTCLR, + prstat0: PRSTAT0, + prset0: PRSET0, + prclr0: PRCLR0, + prstat1: PRSTAT1, + prset1: PRSET1, + prclr1: PRCLR1, + prstat2: PRSTAT2, + prset2: PRSET2, + prclr2: PRCLR2, +} +impl RegisterBlock { #[doc = "0x00 - RCU Reset Status"] - pub rststat: RSTSTAT, + #[inline(always)] + pub const fn rststat(&self) -> &RSTSTAT { + &self.rststat + } #[doc = "0x04 - RCU Reset Set Register"] - pub rstset: RSTSET, + #[inline(always)] + pub const fn rstset(&self) -> &RSTSET { + &self.rstset + } #[doc = "0x08 - RCU Reset Clear Register"] - pub rstclr: RSTCLR, + #[inline(always)] + pub const fn rstclr(&self) -> &RSTCLR { + &self.rstclr + } #[doc = "0x0c - RCU Peripheral 0 Reset Status"] - pub prstat0: PRSTAT0, + #[inline(always)] + pub const fn prstat0(&self) -> &PRSTAT0 { + &self.prstat0 + } #[doc = "0x10 - RCU Peripheral 0 Reset Set"] - pub prset0: PRSET0, + #[inline(always)] + pub const fn prset0(&self) -> &PRSET0 { + &self.prset0 + } #[doc = "0x14 - RCU Peripheral 0 Reset Clear"] - pub prclr0: PRCLR0, + #[inline(always)] + pub const fn prclr0(&self) -> &PRCLR0 { + &self.prclr0 + } #[doc = "0x18 - RCU Peripheral 1 Reset Status"] - pub prstat1: PRSTAT1, + #[inline(always)] + pub const fn prstat1(&self) -> &PRSTAT1 { + &self.prstat1 + } #[doc = "0x1c - RCU Peripheral 1 Reset Set"] - pub prset1: PRSET1, + #[inline(always)] + pub const fn prset1(&self) -> &PRSET1 { + &self.prset1 + } #[doc = "0x20 - RCU Peripheral 1 Reset Clear"] - pub prclr1: PRCLR1, + #[inline(always)] + pub const fn prclr1(&self) -> &PRCLR1 { + &self.prclr1 + } #[doc = "0x24 - RCU Peripheral 2 Reset Status"] - pub prstat2: PRSTAT2, + #[inline(always)] + pub const fn prstat2(&self) -> &PRSTAT2 { + &self.prstat2 + } #[doc = "0x28 - RCU Peripheral 2 Reset Set"] - pub prset2: PRSET2, + #[inline(always)] + pub const fn prset2(&self) -> &PRSET2 { + &self.prset2 + } #[doc = "0x2c - RCU Peripheral 2 Reset Clear"] - pub prclr2: PRCLR2, + #[inline(always)] + pub const fn prclr2(&self) -> &PRCLR2 { + &self.prclr2 + } } -#[doc = "RSTSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "RSTSTAT (r) register accessor: RCU Reset Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rststat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rststat`] +module"] pub type RSTSTAT = crate::Reg; #[doc = "RCU Reset Status"] pub mod rststat; -#[doc = "RSTSET (w) register accessor: an alias for `Reg`"] +#[doc = "RSTSET (w) register accessor: RCU Reset Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rstset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rstset`] +module"] pub type RSTSET = crate::Reg; #[doc = "RCU Reset Set Register"] pub mod rstset; -#[doc = "RSTCLR (w) register accessor: an alias for `Reg`"] +#[doc = "RSTCLR (w) register accessor: RCU Reset Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rstclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rstclr`] +module"] pub type RSTCLR = crate::Reg; #[doc = "RCU Reset Clear Register"] pub mod rstclr; -#[doc = "PRSTAT0 (r) register accessor: an alias for `Reg`"] +#[doc = "PRSTAT0 (r) register accessor: RCU Peripheral 0 Reset Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prstat0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prstat0`] +module"] pub type PRSTAT0 = crate::Reg; #[doc = "RCU Peripheral 0 Reset Status"] pub mod prstat0; -#[doc = "PRSET0 (w) register accessor: an alias for `Reg`"] +#[doc = "PRSET0 (w) register accessor: RCU Peripheral 0 Reset Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prset0::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prset0`] +module"] pub type PRSET0 = crate::Reg; #[doc = "RCU Peripheral 0 Reset Set"] pub mod prset0; -#[doc = "PRCLR0 (w) register accessor: an alias for `Reg`"] +#[doc = "PRCLR0 (w) register accessor: RCU Peripheral 0 Reset Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prclr0::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prclr0`] +module"] pub type PRCLR0 = crate::Reg; #[doc = "RCU Peripheral 0 Reset Clear"] pub mod prclr0; -#[doc = "PRSTAT1 (r) register accessor: an alias for `Reg`"] +#[doc = "PRSTAT1 (r) register accessor: RCU Peripheral 1 Reset Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prstat1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prstat1`] +module"] pub type PRSTAT1 = crate::Reg; #[doc = "RCU Peripheral 1 Reset Status"] pub mod prstat1; -#[doc = "PRSET1 (w) register accessor: an alias for `Reg`"] +#[doc = "PRSET1 (w) register accessor: RCU Peripheral 1 Reset Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prset1::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prset1`] +module"] pub type PRSET1 = crate::Reg; #[doc = "RCU Peripheral 1 Reset Set"] pub mod prset1; -#[doc = "PRCLR1 (w) register accessor: an alias for `Reg`"] +#[doc = "PRCLR1 (w) register accessor: RCU Peripheral 1 Reset Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prclr1::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prclr1`] +module"] pub type PRCLR1 = crate::Reg; #[doc = "RCU Peripheral 1 Reset Clear"] pub mod prclr1; -#[doc = "PRSTAT2 (r) register accessor: an alias for `Reg`"] +#[doc = "PRSTAT2 (r) register accessor: RCU Peripheral 2 Reset Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prstat2::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prstat2`] +module"] pub type PRSTAT2 = crate::Reg; #[doc = "RCU Peripheral 2 Reset Status"] pub mod prstat2; -#[doc = "PRSET2 (w) register accessor: an alias for `Reg`"] +#[doc = "PRSET2 (w) register accessor: RCU Peripheral 2 Reset Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prset2::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prset2`] +module"] pub type PRSET2 = crate::Reg; #[doc = "RCU Peripheral 2 Reset Set"] pub mod prset2; -#[doc = "PRCLR2 (w) register accessor: an alias for `Reg`"] +#[doc = "PRCLR2 (w) register accessor: RCU Peripheral 2 Reset Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prclr2::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@prclr2`] +module"] 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 db5abef5..b6448db4 100644 --- a/src/scu_reset/prclr0.rs +++ b/src/scu_reset/prclr0.rs @@ -1,24 +1,5 @@ #[doc = "Register `PRCLR0` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "VADC Reset Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum VADCRS_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `VADCRS` writer - VADC Reset Clear"] -pub type VADCRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, VADCRS_AW, O>; -impl<'a, const O: u8> VADCRS_W<'a, O> { +pub type VADCRS_W<'a, REG> = crate::BitWriter<'a, REG, VADCRS_AW>; +impl<'a, REG> VADCRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VADCRS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VADCRS_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `DSDRS` writer - DSD Reset Clear"] -pub type DSDRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, DSDRS_AW, O>; -impl<'a, const O: u8> DSDRS_W<'a, O> { +pub type DSDRS_W<'a, REG> = crate::BitWriter<'a, REG, DSDRS_AW>; +impl<'a, REG> DSDRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSDRS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSDRS_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CCU40RS` writer - CCU40 Reset Clear"] -pub type CCU40RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, CCU40RS_AW, O>; -impl<'a, const O: u8> CCU40RS_W<'a, O> { +pub type CCU40RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU40RS_AW>; +impl<'a, REG> CCU40RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU40RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU40RS_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CCU41RS` writer - CCU41 Reset Clear"] -pub type CCU41RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, CCU41RS_AW, O>; -impl<'a, const O: u8> CCU41RS_W<'a, O> { +pub type CCU41RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU41RS_AW>; +impl<'a, REG> CCU41RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU41RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU41RS_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CCU42RS` writer - CCU42 Reset Clear"] -pub type CCU42RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, CCU42RS_AW, O>; -impl<'a, const O: u8> CCU42RS_W<'a, O> { +pub type CCU42RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU42RS_AW>; +impl<'a, REG> CCU42RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU42RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU42RS_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CCU80RS` writer - CCU80 Reset Clear"] -pub type CCU80RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, CCU80RS_AW, O>; -impl<'a, const O: u8> CCU80RS_W<'a, O> { +pub type CCU80RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU80RS_AW>; +impl<'a, REG> CCU80RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU80RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU80RS_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CCU81RS` writer - CCU81 Reset Clear"] -pub type CCU81RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, CCU81RS_AW, O>; -impl<'a, const O: u8> CCU81RS_W<'a, O> { +pub type CCU81RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU81RS_AW>; +impl<'a, REG> CCU81RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU81RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU81RS_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `POSIF0RS` writer - POSIF0 Reset Clear"] -pub type POSIF0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, POSIF0RS_AW, O>; -impl<'a, const O: u8> POSIF0RS_W<'a, O> { +pub type POSIF0RS_W<'a, REG> = crate::BitWriter<'a, REG, POSIF0RS_AW>; +impl<'a, REG> POSIF0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSIF0RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSIF0RS_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `POSIF1RS` writer - POSIF1 Reset Clear"] -pub type POSIF1RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, POSIF1RS_AW, O>; -impl<'a, const O: u8> POSIF1RS_W<'a, O> { +pub type POSIF1RS_W<'a, REG> = crate::BitWriter<'a, REG, POSIF1RS_AW>; +impl<'a, REG> POSIF1RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSIF1RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSIF1RS_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `USIC0RS` writer - USIC0 Reset Clear"] -pub type USIC0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, USIC0RS_AW, O>; -impl<'a, const O: u8> USIC0RS_W<'a, O> { +pub type USIC0RS_W<'a, REG> = crate::BitWriter<'a, REG, USIC0RS_AW>; +impl<'a, REG> USIC0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC0RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC0RS_AW::VALUE2) } } @@ -314,16 +325,19 @@ impl From for bool { } } #[doc = "Field `ERU1RS` writer - ERU1 Reset Clear"] -pub type ERU1RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, ERU1RS_AW, O>; -impl<'a, const O: u8> ERU1RS_W<'a, O> { +pub type ERU1RS_W<'a, REG> = crate::BitWriter<'a, REG, ERU1RS_AW>; +impl<'a, REG> ERU1RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERU1RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERU1RS_AW::VALUE2) } } @@ -342,16 +356,19 @@ impl From for bool { } } #[doc = "Field `HRPWM0RS` writer - HRPWM0 Reset Clear"] -pub type HRPWM0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR0_SPEC, HRPWM0RS_AW, O>; -impl<'a, const O: u8> HRPWM0RS_W<'a, O> { +pub type HRPWM0RS_W<'a, REG> = crate::BitWriter<'a, REG, HRPWM0RS_AW>; +impl<'a, REG> HRPWM0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRPWM0RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRPWM0RS_AW::VALUE2) } } @@ -359,90 +376,93 @@ impl W { #[doc = "Bit 0 - VADC Reset Clear"] #[inline(always)] #[must_use] - pub fn vadcrs(&mut self) -> VADCRS_W<0> { - VADCRS_W::new(self) + pub fn vadcrs(&mut self) -> VADCRS_W { + VADCRS_W::new(self, 0) } #[doc = "Bit 1 - DSD Reset Clear"] #[inline(always)] #[must_use] - pub fn dsdrs(&mut self) -> DSDRS_W<1> { - DSDRS_W::new(self) + pub fn dsdrs(&mut self) -> DSDRS_W { + DSDRS_W::new(self, 1) } #[doc = "Bit 2 - CCU40 Reset Clear"] #[inline(always)] #[must_use] - pub fn ccu40rs(&mut self) -> CCU40RS_W<2> { - CCU40RS_W::new(self) + pub fn ccu40rs(&mut self) -> CCU40RS_W { + CCU40RS_W::new(self, 2) } #[doc = "Bit 3 - CCU41 Reset Clear"] #[inline(always)] #[must_use] - pub fn ccu41rs(&mut self) -> CCU41RS_W<3> { - CCU41RS_W::new(self) + pub fn ccu41rs(&mut self) -> CCU41RS_W { + CCU41RS_W::new(self, 3) } #[doc = "Bit 4 - CCU42 Reset Clear"] #[inline(always)] #[must_use] - pub fn ccu42rs(&mut self) -> CCU42RS_W<4> { - CCU42RS_W::new(self) + pub fn ccu42rs(&mut self) -> CCU42RS_W { + CCU42RS_W::new(self, 4) } #[doc = "Bit 7 - CCU80 Reset Clear"] #[inline(always)] #[must_use] - pub fn ccu80rs(&mut self) -> CCU80RS_W<7> { - CCU80RS_W::new(self) + pub fn ccu80rs(&mut self) -> CCU80RS_W { + CCU80RS_W::new(self, 7) } #[doc = "Bit 8 - CCU81 Reset Clear"] #[inline(always)] #[must_use] - pub fn ccu81rs(&mut self) -> CCU81RS_W<8> { - CCU81RS_W::new(self) + pub fn ccu81rs(&mut self) -> CCU81RS_W { + CCU81RS_W::new(self, 8) } #[doc = "Bit 9 - POSIF0 Reset Clear"] #[inline(always)] #[must_use] - pub fn posif0rs(&mut self) -> POSIF0RS_W<9> { - POSIF0RS_W::new(self) + pub fn posif0rs(&mut self) -> POSIF0RS_W { + POSIF0RS_W::new(self, 9) } #[doc = "Bit 10 - POSIF1 Reset Clear"] #[inline(always)] #[must_use] - pub fn posif1rs(&mut self) -> POSIF1RS_W<10> { - POSIF1RS_W::new(self) + pub fn posif1rs(&mut self) -> POSIF1RS_W { + POSIF1RS_W::new(self, 10) } #[doc = "Bit 11 - USIC0 Reset Clear"] #[inline(always)] #[must_use] - pub fn usic0rs(&mut self) -> USIC0RS_W<11> { - USIC0RS_W::new(self) + pub fn usic0rs(&mut self) -> USIC0RS_W { + USIC0RS_W::new(self, 11) } #[doc = "Bit 16 - ERU1 Reset Clear"] #[inline(always)] #[must_use] - pub fn eru1rs(&mut self) -> ERU1RS_W<16> { - ERU1RS_W::new(self) + pub fn eru1rs(&mut self) -> ERU1RS_W { + ERU1RS_W::new(self, 16) } #[doc = "Bit 23 - HRPWM0 Reset Clear"] #[inline(always)] #[must_use] - pub fn hrpwm0rs(&mut self) -> HRPWM0RS_W<23> { - HRPWM0RS_W::new(self) + pub fn hrpwm0rs(&mut self) -> HRPWM0RS_W { + HRPWM0RS_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RCU Peripheral 0 Reset Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prclr0::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PRCLR0_SPEC; impl crate::RegisterSpec for PRCLR0_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [prclr0::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`prclr0::W`](W) writer structure"] impl crate::Writable for PRCLR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_reset/prclr1.rs b/src/scu_reset/prclr1.rs index f5d10be0..7d6cfb15 100644 --- a/src/scu_reset/prclr1.rs +++ b/src/scu_reset/prclr1.rs @@ -1,24 +1,5 @@ #[doc = "Register `PRCLR1` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "CCU43 Reset Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CCU43RS_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CCU43RS` writer - CCU43 Reset Clear"] -pub type CCU43RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR1_SPEC, CCU43RS_AW, O>; -impl<'a, const O: u8> CCU43RS_W<'a, O> { +pub type CCU43RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU43RS_AW>; +impl<'a, REG> CCU43RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU43RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU43RS_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `LEDTSCU0RS` writer - LEDTS Reset Clear"] -pub type LEDTSCU0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR1_SPEC, LEDTSCU0RS_AW, O>; -impl<'a, const O: u8> LEDTSCU0RS_W<'a, O> { +pub type LEDTSCU0RS_W<'a, REG> = crate::BitWriter<'a, REG, LEDTSCU0RS_AW>; +impl<'a, REG> LEDTSCU0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LEDTSCU0RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LEDTSCU0RS_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `MCAN0RS` writer - MultiCAN Reset Clear"] -pub type MCAN0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR1_SPEC, MCAN0RS_AW, O>; -impl<'a, const O: u8> MCAN0RS_W<'a, O> { +pub type MCAN0RS_W<'a, REG> = crate::BitWriter<'a, REG, MCAN0RS_AW>; +impl<'a, REG> MCAN0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCAN0RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCAN0RS_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `DACRS` writer - DAC Reset Clear"] -pub type DACRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR1_SPEC, DACRS_AW, O>; -impl<'a, const O: u8> DACRS_W<'a, O> { +pub type DACRS_W<'a, REG> = crate::BitWriter<'a, REG, DACRS_AW>; +impl<'a, REG> DACRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DACRS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DACRS_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `USIC1RS` writer - USIC1 Reset Clear"] -pub type USIC1RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR1_SPEC, USIC1RS_AW, O>; -impl<'a, const O: u8> USIC1RS_W<'a, O> { +pub type USIC1RS_W<'a, REG> = crate::BitWriter<'a, REG, USIC1RS_AW>; +impl<'a, REG> USIC1RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC1RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC1RS_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `PPORTSRS` writer - PORTS Reset Clear"] -pub type PPORTSRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR1_SPEC, PPORTSRS_AW, O>; -impl<'a, const O: u8> PPORTSRS_W<'a, O> { +pub type PPORTSRS_W<'a, REG> = crate::BitWriter<'a, REG, PPORTSRS_AW>; +impl<'a, REG> PPORTSRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPORTSRS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPORTSRS_AW::VALUE2) } } @@ -191,54 +190,57 @@ impl W { #[doc = "Bit 0 - CCU43 Reset Clear"] #[inline(always)] #[must_use] - pub fn ccu43rs(&mut self) -> CCU43RS_W<0> { - CCU43RS_W::new(self) + pub fn ccu43rs(&mut self) -> CCU43RS_W { + CCU43RS_W::new(self, 0) } #[doc = "Bit 3 - LEDTS Reset Clear"] #[inline(always)] #[must_use] - pub fn ledtscu0rs(&mut self) -> LEDTSCU0RS_W<3> { - LEDTSCU0RS_W::new(self) + pub fn ledtscu0rs(&mut self) -> LEDTSCU0RS_W { + LEDTSCU0RS_W::new(self, 3) } #[doc = "Bit 4 - MultiCAN Reset Clear"] #[inline(always)] #[must_use] - pub fn mcan0rs(&mut self) -> MCAN0RS_W<4> { - MCAN0RS_W::new(self) + pub fn mcan0rs(&mut self) -> MCAN0RS_W { + MCAN0RS_W::new(self, 4) } #[doc = "Bit 5 - DAC Reset Clear"] #[inline(always)] #[must_use] - pub fn dacrs(&mut self) -> DACRS_W<5> { - DACRS_W::new(self) + pub fn dacrs(&mut self) -> DACRS_W { + DACRS_W::new(self, 5) } #[doc = "Bit 7 - USIC1 Reset Clear"] #[inline(always)] #[must_use] - pub fn usic1rs(&mut self) -> USIC1RS_W<7> { - USIC1RS_W::new(self) + pub fn usic1rs(&mut self) -> USIC1RS_W { + USIC1RS_W::new(self, 7) } #[doc = "Bit 9 - PORTS Reset Clear"] #[inline(always)] #[must_use] - pub fn pportsrs(&mut self) -> PPORTSRS_W<9> { - PPORTSRS_W::new(self) + pub fn pportsrs(&mut self) -> PPORTSRS_W { + PPORTSRS_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RCU Peripheral 1 Reset Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prclr1::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PRCLR1_SPEC; impl crate::RegisterSpec for PRCLR1_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [prclr1::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`prclr1::W`](W) writer structure"] impl crate::Writable for PRCLR1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_reset/prclr2.rs b/src/scu_reset/prclr2.rs index 071c47f2..27b36c97 100644 --- a/src/scu_reset/prclr2.rs +++ b/src/scu_reset/prclr2.rs @@ -1,24 +1,5 @@ #[doc = "Register `PRCLR2` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "WDT Reset Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum WDTRS_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `WDTRS` writer - WDT Reset Clear"] -pub type WDTRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR2_SPEC, WDTRS_AW, O>; -impl<'a, const O: u8> WDTRS_W<'a, O> { +pub type WDTRS_W<'a, REG> = crate::BitWriter<'a, REG, WDTRS_AW>; +impl<'a, REG> WDTRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDTRS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDTRS_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `ETH0RS` writer - ETH0 Reset Clear"] -pub type ETH0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR2_SPEC, ETH0RS_AW, O>; -impl<'a, const O: u8> ETH0RS_W<'a, O> { +pub type ETH0RS_W<'a, REG> = crate::BitWriter<'a, REG, ETH0RS_AW>; +impl<'a, REG> ETH0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ETH0RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ETH0RS_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `DMA0RS` writer - DMA0 Reset Clear"] -pub type DMA0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR2_SPEC, DMA0RS_AW, O>; -impl<'a, const O: u8> DMA0RS_W<'a, O> { +pub type DMA0RS_W<'a, REG> = crate::BitWriter<'a, REG, DMA0RS_AW>; +impl<'a, REG> DMA0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DMA0RS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DMA0RS_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `FCERS` writer - FCE Reset Clear"] -pub type FCERS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR2_SPEC, FCERS_AW, O>; -impl<'a, const O: u8> FCERS_W<'a, O> { +pub type FCERS_W<'a, REG> = crate::BitWriter<'a, REG, FCERS_AW>; +impl<'a, REG> FCERS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FCERS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FCERS_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `USBRS` writer - USB Reset Clear"] -pub type USBRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRCLR2_SPEC, USBRS_AW, O>; -impl<'a, const O: u8> USBRS_W<'a, O> { +pub type USBRS_W<'a, REG> = crate::BitWriter<'a, REG, USBRS_AW>; +impl<'a, REG> USBRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBRS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBRS_AW::VALUE2) } } @@ -163,48 +159,51 @@ impl W { #[doc = "Bit 1 - WDT Reset Clear"] #[inline(always)] #[must_use] - pub fn wdtrs(&mut self) -> WDTRS_W<1> { - WDTRS_W::new(self) + pub fn wdtrs(&mut self) -> WDTRS_W { + WDTRS_W::new(self, 1) } #[doc = "Bit 2 - ETH0 Reset Clear"] #[inline(always)] #[must_use] - pub fn eth0rs(&mut self) -> ETH0RS_W<2> { - ETH0RS_W::new(self) + pub fn eth0rs(&mut self) -> ETH0RS_W { + ETH0RS_W::new(self, 2) } #[doc = "Bit 4 - DMA0 Reset Clear"] #[inline(always)] #[must_use] - pub fn dma0rs(&mut self) -> DMA0RS_W<4> { - DMA0RS_W::new(self) + pub fn dma0rs(&mut self) -> DMA0RS_W { + DMA0RS_W::new(self, 4) } #[doc = "Bit 6 - FCE Reset Clear"] #[inline(always)] #[must_use] - pub fn fcers(&mut self) -> FCERS_W<6> { - FCERS_W::new(self) + pub fn fcers(&mut self) -> FCERS_W { + FCERS_W::new(self, 6) } #[doc = "Bit 7 - USB Reset Clear"] #[inline(always)] #[must_use] - pub fn usbrs(&mut self) -> USBRS_W<7> { - USBRS_W::new(self) + pub fn usbrs(&mut self) -> USBRS_W { + USBRS_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RCU Peripheral 2 Reset Clear\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prclr2::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PRCLR2_SPEC; impl crate::RegisterSpec for PRCLR2_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [prclr2::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`prclr2::W`](W) writer structure"] impl crate::Writable for PRCLR2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_reset/prset0.rs b/src/scu_reset/prset0.rs index 46a687a3..5c2fae78 100644 --- a/src/scu_reset/prset0.rs +++ b/src/scu_reset/prset0.rs @@ -1,24 +1,5 @@ #[doc = "Register `PRSET0` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "VADC Reset Assert\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum VADCRS_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `VADCRS` writer - VADC Reset Assert"] -pub type VADCRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, VADCRS_AW, O>; -impl<'a, const O: u8> VADCRS_W<'a, O> { +pub type VADCRS_W<'a, REG> = crate::BitWriter<'a, REG, VADCRS_AW>; +impl<'a, REG> VADCRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VADCRS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VADCRS_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `DSDRS` writer - DSD Reset Assert"] -pub type DSDRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, DSDRS_AW, O>; -impl<'a, const O: u8> DSDRS_W<'a, O> { +pub type DSDRS_W<'a, REG> = crate::BitWriter<'a, REG, DSDRS_AW>; +impl<'a, REG> DSDRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSDRS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSDRS_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CCU40RS` writer - CCU40 Reset Assert"] -pub type CCU40RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, CCU40RS_AW, O>; -impl<'a, const O: u8> CCU40RS_W<'a, O> { +pub type CCU40RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU40RS_AW>; +impl<'a, REG> CCU40RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU40RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU40RS_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CCU41RS` writer - CCU41 Reset Assert"] -pub type CCU41RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, CCU41RS_AW, O>; -impl<'a, const O: u8> CCU41RS_W<'a, O> { +pub type CCU41RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU41RS_AW>; +impl<'a, REG> CCU41RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU41RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU41RS_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CCU42RS` writer - CCU42 Reset Assert"] -pub type CCU42RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, CCU42RS_AW, O>; -impl<'a, const O: u8> CCU42RS_W<'a, O> { +pub type CCU42RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU42RS_AW>; +impl<'a, REG> CCU42RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU42RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU42RS_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CCU80RS` writer - CCU80 Reset Assert"] -pub type CCU80RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, CCU80RS_AW, O>; -impl<'a, const O: u8> CCU80RS_W<'a, O> { +pub type CCU80RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU80RS_AW>; +impl<'a, REG> CCU80RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU80RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU80RS_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CCU81RS` writer - CCU81 Reset Assert"] -pub type CCU81RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, CCU81RS_AW, O>; -impl<'a, const O: u8> CCU81RS_W<'a, O> { +pub type CCU81RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU81RS_AW>; +impl<'a, REG> CCU81RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU81RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU81RS_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `POSIF0RS` writer - POSIF0 Reset Assert"] -pub type POSIF0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, POSIF0RS_AW, O>; -impl<'a, const O: u8> POSIF0RS_W<'a, O> { +pub type POSIF0RS_W<'a, REG> = crate::BitWriter<'a, REG, POSIF0RS_AW>; +impl<'a, REG> POSIF0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSIF0RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSIF0RS_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `POSIF1RS` writer - POSIF1 Reset Assert"] -pub type POSIF1RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, POSIF1RS_AW, O>; -impl<'a, const O: u8> POSIF1RS_W<'a, O> { +pub type POSIF1RS_W<'a, REG> = crate::BitWriter<'a, REG, POSIF1RS_AW>; +impl<'a, REG> POSIF1RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(POSIF1RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(POSIF1RS_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `USIC0RS` writer - USIC0 Reset Assert"] -pub type USIC0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, USIC0RS_AW, O>; -impl<'a, const O: u8> USIC0RS_W<'a, O> { +pub type USIC0RS_W<'a, REG> = crate::BitWriter<'a, REG, USIC0RS_AW>; +impl<'a, REG> USIC0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC0RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC0RS_AW::VALUE2) } } @@ -314,16 +325,19 @@ impl From for bool { } } #[doc = "Field `ERU1RS` writer - ERU1 Reset Assert"] -pub type ERU1RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, ERU1RS_AW, O>; -impl<'a, const O: u8> ERU1RS_W<'a, O> { +pub type ERU1RS_W<'a, REG> = crate::BitWriter<'a, REG, ERU1RS_AW>; +impl<'a, REG> ERU1RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERU1RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERU1RS_AW::VALUE2) } } @@ -342,16 +356,19 @@ impl From for bool { } } #[doc = "Field `HRPWM0RS` writer - HRPWM0 Reset Assert"] -pub type HRPWM0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET0_SPEC, HRPWM0RS_AW, O>; -impl<'a, const O: u8> HRPWM0RS_W<'a, O> { +pub type HRPWM0RS_W<'a, REG> = crate::BitWriter<'a, REG, HRPWM0RS_AW>; +impl<'a, REG> HRPWM0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HRPWM0RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HRPWM0RS_AW::VALUE2) } } @@ -359,90 +376,93 @@ impl W { #[doc = "Bit 0 - VADC Reset Assert"] #[inline(always)] #[must_use] - pub fn vadcrs(&mut self) -> VADCRS_W<0> { - VADCRS_W::new(self) + pub fn vadcrs(&mut self) -> VADCRS_W { + VADCRS_W::new(self, 0) } #[doc = "Bit 1 - DSD Reset Assert"] #[inline(always)] #[must_use] - pub fn dsdrs(&mut self) -> DSDRS_W<1> { - DSDRS_W::new(self) + pub fn dsdrs(&mut self) -> DSDRS_W { + DSDRS_W::new(self, 1) } #[doc = "Bit 2 - CCU40 Reset Assert"] #[inline(always)] #[must_use] - pub fn ccu40rs(&mut self) -> CCU40RS_W<2> { - CCU40RS_W::new(self) + pub fn ccu40rs(&mut self) -> CCU40RS_W { + CCU40RS_W::new(self, 2) } #[doc = "Bit 3 - CCU41 Reset Assert"] #[inline(always)] #[must_use] - pub fn ccu41rs(&mut self) -> CCU41RS_W<3> { - CCU41RS_W::new(self) + pub fn ccu41rs(&mut self) -> CCU41RS_W { + CCU41RS_W::new(self, 3) } #[doc = "Bit 4 - CCU42 Reset Assert"] #[inline(always)] #[must_use] - pub fn ccu42rs(&mut self) -> CCU42RS_W<4> { - CCU42RS_W::new(self) + pub fn ccu42rs(&mut self) -> CCU42RS_W { + CCU42RS_W::new(self, 4) } #[doc = "Bit 7 - CCU80 Reset Assert"] #[inline(always)] #[must_use] - pub fn ccu80rs(&mut self) -> CCU80RS_W<7> { - CCU80RS_W::new(self) + pub fn ccu80rs(&mut self) -> CCU80RS_W { + CCU80RS_W::new(self, 7) } #[doc = "Bit 8 - CCU81 Reset Assert"] #[inline(always)] #[must_use] - pub fn ccu81rs(&mut self) -> CCU81RS_W<8> { - CCU81RS_W::new(self) + pub fn ccu81rs(&mut self) -> CCU81RS_W { + CCU81RS_W::new(self, 8) } #[doc = "Bit 9 - POSIF0 Reset Assert"] #[inline(always)] #[must_use] - pub fn posif0rs(&mut self) -> POSIF0RS_W<9> { - POSIF0RS_W::new(self) + pub fn posif0rs(&mut self) -> POSIF0RS_W { + POSIF0RS_W::new(self, 9) } #[doc = "Bit 10 - POSIF1 Reset Assert"] #[inline(always)] #[must_use] - pub fn posif1rs(&mut self) -> POSIF1RS_W<10> { - POSIF1RS_W::new(self) + pub fn posif1rs(&mut self) -> POSIF1RS_W { + POSIF1RS_W::new(self, 10) } #[doc = "Bit 11 - USIC0 Reset Assert"] #[inline(always)] #[must_use] - pub fn usic0rs(&mut self) -> USIC0RS_W<11> { - USIC0RS_W::new(self) + pub fn usic0rs(&mut self) -> USIC0RS_W { + USIC0RS_W::new(self, 11) } #[doc = "Bit 16 - ERU1 Reset Assert"] #[inline(always)] #[must_use] - pub fn eru1rs(&mut self) -> ERU1RS_W<16> { - ERU1RS_W::new(self) + pub fn eru1rs(&mut self) -> ERU1RS_W { + ERU1RS_W::new(self, 16) } #[doc = "Bit 23 - HRPWM0 Reset Assert"] #[inline(always)] #[must_use] - pub fn hrpwm0rs(&mut self) -> HRPWM0RS_W<23> { - HRPWM0RS_W::new(self) + pub fn hrpwm0rs(&mut self) -> HRPWM0RS_W { + HRPWM0RS_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RCU Peripheral 0 Reset Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prset0::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PRSET0_SPEC; impl crate::RegisterSpec for PRSET0_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [prset0::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`prset0::W`](W) writer structure"] impl crate::Writable for PRSET0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_reset/prset1.rs b/src/scu_reset/prset1.rs index a4da17a1..44b9b830 100644 --- a/src/scu_reset/prset1.rs +++ b/src/scu_reset/prset1.rs @@ -1,24 +1,5 @@ #[doc = "Register `PRSET1` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "CCU43 Reset Assert\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CCU43RS_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CCU43RS` writer - CCU43 Reset Assert"] -pub type CCU43RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET1_SPEC, CCU43RS_AW, O>; -impl<'a, const O: u8> CCU43RS_W<'a, O> { +pub type CCU43RS_W<'a, REG> = crate::BitWriter<'a, REG, CCU43RS_AW>; +impl<'a, REG> CCU43RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CCU43RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CCU43RS_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `LEDTSCU0RS` writer - LEDTS Reset Assert"] -pub type LEDTSCU0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET1_SPEC, LEDTSCU0RS_AW, O>; -impl<'a, const O: u8> LEDTSCU0RS_W<'a, O> { +pub type LEDTSCU0RS_W<'a, REG> = crate::BitWriter<'a, REG, LEDTSCU0RS_AW>; +impl<'a, REG> LEDTSCU0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LEDTSCU0RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LEDTSCU0RS_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `MCAN0RS` writer - MultiCAN Reset Assert"] -pub type MCAN0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET1_SPEC, MCAN0RS_AW, O>; -impl<'a, const O: u8> MCAN0RS_W<'a, O> { +pub type MCAN0RS_W<'a, REG> = crate::BitWriter<'a, REG, MCAN0RS_AW>; +impl<'a, REG> MCAN0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCAN0RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCAN0RS_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `DACRS` writer - DAC Reset Assert"] -pub type DACRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET1_SPEC, DACRS_AW, O>; -impl<'a, const O: u8> DACRS_W<'a, O> { +pub type DACRS_W<'a, REG> = crate::BitWriter<'a, REG, DACRS_AW>; +impl<'a, REG> DACRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DACRS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DACRS_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `USIC1RS` writer - USIC1 Reset Assert"] -pub type USIC1RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET1_SPEC, USIC1RS_AW, O>; -impl<'a, const O: u8> USIC1RS_W<'a, O> { +pub type USIC1RS_W<'a, REG> = crate::BitWriter<'a, REG, USIC1RS_AW>; +impl<'a, REG> USIC1RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USIC1RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USIC1RS_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `PPORTSRS` writer - PORTS Reset Assert"] -pub type PPORTSRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET1_SPEC, PPORTSRS_AW, O>; -impl<'a, const O: u8> PPORTSRS_W<'a, O> { +pub type PPORTSRS_W<'a, REG> = crate::BitWriter<'a, REG, PPORTSRS_AW>; +impl<'a, REG> PPORTSRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPORTSRS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPORTSRS_AW::VALUE2) } } @@ -191,54 +190,57 @@ impl W { #[doc = "Bit 0 - CCU43 Reset Assert"] #[inline(always)] #[must_use] - pub fn ccu43rs(&mut self) -> CCU43RS_W<0> { - CCU43RS_W::new(self) + pub fn ccu43rs(&mut self) -> CCU43RS_W { + CCU43RS_W::new(self, 0) } #[doc = "Bit 3 - LEDTS Reset Assert"] #[inline(always)] #[must_use] - pub fn ledtscu0rs(&mut self) -> LEDTSCU0RS_W<3> { - LEDTSCU0RS_W::new(self) + pub fn ledtscu0rs(&mut self) -> LEDTSCU0RS_W { + LEDTSCU0RS_W::new(self, 3) } #[doc = "Bit 4 - MultiCAN Reset Assert"] #[inline(always)] #[must_use] - pub fn mcan0rs(&mut self) -> MCAN0RS_W<4> { - MCAN0RS_W::new(self) + pub fn mcan0rs(&mut self) -> MCAN0RS_W { + MCAN0RS_W::new(self, 4) } #[doc = "Bit 5 - DAC Reset Assert"] #[inline(always)] #[must_use] - pub fn dacrs(&mut self) -> DACRS_W<5> { - DACRS_W::new(self) + pub fn dacrs(&mut self) -> DACRS_W { + DACRS_W::new(self, 5) } #[doc = "Bit 7 - USIC1 Reset Assert"] #[inline(always)] #[must_use] - pub fn usic1rs(&mut self) -> USIC1RS_W<7> { - USIC1RS_W::new(self) + pub fn usic1rs(&mut self) -> USIC1RS_W { + USIC1RS_W::new(self, 7) } #[doc = "Bit 9 - PORTS Reset Assert"] #[inline(always)] #[must_use] - pub fn pportsrs(&mut self) -> PPORTSRS_W<9> { - PPORTSRS_W::new(self) + pub fn pportsrs(&mut self) -> PPORTSRS_W { + PPORTSRS_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RCU Peripheral 1 Reset Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prset1::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PRSET1_SPEC; impl crate::RegisterSpec for PRSET1_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [prset1::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`prset1::W`](W) writer structure"] impl crate::Writable for PRSET1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_reset/prset2.rs b/src/scu_reset/prset2.rs index 0df0c66a..72e71d7f 100644 --- a/src/scu_reset/prset2.rs +++ b/src/scu_reset/prset2.rs @@ -1,24 +1,5 @@ #[doc = "Register `PRSET2` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "WDT Reset Assert\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum WDTRS_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `WDTRS` writer - WDT Reset Assert"] -pub type WDTRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET2_SPEC, WDTRS_AW, O>; -impl<'a, const O: u8> WDTRS_W<'a, O> { +pub type WDTRS_W<'a, REG> = crate::BitWriter<'a, REG, WDTRS_AW>; +impl<'a, REG> WDTRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WDTRS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WDTRS_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `ETH0RS` writer - ETH0 Reset Assert"] -pub type ETH0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET2_SPEC, ETH0RS_AW, O>; -impl<'a, const O: u8> ETH0RS_W<'a, O> { +pub type ETH0RS_W<'a, REG> = crate::BitWriter<'a, REG, ETH0RS_AW>; +impl<'a, REG> ETH0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ETH0RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ETH0RS_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `DMA0RS` writer - DMA0 Reset Assert"] -pub type DMA0RS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET2_SPEC, DMA0RS_AW, O>; -impl<'a, const O: u8> DMA0RS_W<'a, O> { +pub type DMA0RS_W<'a, REG> = crate::BitWriter<'a, REG, DMA0RS_AW>; +impl<'a, REG> DMA0RS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DMA0RS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DMA0RS_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `FCERS` writer - FCE Reset Assert"] -pub type FCERS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET2_SPEC, FCERS_AW, O>; -impl<'a, const O: u8> FCERS_W<'a, O> { +pub type FCERS_W<'a, REG> = crate::BitWriter<'a, REG, FCERS_AW>; +impl<'a, REG> FCERS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FCERS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FCERS_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `USBRS` writer - USB Reset Assert"] -pub type USBRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PRSET2_SPEC, USBRS_AW, O>; -impl<'a, const O: u8> USBRS_W<'a, O> { +pub type USBRS_W<'a, REG> = crate::BitWriter<'a, REG, USBRS_AW>; +impl<'a, REG> USBRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(USBRS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(USBRS_AW::VALUE2) } } @@ -163,48 +159,51 @@ impl W { #[doc = "Bit 1 - WDT Reset Assert"] #[inline(always)] #[must_use] - pub fn wdtrs(&mut self) -> WDTRS_W<1> { - WDTRS_W::new(self) + pub fn wdtrs(&mut self) -> WDTRS_W { + WDTRS_W::new(self, 1) } #[doc = "Bit 2 - ETH0 Reset Assert"] #[inline(always)] #[must_use] - pub fn eth0rs(&mut self) -> ETH0RS_W<2> { - ETH0RS_W::new(self) + pub fn eth0rs(&mut self) -> ETH0RS_W { + ETH0RS_W::new(self, 2) } #[doc = "Bit 4 - DMA0 Reset Assert"] #[inline(always)] #[must_use] - pub fn dma0rs(&mut self) -> DMA0RS_W<4> { - DMA0RS_W::new(self) + pub fn dma0rs(&mut self) -> DMA0RS_W { + DMA0RS_W::new(self, 4) } #[doc = "Bit 6 - FCE Reset Assert"] #[inline(always)] #[must_use] - pub fn fcers(&mut self) -> FCERS_W<6> { - FCERS_W::new(self) + pub fn fcers(&mut self) -> FCERS_W { + FCERS_W::new(self, 6) } #[doc = "Bit 7 - USB Reset Assert"] #[inline(always)] #[must_use] - pub fn usbrs(&mut self) -> USBRS_W<7> { - USBRS_W::new(self) + pub fn usbrs(&mut self) -> USBRS_W { + USBRS_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RCU Peripheral 2 Reset Set\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`prset2::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PRSET2_SPEC; impl crate::RegisterSpec for PRSET2_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [prset2::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`prset2::W`](W) writer structure"] impl crate::Writable for PRSET2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_reset/prstat0.rs b/src/scu_reset/prstat0.rs index 3167fdcb..abdcef7c 100644 --- a/src/scu_reset/prstat0.rs +++ b/src/scu_reset/prstat0.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `VADCRS` reader - VADC Reset Status"] pub type VADCRS_R = crate::BitReader; #[doc = "VADC Reset Status\n\nValue on reset: 1"] @@ -32,18 +19,18 @@ impl From for bool { impl VADCRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VADCRS_A { + pub const fn variant(&self) -> VADCRS_A { match self.bits { false => VADCRS_A::VALUE1, true => VADCRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VADCRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VADCRS_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl DSDRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSDRS_A { + pub const fn variant(&self) -> DSDRS_A { match self.bits { false => DSDRS_A::VALUE1, true => DSDRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSDRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSDRS_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl CCU40RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU40RS_A { + pub const fn variant(&self) -> CCU40RS_A { match self.bits { false => CCU40RS_A::VALUE1, true => CCU40RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU40RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU40RS_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl CCU41RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU41RS_A { + pub const fn variant(&self) -> CCU41RS_A { match self.bits { false => CCU41RS_A::VALUE1, true => CCU41RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU41RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU41RS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl CCU42RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU42RS_A { + pub const fn variant(&self) -> CCU42RS_A { match self.bits { false => CCU42RS_A::VALUE1, true => CCU42RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU42RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU42RS_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl CCU80RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU80RS_A { + pub const fn variant(&self) -> CCU80RS_A { match self.bits { false => CCU80RS_A::VALUE1, true => CCU80RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU80RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU80RS_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl CCU81RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU81RS_A { + pub const fn variant(&self) -> CCU81RS_A { match self.bits { false => CCU81RS_A::VALUE1, true => CCU81RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU81RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU81RS_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl POSIF0RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> POSIF0RS_A { + pub const fn variant(&self) -> POSIF0RS_A { match self.bits { false => POSIF0RS_A::VALUE1, true => POSIF0RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == POSIF0RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == POSIF0RS_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl POSIF1RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> POSIF1RS_A { + pub const fn variant(&self) -> POSIF1RS_A { match self.bits { false => POSIF1RS_A::VALUE1, true => POSIF1RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == POSIF1RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == POSIF1RS_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl USIC0RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USIC0RS_A { + pub const fn variant(&self) -> USIC0RS_A { match self.bits { false => USIC0RS_A::VALUE1, true => USIC0RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USIC0RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USIC0RS_A::VALUE2 @@ -392,18 +379,18 @@ impl From for bool { impl ERU1RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERU1RS_A { + pub const fn variant(&self) -> ERU1RS_A { match self.bits { false => ERU1RS_A::VALUE1, true => ERU1RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERU1RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERU1RS_A::VALUE2 @@ -428,18 +415,18 @@ impl From for bool { impl HRPWM0RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HRPWM0RS_A { + pub const fn variant(&self) -> HRPWM0RS_A { match self.bits { false => HRPWM0RS_A::VALUE1, true => HRPWM0RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HRPWM0RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HRPWM0RS_A::VALUE2 @@ -507,15 +494,13 @@ impl R { HRPWM0RS_R::new(((self.bits >> 23) & 1) != 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"] +#[doc = "RCU Peripheral 0 Reset Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prstat0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`prstat0::R`](R) reader structure"] +impl crate::Readable for PRSTAT0_SPEC {} #[doc = "`reset()` method sets PRSTAT0 to value 0x0081_0f9f"] impl crate::Resettable for PRSTAT0_SPEC { const RESET_VALUE: Self::Ux = 0x0081_0f9f; diff --git a/src/scu_reset/prstat1.rs b/src/scu_reset/prstat1.rs index 68b979ae..5f45848e 100644 --- a/src/scu_reset/prstat1.rs +++ b/src/scu_reset/prstat1.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `CCU43RS` reader - CCU43 Reset Status"] pub type CCU43RS_R = crate::BitReader; #[doc = "CCU43 Reset Status\n\nValue on reset: 1"] @@ -32,18 +19,18 @@ impl From for bool { impl CCU43RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CCU43RS_A { + pub const fn variant(&self) -> CCU43RS_A { match self.bits { false => CCU43RS_A::VALUE1, true => CCU43RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CCU43RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CCU43RS_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl LEDTSCU0RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LEDTSCU0RS_A { + pub const fn variant(&self) -> LEDTSCU0RS_A { match self.bits { false => LEDTSCU0RS_A::VALUE1, true => LEDTSCU0RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LEDTSCU0RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LEDTSCU0RS_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl MCAN0RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCAN0RS_A { + pub const fn variant(&self) -> MCAN0RS_A { match self.bits { false => MCAN0RS_A::VALUE1, true => MCAN0RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCAN0RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCAN0RS_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl DACRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DACRS_A { + pub const fn variant(&self) -> DACRS_A { match self.bits { false => DACRS_A::VALUE1, true => DACRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DACRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DACRS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl USIC1RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USIC1RS_A { + pub const fn variant(&self) -> USIC1RS_A { match self.bits { false => USIC1RS_A::VALUE1, true => USIC1RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USIC1RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USIC1RS_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl PPORTSRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPORTSRS_A { + pub const fn variant(&self) -> PPORTSRS_A { match self.bits { false => PPORTSRS_A::VALUE1, true => PPORTSRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPORTSRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPORTSRS_A::VALUE2 @@ -261,15 +248,13 @@ impl R { PPORTSRS_R::new(((self.bits >> 9) & 1) != 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"] +#[doc = "RCU Peripheral 1 Reset Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prstat1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`prstat1::R`](R) reader structure"] +impl crate::Readable for PRSTAT1_SPEC {} #[doc = "`reset()` method sets PRSTAT1 to value 0xb9"] impl crate::Resettable for PRSTAT1_SPEC { const RESET_VALUE: Self::Ux = 0xb9; diff --git a/src/scu_reset/prstat2.rs b/src/scu_reset/prstat2.rs index 6265a9b6..1553b7b5 100644 --- a/src/scu_reset/prstat2.rs +++ b/src/scu_reset/prstat2.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `WDTRS` reader - WDT Reset Status"] pub type WDTRS_R = crate::BitReader; #[doc = "WDT Reset Status\n\nValue on reset: 1"] @@ -32,18 +19,18 @@ impl From for bool { impl WDTRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WDTRS_A { + pub const fn variant(&self) -> WDTRS_A { match self.bits { false => WDTRS_A::VALUE1, true => WDTRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WDTRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WDTRS_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl ETH0RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ETH0RS_A { + pub const fn variant(&self) -> ETH0RS_A { match self.bits { false => ETH0RS_A::VALUE1, true => ETH0RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ETH0RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ETH0RS_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl DMA0RS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DMA0RS_A { + pub const fn variant(&self) -> DMA0RS_A { match self.bits { false => DMA0RS_A::VALUE1, true => DMA0RS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DMA0RS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DMA0RS_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl FCERS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FCERS_A { + pub const fn variant(&self) -> FCERS_A { match self.bits { false => FCERS_A::VALUE1, true => FCERS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FCERS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FCERS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl USBRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> USBRS_A { + pub const fn variant(&self) -> USBRS_A { match self.bits { false => USBRS_A::VALUE1, true => USBRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == USBRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == USBRS_A::VALUE2 @@ -220,15 +207,13 @@ impl R { USBRS_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "RCU Peripheral 2 Reset Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`prstat2::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`prstat2::R`](R) reader structure"] +impl crate::Readable for PRSTAT2_SPEC {} #[doc = "`reset()` method sets PRSTAT2 to value 0xd6"] impl crate::Resettable for PRSTAT2_SPEC { const RESET_VALUE: Self::Ux = 0xd6; diff --git a/src/scu_reset/rstclr.rs b/src/scu_reset/rstclr.rs index 90637ddc..20b52a2c 100644 --- a/src/scu_reset/rstclr.rs +++ b/src/scu_reset/rstclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `RSTCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Reset Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum RSCLR_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `RSCLR` writer - Clear Reset Status"] -pub type RSCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, RSTCLR_SPEC, RSCLR_AW, O>; -impl<'a, const O: u8> RSCLR_W<'a, O> { +pub type RSCLR_W<'a, REG> = crate::BitWriter<'a, REG, RSCLR_AW>; +impl<'a, REG> RSCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSCLR_AW::VALUE1) } #[doc = "Clears field RSTSTAT.RSTSTAT"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSCLR_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `HIBWK` writer - Clear Hibernate Wake-up Reset Status"] -pub type HIBWK_W<'a, const O: u8> = crate::BitWriter<'a, u32, RSTCLR_SPEC, HIBWK_AW, O>; -impl<'a, const O: u8> HIBWK_W<'a, O> { +pub type HIBWK_W<'a, REG> = crate::BitWriter<'a, REG, HIBWK_AW>; +impl<'a, REG> HIBWK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBWK_AW::VALUE1) } #[doc = "De-assert reset status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBWK_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `HIBRS` writer - Clear Hibernate Reset"] -pub type HIBRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, RSTCLR_SPEC, HIBRS_AW, O>; -impl<'a, const O: u8> HIBRS_W<'a, O> { +pub type HIBRS_W<'a, REG> = crate::BitWriter<'a, REG, HIBRS_AW>; +impl<'a, REG> HIBRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBRS_AW::VALUE1) } #[doc = "De-assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBRS_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `LCKEN` writer - Enable Lockup Reset"] -pub type LCKEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RSTCLR_SPEC, LCKEN_AW, O>; -impl<'a, const O: u8> LCKEN_W<'a, O> { +pub type LCKEN_W<'a, REG> = crate::BitWriter<'a, REG, LCKEN_AW>; +impl<'a, REG> LCKEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LCKEN_AW::VALUE1) } #[doc = "Disable reset when Lockup gets asserted"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LCKEN_AW::VALUE2) } } @@ -135,42 +128,45 @@ impl W { #[doc = "Bit 0 - Clear Reset Status"] #[inline(always)] #[must_use] - pub fn rsclr(&mut self) -> RSCLR_W<0> { - RSCLR_W::new(self) + pub fn rsclr(&mut self) -> RSCLR_W { + RSCLR_W::new(self, 0) } #[doc = "Bit 8 - Clear Hibernate Wake-up Reset Status"] #[inline(always)] #[must_use] - pub fn hibwk(&mut self) -> HIBWK_W<8> { - HIBWK_W::new(self) + pub fn hibwk(&mut self) -> HIBWK_W { + HIBWK_W::new(self, 8) } #[doc = "Bit 9 - Clear Hibernate Reset"] #[inline(always)] #[must_use] - pub fn hibrs(&mut self) -> HIBRS_W<9> { - HIBRS_W::new(self) + pub fn hibrs(&mut self) -> HIBRS_W { + HIBRS_W::new(self, 9) } #[doc = "Bit 10 - Enable Lockup Reset"] #[inline(always)] #[must_use] - pub fn lcken(&mut self) -> LCKEN_W<10> { - LCKEN_W::new(self) + pub fn lcken(&mut self) -> LCKEN_W { + LCKEN_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RCU Reset Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rstclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RSTCLR_SPEC; impl crate::RegisterSpec for RSTCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [rstclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`rstclr::W`](W) writer structure"] impl crate::Writable for RSTCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_reset/rstset.rs b/src/scu_reset/rstset.rs index 83f3342f..29e5e91d 100644 --- a/src/scu_reset/rstset.rs +++ b/src/scu_reset/rstset.rs @@ -1,24 +1,5 @@ #[doc = "Register `RSTSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Set Hibernate Wake-up Reset Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum HIBWK_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `HIBWK` writer - Set Hibernate Wake-up Reset Status"] -pub type HIBWK_W<'a, const O: u8> = crate::BitWriter<'a, u32, RSTSET_SPEC, HIBWK_AW, O>; -impl<'a, const O: u8> HIBWK_W<'a, O> { +pub type HIBWK_W<'a, REG> = crate::BitWriter<'a, REG, HIBWK_AW>; +impl<'a, REG> HIBWK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBWK_AW::VALUE1) } #[doc = "Assert reset status bit"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBWK_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `HIBRS` writer - Set Hibernate Reset"] -pub type HIBRS_W<'a, const O: u8> = crate::BitWriter<'a, u32, RSTSET_SPEC, HIBRS_AW, O>; -impl<'a, const O: u8> HIBRS_W<'a, O> { +pub type HIBRS_W<'a, REG> = crate::BitWriter<'a, REG, HIBRS_AW>; +impl<'a, REG> HIBRS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HIBRS_AW::VALUE1) } #[doc = "Assert reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HIBRS_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `LCKEN` writer - Enable Lockup Reset"] -pub type LCKEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RSTSET_SPEC, LCKEN_AW, O>; -impl<'a, const O: u8> LCKEN_W<'a, O> { +pub type LCKEN_W<'a, REG> = crate::BitWriter<'a, REG, LCKEN_AW>; +impl<'a, REG> LCKEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LCKEN_AW::VALUE1) } #[doc = "Enable reset when Lockup gets asserted"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LCKEN_AW::VALUE2) } } @@ -107,36 +97,39 @@ impl W { #[doc = "Bit 8 - Set Hibernate Wake-up Reset Status"] #[inline(always)] #[must_use] - pub fn hibwk(&mut self) -> HIBWK_W<8> { - HIBWK_W::new(self) + pub fn hibwk(&mut self) -> HIBWK_W { + HIBWK_W::new(self, 8) } #[doc = "Bit 9 - Set Hibernate Reset"] #[inline(always)] #[must_use] - pub fn hibrs(&mut self) -> HIBRS_W<9> { - HIBRS_W::new(self) + pub fn hibrs(&mut self) -> HIBRS_W { + HIBRS_W::new(self, 9) } #[doc = "Bit 10 - Enable Lockup Reset"] #[inline(always)] #[must_use] - pub fn lcken(&mut self) -> LCKEN_W<10> { - LCKEN_W::new(self) + pub fn lcken(&mut self) -> LCKEN_W { + LCKEN_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "RCU Reset Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rstset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct RSTSET_SPEC; impl crate::RegisterSpec for RSTSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [rstset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`rstset::W`](W) writer structure"] impl crate::Writable for RSTSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_reset/rststat.rs b/src/scu_reset/rststat.rs index ece944b7..01be0802 100644 --- a/src/scu_reset/rststat.rs +++ b/src/scu_reset/rststat.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `RSTSTAT` reader - Reset Status Information"] -pub type RSTSTAT_R = crate::FieldReader; +pub type RSTSTAT_R = crate::FieldReader; #[doc = "Reset Status Information\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -40,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RSTSTAT_A { + type Ux = u8; +} impl RSTSTAT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(RSTSTAT_A::VALUE1), 2 => Some(RSTSTAT_A::VALUE2), @@ -55,37 +45,37 @@ impl RSTSTAT_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PORST reset"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSTSTAT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "SWD reset"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSTSTAT_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "PV reset"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RSTSTAT_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "CPU system reset"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == RSTSTAT_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "CPU lockup reset"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == RSTSTAT_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "WDT reset"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == RSTSTAT_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "Parity Error reset"] #[inline(always)] pub fn is_value8(&self) -> bool { *self == RSTSTAT_A::VALUE8 @@ -110,18 +100,18 @@ impl From for bool { impl HIBWK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIBWK_A { + pub const fn variant(&self) -> HIBWK_A { match self.bits { false => HIBWK_A::VALUE1, true => HIBWK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No Wake-up"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBWK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wake-up event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBWK_A::VALUE2 @@ -146,18 +136,18 @@ impl From for bool { impl HIBRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HIBRS_A { + pub const fn variant(&self) -> HIBRS_A { match self.bits { false => HIBRS_A::VALUE1, true => HIBRS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset de-asserted"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HIBRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset asserted"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HIBRS_A::VALUE2 @@ -182,18 +172,18 @@ impl From for bool { impl LCKEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LCKEN_A { + pub const fn variant(&self) -> LCKEN_A { match self.bits { false => LCKEN_A::VALUE1, true => LCKEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Reset by Lockup disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LCKEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Reset by Lockup enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LCKEN_A::VALUE2 @@ -221,15 +211,13 @@ impl R { LCKEN_R::new(((self.bits >> 10) & 1) != 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"] +#[doc = "RCU Reset Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rststat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`rststat::R`](R) reader structure"] +impl crate::Readable for RSTSTAT_SPEC {} #[doc = "`reset()` method sets RSTSTAT to value 0"] impl crate::Resettable for RSTSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_trap.rs b/src/scu_trap.rs index 1607f066..e24ac816 100644 --- a/src/scu_trap.rs +++ b/src/scu_trap.rs @@ -1,34 +1,61 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + trapstat: TRAPSTAT, + trapraw: TRAPRAW, + trapdis: TRAPDIS, + trapclr: TRAPCLR, + trapset: TRAPSET, +} +impl RegisterBlock { #[doc = "0x00 - Trap Status Register"] - pub trapstat: TRAPSTAT, + #[inline(always)] + pub const fn trapstat(&self) -> &TRAPSTAT { + &self.trapstat + } #[doc = "0x04 - Trap Raw Status Register"] - pub trapraw: TRAPRAW, + #[inline(always)] + pub const fn trapraw(&self) -> &TRAPRAW { + &self.trapraw + } #[doc = "0x08 - Trap Disable Register"] - pub trapdis: TRAPDIS, + #[inline(always)] + pub const fn trapdis(&self) -> &TRAPDIS { + &self.trapdis + } #[doc = "0x0c - Trap Clear Register"] - pub trapclr: TRAPCLR, + #[inline(always)] + pub const fn trapclr(&self) -> &TRAPCLR { + &self.trapclr + } #[doc = "0x10 - Trap Set Register"] - pub trapset: TRAPSET, + #[inline(always)] + pub const fn trapset(&self) -> &TRAPSET { + &self.trapset + } } -#[doc = "TRAPSTAT (r) register accessor: an alias for `Reg`"] +#[doc = "TRAPSTAT (r) register accessor: Trap Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trapstat::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@trapstat`] +module"] pub type TRAPSTAT = crate::Reg; #[doc = "Trap Status Register"] pub mod trapstat; -#[doc = "TRAPRAW (r) register accessor: an alias for `Reg`"] +#[doc = "TRAPRAW (r) register accessor: Trap Raw Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trapraw::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@trapraw`] +module"] pub type TRAPRAW = crate::Reg; #[doc = "Trap Raw Status Register"] pub mod trapraw; -#[doc = "TRAPDIS (rw) register accessor: an alias for `Reg`"] +#[doc = "TRAPDIS (rw) register accessor: Trap Disable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trapdis::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trapdis::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@trapdis`] +module"] pub type TRAPDIS = crate::Reg; #[doc = "Trap Disable Register"] pub mod trapdis; -#[doc = "TRAPCLR (w) register accessor: an alias for `Reg`"] +#[doc = "TRAPCLR (w) register accessor: Trap Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trapclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@trapclr`] +module"] pub type TRAPCLR = crate::Reg; #[doc = "Trap Clear Register"] pub mod trapclr; -#[doc = "TRAPSET (w) register accessor: an alias for `Reg`"] +#[doc = "TRAPSET (w) register accessor: Trap Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trapset::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@trapset`] +module"] 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 84ec25f0..fc9032c4 100644 --- a/src/scu_trap/trapclr.rs +++ b/src/scu_trap/trapclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `TRAPCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "System OSC WDT Trap Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum SOSCWDGT_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `SOSCWDGT` writer - System OSC WDT Trap Clear"] -pub type SOSCWDGT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, SOSCWDGT_AW, O>; -impl<'a, const O: u8> SOSCWDGT_W<'a, O> { +pub type SOSCWDGT_W<'a, REG> = crate::BitWriter<'a, REG, SOSCWDGT_AW>; +impl<'a, REG> SOSCWDGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SOSCWDGT_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SOSCWDGT_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `SVCOLCKT` writer - System VCO Lock Trap Clear"] -pub type SVCOLCKT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, SVCOLCKT_AW, O>; -impl<'a, const O: u8> SVCOLCKT_W<'a, O> { +pub type SVCOLCKT_W<'a, REG> = crate::BitWriter<'a, REG, SVCOLCKT_AW>; +impl<'a, REG> SVCOLCKT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SVCOLCKT_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SVCOLCKT_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `UVCOLCKT` writer - USB VCO Lock Trap Clear"] -pub type UVCOLCKT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, UVCOLCKT_AW, O>; -impl<'a, const O: u8> UVCOLCKT_W<'a, O> { +pub type UVCOLCKT_W<'a, REG> = crate::BitWriter<'a, REG, UVCOLCKT_AW>; +impl<'a, REG> UVCOLCKT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UVCOLCKT_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UVCOLCKT_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `PET` writer - Parity Error Trap Clear"] -pub type PET_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, PET_AW, O>; -impl<'a, const O: u8> PET_W<'a, O> { +pub type PET_W<'a, REG> = crate::BitWriter<'a, REG, PET_AW>; +impl<'a, REG> PET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PET_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PET_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `BRWNT` writer - Brown Out Trap Clear"] -pub type BRWNT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, BRWNT_AW, O>; -impl<'a, const O: u8> BRWNT_W<'a, O> { +pub type BRWNT_W<'a, REG> = crate::BitWriter<'a, REG, BRWNT_AW>; +impl<'a, REG> BRWNT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRWNT_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRWNT_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `ULPWDGT` writer - OSC_ULP WDG Trap Clear"] -pub type ULPWDGT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, ULPWDGT_AW, O>; -impl<'a, const O: u8> ULPWDGT_W<'a, O> { +pub type ULPWDGT_W<'a, REG> = crate::BitWriter<'a, REG, ULPWDGT_AW>; +impl<'a, REG> ULPWDGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ULPWDGT_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ULPWDGT_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `BWERR0T` writer - Peripheral Bridge 0 Trap Clear"] -pub type BWERR0T_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, BWERR0T_AW, O>; -impl<'a, const O: u8> BWERR0T_W<'a, O> { +pub type BWERR0T_W<'a, REG> = crate::BitWriter<'a, REG, BWERR0T_AW>; +impl<'a, REG> BWERR0T_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BWERR0T_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BWERR0T_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `BWERR1T` writer - Peripheral Bridge 1 Trap Clear"] -pub type BWERR1T_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, BWERR1T_AW, O>; -impl<'a, const O: u8> BWERR1T_W<'a, O> { +pub type BWERR1T_W<'a, REG> = crate::BitWriter<'a, REG, BWERR1T_AW>; +impl<'a, REG> BWERR1T_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BWERR1T_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BWERR1T_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `TEMPHIT` writer - Die Temperature Too High Trap Clear"] -pub type TEMPHIT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, TEMPHIT_AW, O>; -impl<'a, const O: u8> TEMPHIT_W<'a, O> { +pub type TEMPHIT_W<'a, REG> = crate::BitWriter<'a, REG, TEMPHIT_AW>; +impl<'a, REG> TEMPHIT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TEMPHIT_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TEMPHIT_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `TEMPLOT` writer - Die Temperature Too Low Trap Clear"] -pub type TEMPLOT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPCLR_SPEC, TEMPLOT_AW, O>; -impl<'a, const O: u8> TEMPLOT_W<'a, O> { +pub type TEMPLOT_W<'a, REG> = crate::BitWriter<'a, REG, TEMPLOT_AW>; +impl<'a, REG> TEMPLOT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TEMPLOT_AW::VALUE1) } #[doc = "Clear trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TEMPLOT_AW::VALUE2) } } @@ -303,78 +314,81 @@ impl W { #[doc = "Bit 0 - System OSC WDT Trap Clear"] #[inline(always)] #[must_use] - pub fn soscwdgt(&mut self) -> SOSCWDGT_W<0> { - SOSCWDGT_W::new(self) + pub fn soscwdgt(&mut self) -> SOSCWDGT_W { + SOSCWDGT_W::new(self, 0) } #[doc = "Bit 2 - System VCO Lock Trap Clear"] #[inline(always)] #[must_use] - pub fn svcolckt(&mut self) -> SVCOLCKT_W<2> { - SVCOLCKT_W::new(self) + pub fn svcolckt(&mut self) -> SVCOLCKT_W { + SVCOLCKT_W::new(self, 2) } #[doc = "Bit 3 - USB VCO Lock Trap Clear"] #[inline(always)] #[must_use] - pub fn uvcolckt(&mut self) -> UVCOLCKT_W<3> { - UVCOLCKT_W::new(self) + pub fn uvcolckt(&mut self) -> UVCOLCKT_W { + UVCOLCKT_W::new(self, 3) } #[doc = "Bit 4 - Parity Error Trap Clear"] #[inline(always)] #[must_use] - pub fn pet(&mut self) -> PET_W<4> { - PET_W::new(self) + pub fn pet(&mut self) -> PET_W { + PET_W::new(self, 4) } #[doc = "Bit 5 - Brown Out Trap Clear"] #[inline(always)] #[must_use] - pub fn brwnt(&mut self) -> BRWNT_W<5> { - BRWNT_W::new(self) + pub fn brwnt(&mut self) -> BRWNT_W { + BRWNT_W::new(self, 5) } #[doc = "Bit 6 - OSC_ULP WDG Trap Clear"] #[inline(always)] #[must_use] - pub fn ulpwdgt(&mut self) -> ULPWDGT_W<6> { - ULPWDGT_W::new(self) + pub fn ulpwdgt(&mut self) -> ULPWDGT_W { + ULPWDGT_W::new(self, 6) } #[doc = "Bit 7 - Peripheral Bridge 0 Trap Clear"] #[inline(always)] #[must_use] - pub fn bwerr0t(&mut self) -> BWERR0T_W<7> { - BWERR0T_W::new(self) + pub fn bwerr0t(&mut self) -> BWERR0T_W { + BWERR0T_W::new(self, 7) } #[doc = "Bit 8 - Peripheral Bridge 1 Trap Clear"] #[inline(always)] #[must_use] - pub fn bwerr1t(&mut self) -> BWERR1T_W<8> { - BWERR1T_W::new(self) + pub fn bwerr1t(&mut self) -> BWERR1T_W { + BWERR1T_W::new(self, 8) } #[doc = "Bit 12 - Die Temperature Too High Trap Clear"] #[inline(always)] #[must_use] - pub fn temphit(&mut self) -> TEMPHIT_W<12> { - TEMPHIT_W::new(self) + pub fn temphit(&mut self) -> TEMPHIT_W { + TEMPHIT_W::new(self, 12) } #[doc = "Bit 13 - Die Temperature Too Low Trap Clear"] #[inline(always)] #[must_use] - pub fn templot(&mut self) -> TEMPLOT_W<13> { - TEMPLOT_W::new(self) + pub fn templot(&mut self) -> TEMPLOT_W { + TEMPLOT_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Trap Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trapclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TRAPCLR_SPEC; impl crate::RegisterSpec for TRAPCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [trapclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`trapclr::W`](W) writer structure"] impl crate::Writable for TRAPCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_trap/trapdis.rs b/src/scu_trap/trapdis.rs index ec147368..5ef6fb47 100644 --- a/src/scu_trap/trapdis.rs +++ b/src/scu_trap/trapdis.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SOSCWDGT` reader - System OSC WDT Trap Disable"] pub type SOSCWDGT_R = crate::BitReader; #[doc = "System OSC WDT Trap Disable\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl SOSCWDGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SOSCWDGT_A { + pub const fn variant(&self) -> SOSCWDGT_A { match self.bits { false => SOSCWDGT_A::VALUE1, true => SOSCWDGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SOSCWDGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SOSCWDGT_A::VALUE2 } } #[doc = "Field `SOSCWDGT` writer - System OSC WDT Trap Disable"] -pub type SOSCWDGT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, SOSCWDGT_A, O>; -impl<'a, const O: u8> SOSCWDGT_W<'a, O> { +pub type SOSCWDGT_W<'a, REG> = crate::BitWriter<'a, REG, SOSCWDGT_A>; +impl<'a, REG> SOSCWDGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SOSCWDGT_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SOSCWDGT_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl SVCOLCKT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SVCOLCKT_A { + pub const fn variant(&self) -> SVCOLCKT_A { match self.bits { false => SVCOLCKT_A::VALUE1, true => SVCOLCKT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SVCOLCKT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SVCOLCKT_A::VALUE2 } } #[doc = "Field `SVCOLCKT` writer - System VCO Lock Trap Disable"] -pub type SVCOLCKT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, SVCOLCKT_A, O>; -impl<'a, const O: u8> SVCOLCKT_W<'a, O> { +pub type SVCOLCKT_W<'a, REG> = crate::BitWriter<'a, REG, SVCOLCKT_A>; +impl<'a, REG> SVCOLCKT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SVCOLCKT_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SVCOLCKT_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl UVCOLCKT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UVCOLCKT_A { + pub const fn variant(&self) -> UVCOLCKT_A { match self.bits { false => UVCOLCKT_A::VALUE1, true => UVCOLCKT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UVCOLCKT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UVCOLCKT_A::VALUE2 } } #[doc = "Field `UVCOLCKT` writer - USB VCO Lock Trap Disable"] -pub type UVCOLCKT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, UVCOLCKT_A, O>; -impl<'a, const O: u8> UVCOLCKT_W<'a, O> { +pub type UVCOLCKT_W<'a, REG> = crate::BitWriter<'a, REG, UVCOLCKT_A>; +impl<'a, REG> UVCOLCKT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UVCOLCKT_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UVCOLCKT_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl PET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PET_A { + pub const fn variant(&self) -> PET_A { match self.bits { false => PET_A::VALUE1, true => PET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PET_A::VALUE2 } } #[doc = "Field `PET` writer - Parity Error Trap Disable"] -pub type PET_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, PET_A, O>; -impl<'a, const O: u8> PET_W<'a, O> { +pub type PET_W<'a, REG> = crate::BitWriter<'a, REG, PET_A>; +impl<'a, REG> PET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PET_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PET_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl BRWNT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRWNT_A { + pub const fn variant(&self) -> BRWNT_A { match self.bits { false => BRWNT_A::VALUE1, true => BRWNT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRWNT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRWNT_A::VALUE2 } } #[doc = "Field `BRWNT` writer - Brown Out Trap Disable"] -pub type BRWNT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, BRWNT_A, O>; -impl<'a, const O: u8> BRWNT_W<'a, O> { +pub type BRWNT_W<'a, REG> = crate::BitWriter<'a, REG, BRWNT_A>; +impl<'a, REG> BRWNT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRWNT_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRWNT_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl ULPWDGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ULPWDGT_A { + pub const fn variant(&self) -> ULPWDGT_A { match self.bits { false => ULPWDGT_A::VALUE1, true => ULPWDGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ULPWDGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ULPWDGT_A::VALUE2 } } #[doc = "Field `ULPWDGT` writer - Wake-up Trap Disable"] -pub type ULPWDGT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, ULPWDGT_A, O>; -impl<'a, const O: u8> ULPWDGT_W<'a, O> { +pub type ULPWDGT_W<'a, REG> = crate::BitWriter<'a, REG, ULPWDGT_A>; +impl<'a, REG> ULPWDGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ULPWDGT_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ULPWDGT_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl BWERR0T_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BWERR0T_A { + pub const fn variant(&self) -> BWERR0T_A { match self.bits { false => BWERR0T_A::VALUE1, true => BWERR0T_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BWERR0T_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BWERR0T_A::VALUE2 } } #[doc = "Field `BWERR0T` writer - Peripheral Bridge 0 Trap Disable"] -pub type BWERR0T_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, BWERR0T_A, O>; -impl<'a, const O: u8> BWERR0T_W<'a, O> { +pub type BWERR0T_W<'a, REG> = crate::BitWriter<'a, REG, BWERR0T_A>; +impl<'a, REG> BWERR0T_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BWERR0T_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BWERR0T_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl BWERR1T_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BWERR1T_A { + pub const fn variant(&self) -> BWERR1T_A { match self.bits { false => BWERR1T_A::VALUE1, true => BWERR1T_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BWERR1T_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BWERR1T_A::VALUE2 } } #[doc = "Field `BWERR1T` writer - Peripheral Bridge 1 Trap Disable"] -pub type BWERR1T_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, BWERR1T_A, O>; -impl<'a, const O: u8> BWERR1T_W<'a, O> { +pub type BWERR1T_W<'a, REG> = crate::BitWriter<'a, REG, BWERR1T_A>; +impl<'a, REG> BWERR1T_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BWERR1T_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BWERR1T_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl TEMPHIT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TEMPHIT_A { + pub const fn variant(&self) -> TEMPHIT_A { match self.bits { false => TEMPHIT_A::VALUE1, true => TEMPHIT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TEMPHIT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TEMPHIT_A::VALUE2 } } #[doc = "Field `TEMPHIT` writer - Die Temperature Too High Trap Disable"] -pub type TEMPHIT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, TEMPHIT_A, O>; -impl<'a, const O: u8> TEMPHIT_W<'a, O> { +pub type TEMPHIT_W<'a, REG> = crate::BitWriter<'a, REG, TEMPHIT_A>; +impl<'a, REG> TEMPHIT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TEMPHIT_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TEMPHIT_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl TEMPLOT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TEMPLOT_A { + pub const fn variant(&self) -> TEMPLOT_A { match self.bits { false => TEMPLOT_A::VALUE1, true => TEMPLOT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trap request enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TEMPLOT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trap request disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TEMPLOT_A::VALUE2 } } #[doc = "Field `TEMPLOT` writer - Die Temperature Too Low Trap Disable"] -pub type TEMPLOT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPDIS_SPEC, TEMPLOT_A, O>; -impl<'a, const O: u8> TEMPLOT_W<'a, O> { +pub type TEMPLOT_W<'a, REG> = crate::BitWriter<'a, REG, TEMPLOT_A>; +impl<'a, REG> TEMPLOT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trap request enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TEMPLOT_A::VALUE1) } #[doc = "Trap request disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TEMPLOT_A::VALUE2) } } @@ -590,82 +588,83 @@ impl W { #[doc = "Bit 0 - System OSC WDT Trap Disable"] #[inline(always)] #[must_use] - pub fn soscwdgt(&mut self) -> SOSCWDGT_W<0> { - SOSCWDGT_W::new(self) + pub fn soscwdgt(&mut self) -> SOSCWDGT_W { + SOSCWDGT_W::new(self, 0) } #[doc = "Bit 2 - System VCO Lock Trap Disable"] #[inline(always)] #[must_use] - pub fn svcolckt(&mut self) -> SVCOLCKT_W<2> { - SVCOLCKT_W::new(self) + pub fn svcolckt(&mut self) -> SVCOLCKT_W { + SVCOLCKT_W::new(self, 2) } #[doc = "Bit 3 - USB VCO Lock Trap Disable"] #[inline(always)] #[must_use] - pub fn uvcolckt(&mut self) -> UVCOLCKT_W<3> { - UVCOLCKT_W::new(self) + pub fn uvcolckt(&mut self) -> UVCOLCKT_W { + UVCOLCKT_W::new(self, 3) } #[doc = "Bit 4 - Parity Error Trap Disable"] #[inline(always)] #[must_use] - pub fn pet(&mut self) -> PET_W<4> { - PET_W::new(self) + pub fn pet(&mut self) -> PET_W { + PET_W::new(self, 4) } #[doc = "Bit 5 - Brown Out Trap Disable"] #[inline(always)] #[must_use] - pub fn brwnt(&mut self) -> BRWNT_W<5> { - BRWNT_W::new(self) + pub fn brwnt(&mut self) -> BRWNT_W { + BRWNT_W::new(self, 5) } #[doc = "Bit 6 - Wake-up Trap Disable"] #[inline(always)] #[must_use] - pub fn ulpwdgt(&mut self) -> ULPWDGT_W<6> { - ULPWDGT_W::new(self) + pub fn ulpwdgt(&mut self) -> ULPWDGT_W { + ULPWDGT_W::new(self, 6) } #[doc = "Bit 7 - Peripheral Bridge 0 Trap Disable"] #[inline(always)] #[must_use] - pub fn bwerr0t(&mut self) -> BWERR0T_W<7> { - BWERR0T_W::new(self) + pub fn bwerr0t(&mut self) -> BWERR0T_W { + BWERR0T_W::new(self, 7) } #[doc = "Bit 8 - Peripheral Bridge 1 Trap Disable"] #[inline(always)] #[must_use] - pub fn bwerr1t(&mut self) -> BWERR1T_W<8> { - BWERR1T_W::new(self) + pub fn bwerr1t(&mut self) -> BWERR1T_W { + BWERR1T_W::new(self, 8) } #[doc = "Bit 12 - Die Temperature Too High Trap Disable"] #[inline(always)] #[must_use] - pub fn temphit(&mut self) -> TEMPHIT_W<12> { - TEMPHIT_W::new(self) + pub fn temphit(&mut self) -> TEMPHIT_W { + TEMPHIT_W::new(self, 12) } #[doc = "Bit 13 - Die Temperature Too Low Trap Disable"] #[inline(always)] #[must_use] - pub fn templot(&mut self) -> TEMPLOT_W<13> { - TEMPLOT_W::new(self) + pub fn templot(&mut self) -> TEMPLOT_W { + TEMPLOT_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Trap Disable Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trapdis::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trapdis::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`trapdis::R`](R) reader structure"] +impl crate::Readable for TRAPDIS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`trapdis::W`](W) writer structure"] impl crate::Writable for TRAPDIS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_trap/trapraw.rs b/src/scu_trap/trapraw.rs index 2e413de2..2a2f0598 100644 --- a/src/scu_trap/trapraw.rs +++ b/src/scu_trap/trapraw.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `SOSCWDGT` reader - System OSC WDT Trap Raw Status"] pub type SOSCWDGT_R = crate::BitReader; #[doc = "System OSC WDT Trap Raw Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl SOSCWDGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SOSCWDGT_A { + pub const fn variant(&self) -> SOSCWDGT_A { match self.bits { false => SOSCWDGT_A::VALUE1, true => SOSCWDGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SOSCWDGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SOSCWDGT_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl SVCOLCKT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SVCOLCKT_A { + pub const fn variant(&self) -> SVCOLCKT_A { match self.bits { false => SVCOLCKT_A::VALUE1, true => SVCOLCKT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SVCOLCKT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SVCOLCKT_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl UVCOLCKT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UVCOLCKT_A { + pub const fn variant(&self) -> UVCOLCKT_A { match self.bits { false => UVCOLCKT_A::VALUE1, true => UVCOLCKT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UVCOLCKT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UVCOLCKT_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl PET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PET_A { + pub const fn variant(&self) -> PET_A { match self.bits { false => PET_A::VALUE1, true => PET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PET_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl BRWNT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRWNT_A { + pub const fn variant(&self) -> BRWNT_A { match self.bits { false => BRWNT_A::VALUE1, true => BRWNT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRWNT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRWNT_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl ULPWDGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ULPWDGT_A { + pub const fn variant(&self) -> ULPWDGT_A { match self.bits { false => ULPWDGT_A::VALUE1, true => ULPWDGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ULPWDGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ULPWDGT_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl BWERR0T_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BWERR0T_A { + pub const fn variant(&self) -> BWERR0T_A { match self.bits { false => BWERR0T_A::VALUE1, true => BWERR0T_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BWERR0T_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BWERR0T_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl BWERR1T_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BWERR1T_A { + pub const fn variant(&self) -> BWERR1T_A { match self.bits { false => BWERR1T_A::VALUE1, true => BWERR1T_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BWERR1T_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BWERR1T_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl TEMPHIT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TEMPHIT_A { + pub const fn variant(&self) -> TEMPHIT_A { match self.bits { false => TEMPHIT_A::VALUE1, true => TEMPHIT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TEMPHIT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TEMPHIT_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl TEMPLOT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TEMPLOT_A { + pub const fn variant(&self) -> TEMPLOT_A { match self.bits { false => TEMPLOT_A::VALUE1, true => TEMPLOT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TEMPLOT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TEMPLOT_A::VALUE2 @@ -425,15 +412,13 @@ impl R { TEMPLOT_R::new(((self.bits >> 13) & 1) != 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"] +#[doc = "Trap Raw Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trapraw::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`trapraw::R`](R) reader structure"] +impl crate::Readable for TRAPRAW_SPEC {} #[doc = "`reset()` method sets TRAPRAW to value 0"] impl crate::Resettable for TRAPRAW_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/scu_trap/trapset.rs b/src/scu_trap/trapset.rs index bb59d025..3056c7a8 100644 --- a/src/scu_trap/trapset.rs +++ b/src/scu_trap/trapset.rs @@ -1,24 +1,5 @@ #[doc = "Register `TRAPSET` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "System OSC WDT Trap Set\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum SOSCWDGT_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `SOSCWDGT` writer - System OSC WDT Trap Set"] -pub type SOSCWDGT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, SOSCWDGT_AW, O>; -impl<'a, const O: u8> SOSCWDGT_W<'a, O> { +pub type SOSCWDGT_W<'a, REG> = crate::BitWriter<'a, REG, SOSCWDGT_AW>; +impl<'a, REG> SOSCWDGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SOSCWDGT_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SOSCWDGT_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `SVCOLCKT` writer - System VCO Lock Trap Set"] -pub type SVCOLCKT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, SVCOLCKT_AW, O>; -impl<'a, const O: u8> SVCOLCKT_W<'a, O> { +pub type SVCOLCKT_W<'a, REG> = crate::BitWriter<'a, REG, SVCOLCKT_AW>; +impl<'a, REG> SVCOLCKT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SVCOLCKT_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SVCOLCKT_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `UVCOLCKT` writer - USB VCO Lock Trap Set"] -pub type UVCOLCKT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, UVCOLCKT_AW, O>; -impl<'a, const O: u8> UVCOLCKT_W<'a, O> { +pub type UVCOLCKT_W<'a, REG> = crate::BitWriter<'a, REG, UVCOLCKT_AW>; +impl<'a, REG> UVCOLCKT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(UVCOLCKT_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(UVCOLCKT_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `PET` writer - Parity Error Trap Set"] -pub type PET_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, PET_AW, O>; -impl<'a, const O: u8> PET_W<'a, O> { +pub type PET_W<'a, REG> = crate::BitWriter<'a, REG, PET_AW>; +impl<'a, REG> PET_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PET_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PET_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `BRWNT` writer - Brown Out Trap Set"] -pub type BRWNT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, BRWNT_AW, O>; -impl<'a, const O: u8> BRWNT_W<'a, O> { +pub type BRWNT_W<'a, REG> = crate::BitWriter<'a, REG, BRWNT_AW>; +impl<'a, REG> BRWNT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRWNT_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRWNT_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `ULPWDT` writer - OSC_ULP WDG Trap Set"] -pub type ULPWDT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, ULPWDT_AW, O>; -impl<'a, const O: u8> ULPWDT_W<'a, O> { +pub type ULPWDT_W<'a, REG> = crate::BitWriter<'a, REG, ULPWDT_AW>; +impl<'a, REG> ULPWDT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ULPWDT_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ULPWDT_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `BWERR0T` writer - Peripheral Bridge 0 Trap Set"] -pub type BWERR0T_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, BWERR0T_AW, O>; -impl<'a, const O: u8> BWERR0T_W<'a, O> { +pub type BWERR0T_W<'a, REG> = crate::BitWriter<'a, REG, BWERR0T_AW>; +impl<'a, REG> BWERR0T_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BWERR0T_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BWERR0T_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `BWERR1T` writer - Peripheral Bridge 1 Trap Set"] -pub type BWERR1T_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, BWERR1T_AW, O>; -impl<'a, const O: u8> BWERR1T_W<'a, O> { +pub type BWERR1T_W<'a, REG> = crate::BitWriter<'a, REG, BWERR1T_AW>; +impl<'a, REG> BWERR1T_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BWERR1T_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BWERR1T_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `TEMPHIT` writer - Die Temperature Too High Trap Set"] -pub type TEMPHIT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, TEMPHIT_AW, O>; -impl<'a, const O: u8> TEMPHIT_W<'a, O> { +pub type TEMPHIT_W<'a, REG> = crate::BitWriter<'a, REG, TEMPHIT_AW>; +impl<'a, REG> TEMPHIT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TEMPHIT_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TEMPHIT_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `TEMPLOT` writer - Die Temperature Too Low Trap Set"] -pub type TEMPLOT_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRAPSET_SPEC, TEMPLOT_AW, O>; -impl<'a, const O: u8> TEMPLOT_W<'a, O> { +pub type TEMPLOT_W<'a, REG> = crate::BitWriter<'a, REG, TEMPLOT_AW>; +impl<'a, REG> TEMPLOT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TEMPLOT_AW::VALUE1) } #[doc = "Set trap request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TEMPLOT_AW::VALUE2) } } @@ -303,78 +314,81 @@ impl W { #[doc = "Bit 0 - System OSC WDT Trap Set"] #[inline(always)] #[must_use] - pub fn soscwdgt(&mut self) -> SOSCWDGT_W<0> { - SOSCWDGT_W::new(self) + pub fn soscwdgt(&mut self) -> SOSCWDGT_W { + SOSCWDGT_W::new(self, 0) } #[doc = "Bit 2 - System VCO Lock Trap Set"] #[inline(always)] #[must_use] - pub fn svcolckt(&mut self) -> SVCOLCKT_W<2> { - SVCOLCKT_W::new(self) + pub fn svcolckt(&mut self) -> SVCOLCKT_W { + SVCOLCKT_W::new(self, 2) } #[doc = "Bit 3 - USB VCO Lock Trap Set"] #[inline(always)] #[must_use] - pub fn uvcolckt(&mut self) -> UVCOLCKT_W<3> { - UVCOLCKT_W::new(self) + pub fn uvcolckt(&mut self) -> UVCOLCKT_W { + UVCOLCKT_W::new(self, 3) } #[doc = "Bit 4 - Parity Error Trap Set"] #[inline(always)] #[must_use] - pub fn pet(&mut self) -> PET_W<4> { - PET_W::new(self) + pub fn pet(&mut self) -> PET_W { + PET_W::new(self, 4) } #[doc = "Bit 5 - Brown Out Trap Set"] #[inline(always)] #[must_use] - pub fn brwnt(&mut self) -> BRWNT_W<5> { - BRWNT_W::new(self) + pub fn brwnt(&mut self) -> BRWNT_W { + BRWNT_W::new(self, 5) } #[doc = "Bit 6 - OSC_ULP WDG Trap Set"] #[inline(always)] #[must_use] - pub fn ulpwdt(&mut self) -> ULPWDT_W<6> { - ULPWDT_W::new(self) + pub fn ulpwdt(&mut self) -> ULPWDT_W { + ULPWDT_W::new(self, 6) } #[doc = "Bit 7 - Peripheral Bridge 0 Trap Set"] #[inline(always)] #[must_use] - pub fn bwerr0t(&mut self) -> BWERR0T_W<7> { - BWERR0T_W::new(self) + pub fn bwerr0t(&mut self) -> BWERR0T_W { + BWERR0T_W::new(self, 7) } #[doc = "Bit 8 - Peripheral Bridge 1 Trap Set"] #[inline(always)] #[must_use] - pub fn bwerr1t(&mut self) -> BWERR1T_W<8> { - BWERR1T_W::new(self) + pub fn bwerr1t(&mut self) -> BWERR1T_W { + BWERR1T_W::new(self, 8) } #[doc = "Bit 12 - Die Temperature Too High Trap Set"] #[inline(always)] #[must_use] - pub fn temphit(&mut self) -> TEMPHIT_W<12> { - TEMPHIT_W::new(self) + pub fn temphit(&mut self) -> TEMPHIT_W { + TEMPHIT_W::new(self, 12) } #[doc = "Bit 13 - Die Temperature Too Low Trap Set"] #[inline(always)] #[must_use] - pub fn templot(&mut self) -> TEMPLOT_W<13> { - TEMPLOT_W::new(self) + pub fn templot(&mut self) -> TEMPLOT_W { + TEMPLOT_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Trap Set Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trapset::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TRAPSET_SPEC; impl crate::RegisterSpec for TRAPSET_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [trapset::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`trapset::W`](W) writer structure"] impl crate::Writable for TRAPSET_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/scu_trap/trapstat.rs b/src/scu_trap/trapstat.rs index 57d3a4f4..1890b445 100644 --- a/src/scu_trap/trapstat.rs +++ b/src/scu_trap/trapstat.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `SOSCWDGT` reader - System OSC WDT Trap Status"] pub type SOSCWDGT_R = crate::BitReader; #[doc = "System OSC WDT Trap Status\n\nValue on reset: 0"] @@ -32,18 +19,18 @@ impl From for bool { impl SOSCWDGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SOSCWDGT_A { + pub const fn variant(&self) -> SOSCWDGT_A { match self.bits { false => SOSCWDGT_A::VALUE1, true => SOSCWDGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SOSCWDGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SOSCWDGT_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl SVCOLCKT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SVCOLCKT_A { + pub const fn variant(&self) -> SVCOLCKT_A { match self.bits { false => SVCOLCKT_A::VALUE1, true => SVCOLCKT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SVCOLCKT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SVCOLCKT_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl UVCOLCKT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> UVCOLCKT_A { + pub const fn variant(&self) -> UVCOLCKT_A { match self.bits { false => UVCOLCKT_A::VALUE1, true => UVCOLCKT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == UVCOLCKT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == UVCOLCKT_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl PET_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PET_A { + pub const fn variant(&self) -> PET_A { match self.bits { false => PET_A::VALUE1, true => PET_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PET_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PET_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl BRWNT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRWNT_A { + pub const fn variant(&self) -> BRWNT_A { match self.bits { false => BRWNT_A::VALUE1, true => BRWNT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRWNT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRWNT_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl ULPWDGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ULPWDGT_A { + pub const fn variant(&self) -> ULPWDGT_A { match self.bits { false => ULPWDGT_A::VALUE1, true => ULPWDGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ULPWDGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ULPWDGT_A::VALUE2 @@ -248,18 +235,18 @@ impl From for bool { impl BWERR0T_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BWERR0T_A { + pub const fn variant(&self) -> BWERR0T_A { match self.bits { false => BWERR0T_A::VALUE1, true => BWERR0T_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BWERR0T_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BWERR0T_A::VALUE2 @@ -284,18 +271,18 @@ impl From for bool { impl BWERR1T_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BWERR1T_A { + pub const fn variant(&self) -> BWERR1T_A { match self.bits { false => BWERR1T_A::VALUE1, true => BWERR1T_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BWERR1T_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BWERR1T_A::VALUE2 @@ -320,18 +307,18 @@ impl From for bool { impl TEMPHIT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TEMPHIT_A { + pub const fn variant(&self) -> TEMPHIT_A { match self.bits { false => TEMPHIT_A::VALUE1, true => TEMPHIT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TEMPHIT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TEMPHIT_A::VALUE2 @@ -356,18 +343,18 @@ impl From for bool { impl TEMPLOT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TEMPLOT_A { + pub const fn variant(&self) -> TEMPLOT_A { match self.bits { false => TEMPLOT_A::VALUE1, true => TEMPLOT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No pending trap request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TEMPLOT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Pending trap request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TEMPLOT_A::VALUE2 @@ -425,15 +412,13 @@ impl R { TEMPLOT_R::new(((self.bits >> 13) & 1) != 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"] +#[doc = "Trap Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trapstat::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`trapstat::R`](R) reader structure"] +impl crate::Readable for TRAPSTAT_SPEC {} #[doc = "`reset()` method sets TRAPSTAT to value 0"] impl crate::Resettable for TRAPSTAT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0.rs b/src/usb0.rs index 9ddf797b..3e45e3b4 100644 --- a/src/usb0.rs +++ b/src/usb0.rs @@ -1,322 +1,507 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Control and Status Register"] - pub gotgctl: GOTGCTL, - #[doc = "0x04 - OTG Interrupt Register"] - pub gotgint: GOTGINT, - #[doc = "0x08 - AHB Configuration Register"] - pub gahbcfg: GAHBCFG, - #[doc = "0x0c - USB Configuration Register"] - pub gusbcfg: GUSBCFG, - #[doc = "0x10 - Reset Register"] - pub grstctl: GRSTCTL, + gotgctl: GOTGCTL, + gotgint: GOTGINT, + gahbcfg: GAHBCFG, + gusbcfg: GUSBCFG, + grstctl: GRSTCTL, _reserved_5_gintsts: [u8; 0x04], _reserved_6_gintmsk: [u8; 0x04], _reserved_7_grxstsr: [u8; 0x04], _reserved_8_grxstsp: [u8; 0x04], - #[doc = "0x24 - Receive FIFO Size Register"] - pub grxfsiz: GRXFSIZ, + grxfsiz: GRXFSIZ, _reserved_10_gnptxfsiz: [u8; 0x04], - #[doc = "0x2c - Non-Periodic Transmit FIFO/Queue Status Register"] - pub gnptxsts: GNPTXSTS, + gnptxsts: GNPTXSTS, _reserved12: [u8; 0x0c], - #[doc = "0x3c - USB Module Identification Register"] - pub guid: GUID, + guid: GUID, _reserved13: [u8; 0x1c], - #[doc = "0x5c - Global DFIFO Software Config Register"] - pub gdfifocfg: GDFIFOCFG, + gdfifocfg: GDFIFOCFG, _reserved14: [u8; 0xa0], - #[doc = "0x100 - Host Periodic Transmit FIFO Size Register"] - pub hptxfsiz: HPTXFSIZ, - #[doc = "0x104 - Device IN Endpoint Transmit FIFO Size Register"] - pub dieptxf1: DIEPTXF1, - #[doc = "0x108 - Device IN Endpoint Transmit FIFO Size Register"] - pub dieptxf2: DIEPTXF2, - #[doc = "0x10c - Device IN Endpoint Transmit FIFO Size Register"] - pub dieptxf3: DIEPTXF3, - #[doc = "0x110 - Device IN Endpoint Transmit FIFO Size Register"] - pub dieptxf4: DIEPTXF4, - #[doc = "0x114 - Device IN Endpoint Transmit FIFO Size Register"] - pub dieptxf5: DIEPTXF5, - #[doc = "0x118 - Device IN Endpoint Transmit FIFO Size Register"] - pub dieptxf6: DIEPTXF6, + hptxfsiz: HPTXFSIZ, + dieptxf1: DIEPTXF1, + dieptxf2: DIEPTXF2, + dieptxf3: DIEPTXF3, + dieptxf4: DIEPTXF4, + dieptxf5: DIEPTXF5, + dieptxf6: DIEPTXF6, _reserved21: [u8; 0x02e4], - #[doc = "0x400 - Host Configuration Register"] - pub hcfg: HCFG, - #[doc = "0x404 - Host Frame Interval Register"] - pub hfir: HFIR, - #[doc = "0x408 - Host Frame Number/Frame Time Remaining Register"] - pub hfnum: HFNUM, + hcfg: HCFG, + hfir: HFIR, + hfnum: HFNUM, _reserved24: [u8; 0x04], - #[doc = "0x410 - Host Periodic Transmit FIFO/ Queue Status Register"] - pub hptxsts: HPTXSTS, - #[doc = "0x414 - Host All Channels Interrupt Register"] - pub haint: HAINT, - #[doc = "0x418 - Host All Channels Interrupt Mask Register"] - pub haintmsk: HAINTMSK, - #[doc = "0x41c - Host Frame List Base Address Register"] - pub hflbaddr: HFLBADDR, + hptxsts: HPTXSTS, + haint: HAINT, + haintmsk: HAINTMSK, + hflbaddr: HFLBADDR, _reserved28: [u8; 0x20], - #[doc = "0x440 - Host Port Control and Status Register"] - pub hprt: HPRT, + hprt: HPRT, _reserved29: [u8; 0x03bc], - #[doc = "0x800 - Device Configuration Register"] - pub dcfg: DCFG, - #[doc = "0x804 - Device Control Register"] - pub dctl: DCTL, - #[doc = "0x808 - Device Status Register"] - pub dsts: DSTS, + dcfg: DCFG, + dctl: DCTL, + dsts: DSTS, _reserved32: [u8; 0x04], - #[doc = "0x810 - Device IN Endpoint Common Interrupt Mask Register"] - pub diepmsk: DIEPMSK, - #[doc = "0x814 - Device OUT Endpoint Common Interrupt Mask Register"] - pub doepmsk: DOEPMSK, - #[doc = "0x818 - Device All Endpoints Interrupt Register"] - pub daint: DAINT, - #[doc = "0x81c - Device All Endpoints Interrupt Mask Register"] - pub daintmsk: DAINTMSK, + diepmsk: DIEPMSK, + doepmsk: DOEPMSK, + daint: DAINT, + daintmsk: DAINTMSK, _reserved36: [u8; 0x08], - #[doc = "0x828 - Device VBUS Discharge Time Register"] - pub dvbusdis: DVBUSDIS, - #[doc = "0x82c - Device VBUS Pulsing Time Register"] - pub dvbuspulse: DVBUSPULSE, + dvbusdis: DVBUSDIS, + dvbuspulse: DVBUSPULSE, _reserved38: [u8; 0x04], - #[doc = "0x834 - Device IN Endpoint FIFO Empty Interrupt Mask Register"] - pub diepempmsk: DIEPEMPMSK, + diepempmsk: DIEPEMPMSK, _reserved39: [u8; 0x05c8], - #[doc = "0xe00 - Power and Clock Gating Control Register"] - pub pcgcctl: PCGCCTL, + pcgcctl: PCGCCTL, } impl RegisterBlock { + #[doc = "0x00 - Control and Status Register"] + #[inline(always)] + pub const fn gotgctl(&self) -> &GOTGCTL { + &self.gotgctl + } + #[doc = "0x04 - OTG Interrupt Register"] + #[inline(always)] + pub const fn gotgint(&self) -> &GOTGINT { + &self.gotgint + } + #[doc = "0x08 - AHB Configuration Register"] + #[inline(always)] + pub const fn gahbcfg(&self) -> &GAHBCFG { + &self.gahbcfg + } + #[doc = "0x0c - USB Configuration Register"] + #[inline(always)] + pub const fn gusbcfg(&self) -> &GUSBCFG { + &self.gusbcfg + } + #[doc = "0x10 - Reset Register"] + #[inline(always)] + pub const fn grstctl(&self) -> &GRSTCTL { + &self.grstctl + } #[doc = "0x14 - Interrupt Register \\[DEVICEMODE\\]"] #[inline(always)] pub const fn gintsts_devicemode(&self) -> &GINTSTS_DEVICEMODE { - unsafe { &*(self as *const Self).cast::().add(20usize).cast() } + unsafe { &*(self as *const Self).cast::().add(20).cast() } } #[doc = "0x14 - Interrupt Register \\[HOSTMODE\\]"] #[inline(always)] pub const fn gintsts_hostmode(&self) -> &GINTSTS_HOSTMODE { - unsafe { &*(self as *const Self).cast::().add(20usize).cast() } + unsafe { &*(self as *const Self).cast::().add(20).cast() } } #[doc = "0x18 - Interrupt Mask Register \\[DEVICEMODE\\]"] #[inline(always)] pub const fn gintmsk_devicemode(&self) -> &GINTMSK_DEVICEMODE { - unsafe { &*(self as *const Self).cast::().add(24usize).cast() } + unsafe { &*(self as *const Self).cast::().add(24).cast() } } #[doc = "0x18 - Interrupt Mask Register \\[HOSTMODE\\]"] #[inline(always)] pub const fn gintmsk_hostmode(&self) -> &GINTMSK_HOSTMODE { - unsafe { &*(self as *const Self).cast::().add(24usize).cast() } + unsafe { &*(self as *const Self).cast::().add(24).cast() } } #[doc = "0x1c - Receive Status Debug Read Register \\[DEVICEMODE\\]"] #[inline(always)] pub const fn grxstsr_devicemode(&self) -> &GRXSTSR_DEVICEMODE { - unsafe { &*(self as *const Self).cast::().add(28usize).cast() } + unsafe { &*(self as *const Self).cast::().add(28).cast() } } #[doc = "0x1c - Receive Status Debug Read Register \\[HOSTMODE\\]"] #[inline(always)] pub const fn grxstsr_hostmode(&self) -> &GRXSTSR_HOSTMODE { - unsafe { &*(self as *const Self).cast::().add(28usize).cast() } + unsafe { &*(self as *const Self).cast::().add(28).cast() } } #[doc = "0x20 - Receive Status Read and Pop Register \\[HOSTMODE\\]"] #[inline(always)] pub const fn grxstsp_hostmode(&self) -> &GRXSTSP_HOSTMODE { - unsafe { &*(self as *const Self).cast::().add(32usize).cast() } + unsafe { &*(self as *const Self).cast::().add(32).cast() } } #[doc = "0x20 - Receive Status Read and Pop Register \\[DEVICEMODE\\]"] #[inline(always)] pub const fn grxstsp_devicemode(&self) -> &GRXSTSP_DEVICEMODE { - unsafe { &*(self as *const Self).cast::().add(32usize).cast() } + unsafe { &*(self as *const Self).cast::().add(32).cast() } + } + #[doc = "0x24 - Receive FIFO Size Register"] + #[inline(always)] + pub const fn grxfsiz(&self) -> &GRXFSIZ { + &self.grxfsiz } #[doc = "0x28 - Non-Periodic Transmit FIFO Size Register \\[DEVICEMODE\\]"] #[inline(always)] pub const fn gnptxfsiz_devicemode(&self) -> &GNPTXFSIZ_DEVICEMODE { - unsafe { &*(self as *const Self).cast::().add(40usize).cast() } + unsafe { &*(self as *const Self).cast::().add(40).cast() } } #[doc = "0x28 - Non-Periodic Transmit FIFO Size Register \\[HOSTMODE\\]"] #[inline(always)] pub const fn gnptxfsiz_hostmode(&self) -> &GNPTXFSIZ_HOSTMODE { - unsafe { &*(self as *const Self).cast::().add(40usize).cast() } + unsafe { &*(self as *const Self).cast::().add(40).cast() } + } + #[doc = "0x2c - Non-Periodic Transmit FIFO/Queue Status Register"] + #[inline(always)] + pub const fn gnptxsts(&self) -> &GNPTXSTS { + &self.gnptxsts + } + #[doc = "0x3c - USB Module Identification Register"] + #[inline(always)] + pub const fn guid(&self) -> &GUID { + &self.guid + } + #[doc = "0x5c - Global DFIFO Software Config Register"] + #[inline(always)] + pub const fn gdfifocfg(&self) -> &GDFIFOCFG { + &self.gdfifocfg + } + #[doc = "0x100 - Host Periodic Transmit FIFO Size Register"] + #[inline(always)] + pub const fn hptxfsiz(&self) -> &HPTXFSIZ { + &self.hptxfsiz + } + #[doc = "0x104 - Device IN Endpoint Transmit FIFO Size Register"] + #[inline(always)] + pub const fn dieptxf1(&self) -> &DIEPTXF1 { + &self.dieptxf1 + } + #[doc = "0x108 - Device IN Endpoint Transmit FIFO Size Register"] + #[inline(always)] + pub const fn dieptxf2(&self) -> &DIEPTXF2 { + &self.dieptxf2 + } + #[doc = "0x10c - Device IN Endpoint Transmit FIFO Size Register"] + #[inline(always)] + pub const fn dieptxf3(&self) -> &DIEPTXF3 { + &self.dieptxf3 + } + #[doc = "0x110 - Device IN Endpoint Transmit FIFO Size Register"] + #[inline(always)] + pub const fn dieptxf4(&self) -> &DIEPTXF4 { + &self.dieptxf4 + } + #[doc = "0x114 - Device IN Endpoint Transmit FIFO Size Register"] + #[inline(always)] + pub const fn dieptxf5(&self) -> &DIEPTXF5 { + &self.dieptxf5 + } + #[doc = "0x118 - Device IN Endpoint Transmit FIFO Size Register"] + #[inline(always)] + pub const fn dieptxf6(&self) -> &DIEPTXF6 { + &self.dieptxf6 + } + #[doc = "0x400 - Host Configuration Register"] + #[inline(always)] + pub const fn hcfg(&self) -> &HCFG { + &self.hcfg + } + #[doc = "0x404 - Host Frame Interval Register"] + #[inline(always)] + pub const fn hfir(&self) -> &HFIR { + &self.hfir + } + #[doc = "0x408 - Host Frame Number/Frame Time Remaining Register"] + #[inline(always)] + pub const fn hfnum(&self) -> &HFNUM { + &self.hfnum + } + #[doc = "0x410 - Host Periodic Transmit FIFO/ Queue Status Register"] + #[inline(always)] + pub const fn hptxsts(&self) -> &HPTXSTS { + &self.hptxsts + } + #[doc = "0x414 - Host All Channels Interrupt Register"] + #[inline(always)] + pub const fn haint(&self) -> &HAINT { + &self.haint + } + #[doc = "0x418 - Host All Channels Interrupt Mask Register"] + #[inline(always)] + pub const fn haintmsk(&self) -> &HAINTMSK { + &self.haintmsk + } + #[doc = "0x41c - Host Frame List Base Address Register"] + #[inline(always)] + pub const fn hflbaddr(&self) -> &HFLBADDR { + &self.hflbaddr + } + #[doc = "0x440 - Host Port Control and Status Register"] + #[inline(always)] + pub const fn hprt(&self) -> &HPRT { + &self.hprt + } + #[doc = "0x800 - Device Configuration Register"] + #[inline(always)] + pub const fn dcfg(&self) -> &DCFG { + &self.dcfg + } + #[doc = "0x804 - Device Control Register"] + #[inline(always)] + pub const fn dctl(&self) -> &DCTL { + &self.dctl + } + #[doc = "0x808 - Device Status Register"] + #[inline(always)] + pub const fn dsts(&self) -> &DSTS { + &self.dsts + } + #[doc = "0x810 - Device IN Endpoint Common Interrupt Mask Register"] + #[inline(always)] + pub const fn diepmsk(&self) -> &DIEPMSK { + &self.diepmsk + } + #[doc = "0x814 - Device OUT Endpoint Common Interrupt Mask Register"] + #[inline(always)] + pub const fn doepmsk(&self) -> &DOEPMSK { + &self.doepmsk + } + #[doc = "0x818 - Device All Endpoints Interrupt Register"] + #[inline(always)] + pub const fn daint(&self) -> &DAINT { + &self.daint + } + #[doc = "0x81c - Device All Endpoints Interrupt Mask Register"] + #[inline(always)] + pub const fn daintmsk(&self) -> &DAINTMSK { + &self.daintmsk + } + #[doc = "0x828 - Device VBUS Discharge Time Register"] + #[inline(always)] + pub const fn dvbusdis(&self) -> &DVBUSDIS { + &self.dvbusdis + } + #[doc = "0x82c - Device VBUS Pulsing Time Register"] + #[inline(always)] + pub const fn dvbuspulse(&self) -> &DVBUSPULSE { + &self.dvbuspulse + } + #[doc = "0x834 - Device IN Endpoint FIFO Empty Interrupt Mask Register"] + #[inline(always)] + pub const fn diepempmsk(&self) -> &DIEPEMPMSK { + &self.diepempmsk + } + #[doc = "0xe00 - Power and Clock Gating Control Register"] + #[inline(always)] + pub const fn pcgcctl(&self) -> &PCGCCTL { + &self.pcgcctl } } -#[doc = "GOTGCTL (rw) register accessor: an alias for `Reg`"] +#[doc = "GOTGCTL (rw) register accessor: Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gotgctl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gotgctl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gotgctl`] +module"] pub type GOTGCTL = crate::Reg; #[doc = "Control and Status Register"] pub mod gotgctl; -#[doc = "GOTGINT (rw) register accessor: an alias for `Reg`"] +#[doc = "GOTGINT (rw) register accessor: OTG Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gotgint::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gotgint::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gotgint`] +module"] pub type GOTGINT = crate::Reg; #[doc = "OTG Interrupt Register"] pub mod gotgint; -#[doc = "GAHBCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "GAHBCFG (rw) register accessor: AHB Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gahbcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gahbcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gahbcfg`] +module"] pub type GAHBCFG = crate::Reg; #[doc = "AHB Configuration Register"] pub mod gahbcfg; -#[doc = "GUSBCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "GUSBCFG (rw) register accessor: USB Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gusbcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gusbcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gusbcfg`] +module"] pub type GUSBCFG = crate::Reg; #[doc = "USB Configuration Register"] pub mod gusbcfg; -#[doc = "GRSTCTL (rw) register accessor: an alias for `Reg`"] +#[doc = "GRSTCTL (rw) register accessor: Reset Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grstctl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`grstctl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grstctl`] +module"] pub type GRSTCTL = crate::Reg; #[doc = "Reset Register"] pub mod grstctl; -#[doc = "GINTSTS_HOSTMODE (rw) register accessor: an alias for `Reg`"] +#[doc = "GINTSTS_HOSTMODE (rw) register accessor: Interrupt Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintsts_hostmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintsts_hostmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gintsts_hostmode`] +module"] pub type GINTSTS_HOSTMODE = crate::Reg; #[doc = "Interrupt Register \\[HOSTMODE\\]"] pub mod gintsts_hostmode; -#[doc = "GINTSTS_DEVICEMODE (rw) register accessor: an alias for `Reg`"] +#[doc = "GINTSTS_DEVICEMODE (rw) register accessor: Interrupt Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintsts_devicemode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintsts_devicemode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gintsts_devicemode`] +module"] pub type GINTSTS_DEVICEMODE = crate::Reg; #[doc = "Interrupt Register \\[DEVICEMODE\\]"] pub mod gintsts_devicemode; -#[doc = "GINTMSK_HOSTMODE (rw) register accessor: an alias for `Reg`"] +#[doc = "GINTMSK_HOSTMODE (rw) register accessor: Interrupt Mask Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintmsk_hostmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintmsk_hostmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gintmsk_hostmode`] +module"] pub type GINTMSK_HOSTMODE = crate::Reg; #[doc = "Interrupt Mask Register \\[HOSTMODE\\]"] pub mod gintmsk_hostmode; -#[doc = "GINTMSK_DEVICEMODE (rw) register accessor: an alias for `Reg`"] +#[doc = "GINTMSK_DEVICEMODE (rw) register accessor: Interrupt Mask Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintmsk_devicemode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintmsk_devicemode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gintmsk_devicemode`] +module"] pub type GINTMSK_DEVICEMODE = crate::Reg; #[doc = "Interrupt Mask Register \\[DEVICEMODE\\]"] pub mod gintmsk_devicemode; -#[doc = "GRXSTSR_HOSTMODE (r) register accessor: an alias for `Reg`"] +#[doc = "GRXSTSR_HOSTMODE (r) register accessor: Receive Status Debug Read Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxstsr_hostmode::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grxstsr_hostmode`] +module"] pub type GRXSTSR_HOSTMODE = crate::Reg; #[doc = "Receive Status Debug Read Register \\[HOSTMODE\\]"] pub mod grxstsr_hostmode; -#[doc = "GRXSTSR_DEVICEMODE (r) register accessor: an alias for `Reg`"] +#[doc = "GRXSTSR_DEVICEMODE (r) register accessor: Receive Status Debug Read Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxstsr_devicemode::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grxstsr_devicemode`] +module"] pub type GRXSTSR_DEVICEMODE = crate::Reg; #[doc = "Receive Status Debug Read Register \\[DEVICEMODE\\]"] pub mod grxstsr_devicemode; -#[doc = "GRXSTSP_DEVICEMODE (r) register accessor: an alias for `Reg`"] +#[doc = "GRXSTSP_DEVICEMODE (r) register accessor: Receive Status Read and Pop Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxstsp_devicemode::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grxstsp_devicemode`] +module"] pub type GRXSTSP_DEVICEMODE = crate::Reg; #[doc = "Receive Status Read and Pop Register \\[DEVICEMODE\\]"] pub mod grxstsp_devicemode; -#[doc = "GRXSTSP_HOSTMODE (r) register accessor: an alias for `Reg`"] +#[doc = "GRXSTSP_HOSTMODE (r) register accessor: Receive Status Read and Pop Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxstsp_hostmode::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grxstsp_hostmode`] +module"] pub type GRXSTSP_HOSTMODE = crate::Reg; #[doc = "Receive Status Read and Pop Register \\[HOSTMODE\\]"] pub mod grxstsp_hostmode; -#[doc = "GRXFSIZ (rw) register accessor: an alias for `Reg`"] +#[doc = "GRXFSIZ (rw) register accessor: Receive FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxfsiz::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`grxfsiz::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@grxfsiz`] +module"] pub type GRXFSIZ = crate::Reg; #[doc = "Receive FIFO Size Register"] pub mod grxfsiz; -#[doc = "GNPTXFSIZ_HOSTMODE (rw) register accessor: an alias for `Reg`"] +#[doc = "GNPTXFSIZ_HOSTMODE (rw) register accessor: Non-Periodic Transmit FIFO Size Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gnptxfsiz_hostmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gnptxfsiz_hostmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gnptxfsiz_hostmode`] +module"] pub type GNPTXFSIZ_HOSTMODE = crate::Reg; #[doc = "Non-Periodic Transmit FIFO Size Register \\[HOSTMODE\\]"] pub mod gnptxfsiz_hostmode; -#[doc = "GNPTXFSIZ_DEVICEMODE (rw) register accessor: an alias for `Reg`"] +#[doc = "GNPTXFSIZ_DEVICEMODE (rw) register accessor: Non-Periodic Transmit FIFO Size Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gnptxfsiz_devicemode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gnptxfsiz_devicemode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gnptxfsiz_devicemode`] +module"] pub type GNPTXFSIZ_DEVICEMODE = crate::Reg; #[doc = "Non-Periodic Transmit FIFO Size Register \\[DEVICEMODE\\]"] pub mod gnptxfsiz_devicemode; -#[doc = "GNPTXSTS (r) register accessor: an alias for `Reg`"] +#[doc = "GNPTXSTS (r) register accessor: Non-Periodic Transmit FIFO/Queue Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gnptxsts::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gnptxsts`] +module"] pub type GNPTXSTS = crate::Reg; #[doc = "Non-Periodic Transmit FIFO/Queue Status Register"] pub mod gnptxsts; -#[doc = "GUID (rw) register accessor: an alias for `Reg`"] +#[doc = "GUID (rw) register accessor: USB Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`guid::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`guid::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@guid`] +module"] pub type GUID = crate::Reg; #[doc = "USB Module Identification Register"] pub mod guid; -#[doc = "GDFIFOCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "GDFIFOCFG (rw) register accessor: Global DFIFO Software Config Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gdfifocfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gdfifocfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gdfifocfg`] +module"] pub type GDFIFOCFG = crate::Reg; #[doc = "Global DFIFO Software Config Register"] pub mod gdfifocfg; -#[doc = "HPTXFSIZ (rw) register accessor: an alias for `Reg`"] +#[doc = "HPTXFSIZ (rw) register accessor: Host Periodic Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hptxfsiz::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hptxfsiz::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hptxfsiz`] +module"] pub type HPTXFSIZ = crate::Reg; #[doc = "Host Periodic Transmit FIFO Size Register"] pub mod hptxfsiz; -#[doc = "DIEPTXF1 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPTXF1 (rw) register accessor: Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dieptxf1`] +module"] pub type DIEPTXF1 = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Size Register"] pub mod dieptxf1; -#[doc = "DIEPTXF2 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPTXF2 (rw) register accessor: Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf2::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf2::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dieptxf2`] +module"] pub type DIEPTXF2 = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Size Register"] pub mod dieptxf2; -#[doc = "DIEPTXF3 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPTXF3 (rw) register accessor: Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf3::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf3::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dieptxf3`] +module"] pub type DIEPTXF3 = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Size Register"] pub mod dieptxf3; -#[doc = "DIEPTXF4 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPTXF4 (rw) register accessor: Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf4::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf4::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dieptxf4`] +module"] pub type DIEPTXF4 = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Size Register"] pub mod dieptxf4; -#[doc = "DIEPTXF5 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPTXF5 (rw) register accessor: Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf5::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf5::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dieptxf5`] +module"] pub type DIEPTXF5 = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Size Register"] pub mod dieptxf5; -#[doc = "DIEPTXF6 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPTXF6 (rw) register accessor: Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf6::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf6::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dieptxf6`] +module"] pub type DIEPTXF6 = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Size Register"] pub mod dieptxf6; -#[doc = "HCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "HCFG (rw) register accessor: Host Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hcfg`] +module"] pub type HCFG = crate::Reg; #[doc = "Host Configuration Register"] pub mod hcfg; -#[doc = "HFIR (rw) register accessor: an alias for `Reg`"] +#[doc = "HFIR (rw) register accessor: Host Frame Interval Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hfir::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hfir::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hfir`] +module"] pub type HFIR = crate::Reg; #[doc = "Host Frame Interval Register"] pub mod hfir; -#[doc = "HFNUM (rw) register accessor: an alias for `Reg`"] +#[doc = "HFNUM (rw) register accessor: Host Frame Number/Frame Time Remaining Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hfnum::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hfnum::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hfnum`] +module"] pub type HFNUM = crate::Reg; #[doc = "Host Frame Number/Frame Time Remaining Register"] pub mod hfnum; -#[doc = "HPTXSTS (rw) register accessor: an alias for `Reg`"] +#[doc = "HPTXSTS (rw) register accessor: Host Periodic Transmit FIFO/ Queue Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hptxsts::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hptxsts::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hptxsts`] +module"] pub type HPTXSTS = crate::Reg; #[doc = "Host Periodic Transmit FIFO/ Queue Status Register"] pub mod hptxsts; -#[doc = "HAINT (r) register accessor: an alias for `Reg`"] +#[doc = "HAINT (r) register accessor: Host All Channels Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`haint::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@haint`] +module"] pub type HAINT = crate::Reg; #[doc = "Host All Channels Interrupt Register"] pub mod haint; -#[doc = "HAINTMSK (rw) register accessor: an alias for `Reg`"] +#[doc = "HAINTMSK (rw) register accessor: Host All Channels Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`haintmsk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`haintmsk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@haintmsk`] +module"] pub type HAINTMSK = crate::Reg; #[doc = "Host All Channels Interrupt Mask Register"] pub mod haintmsk; -#[doc = "HFLBADDR (rw) register accessor: an alias for `Reg`"] +#[doc = "HFLBADDR (rw) register accessor: Host Frame List Base Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hflbaddr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hflbaddr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hflbaddr`] +module"] pub type HFLBADDR = crate::Reg; #[doc = "Host Frame List Base Address Register"] pub mod hflbaddr; -#[doc = "HPRT (rw) register accessor: an alias for `Reg`"] +#[doc = "HPRT (rw) register accessor: Host Port Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hprt::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hprt::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hprt`] +module"] pub type HPRT = crate::Reg; #[doc = "Host Port Control and Status Register"] pub mod hprt; -#[doc = "DCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "DCFG (rw) register accessor: Device Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dcfg`] +module"] pub type DCFG = crate::Reg; #[doc = "Device Configuration Register"] pub mod dcfg; -#[doc = "DCTL (rw) register accessor: an alias for `Reg`"] +#[doc = "DCTL (rw) register accessor: Device Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dctl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dctl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dctl`] +module"] pub type DCTL = crate::Reg; #[doc = "Device Control Register"] pub mod dctl; -#[doc = "DSTS (r) register accessor: an alias for `Reg`"] +#[doc = "DSTS (r) register accessor: Device Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsts::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dsts`] +module"] pub type DSTS = crate::Reg; #[doc = "Device Status Register"] pub mod dsts; -#[doc = "DIEPMSK (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPMSK (rw) register accessor: Device IN Endpoint Common Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepmsk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepmsk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepmsk`] +module"] pub type DIEPMSK = crate::Reg; #[doc = "Device IN Endpoint Common Interrupt Mask Register"] pub mod diepmsk; -#[doc = "DOEPMSK (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPMSK (rw) register accessor: Device OUT Endpoint Common Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepmsk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepmsk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepmsk`] +module"] pub type DOEPMSK = crate::Reg; #[doc = "Device OUT Endpoint Common Interrupt Mask Register"] pub mod doepmsk; -#[doc = "DAINT (r) register accessor: an alias for `Reg`"] +#[doc = "DAINT (r) register accessor: Device All Endpoints Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`daint::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@daint`] +module"] pub type DAINT = crate::Reg; #[doc = "Device All Endpoints Interrupt Register"] pub mod daint; -#[doc = "DAINTMSK (rw) register accessor: an alias for `Reg`"] +#[doc = "DAINTMSK (rw) register accessor: Device All Endpoints Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`daintmsk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`daintmsk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@daintmsk`] +module"] pub type DAINTMSK = crate::Reg; #[doc = "Device All Endpoints Interrupt Mask Register"] pub mod daintmsk; -#[doc = "DVBUSDIS (rw) register accessor: an alias for `Reg`"] +#[doc = "DVBUSDIS (rw) register accessor: Device VBUS Discharge Time Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dvbusdis::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dvbusdis::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dvbusdis`] +module"] pub type DVBUSDIS = crate::Reg; #[doc = "Device VBUS Discharge Time Register"] pub mod dvbusdis; -#[doc = "DVBUSPULSE (rw) register accessor: an alias for `Reg`"] +#[doc = "DVBUSPULSE (rw) register accessor: Device VBUS Pulsing Time Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dvbuspulse::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dvbuspulse::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dvbuspulse`] +module"] pub type DVBUSPULSE = crate::Reg; #[doc = "Device VBUS Pulsing Time Register"] pub mod dvbuspulse; -#[doc = "DIEPEMPMSK (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPEMPMSK (rw) register accessor: Device IN Endpoint FIFO Empty Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepempmsk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepempmsk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepempmsk`] +module"] pub type DIEPEMPMSK = crate::Reg; #[doc = "Device IN Endpoint FIFO Empty Interrupt Mask Register"] pub mod diepempmsk; -#[doc = "PCGCCTL (rw) register accessor: an alias for `Reg`"] +#[doc = "PCGCCTL (rw) register accessor: Power and Clock Gating Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcgcctl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcgcctl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pcgcctl`] +module"] 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 b5815a93..1c88742a 100644 --- a/src/usb0/daint.rs +++ b/src/usb0/daint.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `InEpInt` reader - IN Endpoint Interrupt Bits"] -pub type IN_EP_INT_R = crate::FieldReader; +pub type IN_EP_INT_R = crate::FieldReader; #[doc = "Field `OutEPInt` reader - OUT Endpoint Interrupt Bits"] -pub type OUT_EPINT_R = crate::FieldReader; +pub type OUT_EPINT_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - IN Endpoint Interrupt Bits"] #[inline(always)] @@ -29,15 +16,13 @@ impl R { OUT_EPINT_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"] +#[doc = "Device All Endpoints Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`daint::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`daint::R`](R) reader structure"] +impl crate::Readable for DAINT_SPEC {} #[doc = "`reset()` method sets DAINT to value 0"] impl crate::Resettable for DAINT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0/daintmsk.rs b/src/usb0/daintmsk.rs index ceeda4ce..c5729f5f 100644 --- a/src/usb0/daintmsk.rs +++ b/src/usb0/daintmsk.rs @@ -1,47 +1,15 @@ #[doc = "Register `DAINTMSK` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `InEpMsk` reader - IN EP Interrupt Mask Bits"] -pub type IN_EP_MSK_R = crate::FieldReader; +pub type IN_EP_MSK_R = crate::FieldReader; #[doc = "Field `InEpMsk` writer - IN EP Interrupt Mask Bits"] -pub type IN_EP_MSK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAINTMSK_SPEC, u16, u16, 16, O>; +pub type IN_EP_MSK_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `OutEpMsk` reader - OUT EP Interrupt Mask Bits"] -pub type OUT_EP_MSK_R = crate::FieldReader; +pub type OUT_EP_MSK_R = crate::FieldReader; #[doc = "Field `OutEpMsk` writer - OUT EP Interrupt Mask Bits"] -pub type OUT_EP_MSK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DAINTMSK_SPEC, u16, u16, 16, O>; +pub type OUT_EP_MSK_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN EP Interrupt Mask Bits"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - IN EP Interrupt Mask Bits"] #[inline(always)] #[must_use] - pub fn in_ep_msk(&mut self) -> IN_EP_MSK_W<0> { - IN_EP_MSK_W::new(self) + pub fn in_ep_msk(&mut self) -> IN_EP_MSK_W { + IN_EP_MSK_W::new(self, 0) } #[doc = "Bits 16:31 - OUT EP Interrupt Mask Bits"] #[inline(always)] #[must_use] - pub fn out_ep_msk(&mut self) -> OUT_EP_MSK_W<16> { - OUT_EP_MSK_W::new(self) + pub fn out_ep_msk(&mut self) -> OUT_EP_MSK_W { + OUT_EP_MSK_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device All Endpoints Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`daintmsk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`daintmsk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`daintmsk::R`](R) reader structure"] +impl crate::Readable for DAINTMSK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`daintmsk::W`](W) writer structure"] impl crate::Writable for DAINTMSK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dcfg.rs b/src/usb0/dcfg.rs index a3d0e4f6..d2fc9d3e 100644 --- a/src/usb0/dcfg.rs +++ b/src/usb0/dcfg.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DevSpd` reader - Device Speed"] -pub type DEV_SPD_R = crate::FieldReader; +pub type DEV_SPD_R = crate::FieldReader; #[doc = "Device Speed\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -49,27 +17,34 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DEV_SPD_A { + type Ux = u8; +} impl DEV_SPD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 3 => Some(DEV_SPD_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Full speed (USB 1.1 transceiver clock is 48 MHz)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DEV_SPD_A::VALUE4 } } #[doc = "Field `DevSpd` writer - Device Speed"] -pub type DEV_SPD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DCFG_SPEC, u8, DEV_SPD_A, 2, O>; -impl<'a, const O: u8> DEV_SPD_W<'a, O> { +pub type DEV_SPD_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DEV_SPD_A>; +impl<'a, REG> DEV_SPD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Full speed (USB 1.1 transceiver clock is 48 MHz)"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DEV_SPD_A::VALUE4) } } @@ -92,43 +67,46 @@ impl From for bool { impl NZSTS_OUTHSHK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NZSTS_OUTHSHK_A { + pub const fn variant(&self) -> NZSTS_OUTHSHK_A { match self.bits { true => NZSTS_OUTHSHK_A::VALUE1, false => NZSTS_OUTHSHK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == NZSTS_OUTHSHK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Send the received OUT packet to the application (zero-length or nonzero-length) and send a handshake based on the NAK and STALL bits for the endpoint in the Device Endpoint Control register."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NZSTS_OUTHSHK_A::VALUE2 } } #[doc = "Field `NZStsOUTHShk` writer - Non-Zero-Length Status OUT Handshake"] -pub type NZSTS_OUTHSHK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCFG_SPEC, NZSTS_OUTHSHK_A, O>; -impl<'a, const O: u8> NZSTS_OUTHSHK_W<'a, O> { +pub type NZSTS_OUTHSHK_W<'a, REG> = crate::BitWriter<'a, REG, NZSTS_OUTHSHK_A>; +impl<'a, REG> NZSTS_OUTHSHK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NZSTS_OUTHSHK_A::VALUE1) } #[doc = "Send the received OUT packet to the application (zero-length or nonzero-length) and send a handshake based on the NAK and STALL bits for the endpoint in the Device Endpoint Control register."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NZSTS_OUTHSHK_A::VALUE2) } } #[doc = "Field `DevAddr` reader - Device Address"] -pub type DEV_ADDR_R = crate::FieldReader; +pub type DEV_ADDR_R = crate::FieldReader; #[doc = "Field `DevAddr` writer - Device Address"] -pub type DEV_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DCFG_SPEC, u8, u8, 7, O>; +pub type DEV_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `PerFrInt` reader - Periodic Frame Interval"] -pub type PER_FR_INT_R = crate::FieldReader; +pub type PER_FR_INT_R = crate::FieldReader; #[doc = "Periodic Frame Interval\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -148,10 +126,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PER_FR_INT_A { + type Ux = u8; +} impl PER_FR_INT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PER_FR_INT_A { + pub const fn variant(&self) -> PER_FR_INT_A { match self.bits { 0 => PER_FR_INT_A::VALUE1, 1 => PER_FR_INT_A::VALUE2, @@ -160,57 +141,61 @@ impl PER_FR_INT_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "80% of the frame interval"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PER_FR_INT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "85%"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PER_FR_INT_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "90%"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PER_FR_INT_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "95%"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PER_FR_INT_A::VALUE4 } } #[doc = "Field `PerFrInt` writer - Periodic Frame Interval"] -pub type PER_FR_INT_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DCFG_SPEC, u8, PER_FR_INT_A, 2, O>; -impl<'a, const O: u8> PER_FR_INT_W<'a, O> { +pub type PER_FR_INT_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PER_FR_INT_A>; +impl<'a, REG> PER_FR_INT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "80% of the frame interval"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PER_FR_INT_A::VALUE1) } #[doc = "85%"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PER_FR_INT_A::VALUE2) } #[doc = "90%"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PER_FR_INT_A::VALUE3) } #[doc = "95%"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PER_FR_INT_A::VALUE4) } } #[doc = "Field `DescDMA` reader - Enable Scatter/Gather DMA in Device mode."] -pub type DESC_DMA_R = crate::BitReader; +pub type DESC_DMA_R = crate::BitReader; #[doc = "Field `DescDMA` writer - Enable Scatter/Gather DMA in Device mode."] -pub type DESC_DMA_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCFG_SPEC, bool, O>; +pub type DESC_DMA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PerSchIntvl` reader - Periodic Scheduling Interval"] -pub type PER_SCH_INTVL_R = crate::FieldReader; +pub type PER_SCH_INTVL_R = crate::FieldReader; #[doc = "Periodic Scheduling Interval\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -228,10 +213,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PER_SCH_INTVL_A { + type Ux = u8; +} impl PER_SCH_INTVL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PER_SCH_INTVL_A::VALUE1), 1 => Some(PER_SCH_INTVL_A::VALUE2), @@ -239,38 +227,42 @@ impl PER_SCH_INTVL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "25% of frame."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PER_SCH_INTVL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "50% of frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PER_SCH_INTVL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "75% of frame."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PER_SCH_INTVL_A::VALUE3 } } #[doc = "Field `PerSchIntvl` writer - Periodic Scheduling Interval"] -pub type PER_SCH_INTVL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DCFG_SPEC, u8, PER_SCH_INTVL_A, 2, O>; -impl<'a, const O: u8> PER_SCH_INTVL_W<'a, O> { +pub type PER_SCH_INTVL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PER_SCH_INTVL_A>; +impl<'a, REG> PER_SCH_INTVL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "25% of frame."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PER_SCH_INTVL_A::VALUE1) } #[doc = "50% of frame."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PER_SCH_INTVL_A::VALUE2) } #[doc = "75% of frame."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PER_SCH_INTVL_A::VALUE3) } } @@ -310,58 +302,59 @@ impl W { #[doc = "Bits 0:1 - Device Speed"] #[inline(always)] #[must_use] - pub fn dev_spd(&mut self) -> DEV_SPD_W<0> { - DEV_SPD_W::new(self) + pub fn dev_spd(&mut self) -> DEV_SPD_W { + DEV_SPD_W::new(self, 0) } #[doc = "Bit 2 - Non-Zero-Length Status OUT Handshake"] #[inline(always)] #[must_use] - pub fn nzsts_outhshk(&mut self) -> NZSTS_OUTHSHK_W<2> { - NZSTS_OUTHSHK_W::new(self) + pub fn nzsts_outhshk(&mut self) -> NZSTS_OUTHSHK_W { + NZSTS_OUTHSHK_W::new(self, 2) } #[doc = "Bits 4:10 - Device Address"] #[inline(always)] #[must_use] - pub fn dev_addr(&mut self) -> DEV_ADDR_W<4> { - DEV_ADDR_W::new(self) + pub fn dev_addr(&mut self) -> DEV_ADDR_W { + DEV_ADDR_W::new(self, 4) } #[doc = "Bits 11:12 - Periodic Frame Interval"] #[inline(always)] #[must_use] - pub fn per_fr_int(&mut self) -> PER_FR_INT_W<11> { - PER_FR_INT_W::new(self) + pub fn per_fr_int(&mut self) -> PER_FR_INT_W { + PER_FR_INT_W::new(self, 11) } #[doc = "Bit 23 - Enable Scatter/Gather DMA in Device mode."] #[inline(always)] #[must_use] - pub fn desc_dma(&mut self) -> DESC_DMA_W<23> { - DESC_DMA_W::new(self) + pub fn desc_dma(&mut self) -> DESC_DMA_W { + DESC_DMA_W::new(self, 23) } #[doc = "Bits 24:25 - Periodic Scheduling Interval"] #[inline(always)] #[must_use] - pub fn per_sch_intvl(&mut self) -> PER_SCH_INTVL_W<24> { - PER_SCH_INTVL_W::new(self) + pub fn per_sch_intvl(&mut self) -> PER_SCH_INTVL_W { + PER_SCH_INTVL_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dcfg::R`](R) reader structure"] +impl crate::Readable for DCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dcfg::W`](W) writer structure"] impl crate::Writable for DCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dctl.rs b/src/usb0/dctl.rs index 39e1469a..d828b66c 100644 --- a/src/usb0/dctl.rs +++ b/src/usb0/dctl.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RmtWkUpSig` reader - Remote Wakeup Signaling"] -pub type RMT_WK_UP_SIG_R = crate::BitReader; +pub type RMT_WK_UP_SIG_R = crate::BitReader; #[doc = "Field `RmtWkUpSig` writer - Remote Wakeup Signaling"] -pub type RMT_WK_UP_SIG_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, bool, O>; +pub type RMT_WK_UP_SIG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SftDiscon` reader - Soft Disconnect"] pub type SFT_DISCON_R = crate::BitReader; #[doc = "Soft Disconnect\n\nValue on reset: 1"] @@ -57,34 +25,37 @@ impl From for bool { impl SFT_DISCON_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SFT_DISCON_A { + pub const fn variant(&self) -> SFT_DISCON_A { match self.bits { false => SFT_DISCON_A::VALUE1, true => SFT_DISCON_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == SFT_DISCON_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The core drives a device disconnect event to the USB host."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SFT_DISCON_A::VALUE2 } } #[doc = "Field `SftDiscon` writer - Soft Disconnect"] -pub type SFT_DISCON_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, SFT_DISCON_A, O>; -impl<'a, const O: u8> SFT_DISCON_W<'a, O> { +pub type SFT_DISCON_W<'a, REG> = crate::BitWriter<'a, REG, SFT_DISCON_A>; +impl<'a, REG> SFT_DISCON_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SFT_DISCON_A::VALUE1) } #[doc = "The core drives a device disconnect event to the USB host."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SFT_DISCON_A::VALUE2) } } @@ -107,18 +78,18 @@ impl From for bool { impl GNPINNAK_STS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GNPINNAK_STS_A { + pub const fn variant(&self) -> GNPINNAK_STS_A { match self.bits { false => GNPINNAK_STS_A::VALUE1, true => GNPINNAK_STS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A handshake is sent out based on the data availability in the transmit FIFO."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GNPINNAK_STS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A NAK handshake is sent out on all non-periodic IN endpoints, irrespective of the data availability in the transmit FIFO."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GNPINNAK_STS_A::VALUE2 @@ -143,33 +114,33 @@ impl From for bool { impl GOUTNAK_STS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GOUTNAK_STS_A { + pub const fn variant(&self) -> GOUTNAK_STS_A { match self.bits { false => GOUTNAK_STS_A::VALUE1, true => GOUTNAK_STS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A handshake is sent based on the FIFO Status and the NAK and STALL bit settings."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GOUTNAK_STS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No data is written to the RxFIFO, irrespective of space availability. Sends a NAK handshake on all packets, except on SETUP transactions. All isochronous OUT packets are dropped."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GOUTNAK_STS_A::VALUE2 } } #[doc = "Field `SGNPInNak` writer - Set Global Non-periodic IN NAK"] -pub type SGNPIN_NAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, bool, O>; +pub type SGNPIN_NAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CGNPInNak` writer - Clear Global Non-periodic IN NAK"] -pub type CGNPIN_NAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, bool, O>; +pub type CGNPIN_NAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SGOUTNak` writer - Set Global OUT NAK"] -pub type SGOUTNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, bool, O>; +pub type SGOUTNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CGOUTNak` writer - Clear Global OUT NAK"] -pub type CGOUTNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, bool, O>; +pub type CGOUTNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `GMC` reader - Global Multi Count"] -pub type GMC_R = crate::FieldReader; +pub type GMC_R = crate::FieldReader; #[doc = "Global Multi Count\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -189,10 +160,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for GMC_A { + type Ux = u8; +} impl GMC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GMC_A { + pub const fn variant(&self) -> GMC_A { match self.bits { 0 => GMC_A::VALUE1, 1 => GMC_A::VALUE2, @@ -201,48 +175,52 @@ impl GMC_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Invalid."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GMC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "1 packet."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GMC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "2 packets."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == GMC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "3 packets."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == GMC_A::VALUE4 } } #[doc = "Field `GMC` writer - Global Multi Count"] -pub type GMC_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DCTL_SPEC, u8, GMC_A, 2, O>; -impl<'a, const O: u8> GMC_W<'a, O> { +pub type GMC_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, GMC_A>; +impl<'a, REG> GMC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Invalid."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GMC_A::VALUE1) } #[doc = "1 packet."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GMC_A::VALUE2) } #[doc = "2 packets."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(GMC_A::VALUE3) } #[doc = "3 packets."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(GMC_A::VALUE4) } } @@ -265,41 +243,44 @@ impl From for bool { impl IGNR_FRM_NUM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IGNR_FRM_NUM_A { + pub const fn variant(&self) -> IGNR_FRM_NUM_A { match self.bits { false => IGNR_FRM_NUM_A::VALUE1, true => IGNR_FRM_NUM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == IGNR_FRM_NUM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Scatter/Gather enabled: The core ignores the frame number, sending packets immediately as the packets are ready. Scatter/Gather disabled: Periodic transfer interrupt feature is enabled; the application can program transfers for multiple frames for periodic endpoints."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IGNR_FRM_NUM_A::VALUE2 } } #[doc = "Field `IgnrFrmNum` writer - Ignore frame number for isochronous endpoints in case of Scatter/Gather DMA"] -pub type IGNR_FRM_NUM_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, IGNR_FRM_NUM_A, O>; -impl<'a, const O: u8> IGNR_FRM_NUM_W<'a, O> { +pub type IGNR_FRM_NUM_W<'a, REG> = crate::BitWriter<'a, REG, IGNR_FRM_NUM_A>; +impl<'a, REG> IGNR_FRM_NUM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IGNR_FRM_NUM_A::VALUE1) } #[doc = "Scatter/Gather enabled: The core ignores the frame number, sending packets immediately as the packets are ready. Scatter/Gather disabled: Periodic transfer interrupt feature is enabled; the application can program transfers for multiple frames for periodic endpoints."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IGNR_FRM_NUM_A::VALUE2) } } #[doc = "Field `NakOnBble` reader - Set NAK automatically on babble"] -pub type NAK_ON_BBLE_R = crate::BitReader; +pub type NAK_ON_BBLE_R = crate::BitReader; #[doc = "Field `NakOnBble` writer - Set NAK automatically on babble"] -pub type NAK_ON_BBLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, bool, O>; +pub type NAK_ON_BBLE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EnContOnBNA` reader - Enable continue on BNA"] pub type EN_CONT_ON_BNA_R = crate::BitReader; #[doc = "Enable continue on BNA\n\nValue on reset: 0"] @@ -319,34 +300,37 @@ impl From for bool { impl EN_CONT_ON_BNA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EN_CONT_ON_BNA_A { + pub const fn variant(&self) -> EN_CONT_ON_BNA_A { match self.bits { false => EN_CONT_ON_BNA_A::VALUE1, true => EN_CONT_ON_BNA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == EN_CONT_ON_BNA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[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 descriptor that received the BNA interrupt."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EN_CONT_ON_BNA_A::VALUE2 } } #[doc = "Field `EnContOnBNA` writer - Enable continue on BNA"] -pub type EN_CONT_ON_BNA_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCTL_SPEC, EN_CONT_ON_BNA_A, O>; -impl<'a, const O: u8> EN_CONT_ON_BNA_W<'a, O> { +pub type EN_CONT_ON_BNA_W<'a, REG> = crate::BitWriter<'a, REG, EN_CONT_ON_BNA_A>; +impl<'a, REG> EN_CONT_ON_BNA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EN_CONT_ON_BNA_A::VALUE1) } #[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 descriptor that received the BNA interrupt."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EN_CONT_ON_BNA_A::VALUE2) } } @@ -396,82 +380,83 @@ impl W { #[doc = "Bit 0 - Remote Wakeup Signaling"] #[inline(always)] #[must_use] - pub fn rmt_wk_up_sig(&mut self) -> RMT_WK_UP_SIG_W<0> { - RMT_WK_UP_SIG_W::new(self) + pub fn rmt_wk_up_sig(&mut self) -> RMT_WK_UP_SIG_W { + RMT_WK_UP_SIG_W::new(self, 0) } #[doc = "Bit 1 - Soft Disconnect"] #[inline(always)] #[must_use] - pub fn sft_discon(&mut self) -> SFT_DISCON_W<1> { - SFT_DISCON_W::new(self) + pub fn sft_discon(&mut self) -> SFT_DISCON_W { + SFT_DISCON_W::new(self, 1) } #[doc = "Bit 7 - Set Global Non-periodic IN NAK"] #[inline(always)] #[must_use] - pub fn sgnpin_nak(&mut self) -> SGNPIN_NAK_W<7> { - SGNPIN_NAK_W::new(self) + pub fn sgnpin_nak(&mut self) -> SGNPIN_NAK_W { + SGNPIN_NAK_W::new(self, 7) } #[doc = "Bit 8 - Clear Global Non-periodic IN NAK"] #[inline(always)] #[must_use] - pub fn cgnpin_nak(&mut self) -> CGNPIN_NAK_W<8> { - CGNPIN_NAK_W::new(self) + pub fn cgnpin_nak(&mut self) -> CGNPIN_NAK_W { + CGNPIN_NAK_W::new(self, 8) } #[doc = "Bit 9 - Set Global OUT NAK"] #[inline(always)] #[must_use] - pub fn sgoutnak(&mut self) -> SGOUTNAK_W<9> { - SGOUTNAK_W::new(self) + pub fn sgoutnak(&mut self) -> SGOUTNAK_W { + SGOUTNAK_W::new(self, 9) } #[doc = "Bit 10 - Clear Global OUT NAK"] #[inline(always)] #[must_use] - pub fn cgoutnak(&mut self) -> CGOUTNAK_W<10> { - CGOUTNAK_W::new(self) + pub fn cgoutnak(&mut self) -> CGOUTNAK_W { + CGOUTNAK_W::new(self, 10) } #[doc = "Bits 13:14 - Global Multi Count"] #[inline(always)] #[must_use] - pub fn gmc(&mut self) -> GMC_W<13> { - GMC_W::new(self) + pub fn gmc(&mut self) -> GMC_W { + GMC_W::new(self, 13) } #[doc = "Bit 15 - Ignore frame number for isochronous endpoints in case of Scatter/Gather DMA"] #[inline(always)] #[must_use] - pub fn ignr_frm_num(&mut self) -> IGNR_FRM_NUM_W<15> { - IGNR_FRM_NUM_W::new(self) + pub fn ignr_frm_num(&mut self) -> IGNR_FRM_NUM_W { + IGNR_FRM_NUM_W::new(self, 15) } #[doc = "Bit 16 - Set NAK automatically on babble"] #[inline(always)] #[must_use] - pub fn nak_on_bble(&mut self) -> NAK_ON_BBLE_W<16> { - NAK_ON_BBLE_W::new(self) + pub fn nak_on_bble(&mut self) -> NAK_ON_BBLE_W { + NAK_ON_BBLE_W::new(self, 16) } #[doc = "Bit 17 - Enable continue on BNA"] #[inline(always)] #[must_use] - pub fn en_cont_on_bna(&mut self) -> EN_CONT_ON_BNA_W<17> { - EN_CONT_ON_BNA_W::new(self) + pub fn en_cont_on_bna(&mut self) -> EN_CONT_ON_BNA_W { + EN_CONT_ON_BNA_W::new(self, 17) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dctl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dctl::R`](R) reader structure"] +impl crate::Readable for DCTL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dctl::W`](W) writer structure"] impl crate::Writable for DCTL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/diepempmsk.rs b/src/usb0/diepempmsk.rs index f0bb5244..8eb09b1b 100644 --- a/src/usb0/diepempmsk.rs +++ b/src/usb0/diepempmsk.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `InEpTxfEmpMsk` reader - IN EP Tx FIFO Empty Interrupt Mask Bits"] -pub type IN_EP_TXF_EMP_MSK_R = crate::FieldReader; +pub type IN_EP_TXF_EMP_MSK_R = crate::FieldReader; #[doc = "Field `InEpTxfEmpMsk` writer - IN EP Tx FIFO Empty Interrupt Mask Bits"] -pub type IN_EP_TXF_EMP_MSK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPEMPMSK_SPEC, u16, u16, 16, O>; +pub type IN_EP_TXF_EMP_MSK_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN EP Tx FIFO Empty Interrupt Mask Bits"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - IN EP Tx FIFO Empty Interrupt Mask Bits"] #[inline(always)] #[must_use] - pub fn in_ep_txf_emp_msk(&mut self) -> IN_EP_TXF_EMP_MSK_W<0> { - IN_EP_TXF_EMP_MSK_W::new(self) + pub fn in_ep_txf_emp_msk(&mut self) -> IN_EP_TXF_EMP_MSK_W { + IN_EP_TXF_EMP_MSK_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device IN Endpoint FIFO Empty Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepempmsk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepempmsk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepempmsk::R`](R) reader structure"] +impl crate::Readable for DIEPEMPMSK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepempmsk::W`](W) writer structure"] impl crate::Writable for DIEPEMPMSK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/diepmsk.rs b/src/usb0/diepmsk.rs index d1881331..f6e367b3 100644 --- a/src/usb0/diepmsk.rs +++ b/src/usb0/diepmsk.rs @@ -1,75 +1,43 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferComplMsk` reader - Transfer Completed Interrupt Mask"] -pub type XFER_COMPL_MSK_R = crate::BitReader; +pub type XFER_COMPL_MSK_R = crate::BitReader; #[doc = "Field `XferComplMsk` writer - Transfer Completed Interrupt Mask"] -pub type XFER_COMPL_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type XFER_COMPL_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDisbldMsk` reader - Endpoint Disabled Interrupt Mask"] -pub type EPDISBLD_MSK_R = crate::BitReader; +pub type EPDISBLD_MSK_R = crate::BitReader; #[doc = "Field `EPDisbldMsk` writer - Endpoint Disabled Interrupt Mask"] -pub type EPDISBLD_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type EPDISBLD_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHBErrMsk` reader - AHB Error Mask"] -pub type AHBERR_MSK_R = crate::BitReader; +pub type AHBERR_MSK_R = crate::BitReader; #[doc = "Field `AHBErrMsk` writer - AHB Error Mask"] -pub type AHBERR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type AHBERR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TimeOUTMsk` reader - Timeout Condition Mask"] -pub type TIME_OUTMSK_R = crate::BitReader; +pub type TIME_OUTMSK_R = crate::BitReader; #[doc = "Field `TimeOUTMsk` writer - Timeout Condition Mask"] -pub type TIME_OUTMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type TIME_OUTMSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `INTknTXFEmpMsk` reader - IN Token Received When TxFIFO Empty Mask"] -pub type INTKN_TXFEMP_MSK_R = crate::BitReader; +pub type INTKN_TXFEMP_MSK_R = crate::BitReader; #[doc = "Field `INTknTXFEmpMsk` writer - IN Token Received When TxFIFO Empty Mask"] -pub type INTKN_TXFEMP_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type INTKN_TXFEMP_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `INEPNakEffMsk` reader - IN Endpoint NAK Effective Mask"] -pub type INEPNAK_EFF_MSK_R = crate::BitReader; +pub type INEPNAK_EFF_MSK_R = crate::BitReader; #[doc = "Field `INEPNakEffMsk` writer - IN Endpoint NAK Effective Mask"] -pub type INEPNAK_EFF_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type INEPNAK_EFF_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxfifoUndrnMsk` reader - Fifo Underrun Mask"] -pub type TXFIFO_UNDRN_MSK_R = crate::BitReader; +pub type TXFIFO_UNDRN_MSK_R = crate::BitReader; #[doc = "Field `TxfifoUndrnMsk` writer - Fifo Underrun Mask"] -pub type TXFIFO_UNDRN_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type TXFIFO_UNDRN_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BNAInIntrMsk` reader - BNA Interrupt Mask"] -pub type BNAIN_INTR_MSK_R = crate::BitReader; +pub type BNAIN_INTR_MSK_R = crate::BitReader; #[doc = "Field `BNAInIntrMsk` writer - BNA Interrupt Mask"] -pub type BNAIN_INTR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type BNAIN_INTR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NAKMsk` reader - NAK interrupt Mask"] -pub type NAKMSK_R = crate::BitReader; +pub type NAKMSK_R = crate::BitReader; #[doc = "Field `NAKMsk` writer - NAK interrupt Mask"] -pub type NAKMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPMSK_SPEC, bool, O>; +pub type NAKMSK_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transfer Completed Interrupt Mask"] #[inline(always)] @@ -121,76 +89,77 @@ impl W { #[doc = "Bit 0 - Transfer Completed Interrupt Mask"] #[inline(always)] #[must_use] - pub fn xfer_compl_msk(&mut self) -> XFER_COMPL_MSK_W<0> { - XFER_COMPL_MSK_W::new(self) + pub fn xfer_compl_msk(&mut self) -> XFER_COMPL_MSK_W { + XFER_COMPL_MSK_W::new(self, 0) } #[doc = "Bit 1 - Endpoint Disabled Interrupt Mask"] #[inline(always)] #[must_use] - pub fn epdisbld_msk(&mut self) -> EPDISBLD_MSK_W<1> { - EPDISBLD_MSK_W::new(self) + pub fn epdisbld_msk(&mut self) -> EPDISBLD_MSK_W { + EPDISBLD_MSK_W::new(self, 1) } #[doc = "Bit 2 - AHB Error Mask"] #[inline(always)] #[must_use] - pub fn ahberr_msk(&mut self) -> AHBERR_MSK_W<2> { - AHBERR_MSK_W::new(self) + pub fn ahberr_msk(&mut self) -> AHBERR_MSK_W { + AHBERR_MSK_W::new(self, 2) } #[doc = "Bit 3 - Timeout Condition Mask"] #[inline(always)] #[must_use] - pub fn time_outmsk(&mut self) -> TIME_OUTMSK_W<3> { - TIME_OUTMSK_W::new(self) + pub fn time_outmsk(&mut self) -> TIME_OUTMSK_W { + TIME_OUTMSK_W::new(self, 3) } #[doc = "Bit 4 - IN Token Received When TxFIFO Empty Mask"] #[inline(always)] #[must_use] - pub fn intkn_txfemp_msk(&mut self) -> INTKN_TXFEMP_MSK_W<4> { - INTKN_TXFEMP_MSK_W::new(self) + pub fn intkn_txfemp_msk(&mut self) -> INTKN_TXFEMP_MSK_W { + INTKN_TXFEMP_MSK_W::new(self, 4) } #[doc = "Bit 6 - IN Endpoint NAK Effective Mask"] #[inline(always)] #[must_use] - pub fn inepnak_eff_msk(&mut self) -> INEPNAK_EFF_MSK_W<6> { - INEPNAK_EFF_MSK_W::new(self) + pub fn inepnak_eff_msk(&mut self) -> INEPNAK_EFF_MSK_W { + INEPNAK_EFF_MSK_W::new(self, 6) } #[doc = "Bit 8 - Fifo Underrun Mask"] #[inline(always)] #[must_use] - pub fn txfifo_undrn_msk(&mut self) -> TXFIFO_UNDRN_MSK_W<8> { - TXFIFO_UNDRN_MSK_W::new(self) + pub fn txfifo_undrn_msk(&mut self) -> TXFIFO_UNDRN_MSK_W { + TXFIFO_UNDRN_MSK_W::new(self, 8) } #[doc = "Bit 9 - BNA Interrupt Mask"] #[inline(always)] #[must_use] - pub fn bnain_intr_msk(&mut self) -> BNAIN_INTR_MSK_W<9> { - BNAIN_INTR_MSK_W::new(self) + pub fn bnain_intr_msk(&mut self) -> BNAIN_INTR_MSK_W { + BNAIN_INTR_MSK_W::new(self, 9) } #[doc = "Bit 13 - NAK interrupt Mask"] #[inline(always)] #[must_use] - pub fn nakmsk(&mut self) -> NAKMSK_W<13> { - NAKMSK_W::new(self) + pub fn nakmsk(&mut self) -> NAKMSK_W { + NAKMSK_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device IN Endpoint Common Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepmsk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepmsk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepmsk::R`](R) reader structure"] +impl crate::Readable for DIEPMSK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepmsk::W`](W) writer structure"] impl crate::Writable for DIEPMSK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dieptxf1.rs b/src/usb0/dieptxf1.rs index a50f93a7..97dc91a0 100644 --- a/src/usb0/dieptxf1.rs +++ b/src/usb0/dieptxf1.rs @@ -1,47 +1,15 @@ #[doc = "Register `DIEPTXF1` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; +pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; #[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF1_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_R = crate::FieldReader; +pub type INEPN_TX_FDEP_R = crate::FieldReader; #[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF1_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] #[must_use] - pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W<0> { - INEPN_TX_FST_ADDR_W::new(self) + pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W { + INEPN_TX_FST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - IN Endpoint TxFIFO Depth"] #[inline(always)] #[must_use] - pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W<16> { - INEPN_TX_FDEP_W::new(self) + pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W { + INEPN_TX_FDEP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Device IN Endpoint 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"] +#[doc = "Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dieptxf1::R`](R) reader structure"] +impl crate::Readable for DIEPTXF1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dieptxf1::W`](W) writer structure"] impl crate::Writable for DIEPTXF1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dieptxf2.rs b/src/usb0/dieptxf2.rs index 0c870391..c0bf7010 100644 --- a/src/usb0/dieptxf2.rs +++ b/src/usb0/dieptxf2.rs @@ -1,47 +1,15 @@ #[doc = "Register `DIEPTXF2` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; +pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; #[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF2_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_R = crate::FieldReader; +pub type INEPN_TX_FDEP_R = crate::FieldReader; #[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF2_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] #[must_use] - pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W<0> { - INEPN_TX_FST_ADDR_W::new(self) + pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W { + INEPN_TX_FST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - IN Endpoint TxFIFO Depth"] #[inline(always)] #[must_use] - pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W<16> { - INEPN_TX_FDEP_W::new(self) + pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W { + INEPN_TX_FDEP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Device IN Endpoint 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"] +#[doc = "Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf2::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dieptxf2::R`](R) reader structure"] +impl crate::Readable for DIEPTXF2_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dieptxf2::W`](W) writer structure"] impl crate::Writable for DIEPTXF2_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dieptxf3.rs b/src/usb0/dieptxf3.rs index d873181a..1e424c7d 100644 --- a/src/usb0/dieptxf3.rs +++ b/src/usb0/dieptxf3.rs @@ -1,47 +1,15 @@ #[doc = "Register `DIEPTXF3` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; +pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; #[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF3_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_R = crate::FieldReader; +pub type INEPN_TX_FDEP_R = crate::FieldReader; #[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF3_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] #[must_use] - pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W<0> { - INEPN_TX_FST_ADDR_W::new(self) + pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W { + INEPN_TX_FST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - IN Endpoint TxFIFO Depth"] #[inline(always)] #[must_use] - pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W<16> { - INEPN_TX_FDEP_W::new(self) + pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W { + INEPN_TX_FDEP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Device IN Endpoint 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"] +#[doc = "Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf3::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf3::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dieptxf3::R`](R) reader structure"] +impl crate::Readable for DIEPTXF3_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dieptxf3::W`](W) writer structure"] impl crate::Writable for DIEPTXF3_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dieptxf4.rs b/src/usb0/dieptxf4.rs index b0a15ca9..cf2a001d 100644 --- a/src/usb0/dieptxf4.rs +++ b/src/usb0/dieptxf4.rs @@ -1,47 +1,15 @@ #[doc = "Register `DIEPTXF4` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; +pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; #[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF4_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_R = crate::FieldReader; +pub type INEPN_TX_FDEP_R = crate::FieldReader; #[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF4_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] #[must_use] - pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W<0> { - INEPN_TX_FST_ADDR_W::new(self) + pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W { + INEPN_TX_FST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - IN Endpoint TxFIFO Depth"] #[inline(always)] #[must_use] - pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W<16> { - INEPN_TX_FDEP_W::new(self) + pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W { + INEPN_TX_FDEP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Device IN Endpoint 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"] +#[doc = "Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf4::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dieptxf4::R`](R) reader structure"] +impl crate::Readable for DIEPTXF4_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dieptxf4::W`](W) writer structure"] impl crate::Writable for DIEPTXF4_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dieptxf5.rs b/src/usb0/dieptxf5.rs index cb0b3b05..8f960615 100644 --- a/src/usb0/dieptxf5.rs +++ b/src/usb0/dieptxf5.rs @@ -1,47 +1,15 @@ #[doc = "Register `DIEPTXF5` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; +pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; #[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF5_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_R = crate::FieldReader; +pub type INEPN_TX_FDEP_R = crate::FieldReader; #[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF5_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] #[must_use] - pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W<0> { - INEPN_TX_FST_ADDR_W::new(self) + pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W { + INEPN_TX_FST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - IN Endpoint TxFIFO Depth"] #[inline(always)] #[must_use] - pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W<16> { - INEPN_TX_FDEP_W::new(self) + pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W { + INEPN_TX_FDEP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Device IN Endpoint 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"] +#[doc = "Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf5::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf5::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dieptxf5::R`](R) reader structure"] +impl crate::Readable for DIEPTXF5_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dieptxf5::W`](W) writer structure"] impl crate::Writable for DIEPTXF5_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dieptxf6.rs b/src/usb0/dieptxf6.rs index 22993513..41cade81 100644 --- a/src/usb0/dieptxf6.rs +++ b/src/usb0/dieptxf6.rs @@ -1,47 +1,15 @@ #[doc = "Register `DIEPTXF6` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `INEPnTxFStAddr` reader - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; +pub type INEPN_TX_FST_ADDR_R = crate::FieldReader; #[doc = "Field `INEPnTxFStAddr` writer - IN Endpoint FIFOn Transmit RAM Start Address"] -pub type INEPN_TX_FST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF6_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `INEPnTxFDep` reader - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_R = crate::FieldReader; +pub type INEPN_TX_FDEP_R = crate::FieldReader; #[doc = "Field `INEPnTxFDep` writer - IN Endpoint TxFIFO Depth"] -pub type INEPN_TX_FDEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTXF6_SPEC, u16, u16, 16, O>; +pub type INEPN_TX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - IN Endpoint FIFOn Transmit RAM Start Address"] #[inline(always)] #[must_use] - pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W<0> { - INEPN_TX_FST_ADDR_W::new(self) + pub fn inepn_tx_fst_addr(&mut self) -> INEPN_TX_FST_ADDR_W { + INEPN_TX_FST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - IN Endpoint TxFIFO Depth"] #[inline(always)] #[must_use] - pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W<16> { - INEPN_TX_FDEP_W::new(self) + pub fn inepn_tx_fdep(&mut self) -> INEPN_TX_FDEP_W { + INEPN_TX_FDEP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Device IN Endpoint 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"] +#[doc = "Device IN Endpoint Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptxf6::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptxf6::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dieptxf6::R`](R) reader structure"] +impl crate::Readable for DIEPTXF6_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dieptxf6::W`](W) writer structure"] impl crate::Writable for DIEPTXF6_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/doepmsk.rs b/src/usb0/doepmsk.rs index 81956fdc..d7345b64 100644 --- a/src/usb0/doepmsk.rs +++ b/src/usb0/doepmsk.rs @@ -1,83 +1,51 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferComplMsk` reader - Transfer Completed Interrupt Mask"] -pub type XFER_COMPL_MSK_R = crate::BitReader; +pub type XFER_COMPL_MSK_R = crate::BitReader; #[doc = "Field `XferComplMsk` writer - Transfer Completed Interrupt Mask"] -pub type XFER_COMPL_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type XFER_COMPL_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDisbldMsk` reader - Endpoint Disabled Interrupt Mask"] -pub type EPDISBLD_MSK_R = crate::BitReader; +pub type EPDISBLD_MSK_R = crate::BitReader; #[doc = "Field `EPDisbldMsk` writer - Endpoint Disabled Interrupt Mask"] -pub type EPDISBLD_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type EPDISBLD_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHBErrMsk` reader - AHB Error"] -pub type AHBERR_MSK_R = crate::BitReader; +pub type AHBERR_MSK_R = crate::BitReader; #[doc = "Field `AHBErrMsk` writer - AHB Error"] -pub type AHBERR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type AHBERR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetUPMsk` reader - SETUP Phase Done Mask"] -pub type SET_UPMSK_R = crate::BitReader; +pub type SET_UPMSK_R = crate::BitReader; #[doc = "Field `SetUPMsk` writer - SETUP Phase Done Mask"] -pub type SET_UPMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type SET_UPMSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OUTTknEPdisMsk` reader - OUT Token Received when Endpoint Disabled Mask"] -pub type OUTTKN_EPDIS_MSK_R = crate::BitReader; +pub type OUTTKN_EPDIS_MSK_R = crate::BitReader; #[doc = "Field `OUTTknEPdisMsk` writer - OUT Token Received when Endpoint Disabled Mask"] -pub type OUTTKN_EPDIS_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type OUTTKN_EPDIS_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `Back2BackSETup` reader - Back-to-Back SETUP Packets Received Mask"] -pub type BACK2BACK_SETUP_R = crate::BitReader; +pub type BACK2BACK_SETUP_R = crate::BitReader; #[doc = "Field `Back2BackSETup` writer - Back-to-Back SETUP Packets Received Mask"] -pub type BACK2BACK_SETUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type BACK2BACK_SETUP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OutPktErrMsk` reader - OUT Packet Error Mask"] -pub type OUT_PKT_ERR_MSK_R = crate::BitReader; +pub type OUT_PKT_ERR_MSK_R = crate::BitReader; #[doc = "Field `OutPktErrMsk` writer - OUT Packet Error Mask"] -pub type OUT_PKT_ERR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type OUT_PKT_ERR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BnaOutIntrMsk` reader - BNA interrupt Mask"] -pub type BNA_OUT_INTR_MSK_R = crate::BitReader; +pub type BNA_OUT_INTR_MSK_R = crate::BitReader; #[doc = "Field `BnaOutIntrMsk` writer - BNA interrupt Mask"] -pub type BNA_OUT_INTR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type BNA_OUT_INTR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BbleErrMsk` reader - Babble Interrupt Mask"] -pub type BBLE_ERR_MSK_R = crate::BitReader; +pub type BBLE_ERR_MSK_R = crate::BitReader; #[doc = "Field `BbleErrMsk` writer - Babble Interrupt Mask"] -pub type BBLE_ERR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type BBLE_ERR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NAKMsk` reader - NAK Interrupt Mask"] -pub type NAKMSK_R = crate::BitReader; +pub type NAKMSK_R = crate::BitReader; #[doc = "Field `NAKMsk` writer - NAK Interrupt Mask"] -pub type NAKMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type NAKMSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NYETMsk` reader - NYET Interrupt Mask"] -pub type NYETMSK_R = crate::BitReader; +pub type NYETMSK_R = crate::BitReader; #[doc = "Field `NYETMsk` writer - NYET Interrupt Mask"] -pub type NYETMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPMSK_SPEC, bool, O>; +pub type NYETMSK_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transfer Completed Interrupt Mask"] #[inline(always)] @@ -139,88 +107,89 @@ impl W { #[doc = "Bit 0 - Transfer Completed Interrupt Mask"] #[inline(always)] #[must_use] - pub fn xfer_compl_msk(&mut self) -> XFER_COMPL_MSK_W<0> { - XFER_COMPL_MSK_W::new(self) + pub fn xfer_compl_msk(&mut self) -> XFER_COMPL_MSK_W { + XFER_COMPL_MSK_W::new(self, 0) } #[doc = "Bit 1 - Endpoint Disabled Interrupt Mask"] #[inline(always)] #[must_use] - pub fn epdisbld_msk(&mut self) -> EPDISBLD_MSK_W<1> { - EPDISBLD_MSK_W::new(self) + pub fn epdisbld_msk(&mut self) -> EPDISBLD_MSK_W { + EPDISBLD_MSK_W::new(self, 1) } #[doc = "Bit 2 - AHB Error"] #[inline(always)] #[must_use] - pub fn ahberr_msk(&mut self) -> AHBERR_MSK_W<2> { - AHBERR_MSK_W::new(self) + pub fn ahberr_msk(&mut self) -> AHBERR_MSK_W { + AHBERR_MSK_W::new(self, 2) } #[doc = "Bit 3 - SETUP Phase Done Mask"] #[inline(always)] #[must_use] - pub fn set_upmsk(&mut self) -> SET_UPMSK_W<3> { - SET_UPMSK_W::new(self) + pub fn set_upmsk(&mut self) -> SET_UPMSK_W { + SET_UPMSK_W::new(self, 3) } #[doc = "Bit 4 - OUT Token Received when Endpoint Disabled Mask"] #[inline(always)] #[must_use] - pub fn outtkn_epdis_msk(&mut self) -> OUTTKN_EPDIS_MSK_W<4> { - OUTTKN_EPDIS_MSK_W::new(self) + pub fn outtkn_epdis_msk(&mut self) -> OUTTKN_EPDIS_MSK_W { + OUTTKN_EPDIS_MSK_W::new(self, 4) } #[doc = "Bit 6 - Back-to-Back SETUP Packets Received Mask"] #[inline(always)] #[must_use] - pub fn back2back_setup(&mut self) -> BACK2BACK_SETUP_W<6> { - BACK2BACK_SETUP_W::new(self) + pub fn back2back_setup(&mut self) -> BACK2BACK_SETUP_W { + BACK2BACK_SETUP_W::new(self, 6) } #[doc = "Bit 8 - OUT Packet Error Mask"] #[inline(always)] #[must_use] - pub fn out_pkt_err_msk(&mut self) -> OUT_PKT_ERR_MSK_W<8> { - OUT_PKT_ERR_MSK_W::new(self) + pub fn out_pkt_err_msk(&mut self) -> OUT_PKT_ERR_MSK_W { + OUT_PKT_ERR_MSK_W::new(self, 8) } #[doc = "Bit 9 - BNA interrupt Mask"] #[inline(always)] #[must_use] - pub fn bna_out_intr_msk(&mut self) -> BNA_OUT_INTR_MSK_W<9> { - BNA_OUT_INTR_MSK_W::new(self) + pub fn bna_out_intr_msk(&mut self) -> BNA_OUT_INTR_MSK_W { + BNA_OUT_INTR_MSK_W::new(self, 9) } #[doc = "Bit 12 - Babble Interrupt Mask"] #[inline(always)] #[must_use] - pub fn bble_err_msk(&mut self) -> BBLE_ERR_MSK_W<12> { - BBLE_ERR_MSK_W::new(self) + pub fn bble_err_msk(&mut self) -> BBLE_ERR_MSK_W { + BBLE_ERR_MSK_W::new(self, 12) } #[doc = "Bit 13 - NAK Interrupt Mask"] #[inline(always)] #[must_use] - pub fn nakmsk(&mut self) -> NAKMSK_W<13> { - NAKMSK_W::new(self) + pub fn nakmsk(&mut self) -> NAKMSK_W { + NAKMSK_W::new(self, 13) } #[doc = "Bit 14 - NYET Interrupt Mask"] #[inline(always)] #[must_use] - pub fn nyetmsk(&mut self) -> NYETMSK_W<14> { - NYETMSK_W::new(self) + pub fn nyetmsk(&mut self) -> NYETMSK_W { + NYETMSK_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device OUT Endpoint Common Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepmsk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepmsk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doepmsk::R`](R) reader structure"] +impl crate::Readable for DOEPMSK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doepmsk::W`](W) writer structure"] impl crate::Writable for DOEPMSK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dsts.rs b/src/usb0/dsts.rs index a4c01d5c..f0cca0d5 100644 --- a/src/usb0/dsts.rs +++ b/src/usb0/dsts.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `SuspSts` reader - Suspend Status"] -pub type SUSP_STS_R = crate::BitReader; +pub type SUSP_STS_R = crate::BitReader; #[doc = "Field `EnumSpd` reader - Enumerated Speed"] -pub type ENUM_SPD_R = crate::FieldReader; +pub type ENUM_SPD_R = crate::FieldReader; #[doc = "Enumerated Speed\n\nValue on reset: 1"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -30,25 +17,28 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ENUM_SPD_A { + type Ux = u8; +} impl ENUM_SPD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 3 => Some(ENUM_SPD_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Full speed (PHY clock is running at 48 MHz)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ENUM_SPD_A::VALUE4 } } #[doc = "Field `ErrticErr` reader - Erratic Error"] -pub type ERRTIC_ERR_R = crate::BitReader; +pub type ERRTIC_ERR_R = crate::BitReader; #[doc = "Field `SOFFN` reader - Frame Number of the Received SOF"] -pub type SOFFN_R = crate::FieldReader; +pub type SOFFN_R = crate::FieldReader; impl R { #[doc = "Bit 0 - Suspend Status"] #[inline(always)] @@ -71,15 +61,13 @@ 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"] +#[doc = "Device Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dsts::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dsts::R`](R) reader structure"] +impl crate::Readable for DSTS_SPEC {} #[doc = "`reset()` method sets DSTS to value 0x02"] impl crate::Resettable for DSTS_SPEC { const RESET_VALUE: Self::Ux = 0x02; diff --git a/src/usb0/dvbusdis.rs b/src/usb0/dvbusdis.rs index f8681244..3a882beb 100644 --- a/src/usb0/dvbusdis.rs +++ b/src/usb0/dvbusdis.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DVBUSDis` reader - Device Vbus Discharge Time"] -pub type DVBUSDIS_R = crate::FieldReader; +pub type DVBUSDIS_R = crate::FieldReader; #[doc = "Field `DVBUSDis` writer - Device Vbus Discharge Time"] -pub type DVBUSDIS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DVBUSDIS_SPEC, u16, u16, 16, O>; +pub type DVBUSDIS_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Device Vbus Discharge Time"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Device Vbus Discharge Time"] #[inline(always)] #[must_use] - pub fn dvbusdis(&mut self) -> DVBUSDIS_W<0> { - DVBUSDIS_W::new(self) + pub fn dvbusdis(&mut self) -> DVBUSDIS_W { + DVBUSDIS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device VBUS Discharge Time Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dvbusdis::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dvbusdis::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dvbusdis::R`](R) reader structure"] +impl crate::Readable for DVBUSDIS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dvbusdis::W`](W) writer structure"] impl crate::Writable for DVBUSDIS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/dvbuspulse.rs b/src/usb0/dvbuspulse.rs index 8e8536b3..78619a01 100644 --- a/src/usb0/dvbuspulse.rs +++ b/src/usb0/dvbuspulse.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DVBUSPulse` reader - Device Vbus Pulsing Time"] -pub type DVBUSPULSE_R = crate::FieldReader; +pub type DVBUSPULSE_R = crate::FieldReader; #[doc = "Field `DVBUSPulse` writer - Device Vbus Pulsing Time"] -pub type DVBUSPULSE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DVBUSPULSE_SPEC, u16, u16, 12, O>; +pub type DVBUSPULSE_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:11 - Device Vbus Pulsing Time"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:11 - Device Vbus Pulsing Time"] #[inline(always)] #[must_use] - pub fn dvbuspulse(&mut self) -> DVBUSPULSE_W<0> { - DVBUSPULSE_W::new(self) + pub fn dvbuspulse(&mut self) -> DVBUSPULSE_W { + DVBUSPULSE_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device VBUS Pulsing Time Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dvbuspulse::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dvbuspulse::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dvbuspulse::R`](R) reader structure"] +impl crate::Readable for DVBUSPULSE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dvbuspulse::W`](W) writer structure"] impl crate::Writable for DVBUSPULSE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gahbcfg.rs b/src/usb0/gahbcfg.rs index bce83078..6601d89a 100644 --- a/src/usb0/gahbcfg.rs +++ b/src/usb0/gahbcfg.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `GlblIntrMsk` reader - Global Interrupt Mask"] pub type GLBL_INTR_MSK_R = crate::BitReader; #[doc = "Global Interrupt Mask\n\nValue on reset: 0"] @@ -53,39 +21,42 @@ impl From for bool { impl GLBL_INTR_MSK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> GLBL_INTR_MSK_A { + pub const fn variant(&self) -> GLBL_INTR_MSK_A { match self.bits { false => GLBL_INTR_MSK_A::VALUE1, true => GLBL_INTR_MSK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Mask the interrupt assertion to the application."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == GLBL_INTR_MSK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Unmask the interrupt assertion to the application."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == GLBL_INTR_MSK_A::VALUE2 } } #[doc = "Field `GlblIntrMsk` writer - Global Interrupt Mask"] -pub type GLBL_INTR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GAHBCFG_SPEC, GLBL_INTR_MSK_A, O>; -impl<'a, const O: u8> GLBL_INTR_MSK_W<'a, O> { +pub type GLBL_INTR_MSK_W<'a, REG> = crate::BitWriter<'a, REG, GLBL_INTR_MSK_A>; +impl<'a, REG> GLBL_INTR_MSK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Mask the interrupt assertion to the application."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GLBL_INTR_MSK_A::VALUE1) } #[doc = "Unmask the interrupt assertion to the application."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GLBL_INTR_MSK_A::VALUE2) } } #[doc = "Field `HBstLen` reader - Burst Length/Type"] -pub type HBST_LEN_R = crate::FieldReader; +pub type HBST_LEN_R = crate::FieldReader; #[doc = "Burst Length/Type\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -107,10 +78,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HBST_LEN_A { + type Ux = u8; +} impl HBST_LEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(HBST_LEN_A::VALUE1), 1 => Some(HBST_LEN_A::VALUE2), @@ -120,58 +94,62 @@ impl HBST_LEN_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Single"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HBST_LEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "INCR"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HBST_LEN_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "INCR4"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HBST_LEN_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "INCR8"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == HBST_LEN_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "INCR16"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == HBST_LEN_A::VALUE5 } } #[doc = "Field `HBstLen` writer - Burst Length/Type"] -pub type HBST_LEN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GAHBCFG_SPEC, u8, HBST_LEN_A, 4, O>; -impl<'a, const O: u8> HBST_LEN_W<'a, O> { +pub type HBST_LEN_W<'a, REG> = crate::FieldWriter<'a, REG, 4, HBST_LEN_A>; +impl<'a, REG> HBST_LEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Single"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HBST_LEN_A::VALUE1) } #[doc = "INCR"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HBST_LEN_A::VALUE2) } #[doc = "INCR4"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HBST_LEN_A::VALUE3) } #[doc = "INCR8"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(HBST_LEN_A::VALUE4) } #[doc = "INCR16"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(HBST_LEN_A::VALUE5) } } @@ -194,34 +172,37 @@ impl From for bool { impl DMAEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DMAEN_A { + pub const fn variant(&self) -> DMAEN_A { match self.bits { false => DMAEN_A::VALUE1, true => DMAEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Core operates in Slave mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DMAEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Core operates in a DMA mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DMAEN_A::VALUE2 } } #[doc = "Field `DMAEn` writer - DMA Enable"] -pub type DMAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GAHBCFG_SPEC, DMAEN_A, O>; -impl<'a, const O: u8> DMAEN_W<'a, O> { +pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG, DMAEN_A>; +impl<'a, REG> DMAEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Core operates in Slave mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DMAEN_A::VALUE1) } #[doc = "Core operates in a DMA mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DMAEN_A::VALUE2) } } @@ -244,34 +225,37 @@ impl From for bool { impl NPTX_FEMP_LVL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NPTX_FEMP_LVL_A { + pub const fn variant(&self) -> NPTX_FEMP_LVL_A { match self.bits { false => NPTX_FEMP_LVL_A::VALUE1, true => NPTX_FEMP_LVL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DIEPINTx.TxFEmp interrupt indicates that the IN Endpoint TxFIFO is half empty"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NPTX_FEMP_LVL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DIEPINTx.TxFEmp interrupt indicates that the IN Endpoint TxFIFO is completely empty"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NPTX_FEMP_LVL_A::VALUE2 } } #[doc = "Field `NPTxFEmpLvl` writer - Non-Periodic TxFIFO Empty Level"] -pub type NPTX_FEMP_LVL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GAHBCFG_SPEC, NPTX_FEMP_LVL_A, O>; -impl<'a, const O: u8> NPTX_FEMP_LVL_W<'a, O> { +pub type NPTX_FEMP_LVL_W<'a, REG> = crate::BitWriter<'a, REG, NPTX_FEMP_LVL_A>; +impl<'a, REG> NPTX_FEMP_LVL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DIEPINTx.TxFEmp interrupt indicates that the IN Endpoint TxFIFO is half empty"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NPTX_FEMP_LVL_A::VALUE1) } #[doc = "DIEPINTx.TxFEmp interrupt indicates that the IN Endpoint TxFIFO is completely empty"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NPTX_FEMP_LVL_A::VALUE2) } } @@ -294,34 +278,37 @@ impl From for bool { impl PTX_FEMP_LVL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PTX_FEMP_LVL_A { + pub const fn variant(&self) -> PTX_FEMP_LVL_A { match self.bits { false => PTX_FEMP_LVL_A::VALUE1, true => PTX_FEMP_LVL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "GINTSTS.PTxFEmp interrupt indicates that the Periodic TxFIFO is half empty"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PTX_FEMP_LVL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "GINTSTS.PTxFEmp interrupt indicates that the Periodic TxFIFO is completely empty"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PTX_FEMP_LVL_A::VALUE2 } } #[doc = "Field `PTxFEmpLvl` writer - Periodic TxFIFO Empty Level"] -pub type PTX_FEMP_LVL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GAHBCFG_SPEC, PTX_FEMP_LVL_A, O>; -impl<'a, const O: u8> PTX_FEMP_LVL_W<'a, O> { +pub type PTX_FEMP_LVL_W<'a, REG> = crate::BitWriter<'a, REG, PTX_FEMP_LVL_A>; +impl<'a, REG> PTX_FEMP_LVL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "GINTSTS.PTxFEmp interrupt indicates that the Periodic TxFIFO is half empty"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PTX_FEMP_LVL_A::VALUE1) } #[doc = "GINTSTS.PTxFEmp interrupt indicates that the Periodic TxFIFO is completely empty"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PTX_FEMP_LVL_A::VALUE2) } } @@ -344,34 +331,37 @@ impl From for bool { impl AHBSINGLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AHBSINGLE_A { + pub const fn variant(&self) -> AHBSINGLE_A { match self.bits { false => AHBSINGLE_A::VALUE1, true => AHBSINGLE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The remaining data in a transfer is sent using INCR burst size. This is the default mode."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AHBSINGLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The remaining data in a transfer is sent using single burst size."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AHBSINGLE_A::VALUE2 } } #[doc = "Field `AHBSingle` writer - AHB Single Support"] -pub type AHBSINGLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GAHBCFG_SPEC, AHBSINGLE_A, O>; -impl<'a, const O: u8> AHBSINGLE_W<'a, O> { +pub type AHBSINGLE_W<'a, REG> = crate::BitWriter<'a, REG, AHBSINGLE_A>; +impl<'a, REG> AHBSINGLE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The remaining data in a transfer is sent using INCR burst size. This is the default mode."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AHBSINGLE_A::VALUE1) } #[doc = "The remaining data in a transfer is sent using single burst size."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AHBSINGLE_A::VALUE2) } } @@ -411,58 +401,59 @@ impl W { #[doc = "Bit 0 - Global Interrupt Mask"] #[inline(always)] #[must_use] - pub fn glbl_intr_msk(&mut self) -> GLBL_INTR_MSK_W<0> { - GLBL_INTR_MSK_W::new(self) + pub fn glbl_intr_msk(&mut self) -> GLBL_INTR_MSK_W { + GLBL_INTR_MSK_W::new(self, 0) } #[doc = "Bits 1:4 - Burst Length/Type"] #[inline(always)] #[must_use] - pub fn hbst_len(&mut self) -> HBST_LEN_W<1> { - HBST_LEN_W::new(self) + pub fn hbst_len(&mut self) -> HBST_LEN_W { + HBST_LEN_W::new(self, 1) } #[doc = "Bit 5 - DMA Enable"] #[inline(always)] #[must_use] - pub fn dmaen(&mut self) -> DMAEN_W<5> { - DMAEN_W::new(self) + pub fn dmaen(&mut self) -> DMAEN_W { + DMAEN_W::new(self, 5) } #[doc = "Bit 7 - Non-Periodic TxFIFO Empty Level"] #[inline(always)] #[must_use] - pub fn nptx_femp_lvl(&mut self) -> NPTX_FEMP_LVL_W<7> { - NPTX_FEMP_LVL_W::new(self) + pub fn nptx_femp_lvl(&mut self) -> NPTX_FEMP_LVL_W { + NPTX_FEMP_LVL_W::new(self, 7) } #[doc = "Bit 8 - Periodic TxFIFO Empty Level"] #[inline(always)] #[must_use] - pub fn ptx_femp_lvl(&mut self) -> PTX_FEMP_LVL_W<8> { - PTX_FEMP_LVL_W::new(self) + pub fn ptx_femp_lvl(&mut self) -> PTX_FEMP_LVL_W { + PTX_FEMP_LVL_W::new(self, 8) } #[doc = "Bit 23 - AHB Single Support"] #[inline(always)] #[must_use] - pub fn ahbsingle(&mut self) -> AHBSINGLE_W<23> { - AHBSINGLE_W::new(self) + pub fn ahbsingle(&mut self) -> AHBSINGLE_W { + AHBSINGLE_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "AHB Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gahbcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gahbcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gahbcfg::R`](R) reader structure"] +impl crate::Readable for GAHBCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gahbcfg::W`](W) writer structure"] impl crate::Writable for GAHBCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gdfifocfg.rs b/src/usb0/gdfifocfg.rs index d8f07a00..8215490f 100644 --- a/src/usb0/gdfifocfg.rs +++ b/src/usb0/gdfifocfg.rs @@ -1,47 +1,15 @@ #[doc = "Register `GDFIFOCFG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `GDFIFOCfg` reader - GDFIFOCfg"] -pub type GDFIFOCFG_R = crate::FieldReader; +pub type GDFIFOCFG_R = crate::FieldReader; #[doc = "Field `GDFIFOCfg` writer - GDFIFOCfg"] -pub type GDFIFOCFG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GDFIFOCFG_SPEC, u16, u16, 16, O>; +pub type GDFIFOCFG_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `EPInfoBaseAddr` reader - EPInfoBaseAddr"] -pub type EPINFO_BASE_ADDR_R = crate::FieldReader; +pub type EPINFO_BASE_ADDR_R = crate::FieldReader; #[doc = "Field `EPInfoBaseAddr` writer - EPInfoBaseAddr"] -pub type EPINFO_BASE_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GDFIFOCFG_SPEC, u16, u16, 16, O>; +pub type EPINFO_BASE_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - GDFIFOCfg"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - GDFIFOCfg"] #[inline(always)] #[must_use] - pub fn gdfifocfg(&mut self) -> GDFIFOCFG_W<0> { - GDFIFOCFG_W::new(self) + pub fn gdfifocfg(&mut self) -> GDFIFOCFG_W { + GDFIFOCFG_W::new(self, 0) } #[doc = "Bits 16:31 - EPInfoBaseAddr"] #[inline(always)] #[must_use] - pub fn epinfo_base_addr(&mut self) -> EPINFO_BASE_ADDR_W<16> { - EPINFO_BASE_ADDR_W::new(self) + pub fn epinfo_base_addr(&mut self) -> EPINFO_BASE_ADDR_W { + EPINFO_BASE_ADDR_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global DFIFO Software Config Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gdfifocfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gdfifocfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gdfifocfg::R`](R) reader structure"] +impl crate::Readable for GDFIFOCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gdfifocfg::W`](W) writer structure"] impl crate::Writable for GDFIFOCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gintmsk_devicemode.rs b/src/usb0/gintmsk_devicemode.rs index df55bc7a..d1512121 100644 --- a/src/usb0/gintmsk_devicemode.rs +++ b/src/usb0/gintmsk_devicemode.rs @@ -1,119 +1,87 @@ #[doc = "Register `GINTMSK_DEVICEMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GINTMSK_DEVICEMODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ModeMisMsk` reader - Mode Mismatch Interrupt Mask"] -pub type MODE_MIS_MSK_R = crate::BitReader; +pub type MODE_MIS_MSK_R = crate::BitReader; #[doc = "Field `ModeMisMsk` writer - Mode Mismatch Interrupt Mask"] -pub type MODE_MIS_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type MODE_MIS_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OTGIntMsk` reader - OTG Interrupt Mask"] -pub type OTGINT_MSK_R = crate::BitReader; +pub type OTGINT_MSK_R = crate::BitReader; #[doc = "Field `OTGIntMsk` writer - OTG Interrupt Mask"] -pub type OTGINT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type OTGINT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SofMsk` reader - Start of Frame Mask"] -pub type SOF_MSK_R = crate::BitReader; +pub type SOF_MSK_R = crate::BitReader; #[doc = "Field `SofMsk` writer - Start of Frame Mask"] -pub type SOF_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type SOF_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RxFLvlMsk` reader - Receive FIFO Non-Empty Mask"] -pub type RX_FLVL_MSK_R = crate::BitReader; +pub type RX_FLVL_MSK_R = crate::BitReader; #[doc = "Field `RxFLvlMsk` writer - Receive FIFO Non-Empty Mask"] -pub type RX_FLVL_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type RX_FLVL_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `GINNakEffMsk` reader - Global Non-periodic IN NAK Effective Mask"] -pub type GINNAK_EFF_MSK_R = crate::BitReader; +pub type GINNAK_EFF_MSK_R = crate::BitReader; #[doc = "Field `GINNakEffMsk` writer - Global Non-periodic IN NAK Effective Mask"] -pub type GINNAK_EFF_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type GINNAK_EFF_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `GOUTNakEffMsk` reader - Global OUT NAK Effective Mask"] -pub type GOUTNAK_EFF_MSK_R = crate::BitReader; +pub type GOUTNAK_EFF_MSK_R = crate::BitReader; #[doc = "Field `GOUTNakEffMsk` writer - Global OUT NAK Effective Mask"] -pub type GOUTNAK_EFF_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type GOUTNAK_EFF_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ErlySuspMsk` reader - Early Suspend Mask"] -pub type ERLY_SUSP_MSK_R = crate::BitReader; +pub type ERLY_SUSP_MSK_R = crate::BitReader; #[doc = "Field `ErlySuspMsk` writer - Early Suspend Mask"] -pub type ERLY_SUSP_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type ERLY_SUSP_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `USBSuspMsk` reader - USB Suspend Mask"] -pub type USBSUSP_MSK_R = crate::BitReader; +pub type USBSUSP_MSK_R = crate::BitReader; #[doc = "Field `USBSuspMsk` writer - USB Suspend Mask"] -pub type USBSUSP_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type USBSUSP_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `USBRstMsk` reader - USB Reset Mask"] -pub type USBRST_MSK_R = crate::BitReader; +pub type USBRST_MSK_R = crate::BitReader; #[doc = "Field `USBRstMsk` writer - USB Reset Mask"] -pub type USBRST_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type USBRST_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EnumDoneMsk` reader - Enumeration Done Mask"] -pub type ENUM_DONE_MSK_R = crate::BitReader; +pub type ENUM_DONE_MSK_R = crate::BitReader; #[doc = "Field `EnumDoneMsk` writer - Enumeration Done Mask"] -pub type ENUM_DONE_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type ENUM_DONE_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ISOOutDropMsk` reader - Isochronous OUT Packet Dropped Interrupt Mask"] -pub type ISOOUT_DROP_MSK_R = crate::BitReader; +pub type ISOOUT_DROP_MSK_R = crate::BitReader; #[doc = "Field `ISOOutDropMsk` writer - Isochronous OUT Packet Dropped Interrupt Mask"] -pub type ISOOUT_DROP_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type ISOOUT_DROP_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EOPFMsk` reader - End of Periodic Frame Interrupt Mask"] -pub type EOPFMSK_R = crate::BitReader; +pub type EOPFMSK_R = crate::BitReader; #[doc = "Field `EOPFMsk` writer - End of Periodic Frame Interrupt Mask"] -pub type EOPFMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type EOPFMSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `IEPIntMsk` reader - IN Endpoints Interrupt Mask"] -pub type IEPINT_MSK_R = crate::BitReader; +pub type IEPINT_MSK_R = crate::BitReader; #[doc = "Field `IEPIntMsk` writer - IN Endpoints Interrupt Mask"] -pub type IEPINT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type IEPINT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OEPIntMsk` reader - OUT Endpoints Interrupt Mask"] -pub type OEPINT_MSK_R = crate::BitReader; +pub type OEPINT_MSK_R = crate::BitReader; #[doc = "Field `OEPIntMsk` writer - OUT Endpoints Interrupt Mask"] -pub type OEPINT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type OEPINT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `incompISOINMsk` reader - Incomplete Isochronous IN Transfer Mask"] -pub type INCOMP_ISOINMSK_R = crate::BitReader; +pub type INCOMP_ISOINMSK_R = crate::BitReader; #[doc = "Field `incompISOINMsk` writer - Incomplete Isochronous IN Transfer Mask"] -pub type INCOMP_ISOINMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type INCOMP_ISOINMSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `incomplSOOUTMsk` reader - Incomplete Isochronous OUT Transfer Mask"] -pub type INCOMPL_SOOUTMSK_R = crate::BitReader; +pub type INCOMPL_SOOUTMSK_R = crate::BitReader; #[doc = "Field `incomplSOOUTMsk` writer - Incomplete Isochronous OUT Transfer Mask"] -pub type INCOMPL_SOOUTMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type INCOMPL_SOOUTMSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ConIDStsChngMsk` reader - Connector ID Status Change Mask"] -pub type CON_IDSTS_CHNG_MSK_R = crate::BitReader; +pub type CON_IDSTS_CHNG_MSK_R = crate::BitReader; #[doc = "Field `ConIDStsChngMsk` writer - Connector ID Status Change Mask"] -pub type CON_IDSTS_CHNG_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type CON_IDSTS_CHNG_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DisconnIntMsk` reader - Disconnect Detected Interrupt Mask"] -pub type DISCONN_INT_MSK_R = crate::BitReader; +pub type DISCONN_INT_MSK_R = crate::BitReader; #[doc = "Field `DisconnIntMsk` writer - Disconnect Detected Interrupt Mask"] -pub type DISCONN_INT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type DISCONN_INT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SessReqIntMsk` reader - Session Request/New Session Detected Interrupt Mask"] -pub type SESS_REQ_INT_MSK_R = crate::BitReader; +pub type SESS_REQ_INT_MSK_R = crate::BitReader; #[doc = "Field `SessReqIntMsk` writer - Session Request/New Session Detected Interrupt Mask"] -pub type SESS_REQ_INT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type SESS_REQ_INT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `WkUpIntMsk` reader - Resume/Remote Wakeup Detected Interrupt Mask"] -pub type WK_UP_INT_MSK_R = crate::BitReader; +pub type WK_UP_INT_MSK_R = crate::BitReader; #[doc = "Field `WkUpIntMsk` writer - Resume/Remote Wakeup Detected Interrupt Mask"] -pub type WK_UP_INT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_DEVICEMODE_SPEC, bool, O>; +pub type WK_UP_INT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 1 - Mode Mismatch Interrupt Mask"] #[inline(always)] @@ -220,142 +188,143 @@ impl W { #[doc = "Bit 1 - Mode Mismatch Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mode_mis_msk(&mut self) -> MODE_MIS_MSK_W<1> { - MODE_MIS_MSK_W::new(self) + pub fn mode_mis_msk(&mut self) -> MODE_MIS_MSK_W { + MODE_MIS_MSK_W::new(self, 1) } #[doc = "Bit 2 - OTG Interrupt Mask"] #[inline(always)] #[must_use] - pub fn otgint_msk(&mut self) -> OTGINT_MSK_W<2> { - OTGINT_MSK_W::new(self) + pub fn otgint_msk(&mut self) -> OTGINT_MSK_W { + OTGINT_MSK_W::new(self, 2) } #[doc = "Bit 3 - Start of Frame Mask"] #[inline(always)] #[must_use] - pub fn sof_msk(&mut self) -> SOF_MSK_W<3> { - SOF_MSK_W::new(self) + pub fn sof_msk(&mut self) -> SOF_MSK_W { + SOF_MSK_W::new(self, 3) } #[doc = "Bit 4 - Receive FIFO Non-Empty Mask"] #[inline(always)] #[must_use] - pub fn rx_flvl_msk(&mut self) -> RX_FLVL_MSK_W<4> { - RX_FLVL_MSK_W::new(self) + pub fn rx_flvl_msk(&mut self) -> RX_FLVL_MSK_W { + RX_FLVL_MSK_W::new(self, 4) } #[doc = "Bit 6 - Global Non-periodic IN NAK Effective Mask"] #[inline(always)] #[must_use] - pub fn ginnak_eff_msk(&mut self) -> GINNAK_EFF_MSK_W<6> { - GINNAK_EFF_MSK_W::new(self) + pub fn ginnak_eff_msk(&mut self) -> GINNAK_EFF_MSK_W { + GINNAK_EFF_MSK_W::new(self, 6) } #[doc = "Bit 7 - Global OUT NAK Effective Mask"] #[inline(always)] #[must_use] - pub fn goutnak_eff_msk(&mut self) -> GOUTNAK_EFF_MSK_W<7> { - GOUTNAK_EFF_MSK_W::new(self) + pub fn goutnak_eff_msk(&mut self) -> GOUTNAK_EFF_MSK_W { + GOUTNAK_EFF_MSK_W::new(self, 7) } #[doc = "Bit 10 - Early Suspend Mask"] #[inline(always)] #[must_use] - pub fn erly_susp_msk(&mut self) -> ERLY_SUSP_MSK_W<10> { - ERLY_SUSP_MSK_W::new(self) + pub fn erly_susp_msk(&mut self) -> ERLY_SUSP_MSK_W { + ERLY_SUSP_MSK_W::new(self, 10) } #[doc = "Bit 11 - USB Suspend Mask"] #[inline(always)] #[must_use] - pub fn usbsusp_msk(&mut self) -> USBSUSP_MSK_W<11> { - USBSUSP_MSK_W::new(self) + pub fn usbsusp_msk(&mut self) -> USBSUSP_MSK_W { + USBSUSP_MSK_W::new(self, 11) } #[doc = "Bit 12 - USB Reset Mask"] #[inline(always)] #[must_use] - pub fn usbrst_msk(&mut self) -> USBRST_MSK_W<12> { - USBRST_MSK_W::new(self) + pub fn usbrst_msk(&mut self) -> USBRST_MSK_W { + USBRST_MSK_W::new(self, 12) } #[doc = "Bit 13 - Enumeration Done Mask"] #[inline(always)] #[must_use] - pub fn enum_done_msk(&mut self) -> ENUM_DONE_MSK_W<13> { - ENUM_DONE_MSK_W::new(self) + pub fn enum_done_msk(&mut self) -> ENUM_DONE_MSK_W { + ENUM_DONE_MSK_W::new(self, 13) } #[doc = "Bit 14 - Isochronous OUT Packet Dropped Interrupt Mask"] #[inline(always)] #[must_use] - pub fn isoout_drop_msk(&mut self) -> ISOOUT_DROP_MSK_W<14> { - ISOOUT_DROP_MSK_W::new(self) + pub fn isoout_drop_msk(&mut self) -> ISOOUT_DROP_MSK_W { + ISOOUT_DROP_MSK_W::new(self, 14) } #[doc = "Bit 15 - End of Periodic Frame Interrupt Mask"] #[inline(always)] #[must_use] - pub fn eopfmsk(&mut self) -> EOPFMSK_W<15> { - EOPFMSK_W::new(self) + pub fn eopfmsk(&mut self) -> EOPFMSK_W { + EOPFMSK_W::new(self, 15) } #[doc = "Bit 18 - IN Endpoints Interrupt Mask"] #[inline(always)] #[must_use] - pub fn iepint_msk(&mut self) -> IEPINT_MSK_W<18> { - IEPINT_MSK_W::new(self) + pub fn iepint_msk(&mut self) -> IEPINT_MSK_W { + IEPINT_MSK_W::new(self, 18) } #[doc = "Bit 19 - OUT Endpoints Interrupt Mask"] #[inline(always)] #[must_use] - pub fn oepint_msk(&mut self) -> OEPINT_MSK_W<19> { - OEPINT_MSK_W::new(self) + pub fn oepint_msk(&mut self) -> OEPINT_MSK_W { + OEPINT_MSK_W::new(self, 19) } #[doc = "Bit 20 - Incomplete Isochronous IN Transfer Mask"] #[inline(always)] #[must_use] - pub fn incomp_isoinmsk(&mut self) -> INCOMP_ISOINMSK_W<20> { - INCOMP_ISOINMSK_W::new(self) + pub fn incomp_isoinmsk(&mut self) -> INCOMP_ISOINMSK_W { + INCOMP_ISOINMSK_W::new(self, 20) } #[doc = "Bit 21 - Incomplete Isochronous OUT Transfer Mask"] #[inline(always)] #[must_use] - pub fn incompl_sooutmsk(&mut self) -> INCOMPL_SOOUTMSK_W<21> { - INCOMPL_SOOUTMSK_W::new(self) + pub fn incompl_sooutmsk(&mut self) -> INCOMPL_SOOUTMSK_W { + INCOMPL_SOOUTMSK_W::new(self, 21) } #[doc = "Bit 28 - Connector ID Status Change Mask"] #[inline(always)] #[must_use] - pub fn con_idsts_chng_msk(&mut self) -> CON_IDSTS_CHNG_MSK_W<28> { - CON_IDSTS_CHNG_MSK_W::new(self) + pub fn con_idsts_chng_msk(&mut self) -> CON_IDSTS_CHNG_MSK_W { + CON_IDSTS_CHNG_MSK_W::new(self, 28) } #[doc = "Bit 29 - Disconnect Detected Interrupt Mask"] #[inline(always)] #[must_use] - pub fn disconn_int_msk(&mut self) -> DISCONN_INT_MSK_W<29> { - DISCONN_INT_MSK_W::new(self) + pub fn disconn_int_msk(&mut self) -> DISCONN_INT_MSK_W { + DISCONN_INT_MSK_W::new(self, 29) } #[doc = "Bit 30 - Session Request/New Session Detected Interrupt Mask"] #[inline(always)] #[must_use] - pub fn sess_req_int_msk(&mut self) -> SESS_REQ_INT_MSK_W<30> { - SESS_REQ_INT_MSK_W::new(self) + pub fn sess_req_int_msk(&mut self) -> SESS_REQ_INT_MSK_W { + SESS_REQ_INT_MSK_W::new(self, 30) } #[doc = "Bit 31 - Resume/Remote Wakeup Detected Interrupt Mask"] #[inline(always)] #[must_use] - pub fn wk_up_int_msk(&mut self) -> WK_UP_INT_MSK_W<31> { - WK_UP_INT_MSK_W::new(self) + pub fn wk_up_int_msk(&mut self) -> WK_UP_INT_MSK_W { + WK_UP_INT_MSK_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Interrupt Mask Register \\[DEVICEMODE\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::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_devicemode](index.html) module"] +#[doc = "Interrupt Mask Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintmsk_devicemode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintmsk_devicemode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GINTMSK_DEVICEMODE_SPEC; impl crate::RegisterSpec for GINTMSK_DEVICEMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gintmsk_devicemode::R](R) reader structure"] -impl crate::Readable for GINTMSK_DEVICEMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gintmsk_devicemode::W](W) writer structure"] +#[doc = "`read()` method returns [`gintmsk_devicemode::R`](R) reader structure"] +impl crate::Readable for GINTMSK_DEVICEMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gintmsk_devicemode::W`](W) writer structure"] impl crate::Writable for GINTMSK_DEVICEMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gintmsk_hostmode.rs b/src/usb0/gintmsk_hostmode.rs index 22e73d2c..4052ca73 100644 --- a/src/usb0/gintmsk_hostmode.rs +++ b/src/usb0/gintmsk_hostmode.rs @@ -1,87 +1,55 @@ #[doc = "Register `GINTMSK_HOSTMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GINTMSK_HOSTMODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ModeMisMsk` reader - Mode Mismatch Interrupt Mask"] -pub type MODE_MIS_MSK_R = crate::BitReader; +pub type MODE_MIS_MSK_R = crate::BitReader; #[doc = "Field `ModeMisMsk` writer - Mode Mismatch Interrupt Mask"] -pub type MODE_MIS_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type MODE_MIS_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OTGIntMsk` reader - OTG Interrupt Mask"] -pub type OTGINT_MSK_R = crate::BitReader; +pub type OTGINT_MSK_R = crate::BitReader; #[doc = "Field `OTGIntMsk` writer - OTG Interrupt Mask"] -pub type OTGINT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type OTGINT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SofMsk` reader - Start of Frame Mask"] -pub type SOF_MSK_R = crate::BitReader; +pub type SOF_MSK_R = crate::BitReader; #[doc = "Field `SofMsk` writer - Start of Frame Mask"] -pub type SOF_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type SOF_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RxFLvlMsk` reader - Receive FIFO Non-Empty Mask"] -pub type RX_FLVL_MSK_R = crate::BitReader; +pub type RX_FLVL_MSK_R = crate::BitReader; #[doc = "Field `RxFLvlMsk` writer - Receive FIFO Non-Empty Mask"] -pub type RX_FLVL_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type RX_FLVL_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `incomplPMsk` reader - Incomplete Periodic Transfer Mask"] -pub type INCOMPL_PMSK_R = crate::BitReader; +pub type INCOMPL_PMSK_R = crate::BitReader; #[doc = "Field `incomplPMsk` writer - Incomplete Periodic Transfer Mask"] -pub type INCOMPL_PMSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type INCOMPL_PMSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PrtIntMsk` reader - Host Port Interrupt Mask"] -pub type PRT_INT_MSK_R = crate::BitReader; +pub type PRT_INT_MSK_R = crate::BitReader; #[doc = "Field `PrtIntMsk` writer - Host Port Interrupt Mask"] -pub type PRT_INT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type PRT_INT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `HChIntMsk` reader - Host Channels Interrupt Mask"] -pub type HCH_INT_MSK_R = crate::BitReader; +pub type HCH_INT_MSK_R = crate::BitReader; #[doc = "Field `HChIntMsk` writer - Host Channels Interrupt Mask"] -pub type HCH_INT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type HCH_INT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PTxFEmpMsk` reader - Periodic TxFIFO Empty Mask"] -pub type PTX_FEMP_MSK_R = crate::BitReader; +pub type PTX_FEMP_MSK_R = crate::BitReader; #[doc = "Field `PTxFEmpMsk` writer - Periodic TxFIFO Empty Mask"] -pub type PTX_FEMP_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type PTX_FEMP_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ConIDStsChngMsk` reader - Connector ID Status Change Mask"] -pub type CON_IDSTS_CHNG_MSK_R = crate::BitReader; +pub type CON_IDSTS_CHNG_MSK_R = crate::BitReader; #[doc = "Field `ConIDStsChngMsk` writer - Connector ID Status Change Mask"] -pub type CON_IDSTS_CHNG_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type CON_IDSTS_CHNG_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DisconnIntMsk` reader - Disconnect Detected Interrupt Mask"] -pub type DISCONN_INT_MSK_R = crate::BitReader; +pub type DISCONN_INT_MSK_R = crate::BitReader; #[doc = "Field `DisconnIntMsk` writer - Disconnect Detected Interrupt Mask"] -pub type DISCONN_INT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type DISCONN_INT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SessReqIntMsk` reader - Session Request/New Session Detected Interrupt Mask"] -pub type SESS_REQ_INT_MSK_R = crate::BitReader; +pub type SESS_REQ_INT_MSK_R = crate::BitReader; #[doc = "Field `SessReqIntMsk` writer - Session Request/New Session Detected Interrupt Mask"] -pub type SESS_REQ_INT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type SESS_REQ_INT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `WkUpIntMsk` reader - Resume/Remote Wakeup Detected Interrupt Mask"] -pub type WK_UP_INT_MSK_R = crate::BitReader; +pub type WK_UP_INT_MSK_R = crate::BitReader; #[doc = "Field `WkUpIntMsk` writer - Resume/Remote Wakeup Detected Interrupt Mask"] -pub type WK_UP_INT_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTMSK_HOSTMODE_SPEC, bool, O>; +pub type WK_UP_INT_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 1 - Mode Mismatch Interrupt Mask"] #[inline(always)] @@ -148,94 +116,95 @@ impl W { #[doc = "Bit 1 - Mode Mismatch Interrupt Mask"] #[inline(always)] #[must_use] - pub fn mode_mis_msk(&mut self) -> MODE_MIS_MSK_W<1> { - MODE_MIS_MSK_W::new(self) + pub fn mode_mis_msk(&mut self) -> MODE_MIS_MSK_W { + MODE_MIS_MSK_W::new(self, 1) } #[doc = "Bit 2 - OTG Interrupt Mask"] #[inline(always)] #[must_use] - pub fn otgint_msk(&mut self) -> OTGINT_MSK_W<2> { - OTGINT_MSK_W::new(self) + pub fn otgint_msk(&mut self) -> OTGINT_MSK_W { + OTGINT_MSK_W::new(self, 2) } #[doc = "Bit 3 - Start of Frame Mask"] #[inline(always)] #[must_use] - pub fn sof_msk(&mut self) -> SOF_MSK_W<3> { - SOF_MSK_W::new(self) + pub fn sof_msk(&mut self) -> SOF_MSK_W { + SOF_MSK_W::new(self, 3) } #[doc = "Bit 4 - Receive FIFO Non-Empty Mask"] #[inline(always)] #[must_use] - pub fn rx_flvl_msk(&mut self) -> RX_FLVL_MSK_W<4> { - RX_FLVL_MSK_W::new(self) + pub fn rx_flvl_msk(&mut self) -> RX_FLVL_MSK_W { + RX_FLVL_MSK_W::new(self, 4) } #[doc = "Bit 21 - Incomplete Periodic Transfer Mask"] #[inline(always)] #[must_use] - pub fn incompl_pmsk(&mut self) -> INCOMPL_PMSK_W<21> { - INCOMPL_PMSK_W::new(self) + pub fn incompl_pmsk(&mut self) -> INCOMPL_PMSK_W { + INCOMPL_PMSK_W::new(self, 21) } #[doc = "Bit 24 - Host Port Interrupt Mask"] #[inline(always)] #[must_use] - pub fn prt_int_msk(&mut self) -> PRT_INT_MSK_W<24> { - PRT_INT_MSK_W::new(self) + pub fn prt_int_msk(&mut self) -> PRT_INT_MSK_W { + PRT_INT_MSK_W::new(self, 24) } #[doc = "Bit 25 - Host Channels Interrupt Mask"] #[inline(always)] #[must_use] - pub fn hch_int_msk(&mut self) -> HCH_INT_MSK_W<25> { - HCH_INT_MSK_W::new(self) + pub fn hch_int_msk(&mut self) -> HCH_INT_MSK_W { + HCH_INT_MSK_W::new(self, 25) } #[doc = "Bit 26 - Periodic TxFIFO Empty Mask"] #[inline(always)] #[must_use] - pub fn ptx_femp_msk(&mut self) -> PTX_FEMP_MSK_W<26> { - PTX_FEMP_MSK_W::new(self) + pub fn ptx_femp_msk(&mut self) -> PTX_FEMP_MSK_W { + PTX_FEMP_MSK_W::new(self, 26) } #[doc = "Bit 28 - Connector ID Status Change Mask"] #[inline(always)] #[must_use] - pub fn con_idsts_chng_msk(&mut self) -> CON_IDSTS_CHNG_MSK_W<28> { - CON_IDSTS_CHNG_MSK_W::new(self) + pub fn con_idsts_chng_msk(&mut self) -> CON_IDSTS_CHNG_MSK_W { + CON_IDSTS_CHNG_MSK_W::new(self, 28) } #[doc = "Bit 29 - Disconnect Detected Interrupt Mask"] #[inline(always)] #[must_use] - pub fn disconn_int_msk(&mut self) -> DISCONN_INT_MSK_W<29> { - DISCONN_INT_MSK_W::new(self) + pub fn disconn_int_msk(&mut self) -> DISCONN_INT_MSK_W { + DISCONN_INT_MSK_W::new(self, 29) } #[doc = "Bit 30 - Session Request/New Session Detected Interrupt Mask"] #[inline(always)] #[must_use] - pub fn sess_req_int_msk(&mut self) -> SESS_REQ_INT_MSK_W<30> { - SESS_REQ_INT_MSK_W::new(self) + pub fn sess_req_int_msk(&mut self) -> SESS_REQ_INT_MSK_W { + SESS_REQ_INT_MSK_W::new(self, 30) } #[doc = "Bit 31 - Resume/Remote Wakeup Detected Interrupt Mask"] #[inline(always)] #[must_use] - pub fn wk_up_int_msk(&mut self) -> WK_UP_INT_MSK_W<31> { - WK_UP_INT_MSK_W::new(self) + pub fn wk_up_int_msk(&mut self) -> WK_UP_INT_MSK_W { + WK_UP_INT_MSK_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Interrupt Mask Register \\[HOSTMODE\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::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_hostmode](index.html) module"] +#[doc = "Interrupt Mask Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintmsk_hostmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintmsk_hostmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GINTMSK_HOSTMODE_SPEC; impl crate::RegisterSpec for GINTMSK_HOSTMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gintmsk_hostmode::R](R) reader structure"] -impl crate::Readable for GINTMSK_HOSTMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gintmsk_hostmode::W](W) writer structure"] +#[doc = "`read()` method returns [`gintmsk_hostmode::R`](R) reader structure"] +impl crate::Readable for GINTMSK_HOSTMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gintmsk_hostmode::W`](W) writer structure"] impl crate::Writable for GINTMSK_HOSTMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gintsts_devicemode.rs b/src/usb0/gintsts_devicemode.rs index 7fd62848..2db3e27c 100644 --- a/src/usb0/gintsts_devicemode.rs +++ b/src/usb0/gintsts_devicemode.rs @@ -1,39 +1,7 @@ #[doc = "Register `GINTSTS_DEVICEMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GINTSTS_DEVICEMODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CurMod` reader - Current Mode of Operation"] pub type CUR_MOD_R = crate::BitReader; #[doc = "Current Mode of Operation\n\nValue on reset: 0"] @@ -53,87 +21,87 @@ impl From for bool { impl CUR_MOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CUR_MOD_A { + pub const fn variant(&self) -> CUR_MOD_A { match self.bits { false => CUR_MOD_A::VALUE1, true => CUR_MOD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Device mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CUR_MOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Host mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CUR_MOD_A::VALUE2 } } #[doc = "Field `ModeMis` reader - Mode Mismatch Interrupt"] -pub type MODE_MIS_R = crate::BitReader; +pub type MODE_MIS_R = crate::BitReader; #[doc = "Field `ModeMis` writer - Mode Mismatch Interrupt"] -pub type MODE_MIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type MODE_MIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OTGInt` reader - OTG Interrupt"] -pub type OTGINT_R = crate::BitReader; +pub type OTGINT_R = crate::BitReader; #[doc = "Field `Sof` reader - Start of Frame"] -pub type SOF_R = crate::BitReader; +pub type SOF_R = crate::BitReader; #[doc = "Field `Sof` writer - Start of Frame"] -pub type SOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type SOF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RxFLvl` reader - RxFIFO Non-Empty"] -pub type RX_FLVL_R = crate::BitReader; +pub type RX_FLVL_R = crate::BitReader; #[doc = "Field `GINNakEff` reader - Global IN Non-Periodic NAK Effective"] -pub type GINNAK_EFF_R = crate::BitReader; +pub type GINNAK_EFF_R = crate::BitReader; #[doc = "Field `GOUTNakEff` reader - Global OUT NAK Effective"] -pub type GOUTNAK_EFF_R = crate::BitReader; +pub type GOUTNAK_EFF_R = crate::BitReader; #[doc = "Field `ErlySusp` reader - Early Suspend"] -pub type ERLY_SUSP_R = crate::BitReader; +pub type ERLY_SUSP_R = crate::BitReader; #[doc = "Field `ErlySusp` writer - Early Suspend"] -pub type ERLY_SUSP_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type ERLY_SUSP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `USBSusp` reader - USB Suspend"] -pub type USBSUSP_R = crate::BitReader; +pub type USBSUSP_R = crate::BitReader; #[doc = "Field `USBSusp` writer - USB Suspend"] -pub type USBSUSP_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type USBSUSP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `USBRst` reader - USB Reset"] -pub type USBRST_R = crate::BitReader; +pub type USBRST_R = crate::BitReader; #[doc = "Field `USBRst` writer - USB Reset"] -pub type USBRST_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type USBRST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EnumDone` reader - Enumeration Done"] -pub type ENUM_DONE_R = crate::BitReader; +pub type ENUM_DONE_R = crate::BitReader; #[doc = "Field `EnumDone` writer - Enumeration Done"] -pub type ENUM_DONE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type ENUM_DONE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ISOOutDrop` reader - Isochronous OUT Packet Dropped Interrupt"] -pub type ISOOUT_DROP_R = crate::BitReader; +pub type ISOOUT_DROP_R = crate::BitReader; #[doc = "Field `ISOOutDrop` writer - Isochronous OUT Packet Dropped Interrupt"] -pub type ISOOUT_DROP_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type ISOOUT_DROP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EOPF` reader - End of Periodic Frame Interrupt"] -pub type EOPF_R = crate::BitReader; +pub type EOPF_R = crate::BitReader; #[doc = "Field `EOPF` writer - End of Periodic Frame Interrupt"] -pub type EOPF_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type EOPF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `IEPInt` reader - IN Endpoints Interrupt"] -pub type IEPINT_R = crate::BitReader; +pub type IEPINT_R = crate::BitReader; #[doc = "Field `OEPInt` reader - OUT Endpoints Interrupt"] -pub type OEPINT_R = crate::BitReader; +pub type OEPINT_R = crate::BitReader; #[doc = "Field `incompISOIN` reader - Incomplete Isochronous IN Transfer"] -pub type INCOMP_ISOIN_R = crate::BitReader; +pub type INCOMP_ISOIN_R = crate::BitReader; #[doc = "Field `incompISOIN` writer - Incomplete Isochronous IN Transfer"] -pub type INCOMP_ISOIN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type INCOMP_ISOIN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `incomplSOOUT` reader - Incomplete Isochronous OUT Transfer"] -pub type INCOMPL_SOOUT_R = crate::BitReader; +pub type INCOMPL_SOOUT_R = crate::BitReader; #[doc = "Field `incomplSOOUT` writer - Incomplete Isochronous OUT Transfer"] -pub type INCOMPL_SOOUT_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type INCOMPL_SOOUT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ConIDStsChng` reader - Connector ID Status Change"] -pub type CON_IDSTS_CHNG_R = crate::BitReader; +pub type CON_IDSTS_CHNG_R = crate::BitReader; #[doc = "Field `ConIDStsChng` writer - Connector ID Status Change"] -pub type CON_IDSTS_CHNG_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type CON_IDSTS_CHNG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SessReqInt` reader - Session Request/New Session Detected Interrupt"] -pub type SESS_REQ_INT_R = crate::BitReader; +pub type SESS_REQ_INT_R = crate::BitReader; #[doc = "Field `SessReqInt` writer - Session Request/New Session Detected Interrupt"] -pub type SESS_REQ_INT_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type SESS_REQ_INT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `WkUpInt` reader - Resume/Remote Wakeup Detected Interrupt"] -pub type WK_UP_INT_R = crate::BitReader; +pub type WK_UP_INT_R = crate::BitReader; #[doc = "Field `WkUpInt` writer - Resume/Remote Wakeup Detected Interrupt"] -pub type WK_UP_INT_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_DEVICEMODE_SPEC, bool, O>; +pub type WK_UP_INT_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Current Mode of Operation"] #[inline(always)] @@ -240,100 +208,101 @@ impl W { #[doc = "Bit 1 - Mode Mismatch Interrupt"] #[inline(always)] #[must_use] - pub fn mode_mis(&mut self) -> MODE_MIS_W<1> { - MODE_MIS_W::new(self) + pub fn mode_mis(&mut self) -> MODE_MIS_W { + MODE_MIS_W::new(self, 1) } #[doc = "Bit 3 - Start of Frame"] #[inline(always)] #[must_use] - pub fn sof(&mut self) -> SOF_W<3> { - SOF_W::new(self) + pub fn sof(&mut self) -> SOF_W { + SOF_W::new(self, 3) } #[doc = "Bit 10 - Early Suspend"] #[inline(always)] #[must_use] - pub fn erly_susp(&mut self) -> ERLY_SUSP_W<10> { - ERLY_SUSP_W::new(self) + pub fn erly_susp(&mut self) -> ERLY_SUSP_W { + ERLY_SUSP_W::new(self, 10) } #[doc = "Bit 11 - USB Suspend"] #[inline(always)] #[must_use] - pub fn usbsusp(&mut self) -> USBSUSP_W<11> { - USBSUSP_W::new(self) + pub fn usbsusp(&mut self) -> USBSUSP_W { + USBSUSP_W::new(self, 11) } #[doc = "Bit 12 - USB Reset"] #[inline(always)] #[must_use] - pub fn usbrst(&mut self) -> USBRST_W<12> { - USBRST_W::new(self) + pub fn usbrst(&mut self) -> USBRST_W { + USBRST_W::new(self, 12) } #[doc = "Bit 13 - Enumeration Done"] #[inline(always)] #[must_use] - pub fn enum_done(&mut self) -> ENUM_DONE_W<13> { - ENUM_DONE_W::new(self) + pub fn enum_done(&mut self) -> ENUM_DONE_W { + ENUM_DONE_W::new(self, 13) } #[doc = "Bit 14 - Isochronous OUT Packet Dropped Interrupt"] #[inline(always)] #[must_use] - pub fn isoout_drop(&mut self) -> ISOOUT_DROP_W<14> { - ISOOUT_DROP_W::new(self) + pub fn isoout_drop(&mut self) -> ISOOUT_DROP_W { + ISOOUT_DROP_W::new(self, 14) } #[doc = "Bit 15 - End of Periodic Frame Interrupt"] #[inline(always)] #[must_use] - pub fn eopf(&mut self) -> EOPF_W<15> { - EOPF_W::new(self) + pub fn eopf(&mut self) -> EOPF_W { + EOPF_W::new(self, 15) } #[doc = "Bit 20 - Incomplete Isochronous IN Transfer"] #[inline(always)] #[must_use] - pub fn incomp_isoin(&mut self) -> INCOMP_ISOIN_W<20> { - INCOMP_ISOIN_W::new(self) + pub fn incomp_isoin(&mut self) -> INCOMP_ISOIN_W { + INCOMP_ISOIN_W::new(self, 20) } #[doc = "Bit 21 - Incomplete Isochronous OUT Transfer"] #[inline(always)] #[must_use] - pub fn incompl_soout(&mut self) -> INCOMPL_SOOUT_W<21> { - INCOMPL_SOOUT_W::new(self) + pub fn incompl_soout(&mut self) -> INCOMPL_SOOUT_W { + INCOMPL_SOOUT_W::new(self, 21) } #[doc = "Bit 28 - Connector ID Status Change"] #[inline(always)] #[must_use] - pub fn con_idsts_chng(&mut self) -> CON_IDSTS_CHNG_W<28> { - CON_IDSTS_CHNG_W::new(self) + pub fn con_idsts_chng(&mut self) -> CON_IDSTS_CHNG_W { + CON_IDSTS_CHNG_W::new(self, 28) } #[doc = "Bit 30 - Session Request/New Session Detected Interrupt"] #[inline(always)] #[must_use] - pub fn sess_req_int(&mut self) -> SESS_REQ_INT_W<30> { - SESS_REQ_INT_W::new(self) + pub fn sess_req_int(&mut self) -> SESS_REQ_INT_W { + SESS_REQ_INT_W::new(self, 30) } #[doc = "Bit 31 - Resume/Remote Wakeup Detected Interrupt"] #[inline(always)] #[must_use] - pub fn wk_up_int(&mut self) -> WK_UP_INT_W<31> { - WK_UP_INT_W::new(self) + pub fn wk_up_int(&mut self) -> WK_UP_INT_W { + WK_UP_INT_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Interrupt Register \\[DEVICEMODE\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::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_devicemode](index.html) module"] +#[doc = "Interrupt Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintsts_devicemode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintsts_devicemode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GINTSTS_DEVICEMODE_SPEC; impl crate::RegisterSpec for GINTSTS_DEVICEMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gintsts_devicemode::R](R) reader structure"] -impl crate::Readable for GINTSTS_DEVICEMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gintsts_devicemode::W](W) writer structure"] +#[doc = "`read()` method returns [`gintsts_devicemode::R`](R) reader structure"] +impl crate::Readable for GINTSTS_DEVICEMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gintsts_devicemode::W`](W) writer structure"] impl crate::Writable for GINTSTS_DEVICEMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gintsts_hostmode.rs b/src/usb0/gintsts_hostmode.rs index b647f8e4..aa92a22c 100644 --- a/src/usb0/gintsts_hostmode.rs +++ b/src/usb0/gintsts_hostmode.rs @@ -1,39 +1,7 @@ #[doc = "Register `GINTSTS_HOSTMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GINTSTS_HOSTMODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CurMod` reader - Current Mode of Operation"] pub type CUR_MOD_R = crate::BitReader; #[doc = "Current Mode of Operation\n\nValue on reset: 0"] @@ -53,61 +21,61 @@ impl From for bool { impl CUR_MOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CUR_MOD_A { + pub const fn variant(&self) -> CUR_MOD_A { match self.bits { false => CUR_MOD_A::VALUE1, true => CUR_MOD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Device mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CUR_MOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Host mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CUR_MOD_A::VALUE2 } } #[doc = "Field `ModeMis` reader - Mode Mismatch Interrupt"] -pub type MODE_MIS_R = crate::BitReader; +pub type MODE_MIS_R = crate::BitReader; #[doc = "Field `ModeMis` writer - Mode Mismatch Interrupt"] -pub type MODE_MIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_HOSTMODE_SPEC, bool, O>; +pub type MODE_MIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OTGInt` reader - OTG Interrupt"] -pub type OTGINT_R = crate::BitReader; +pub type OTGINT_R = crate::BitReader; #[doc = "Field `Sof` reader - Start of Frame"] -pub type SOF_R = crate::BitReader; +pub type SOF_R = crate::BitReader; #[doc = "Field `Sof` writer - Start of Frame"] -pub type SOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_HOSTMODE_SPEC, bool, O>; +pub type SOF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RxFLvl` reader - RxFIFO Non-Empty"] -pub type RX_FLVL_R = crate::BitReader; +pub type RX_FLVL_R = crate::BitReader; #[doc = "Field `incomplP` reader - Incomplete Periodic Transfer"] -pub type INCOMPL_P_R = crate::BitReader; +pub type INCOMPL_P_R = crate::BitReader; #[doc = "Field `incomplP` writer - Incomplete Periodic Transfer"] -pub type INCOMPL_P_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_HOSTMODE_SPEC, bool, O>; +pub type INCOMPL_P_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PrtInt` reader - Host Port Interrupt"] -pub type PRT_INT_R = crate::BitReader; +pub type PRT_INT_R = crate::BitReader; #[doc = "Field `HChInt` reader - Host Channels Interrupt"] -pub type HCH_INT_R = crate::BitReader; +pub type HCH_INT_R = crate::BitReader; #[doc = "Field `PTxFEmp` reader - Periodic TxFIFO Empty"] -pub type PTX_FEMP_R = crate::BitReader; +pub type PTX_FEMP_R = crate::BitReader; #[doc = "Field `ConIDStsChng` reader - Connector ID Status Change"] -pub type CON_IDSTS_CHNG_R = crate::BitReader; +pub type CON_IDSTS_CHNG_R = crate::BitReader; #[doc = "Field `ConIDStsChng` writer - Connector ID Status Change"] -pub type CON_IDSTS_CHNG_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_HOSTMODE_SPEC, bool, O>; +pub type CON_IDSTS_CHNG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DisconnInt` reader - Disconnect Detected Interrupt"] -pub type DISCONN_INT_R = crate::BitReader; +pub type DISCONN_INT_R = crate::BitReader; #[doc = "Field `DisconnInt` writer - Disconnect Detected Interrupt"] -pub type DISCONN_INT_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_HOSTMODE_SPEC, bool, O>; +pub type DISCONN_INT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SessReqInt` reader - Session Request/New Session Detected Interrupt"] -pub type SESS_REQ_INT_R = crate::BitReader; +pub type SESS_REQ_INT_R = crate::BitReader; #[doc = "Field `SessReqInt` writer - Session Request/New Session Detected Interrupt"] -pub type SESS_REQ_INT_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_HOSTMODE_SPEC, bool, O>; +pub type SESS_REQ_INT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `WkUpInt` reader - Resume/Remote Wakeup Detected Interrupt"] -pub type WK_UP_INT_R = crate::BitReader; +pub type WK_UP_INT_R = crate::BitReader; #[doc = "Field `WkUpInt` writer - Resume/Remote Wakeup Detected Interrupt"] -pub type WK_UP_INT_W<'a, const O: u8> = crate::BitWriter<'a, u32, GINTSTS_HOSTMODE_SPEC, bool, O>; +pub type WK_UP_INT_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Current Mode of Operation"] #[inline(always)] @@ -179,64 +147,65 @@ impl W { #[doc = "Bit 1 - Mode Mismatch Interrupt"] #[inline(always)] #[must_use] - pub fn mode_mis(&mut self) -> MODE_MIS_W<1> { - MODE_MIS_W::new(self) + pub fn mode_mis(&mut self) -> MODE_MIS_W { + MODE_MIS_W::new(self, 1) } #[doc = "Bit 3 - Start of Frame"] #[inline(always)] #[must_use] - pub fn sof(&mut self) -> SOF_W<3> { - SOF_W::new(self) + pub fn sof(&mut self) -> SOF_W { + SOF_W::new(self, 3) } #[doc = "Bit 21 - Incomplete Periodic Transfer"] #[inline(always)] #[must_use] - pub fn incompl_p(&mut self) -> INCOMPL_P_W<21> { - INCOMPL_P_W::new(self) + pub fn incompl_p(&mut self) -> INCOMPL_P_W { + INCOMPL_P_W::new(self, 21) } #[doc = "Bit 28 - Connector ID Status Change"] #[inline(always)] #[must_use] - pub fn con_idsts_chng(&mut self) -> CON_IDSTS_CHNG_W<28> { - CON_IDSTS_CHNG_W::new(self) + pub fn con_idsts_chng(&mut self) -> CON_IDSTS_CHNG_W { + CON_IDSTS_CHNG_W::new(self, 28) } #[doc = "Bit 29 - Disconnect Detected Interrupt"] #[inline(always)] #[must_use] - pub fn disconn_int(&mut self) -> DISCONN_INT_W<29> { - DISCONN_INT_W::new(self) + pub fn disconn_int(&mut self) -> DISCONN_INT_W { + DISCONN_INT_W::new(self, 29) } #[doc = "Bit 30 - Session Request/New Session Detected Interrupt"] #[inline(always)] #[must_use] - pub fn sess_req_int(&mut self) -> SESS_REQ_INT_W<30> { - SESS_REQ_INT_W::new(self) + pub fn sess_req_int(&mut self) -> SESS_REQ_INT_W { + SESS_REQ_INT_W::new(self, 30) } #[doc = "Bit 31 - Resume/Remote Wakeup Detected Interrupt"] #[inline(always)] #[must_use] - pub fn wk_up_int(&mut self) -> WK_UP_INT_W<31> { - WK_UP_INT_W::new(self) + pub fn wk_up_int(&mut self) -> WK_UP_INT_W { + WK_UP_INT_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Interrupt Register \\[HOSTMODE\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::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_hostmode](index.html) module"] +#[doc = "Interrupt Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gintsts_hostmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gintsts_hostmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GINTSTS_HOSTMODE_SPEC; impl crate::RegisterSpec for GINTSTS_HOSTMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gintsts_hostmode::R](R) reader structure"] -impl crate::Readable for GINTSTS_HOSTMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gintsts_hostmode::W](W) writer structure"] +#[doc = "`read()` method returns [`gintsts_hostmode::R`](R) reader structure"] +impl crate::Readable for GINTSTS_HOSTMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gintsts_hostmode::W`](W) writer structure"] impl crate::Writable for GINTSTS_HOSTMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gnptxfsiz_devicemode.rs b/src/usb0/gnptxfsiz_devicemode.rs index f4091647..a5aa6cf4 100644 --- a/src/usb0/gnptxfsiz_devicemode.rs +++ b/src/usb0/gnptxfsiz_devicemode.rs @@ -1,47 +1,15 @@ #[doc = "Register `GNPTXFSIZ_DEVICEMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GNPTXFSIZ_DEVICEMODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `INEPTxF0StAddr` reader - IN Endpoint FIFO0 Transmit RAM Start Address"] -pub type INEPTX_F0ST_ADDR_R = crate::FieldReader; +pub type INEPTX_F0ST_ADDR_R = crate::FieldReader; #[doc = "Field `INEPTxF0StAddr` writer - IN Endpoint FIFO0 Transmit RAM Start Address"] -pub type INEPTX_F0ST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GNPTXFSIZ_DEVICEMODE_SPEC, u16, u16, 16, O>; +pub type INEPTX_F0ST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `INEPTxF0Dep` reader - IN Endpoint TxFIFO 0 Depth"] -pub type INEPTX_F0DEP_R = crate::FieldReader; +pub type INEPTX_F0DEP_R = crate::FieldReader; #[doc = "Field `INEPTxF0Dep` writer - IN Endpoint TxFIFO 0 Depth"] -pub type INEPTX_F0DEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GNPTXFSIZ_DEVICEMODE_SPEC, u16, u16, 16, O>; +pub type INEPTX_F0DEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - IN Endpoint FIFO0 Transmit RAM Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - IN Endpoint FIFO0 Transmit RAM Start Address"] #[inline(always)] #[must_use] - pub fn ineptx_f0st_addr(&mut self) -> INEPTX_F0ST_ADDR_W<0> { - INEPTX_F0ST_ADDR_W::new(self) + pub fn ineptx_f0st_addr(&mut self) -> INEPTX_F0ST_ADDR_W { + INEPTX_F0ST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - IN Endpoint TxFIFO 0 Depth"] #[inline(always)] #[must_use] - pub fn ineptx_f0dep(&mut self) -> INEPTX_F0DEP_W<16> { - INEPTX_F0DEP_W::new(self) + pub fn ineptx_f0dep(&mut self) -> INEPTX_F0DEP_W { + INEPTX_F0DEP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Non-Periodic Transmit FIFO Size Register \\[DEVICEMODE\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::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_devicemode](index.html) module"] +#[doc = "Non-Periodic Transmit FIFO Size Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gnptxfsiz_devicemode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gnptxfsiz_devicemode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GNPTXFSIZ_DEVICEMODE_SPEC; impl crate::RegisterSpec for GNPTXFSIZ_DEVICEMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gnptxfsiz_devicemode::R](R) reader structure"] -impl crate::Readable for GNPTXFSIZ_DEVICEMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gnptxfsiz_devicemode::W](W) writer structure"] +#[doc = "`read()` method returns [`gnptxfsiz_devicemode::R`](R) reader structure"] +impl crate::Readable for GNPTXFSIZ_DEVICEMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gnptxfsiz_devicemode::W`](W) writer structure"] impl crate::Writable for GNPTXFSIZ_DEVICEMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gnptxfsiz_hostmode.rs b/src/usb0/gnptxfsiz_hostmode.rs index afd0cc95..8ef73dac 100644 --- a/src/usb0/gnptxfsiz_hostmode.rs +++ b/src/usb0/gnptxfsiz_hostmode.rs @@ -1,47 +1,15 @@ #[doc = "Register `GNPTXFSIZ_HOSTMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GNPTXFSIZ_HOSTMODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `NPTxFStAddr` reader - Non-periodic Transmit RAM Start Address"] -pub type NPTX_FST_ADDR_R = crate::FieldReader; +pub type NPTX_FST_ADDR_R = crate::FieldReader; #[doc = "Field `NPTxFStAddr` writer - Non-periodic Transmit RAM Start Address"] -pub type NPTX_FST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GNPTXFSIZ_HOSTMODE_SPEC, u16, u16, 16, O>; +pub type NPTX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `NPTxFDep` reader - Non-periodic TxFIFO Depth"] -pub type NPTX_FDEP_R = crate::FieldReader; +pub type NPTX_FDEP_R = crate::FieldReader; #[doc = "Field `NPTxFDep` writer - Non-periodic TxFIFO Depth"] -pub type NPTX_FDEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GNPTXFSIZ_HOSTMODE_SPEC, u16, u16, 16, O>; +pub type NPTX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Non-periodic Transmit RAM Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - Non-periodic Transmit RAM Start Address"] #[inline(always)] #[must_use] - pub fn nptx_fst_addr(&mut self) -> NPTX_FST_ADDR_W<0> { - NPTX_FST_ADDR_W::new(self) + pub fn nptx_fst_addr(&mut self) -> NPTX_FST_ADDR_W { + NPTX_FST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - Non-periodic TxFIFO Depth"] #[inline(always)] #[must_use] - pub fn nptx_fdep(&mut self) -> NPTX_FDEP_W<16> { - NPTX_FDEP_W::new(self) + pub fn nptx_fdep(&mut self) -> NPTX_FDEP_W { + NPTX_FDEP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Non-Periodic Transmit FIFO Size Register \\[HOSTMODE\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::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_hostmode](index.html) module"] +#[doc = "Non-Periodic Transmit FIFO Size Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gnptxfsiz_hostmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gnptxfsiz_hostmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GNPTXFSIZ_HOSTMODE_SPEC; impl crate::RegisterSpec for GNPTXFSIZ_HOSTMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gnptxfsiz_hostmode::R](R) reader structure"] -impl crate::Readable for GNPTXFSIZ_HOSTMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gnptxfsiz_hostmode::W](W) writer structure"] +#[doc = "`read()` method returns [`gnptxfsiz_hostmode::R`](R) reader structure"] +impl crate::Readable for GNPTXFSIZ_HOSTMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gnptxfsiz_hostmode::W`](W) writer structure"] impl crate::Writable for GNPTXFSIZ_HOSTMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gnptxsts.rs b/src/usb0/gnptxsts.rs index 42f0ca45..368b8e61 100644 --- a/src/usb0/gnptxsts.rs +++ b/src/usb0/gnptxsts.rs @@ -1,20 +1,7 @@ #[doc = "Register `GNPTXSTS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `NPTxFSpcAvail` reader - Non-periodic TxFIFO Space Avail"] -pub type NPTX_FSPC_AVAIL_R = crate::FieldReader; +pub type NPTX_FSPC_AVAIL_R = crate::FieldReader; #[doc = "Non-periodic TxFIFO Space Avail\n\nValue on reset: 16"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u16)] @@ -32,10 +19,13 @@ impl From for u16 { variant as _ } } +impl crate::FieldSpec for NPTX_FSPC_AVAIL_A { + type Ux = u16; +} impl NPTX_FSPC_AVAIL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(NPTX_FSPC_AVAIL_A::VALUE1), 1 => Some(NPTX_FSPC_AVAIL_A::VALUE2), @@ -43,24 +33,24 @@ impl NPTX_FSPC_AVAIL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Non-periodic TxFIFO is full"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NPTX_FSPC_AVAIL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "1 word available"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NPTX_FSPC_AVAIL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "2 words available"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == NPTX_FSPC_AVAIL_A::VALUE3 } } #[doc = "Field `NPTxQSpcAvail` reader - Non-periodic Transmit Request Queue Space Available"] -pub type NPTX_QSPC_AVAIL_R = crate::FieldReader; +pub type NPTX_QSPC_AVAIL_R = crate::FieldReader; #[doc = "Non-periodic Transmit Request Queue Space Available\n\nValue on reset: 8"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -78,10 +68,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for NPTX_QSPC_AVAIL_A { + type Ux = u8; +} impl NPTX_QSPC_AVAIL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(NPTX_QSPC_AVAIL_A::VALUE1), 1 => Some(NPTX_QSPC_AVAIL_A::VALUE2), @@ -89,24 +82,24 @@ impl NPTX_QSPC_AVAIL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Non-periodic Transmit Request Queue is full"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NPTX_QSPC_AVAIL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "1 location available"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NPTX_QSPC_AVAIL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "2 locations available"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == NPTX_QSPC_AVAIL_A::VALUE3 } } #[doc = "Field `NPTxQTop` reader - Top of the Non-periodic Transmit Request Queue"] -pub type NPTX_QTOP_R = crate::FieldReader; +pub type NPTX_QTOP_R = crate::FieldReader; #[doc = "Top of the Non-periodic Transmit Request Queue\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -124,10 +117,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for NPTX_QTOP_A { + type Ux = u8; +} impl NPTX_QTOP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(NPTX_QTOP_A::VALUE1), 1 => Some(NPTX_QTOP_A::VALUE2), @@ -135,17 +131,17 @@ impl NPTX_QTOP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "IN/OUT token"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NPTX_QTOP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Zero-length transmit packet (device IN/host OUT)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NPTX_QTOP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Channel halt command"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == NPTX_QTOP_A::VALUE4 @@ -168,15 +164,13 @@ impl R { NPTX_QTOP_R::new(((self.bits >> 24) & 0x7f) as u8) } } -#[doc = "Non-Periodic Transmit FIFO/Queue 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 [gnptxsts](index.html) module"] +#[doc = "Non-Periodic Transmit FIFO/Queue Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gnptxsts::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GNPTXSTS_SPEC; impl crate::RegisterSpec for GNPTXSTS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gnptxsts::R](R) reader structure"] -impl crate::Readable for GNPTXSTS_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`gnptxsts::R`](R) reader structure"] +impl crate::Readable for GNPTXSTS_SPEC {} #[doc = "`reset()` method sets GNPTXSTS to value 0x0008_0010"] impl crate::Resettable for GNPTXSTS_SPEC { const RESET_VALUE: Self::Ux = 0x0008_0010; diff --git a/src/usb0/gotgctl.rs b/src/usb0/gotgctl.rs index 67d55e72..7e7edbd1 100644 --- a/src/usb0/gotgctl.rs +++ b/src/usb0/gotgctl.rs @@ -1,39 +1,7 @@ #[doc = "Register `GOTGCTL` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GOTGCTL` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SesReqScs` reader - Session Request Success"] pub type SES_REQ_SCS_R = crate::BitReader; #[doc = "Session Request Success\n\nValue on reset: 0"] @@ -53,18 +21,18 @@ impl From for bool { impl SES_REQ_SCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SES_REQ_SCS_A { + pub const fn variant(&self) -> SES_REQ_SCS_A { match self.bits { false => SES_REQ_SCS_A::VALUE1, true => SES_REQ_SCS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Session request failure"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SES_REQ_SCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Session request success"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SES_REQ_SCS_A::VALUE2 @@ -89,34 +57,37 @@ impl From for bool { impl SES_REQ_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SES_REQ_A { + pub const fn variant(&self) -> SES_REQ_A { match self.bits { false => SES_REQ_A::VALUE1, true => SES_REQ_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No session request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SES_REQ_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Session request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SES_REQ_A::VALUE2 } } #[doc = "Field `SesReq` writer - Session Request"] -pub type SES_REQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, SES_REQ_A, O>; -impl<'a, const O: u8> SES_REQ_W<'a, O> { +pub type SES_REQ_W<'a, REG> = crate::BitWriter<'a, REG, SES_REQ_A>; +impl<'a, REG> SES_REQ_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No session request"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SES_REQ_A::VALUE1) } #[doc = "Session request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SES_REQ_A::VALUE2) } } @@ -139,34 +110,37 @@ impl From for bool { impl VBVALID_OV_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VBVALID_OV_EN_A { + pub const fn variant(&self) -> VBVALID_OV_EN_A { match self.bits { false => VBVALID_OV_EN_A::VALUE1, true => VBVALID_OV_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Override is disabled and vbus valid signal from the PHY is used internally by the core."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VBVALID_OV_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Internally vbus valid received from the PHY is overridden with GOTGCTL.VbvalidOvVal."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VBVALID_OV_EN_A::VALUE2 } } #[doc = "Field `VbvalidOvEn` writer - VBUS Valid Override Enable"] -pub type VBVALID_OV_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, VBVALID_OV_EN_A, O>; -impl<'a, const O: u8> VBVALID_OV_EN_W<'a, O> { +pub type VBVALID_OV_EN_W<'a, REG> = crate::BitWriter<'a, REG, VBVALID_OV_EN_A>; +impl<'a, REG> VBVALID_OV_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Override is disabled and vbus valid signal from the PHY is used internally by the core."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBVALID_OV_EN_A::VALUE1) } #[doc = "Internally vbus valid received from the PHY is overridden with GOTGCTL.VbvalidOvVal."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBVALID_OV_EN_A::VALUE2) } } @@ -189,34 +163,37 @@ impl From for bool { impl VBVALID_OV_VAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VBVALID_OV_VAL_A { + pub const fn variant(&self) -> VBVALID_OV_VAL_A { match self.bits { false => VBVALID_OV_VAL_A::VALUE1, true => VBVALID_OV_VAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "vbusvalid value is 0# when GOTGCTL.VbvalidOvEn = 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VBVALID_OV_VAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "vbusvalid value is 1# when GOTGCTL.VbvalidOvEn = 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VBVALID_OV_VAL_A::VALUE2 } } #[doc = "Field `VbvalidOvVal` writer - VBUS Valid Override Value"] -pub type VBVALID_OV_VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, VBVALID_OV_VAL_A, O>; -impl<'a, const O: u8> VBVALID_OV_VAL_W<'a, O> { +pub type VBVALID_OV_VAL_W<'a, REG> = crate::BitWriter<'a, REG, VBVALID_OV_VAL_A>; +impl<'a, REG> VBVALID_OV_VAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "vbusvalid value is 0# when GOTGCTL.VbvalidOvEn = 1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VBVALID_OV_VAL_A::VALUE1) } #[doc = "vbusvalid value is 1# when GOTGCTL.VbvalidOvEn = 1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VBVALID_OV_VAL_A::VALUE2) } } @@ -239,34 +216,37 @@ impl From for bool { impl AVALID_OV_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AVALID_OV_EN_A { + pub const fn variant(&self) -> AVALID_OV_EN_A { match self.bits { false => AVALID_OV_EN_A::VALUE1, true => AVALID_OV_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Override is disabled and Avalid signal from the PHY is used internally by the core."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AVALID_OV_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Internally Avalid received from the PHY is overridden with GOTGCTL.AvalidOvVal."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AVALID_OV_EN_A::VALUE2 } } #[doc = "Field `AvalidOvEn` writer - A-Peripheral Session Valid Override Enable"] -pub type AVALID_OV_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, AVALID_OV_EN_A, O>; -impl<'a, const O: u8> AVALID_OV_EN_W<'a, O> { +pub type AVALID_OV_EN_W<'a, REG> = crate::BitWriter<'a, REG, AVALID_OV_EN_A>; +impl<'a, REG> AVALID_OV_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Override is disabled and Avalid signal from the PHY is used internally by the core."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AVALID_OV_EN_A::VALUE1) } #[doc = "Internally Avalid received from the PHY is overridden with GOTGCTL.AvalidOvVal."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AVALID_OV_EN_A::VALUE2) } } @@ -289,34 +269,37 @@ impl From for bool { impl AVALID_OV_VAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AVALID_OV_VAL_A { + pub const fn variant(&self) -> AVALID_OV_VAL_A { match self.bits { false => AVALID_OV_VAL_A::VALUE1, true => AVALID_OV_VAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Avalid value is 0# when GOTGCTL.AvalidOvEn = 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AVALID_OV_VAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Avalid value is 1# when GOTGCTL.AvalidOvEn = 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AVALID_OV_VAL_A::VALUE2 } } #[doc = "Field `AvalidOvVal` writer - A-Peripheral Session Valid Override Value"] -pub type AVALID_OV_VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, AVALID_OV_VAL_A, O>; -impl<'a, const O: u8> AVALID_OV_VAL_W<'a, O> { +pub type AVALID_OV_VAL_W<'a, REG> = crate::BitWriter<'a, REG, AVALID_OV_VAL_A>; +impl<'a, REG> AVALID_OV_VAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Avalid value is 0# when GOTGCTL.AvalidOvEn = 1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AVALID_OV_VAL_A::VALUE1) } #[doc = "Avalid value is 1# when GOTGCTL.AvalidOvEn = 1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AVALID_OV_VAL_A::VALUE2) } } @@ -339,34 +322,37 @@ impl From for bool { impl BVALID_OV_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BVALID_OV_EN_A { + pub const fn variant(&self) -> BVALID_OV_EN_A { match self.bits { false => BVALID_OV_EN_A::VALUE1, true => BVALID_OV_EN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Override is disabled and Bvalid signal from the PHY is used internally by the core."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BVALID_OV_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Internally Bvalid received from the PHY is overridden with GOTGCTL.BvalidOvVal."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BVALID_OV_EN_A::VALUE2 } } #[doc = "Field `BvalidOvEn` writer - B-Peripheral Session Valid Override Enable"] -pub type BVALID_OV_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, BVALID_OV_EN_A, O>; -impl<'a, const O: u8> BVALID_OV_EN_W<'a, O> { +pub type BVALID_OV_EN_W<'a, REG> = crate::BitWriter<'a, REG, BVALID_OV_EN_A>; +impl<'a, REG> BVALID_OV_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Override is disabled and Bvalid signal from the PHY is used internally by the core."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BVALID_OV_EN_A::VALUE1) } #[doc = "Internally Bvalid received from the PHY is overridden with GOTGCTL.BvalidOvVal."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BVALID_OV_EN_A::VALUE2) } } @@ -389,34 +375,37 @@ impl From for bool { impl BVALID_OV_VAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BVALID_OV_VAL_A { + pub const fn variant(&self) -> BVALID_OV_VAL_A { match self.bits { false => BVALID_OV_VAL_A::VALUE1, true => BVALID_OV_VAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Bvalid value is 0# when GOTGCTL.BvalidOvEn = 1"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BVALID_OV_VAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bvalid value is 1# when GOTGCTL.BvalidOvEn = 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BVALID_OV_VAL_A::VALUE2 } } #[doc = "Field `BvalidOvVal` writer - B-Peripheral Session Valid Override Value"] -pub type BVALID_OV_VAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, BVALID_OV_VAL_A, O>; -impl<'a, const O: u8> BVALID_OV_VAL_W<'a, O> { +pub type BVALID_OV_VAL_W<'a, REG> = crate::BitWriter<'a, REG, BVALID_OV_VAL_A>; +impl<'a, REG> BVALID_OV_VAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Bvalid value is 0# when GOTGCTL.BvalidOvEn = 1"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BVALID_OV_VAL_A::VALUE1) } #[doc = "Bvalid value is 1# when GOTGCTL.BvalidOvEn = 1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BVALID_OV_VAL_A::VALUE2) } } @@ -439,18 +428,18 @@ impl From for bool { impl HST_NEG_SCS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HST_NEG_SCS_A { + pub const fn variant(&self) -> HST_NEG_SCS_A { match self.bits { false => HST_NEG_SCS_A::VALUE1, true => HST_NEG_SCS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Host negotiation failure"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HST_NEG_SCS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Host negotiation success"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HST_NEG_SCS_A::VALUE2 @@ -475,34 +464,37 @@ impl From for bool { impl HNPREQ_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HNPREQ_A { + pub const fn variant(&self) -> HNPREQ_A { match self.bits { false => HNPREQ_A::VALUE1, true => HNPREQ_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No HNP request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HNPREQ_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HNP request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HNPREQ_A::VALUE2 } } #[doc = "Field `HNPReq` writer - HNP Request"] -pub type HNPREQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, HNPREQ_A, O>; -impl<'a, const O: u8> HNPREQ_W<'a, O> { +pub type HNPREQ_W<'a, REG> = crate::BitWriter<'a, REG, HNPREQ_A>; +impl<'a, REG> HNPREQ_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No HNP request"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HNPREQ_A::VALUE1) } #[doc = "HNP request"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HNPREQ_A::VALUE2) } } @@ -525,34 +517,37 @@ impl From for bool { impl HST_SET_HNPEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HST_SET_HNPEN_A { + pub const fn variant(&self) -> HST_SET_HNPEN_A { match self.bits { false => HST_SET_HNPEN_A::VALUE1, true => HST_SET_HNPEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Host Set HNP is not enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HST_SET_HNPEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Host Set HNP is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HST_SET_HNPEN_A::VALUE2 } } #[doc = "Field `HstSetHNPEn` writer - Host Set HNP Enable"] -pub type HST_SET_HNPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, HST_SET_HNPEN_A, O>; -impl<'a, const O: u8> HST_SET_HNPEN_W<'a, O> { +pub type HST_SET_HNPEN_W<'a, REG> = crate::BitWriter<'a, REG, HST_SET_HNPEN_A>; +impl<'a, REG> HST_SET_HNPEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Host Set HNP is not enabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HST_SET_HNPEN_A::VALUE1) } #[doc = "Host Set HNP is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HST_SET_HNPEN_A::VALUE2) } } @@ -575,34 +570,37 @@ impl From for bool { impl DEV_HNPEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DEV_HNPEN_A { + pub const fn variant(&self) -> DEV_HNPEN_A { match self.bits { false => DEV_HNPEN_A::VALUE1, true => DEV_HNPEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HNP is not enabled in the application"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DEV_HNPEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HNP is enabled in the application"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DEV_HNPEN_A::VALUE2 } } #[doc = "Field `DevHNPEn` writer - Device HNP Enabled"] -pub type DEV_HNPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, DEV_HNPEN_A, O>; -impl<'a, const O: u8> DEV_HNPEN_W<'a, O> { +pub type DEV_HNPEN_W<'a, REG> = crate::BitWriter<'a, REG, DEV_HNPEN_A>; +impl<'a, REG> DEV_HNPEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HNP is not enabled in the application"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DEV_HNPEN_A::VALUE1) } #[doc = "HNP is enabled in the application"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DEV_HNPEN_A::VALUE2) } } @@ -625,18 +623,18 @@ impl From for bool { impl CONL_DSTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CONL_DSTS_A { + pub const fn variant(&self) -> CONL_DSTS_A { match self.bits { false => CONL_DSTS_A::VALUE1, true => CONL_DSTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The USB core is in A-Device mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CONL_DSTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The USB core is in B-Device mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CONL_DSTS_A::VALUE2 @@ -661,18 +659,18 @@ impl From for bool { impl DBNC_TIME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DBNC_TIME_A { + pub const fn variant(&self) -> DBNC_TIME_A { match self.bits { false => DBNC_TIME_A::VALUE1, true => DBNC_TIME_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Long debounce time, used for physical connections (100 ms + 2.5 us)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DBNC_TIME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Short debounce time, used for soft connections (2.5 us)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DBNC_TIME_A::VALUE2 @@ -697,18 +695,18 @@ impl From for bool { impl ASES_VID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASES_VID_A { + pub const fn variant(&self) -> ASES_VID_A { match self.bits { false => ASES_VID_A::VALUE1, true => ASES_VID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A-session is not valid"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASES_VID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A-session is valid"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASES_VID_A::VALUE2 @@ -733,18 +731,18 @@ impl From for bool { impl BSES_VLD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BSES_VLD_A { + pub const fn variant(&self) -> BSES_VLD_A { match self.bits { false => BSES_VLD_A::VALUE1, true => BSES_VLD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "B-session is not valid."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BSES_VLD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "B-session is valid."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BSES_VLD_A::VALUE2 @@ -769,34 +767,37 @@ impl From for bool { impl OTGVER_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> OTGVER_A { + pub const fn variant(&self) -> OTGVER_A { match self.bits { false => OTGVER_A::VALUE1, true => OTGVER_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "OTG Version 1.3. In this version the core supports Data line pulsing and VBus pulsing for SRP."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OTGVER_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "OTG Version 2.0. In this version the core supports only Data line pulsing for SRP."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == OTGVER_A::VALUE2 } } #[doc = "Field `OTGVer` writer - OTG Version"] -pub type OTGVER_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGCTL_SPEC, OTGVER_A, O>; -impl<'a, const O: u8> OTGVER_W<'a, O> { +pub type OTGVER_W<'a, REG> = crate::BitWriter<'a, REG, OTGVER_A>; +impl<'a, REG> OTGVER_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "OTG Version 1.3. In this version the core supports Data line pulsing and VBus pulsing for SRP."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OTGVER_A::VALUE1) } #[doc = "OTG Version 2.0. In this version the core supports only Data line pulsing for SRP."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(OTGVER_A::VALUE2) } } @@ -891,88 +892,89 @@ impl W { #[doc = "Bit 1 - Session Request"] #[inline(always)] #[must_use] - pub fn ses_req(&mut self) -> SES_REQ_W<1> { - SES_REQ_W::new(self) + pub fn ses_req(&mut self) -> SES_REQ_W { + SES_REQ_W::new(self, 1) } #[doc = "Bit 2 - VBUS Valid Override Enable"] #[inline(always)] #[must_use] - pub fn vbvalid_ov_en(&mut self) -> VBVALID_OV_EN_W<2> { - VBVALID_OV_EN_W::new(self) + pub fn vbvalid_ov_en(&mut self) -> VBVALID_OV_EN_W { + VBVALID_OV_EN_W::new(self, 2) } #[doc = "Bit 3 - VBUS Valid Override Value"] #[inline(always)] #[must_use] - pub fn vbvalid_ov_val(&mut self) -> VBVALID_OV_VAL_W<3> { - VBVALID_OV_VAL_W::new(self) + pub fn vbvalid_ov_val(&mut self) -> VBVALID_OV_VAL_W { + VBVALID_OV_VAL_W::new(self, 3) } #[doc = "Bit 4 - A-Peripheral Session Valid Override Enable"] #[inline(always)] #[must_use] - pub fn avalid_ov_en(&mut self) -> AVALID_OV_EN_W<4> { - AVALID_OV_EN_W::new(self) + pub fn avalid_ov_en(&mut self) -> AVALID_OV_EN_W { + AVALID_OV_EN_W::new(self, 4) } #[doc = "Bit 5 - A-Peripheral Session Valid Override Value"] #[inline(always)] #[must_use] - pub fn avalid_ov_val(&mut self) -> AVALID_OV_VAL_W<5> { - AVALID_OV_VAL_W::new(self) + pub fn avalid_ov_val(&mut self) -> AVALID_OV_VAL_W { + AVALID_OV_VAL_W::new(self, 5) } #[doc = "Bit 6 - B-Peripheral Session Valid Override Enable"] #[inline(always)] #[must_use] - pub fn bvalid_ov_en(&mut self) -> BVALID_OV_EN_W<6> { - BVALID_OV_EN_W::new(self) + pub fn bvalid_ov_en(&mut self) -> BVALID_OV_EN_W { + BVALID_OV_EN_W::new(self, 6) } #[doc = "Bit 7 - B-Peripheral Session Valid Override Value"] #[inline(always)] #[must_use] - pub fn bvalid_ov_val(&mut self) -> BVALID_OV_VAL_W<7> { - BVALID_OV_VAL_W::new(self) + pub fn bvalid_ov_val(&mut self) -> BVALID_OV_VAL_W { + BVALID_OV_VAL_W::new(self, 7) } #[doc = "Bit 9 - HNP Request"] #[inline(always)] #[must_use] - pub fn hnpreq(&mut self) -> HNPREQ_W<9> { - HNPREQ_W::new(self) + pub fn hnpreq(&mut self) -> HNPREQ_W { + HNPREQ_W::new(self, 9) } #[doc = "Bit 10 - Host Set HNP Enable"] #[inline(always)] #[must_use] - pub fn hst_set_hnpen(&mut self) -> HST_SET_HNPEN_W<10> { - HST_SET_HNPEN_W::new(self) + pub fn hst_set_hnpen(&mut self) -> HST_SET_HNPEN_W { + HST_SET_HNPEN_W::new(self, 10) } #[doc = "Bit 11 - Device HNP Enabled"] #[inline(always)] #[must_use] - pub fn dev_hnpen(&mut self) -> DEV_HNPEN_W<11> { - DEV_HNPEN_W::new(self) + pub fn dev_hnpen(&mut self) -> DEV_HNPEN_W { + DEV_HNPEN_W::new(self, 11) } #[doc = "Bit 20 - OTG Version"] #[inline(always)] #[must_use] - pub fn otgver(&mut self) -> OTGVER_W<20> { - OTGVER_W::new(self) + pub fn otgver(&mut self) -> OTGVER_W { + OTGVER_W::new(self, 20) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "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 [gotgctl](index.html) module"] +#[doc = "Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gotgctl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gotgctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GOTGCTL_SPEC; impl crate::RegisterSpec for GOTGCTL_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gotgctl::R](R) reader structure"] -impl crate::Readable for GOTGCTL_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gotgctl::W](W) writer structure"] +#[doc = "`read()` method returns [`gotgctl::R`](R) reader structure"] +impl crate::Readable for GOTGCTL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gotgctl::W`](W) writer structure"] impl crate::Writable for GOTGCTL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gotgint.rs b/src/usb0/gotgint.rs index 5e9e976c..5ee26285 100644 --- a/src/usb0/gotgint.rs +++ b/src/usb0/gotgint.rs @@ -1,63 +1,31 @@ #[doc = "Register `GOTGINT` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `GOTGINT` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SesEndDet` reader - Session End Detected"] -pub type SES_END_DET_R = crate::BitReader; +pub type SES_END_DET_R = crate::BitReader; #[doc = "Field `SesEndDet` writer - Session End Detected"] -pub type SES_END_DET_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGINT_SPEC, bool, O>; +pub type SES_END_DET_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SesReqSucStsChng` reader - Session Request Success Status Change"] -pub type SES_REQ_SUC_STS_CHNG_R = crate::BitReader; +pub type SES_REQ_SUC_STS_CHNG_R = crate::BitReader; #[doc = "Field `SesReqSucStsChng` writer - Session Request Success Status Change"] -pub type SES_REQ_SUC_STS_CHNG_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGINT_SPEC, bool, O>; +pub type SES_REQ_SUC_STS_CHNG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `HstNegSucStsChng` reader - Host Negotiation Success Status Change"] -pub type HST_NEG_SUC_STS_CHNG_R = crate::BitReader; +pub type HST_NEG_SUC_STS_CHNG_R = crate::BitReader; #[doc = "Field `HstNegSucStsChng` writer - Host Negotiation Success Status Change"] -pub type HST_NEG_SUC_STS_CHNG_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGINT_SPEC, bool, O>; +pub type HST_NEG_SUC_STS_CHNG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `HstNegDet` reader - Host Negotiation Detected"] -pub type HST_NEG_DET_R = crate::BitReader; +pub type HST_NEG_DET_R = crate::BitReader; #[doc = "Field `HstNegDet` writer - Host Negotiation Detected"] -pub type HST_NEG_DET_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGINT_SPEC, bool, O>; +pub type HST_NEG_DET_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ADevTOUTChg` reader - A-Device Timeout Change"] -pub type ADEV_TOUTCHG_R = crate::BitReader; +pub type ADEV_TOUTCHG_R = crate::BitReader; #[doc = "Field `ADevTOUTChg` writer - A-Device Timeout Change"] -pub type ADEV_TOUTCHG_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGINT_SPEC, bool, O>; +pub type ADEV_TOUTCHG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DbnceDone` reader - Debounce Done"] -pub type DBNCE_DONE_R = crate::BitReader; +pub type DBNCE_DONE_R = crate::BitReader; #[doc = "Field `DbnceDone` writer - Debounce Done"] -pub type DBNCE_DONE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GOTGINT_SPEC, bool, O>; +pub type DBNCE_DONE_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 2 - Session End Detected"] #[inline(always)] @@ -94,58 +62,59 @@ impl W { #[doc = "Bit 2 - Session End Detected"] #[inline(always)] #[must_use] - pub fn ses_end_det(&mut self) -> SES_END_DET_W<2> { - SES_END_DET_W::new(self) + pub fn ses_end_det(&mut self) -> SES_END_DET_W { + SES_END_DET_W::new(self, 2) } #[doc = "Bit 8 - Session Request Success Status Change"] #[inline(always)] #[must_use] - pub fn ses_req_suc_sts_chng(&mut self) -> SES_REQ_SUC_STS_CHNG_W<8> { - SES_REQ_SUC_STS_CHNG_W::new(self) + pub fn ses_req_suc_sts_chng(&mut self) -> SES_REQ_SUC_STS_CHNG_W { + SES_REQ_SUC_STS_CHNG_W::new(self, 8) } #[doc = "Bit 9 - Host Negotiation Success Status Change"] #[inline(always)] #[must_use] - pub fn hst_neg_suc_sts_chng(&mut self) -> HST_NEG_SUC_STS_CHNG_W<9> { - HST_NEG_SUC_STS_CHNG_W::new(self) + pub fn hst_neg_suc_sts_chng(&mut self) -> HST_NEG_SUC_STS_CHNG_W { + HST_NEG_SUC_STS_CHNG_W::new(self, 9) } #[doc = "Bit 17 - Host Negotiation Detected"] #[inline(always)] #[must_use] - pub fn hst_neg_det(&mut self) -> HST_NEG_DET_W<17> { - HST_NEG_DET_W::new(self) + pub fn hst_neg_det(&mut self) -> HST_NEG_DET_W { + HST_NEG_DET_W::new(self, 17) } #[doc = "Bit 18 - A-Device Timeout Change"] #[inline(always)] #[must_use] - pub fn adev_toutchg(&mut self) -> ADEV_TOUTCHG_W<18> { - ADEV_TOUTCHG_W::new(self) + pub fn adev_toutchg(&mut self) -> ADEV_TOUTCHG_W { + ADEV_TOUTCHG_W::new(self, 18) } #[doc = "Bit 19 - Debounce Done"] #[inline(always)] #[must_use] - pub fn dbnce_done(&mut self) -> DBNCE_DONE_W<19> { - DBNCE_DONE_W::new(self) + pub fn dbnce_done(&mut self) -> DBNCE_DONE_W { + DBNCE_DONE_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "OTG 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 [gotgint](index.html) module"] +#[doc = "OTG Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gotgint::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gotgint::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GOTGINT_SPEC; impl crate::RegisterSpec for GOTGINT_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [gotgint::R](R) reader structure"] -impl crate::Readable for GOTGINT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [gotgint::W](W) writer structure"] +#[doc = "`read()` method returns [`gotgint::R`](R) reader structure"] +impl crate::Readable for GOTGINT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gotgint::W`](W) writer structure"] impl crate::Writable for GOTGINT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/grstctl.rs b/src/usb0/grstctl.rs index 1cc0111e..3d97b86d 100644 --- a/src/usb0/grstctl.rs +++ b/src/usb0/grstctl.rs @@ -1,57 +1,25 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CSftRst` reader - Core Soft Reset"] -pub type CSFT_RST_R = crate::BitReader; +pub type CSFT_RST_R = crate::BitReader; #[doc = "Field `CSftRst` writer - Core Soft Reset"] -pub type CSFT_RST_W<'a, const O: u8> = crate::BitWriter<'a, u32, GRSTCTL_SPEC, bool, O>; +pub type CSFT_RST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FrmCntrRst` reader - Host Frame Counter Reset"] -pub type FRM_CNTR_RST_R = crate::BitReader; +pub type FRM_CNTR_RST_R = crate::BitReader; #[doc = "Field `FrmCntrRst` writer - Host Frame Counter Reset"] -pub type FRM_CNTR_RST_W<'a, const O: u8> = crate::BitWriter<'a, u32, GRSTCTL_SPEC, bool, O>; +pub type FRM_CNTR_RST_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RxFFlsh` reader - RxFIFO Flush"] -pub type RX_FFLSH_R = crate::BitReader; +pub type RX_FFLSH_R = crate::BitReader; #[doc = "Field `RxFFlsh` writer - RxFIFO Flush"] -pub type RX_FFLSH_W<'a, const O: u8> = crate::BitWriter<'a, u32, GRSTCTL_SPEC, bool, O>; +pub type RX_FFLSH_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFFlsh` reader - TxFIFO Flush"] -pub type TX_FFLSH_R = crate::BitReader; +pub type TX_FFLSH_R = crate::BitReader; #[doc = "Field `TxFFlsh` writer - TxFIFO Flush"] -pub type TX_FFLSH_W<'a, const O: u8> = crate::BitWriter<'a, u32, GRSTCTL_SPEC, bool, O>; +pub type TX_FFLSH_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFNum` reader - TxFIFO Number"] -pub type TX_FNUM_R = crate::FieldReader; +pub type TX_FNUM_R = crate::FieldReader; #[doc = "TxFIFO Number\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -73,10 +41,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TX_FNUM_A { + type Ux = u8; +} impl TX_FNUM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TX_FNUM_A::VALUE1), 1 => Some(TX_FNUM_A::VALUE2), @@ -86,65 +57,69 @@ impl TX_FNUM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Non-periodic TxFIFO flush in Host mode or Tx FIFO 0 flush in device mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TX_FNUM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Periodic TxFIFO flush in Host mode or Tx FIFO 1 flush in device mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TX_FNUM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Tx FIFO 2 flush in device mode"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TX_FNUM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Tx FIFO 15 flush in device mode"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TX_FNUM_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Flush all the transmit FIFOs in device or host mode."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == TX_FNUM_A::VALUE5 } } #[doc = "Field `TxFNum` writer - TxFIFO Number"] -pub type TX_FNUM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GRSTCTL_SPEC, u8, TX_FNUM_A, 5, O>; -impl<'a, const O: u8> TX_FNUM_W<'a, O> { +pub type TX_FNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 5, TX_FNUM_A>; +impl<'a, REG> TX_FNUM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Non-periodic TxFIFO flush in Host mode or Tx FIFO 0 flush in device mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TX_FNUM_A::VALUE1) } #[doc = "Periodic TxFIFO flush in Host mode or Tx FIFO 1 flush in device mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TX_FNUM_A::VALUE2) } #[doc = "Tx FIFO 2 flush in device mode"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TX_FNUM_A::VALUE3) } #[doc = "Tx FIFO 15 flush in device mode"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TX_FNUM_A::VALUE4) } #[doc = "Flush all the transmit FIFOs in device or host mode."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(TX_FNUM_A::VALUE5) } } #[doc = "Field `DMAReq` reader - DMA Request Signal"] -pub type DMAREQ_R = crate::BitReader; +pub type DMAREQ_R = crate::BitReader; #[doc = "Field `AHBIdle` reader - AHB Master Idle"] -pub type AHBIDLE_R = crate::BitReader; +pub type AHBIDLE_R = crate::BitReader; impl R { #[doc = "Bit 0 - Core Soft Reset"] #[inline(always)] @@ -186,52 +161,53 @@ impl W { #[doc = "Bit 0 - Core Soft Reset"] #[inline(always)] #[must_use] - pub fn csft_rst(&mut self) -> CSFT_RST_W<0> { - CSFT_RST_W::new(self) + pub fn csft_rst(&mut self) -> CSFT_RST_W { + CSFT_RST_W::new(self, 0) } #[doc = "Bit 2 - Host Frame Counter Reset"] #[inline(always)] #[must_use] - pub fn frm_cntr_rst(&mut self) -> FRM_CNTR_RST_W<2> { - FRM_CNTR_RST_W::new(self) + pub fn frm_cntr_rst(&mut self) -> FRM_CNTR_RST_W { + FRM_CNTR_RST_W::new(self, 2) } #[doc = "Bit 4 - RxFIFO Flush"] #[inline(always)] #[must_use] - pub fn rx_fflsh(&mut self) -> RX_FFLSH_W<4> { - RX_FFLSH_W::new(self) + pub fn rx_fflsh(&mut self) -> RX_FFLSH_W { + RX_FFLSH_W::new(self, 4) } #[doc = "Bit 5 - TxFIFO Flush"] #[inline(always)] #[must_use] - pub fn tx_fflsh(&mut self) -> TX_FFLSH_W<5> { - TX_FFLSH_W::new(self) + pub fn tx_fflsh(&mut self) -> TX_FFLSH_W { + TX_FFLSH_W::new(self, 5) } #[doc = "Bits 6:10 - TxFIFO Number"] #[inline(always)] #[must_use] - pub fn tx_fnum(&mut self) -> TX_FNUM_W<6> { - TX_FNUM_W::new(self) + pub fn tx_fnum(&mut self) -> TX_FNUM_W { + TX_FNUM_W::new(self, 6) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Reset Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grstctl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`grstctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`grstctl::R`](R) reader structure"] +impl crate::Readable for GRSTCTL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`grstctl::W`](W) writer structure"] impl crate::Writable for GRSTCTL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/grxfsiz.rs b/src/usb0/grxfsiz.rs index 73528843..ea52da84 100644 --- a/src/usb0/grxfsiz.rs +++ b/src/usb0/grxfsiz.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RxFDep` reader - RxFIFO Depth"] -pub type RX_FDEP_R = crate::FieldReader; +pub type RX_FDEP_R = crate::FieldReader; #[doc = "Field `RxFDep` writer - RxFIFO Depth"] -pub type RX_FDEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GRXFSIZ_SPEC, u16, u16, 16, O>; +pub type RX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - RxFIFO Depth"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - RxFIFO Depth"] #[inline(always)] #[must_use] - pub fn rx_fdep(&mut self) -> RX_FDEP_W<0> { - RX_FDEP_W::new(self) + pub fn rx_fdep(&mut self) -> RX_FDEP_W { + RX_FDEP_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Receive FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxfsiz::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`grxfsiz::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`grxfsiz::R`](R) reader structure"] +impl crate::Readable for GRXFSIZ_SPEC {} +#[doc = "`write(|w| ..)` method takes [`grxfsiz::W`](W) writer structure"] impl crate::Writable for GRXFSIZ_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/grxstsp_devicemode.rs b/src/usb0/grxstsp_devicemode.rs index 816a568e..556b07ee 100644 --- a/src/usb0/grxstsp_devicemode.rs +++ b/src/usb0/grxstsp_devicemode.rs @@ -1,24 +1,11 @@ #[doc = "Register `GRXSTSP_DEVICEMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `EPNum` reader - Endpoint Number"] -pub type EPNUM_R = crate::FieldReader; +pub type EPNUM_R = crate::FieldReader; #[doc = "Field `BCnt` reader - Byte Count"] -pub type BCNT_R = crate::FieldReader; +pub type BCNT_R = crate::FieldReader; #[doc = "Field `DPID` reader - Data PID"] -pub type DPID_R = crate::FieldReader; +pub type DPID_R = crate::FieldReader; #[doc = "Data PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -38,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DPID_A { + type Ux = u8; +} impl DPID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPID_A { + pub const fn variant(&self) -> DPID_A { match self.bits { 0 => DPID_A::VALUE1, 2 => DPID_A::VALUE2, @@ -50,29 +40,29 @@ impl DPID_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPID_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "DATA2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DPID_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "MDATA"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DPID_A::VALUE4 } } #[doc = "Field `PktSts` reader - Packet Status"] -pub type PKT_STS_R = crate::FieldReader; +pub type PKT_STS_R = crate::FieldReader; #[doc = "Packet Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -94,10 +84,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PKT_STS_A { + type Ux = u8; +} impl PKT_STS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(PKT_STS_A::VALUE1), 2 => Some(PKT_STS_A::VALUE2), @@ -107,34 +100,34 @@ impl PKT_STS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Global OUT NAK (triggers an interrupt)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PKT_STS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "OUT data packet received"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PKT_STS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "OUT transfer completed (triggers an interrupt)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PKT_STS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "SETUP transaction completed (triggers an interrupt)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PKT_STS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "SETUP data packet received"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PKT_STS_A::VALUE5 } } #[doc = "Field `FN` reader - Frame Number"] -pub type FN_R = crate::FieldReader; +pub type FN_R = crate::FieldReader; impl R { #[doc = "Bits 0:3 - Endpoint Number"] #[inline(always)] @@ -162,15 +155,13 @@ impl R { FN_R::new(((self.bits >> 21) & 0x0f) as u8) } } -#[doc = "Receive Status Read and Pop Register \\[DEVICEMODE\\]\n\nThis register 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_devicemode](index.html) module\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Receive Status Read and Pop Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxstsp_devicemode::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GRXSTSP_DEVICEMODE_SPEC; impl crate::RegisterSpec for GRXSTSP_DEVICEMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [grxstsp_devicemode::R](R) reader structure"] -impl crate::Readable for GRXSTSP_DEVICEMODE_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`grxstsp_devicemode::R`](R) reader structure"] +impl crate::Readable for GRXSTSP_DEVICEMODE_SPEC {} #[doc = "`reset()` method sets GRXSTSP_DEVICEMODE to value 0"] impl crate::Resettable for GRXSTSP_DEVICEMODE_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0/grxstsp_hostmode.rs b/src/usb0/grxstsp_hostmode.rs index 596f62f5..490c51f1 100644 --- a/src/usb0/grxstsp_hostmode.rs +++ b/src/usb0/grxstsp_hostmode.rs @@ -1,24 +1,11 @@ #[doc = "Register `GRXSTSP_HOSTMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `ChNum` reader - Channel Number"] -pub type CH_NUM_R = crate::FieldReader; +pub type CH_NUM_R = crate::FieldReader; #[doc = "Field `BCnt` reader - Byte Count"] -pub type BCNT_R = crate::FieldReader; +pub type BCNT_R = crate::FieldReader; #[doc = "Field `DPID` reader - Data PID"] -pub type DPID_R = crate::FieldReader; +pub type DPID_R = crate::FieldReader; #[doc = "Data PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -38,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DPID_A { + type Ux = u8; +} impl DPID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPID_A { + pub const fn variant(&self) -> DPID_A { match self.bits { 0 => DPID_A::VALUE1, 2 => DPID_A::VALUE2, @@ -50,29 +40,29 @@ impl DPID_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPID_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "DATA2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DPID_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "MDATA"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DPID_A::VALUE4 } } #[doc = "Field `PktSts` reader - Packet Status"] -pub type PKT_STS_R = crate::FieldReader; +pub type PKT_STS_R = crate::FieldReader; #[doc = "Packet Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -92,10 +82,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PKT_STS_A { + type Ux = u8; +} impl PKT_STS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 2 => Some(PKT_STS_A::VALUE1), 3 => Some(PKT_STS_A::VALUE2), @@ -104,22 +97,22 @@ impl PKT_STS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "IN data packet received"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PKT_STS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "IN transfer completed (triggers an interrupt)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PKT_STS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data toggle error (triggers an interrupt)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PKT_STS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Channel halted (triggers an interrupt)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PKT_STS_A::VALUE4 @@ -147,15 +140,13 @@ impl R { PKT_STS_R::new(((self.bits >> 17) & 0x0f) as u8) } } -#[doc = "Receive Status Read and Pop Register \\[HOSTMODE\\]\n\nThis register 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_hostmode](index.html) module\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Receive Status Read and Pop Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxstsp_hostmode::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GRXSTSP_HOSTMODE_SPEC; impl crate::RegisterSpec for GRXSTSP_HOSTMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [grxstsp_hostmode::R](R) reader structure"] -impl crate::Readable for GRXSTSP_HOSTMODE_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`grxstsp_hostmode::R`](R) reader structure"] +impl crate::Readable for GRXSTSP_HOSTMODE_SPEC {} #[doc = "`reset()` method sets GRXSTSP_HOSTMODE to value 0"] impl crate::Resettable for GRXSTSP_HOSTMODE_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0/grxstsr_devicemode.rs b/src/usb0/grxstsr_devicemode.rs index 98f785ab..1bd7a876 100644 --- a/src/usb0/grxstsr_devicemode.rs +++ b/src/usb0/grxstsr_devicemode.rs @@ -1,24 +1,11 @@ #[doc = "Register `GRXSTSR_DEVICEMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `EPNum` reader - Endpoint Number"] -pub type EPNUM_R = crate::FieldReader; +pub type EPNUM_R = crate::FieldReader; #[doc = "Field `BCnt` reader - Byte Count"] -pub type BCNT_R = crate::FieldReader; +pub type BCNT_R = crate::FieldReader; #[doc = "Field `DPID` reader - Data PID"] -pub type DPID_R = crate::FieldReader; +pub type DPID_R = crate::FieldReader; #[doc = "Data PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -38,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DPID_A { + type Ux = u8; +} impl DPID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPID_A { + pub const fn variant(&self) -> DPID_A { match self.bits { 0 => DPID_A::VALUE1, 2 => DPID_A::VALUE2, @@ -50,29 +40,29 @@ impl DPID_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPID_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "DATA2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DPID_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "MDATA"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DPID_A::VALUE4 } } #[doc = "Field `PktSts` reader - Packet Status"] -pub type PKT_STS_R = crate::FieldReader; +pub type PKT_STS_R = crate::FieldReader; #[doc = "Packet Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -94,10 +84,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PKT_STS_A { + type Ux = u8; +} impl PKT_STS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(PKT_STS_A::VALUE1), 2 => Some(PKT_STS_A::VALUE2), @@ -107,34 +100,34 @@ impl PKT_STS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Global OUT NAK (triggers an interrupt)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PKT_STS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "OUT data packet received"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PKT_STS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "OUT transfer completed (triggers an interrupt)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PKT_STS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "SETUP transaction completed (triggers an interrupt)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PKT_STS_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "SETUP data packet received"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == PKT_STS_A::VALUE5 } } #[doc = "Field `FN` reader - Frame Number"] -pub type FN_R = crate::FieldReader; +pub type FN_R = crate::FieldReader; impl R { #[doc = "Bits 0:3 - Endpoint Number"] #[inline(always)] @@ -162,15 +155,13 @@ impl R { FN_R::new(((self.bits >> 21) & 0x0f) as u8) } } -#[doc = "Receive Status Debug Read Register \\[DEVICEMODE\\]\n\nThis register 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_devicemode](index.html) module"] +#[doc = "Receive Status Debug Read Register \\[DEVICEMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxstsr_devicemode::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GRXSTSR_DEVICEMODE_SPEC; impl crate::RegisterSpec for GRXSTSR_DEVICEMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [grxstsr_devicemode::R](R) reader structure"] -impl crate::Readable for GRXSTSR_DEVICEMODE_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`grxstsr_devicemode::R`](R) reader structure"] +impl crate::Readable for GRXSTSR_DEVICEMODE_SPEC {} #[doc = "`reset()` method sets GRXSTSR_DEVICEMODE to value 0"] impl crate::Resettable for GRXSTSR_DEVICEMODE_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0/grxstsr_hostmode.rs b/src/usb0/grxstsr_hostmode.rs index fb672886..d8033bac 100644 --- a/src/usb0/grxstsr_hostmode.rs +++ b/src/usb0/grxstsr_hostmode.rs @@ -1,24 +1,11 @@ #[doc = "Register `GRXSTSR_HOSTMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `ChNum` reader - Channel Number"] -pub type CH_NUM_R = crate::FieldReader; +pub type CH_NUM_R = crate::FieldReader; #[doc = "Field `BCnt` reader - Byte Count"] -pub type BCNT_R = crate::FieldReader; +pub type BCNT_R = crate::FieldReader; #[doc = "Field `DPID` reader - Data PID"] -pub type DPID_R = crate::FieldReader; +pub type DPID_R = crate::FieldReader; #[doc = "Data PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -38,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DPID_A { + type Ux = u8; +} impl DPID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPID_A { + pub const fn variant(&self) -> DPID_A { match self.bits { 0 => DPID_A::VALUE1, 2 => DPID_A::VALUE2, @@ -50,29 +40,29 @@ impl DPID_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPID_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "DATA2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DPID_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "MDATA"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DPID_A::VALUE4 } } #[doc = "Field `PktSts` reader - Packet Status"] -pub type PKT_STS_R = crate::FieldReader; +pub type PKT_STS_R = crate::FieldReader; #[doc = "Packet Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -92,10 +82,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PKT_STS_A { + type Ux = u8; +} impl PKT_STS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 2 => Some(PKT_STS_A::VALUE1), 3 => Some(PKT_STS_A::VALUE2), @@ -104,22 +97,22 @@ impl PKT_STS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "IN data packet received"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PKT_STS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "IN transfer completed (triggers an interrupt)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PKT_STS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Data toggle error (triggers an interrupt)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PKT_STS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Channel halted (triggers an interrupt)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PKT_STS_A::VALUE4 @@ -147,15 +140,13 @@ impl R { PKT_STS_R::new(((self.bits >> 17) & 0x0f) as u8) } } -#[doc = "Receive Status Debug Read Register \\[HOSTMODE\\]\n\nThis register 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_hostmode](index.html) module"] +#[doc = "Receive Status Debug Read Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grxstsr_hostmode::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct GRXSTSR_HOSTMODE_SPEC; impl crate::RegisterSpec for GRXSTSR_HOSTMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [grxstsr_hostmode::R](R) reader structure"] -impl crate::Readable for GRXSTSR_HOSTMODE_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`grxstsr_hostmode::R`](R) reader structure"] +impl crate::Readable for GRXSTSR_HOSTMODE_SPEC {} #[doc = "`reset()` method sets GRXSTSR_HOSTMODE to value 0"] impl crate::Resettable for GRXSTSR_HOSTMODE_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0/guid.rs b/src/usb0/guid.rs index f4bf5bc8..c631e3ea 100644 --- a/src/usb0/guid.rs +++ b/src/usb0/guid.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MOD_REV` reader - Module Revision"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_REV` writer - Module Revision"] -pub type MOD_REV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GUID_SPEC, u8, u8, 8, O>; +pub type MOD_REV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` writer - Module Type"] -pub type MOD_TYPE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GUID_SPEC, u8, u8, 8, O>; +pub type MOD_TYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `MOD_NUMBER` reader - Module Number"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` writer - Module Number"] -pub type MOD_NUMBER_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GUID_SPEC, u16, u16, 16, O>; +pub type MOD_NUMBER_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] #[must_use] - pub fn mod_rev(&mut self) -> MOD_REV_W<0> { - MOD_REV_W::new(self) + pub fn mod_rev(&mut self) -> MOD_REV_W { + MOD_REV_W::new(self, 0) } #[doc = "Bits 8:15 - Module Type"] #[inline(always)] #[must_use] - pub fn mod_type(&mut self) -> MOD_TYPE_W<8> { - MOD_TYPE_W::new(self) + pub fn mod_type(&mut self) -> MOD_TYPE_W { + MOD_TYPE_W::new(self, 8) } #[doc = "Bits 16:31 - Module Number"] #[inline(always)] #[must_use] - pub fn mod_number(&mut self) -> MOD_NUMBER_W<16> { - MOD_NUMBER_W::new(self) + pub fn mod_number(&mut self) -> MOD_NUMBER_W { + MOD_NUMBER_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "USB Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`guid::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`guid::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`guid::R`](R) reader structure"] +impl crate::Readable for GUID_SPEC {} +#[doc = "`write(|w| ..)` method takes [`guid::W`](W) writer structure"] impl crate::Writable for GUID_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/gusbcfg.rs b/src/usb0/gusbcfg.rs index ef61f7e5..604c9ff2 100644 --- a/src/usb0/gusbcfg.rs +++ b/src/usb0/gusbcfg.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TOutCal` reader - FS Timeout Calibration"] -pub type TOUT_CAL_R = crate::FieldReader; +pub type TOUT_CAL_R = crate::FieldReader; #[doc = "Field `TOutCal` writer - FS Timeout Calibration"] -pub type TOUT_CAL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GUSBCFG_SPEC, u8, u8, 3, O>; +pub type TOUT_CAL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PHYSel` reader - USB 1.1 Full-Speed Serial Transceiver Select"] pub type PHYSEL_R = crate::BitReader; #[doc = "USB 1.1 Full-Speed Serial Transceiver Select\n\nValue on reset: 1"] @@ -55,13 +23,13 @@ impl From for bool { impl PHYSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { true => Some(PHYSEL_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "USB 1.1 full-speed serial transceiver"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PHYSEL_A::VALUE2 @@ -86,34 +54,37 @@ impl From for bool { impl SRPCAP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRPCAP_A { + pub const fn variant(&self) -> SRPCAP_A { match self.bits { false => SRPCAP_A::VALUE1, true => SRPCAP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "SRP capability is not enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRPCAP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "SRP capability is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRPCAP_A::VALUE2 } } #[doc = "Field `SRPCap` writer - SRP-Capable"] -pub type SRPCAP_W<'a, const O: u8> = crate::BitWriter<'a, u32, GUSBCFG_SPEC, SRPCAP_A, O>; -impl<'a, const O: u8> SRPCAP_W<'a, O> { +pub type SRPCAP_W<'a, REG> = crate::BitWriter<'a, REG, SRPCAP_A>; +impl<'a, REG> SRPCAP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "SRP capability is not enabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRPCAP_A::VALUE1) } #[doc = "SRP capability is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRPCAP_A::VALUE2) } } @@ -136,41 +107,44 @@ impl From for bool { impl HNPCAP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HNPCAP_A { + pub const fn variant(&self) -> HNPCAP_A { match self.bits { false => HNPCAP_A::VALUE1, true => HNPCAP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HNP capability is not enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HNPCAP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HNP capability is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HNPCAP_A::VALUE2 } } #[doc = "Field `HNPCap` writer - HNP-Capable"] -pub type HNPCAP_W<'a, const O: u8> = crate::BitWriter<'a, u32, GUSBCFG_SPEC, HNPCAP_A, O>; -impl<'a, const O: u8> HNPCAP_W<'a, O> { +pub type HNPCAP_W<'a, REG> = crate::BitWriter<'a, REG, HNPCAP_A>; +impl<'a, REG> HNPCAP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HNP capability is not enabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HNPCAP_A::VALUE1) } #[doc = "HNP capability is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HNPCAP_A::VALUE2) } } #[doc = "Field `USBTrdTim` reader - USB Turnaround Time"] -pub type USBTRD_TIM_R = crate::FieldReader; +pub type USBTRD_TIM_R = crate::FieldReader; #[doc = "Field `USBTrdTim` writer - USB Turnaround Time"] -pub type USBTRD_TIM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GUSBCFG_SPEC, u8, u8, 4, O>; +pub type USBTRD_TIM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `OtgI2CSel` reader - UTMIFS Interface Select"] pub type OTG_I2CSEL_R = crate::BitReader; #[doc = "UTMIFS Interface Select\n\nValue on reset: 0"] @@ -188,24 +162,27 @@ impl From for bool { impl OTG_I2CSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { false => Some(OTG_I2CSEL_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "UTMI USB 1.1 Full-Speed interface for OTG signals"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == OTG_I2CSEL_A::VALUE1 } } #[doc = "Field `OtgI2CSel` writer - UTMIFS Interface Select"] -pub type OTG_I2CSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GUSBCFG_SPEC, OTG_I2CSEL_A, O>; -impl<'a, const O: u8> OTG_I2CSEL_W<'a, O> { +pub type OTG_I2CSEL_W<'a, REG> = crate::BitWriter<'a, REG, OTG_I2CSEL_A>; +impl<'a, REG> OTG_I2CSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "UTMI USB 1.1 Full-Speed interface for OTG signals"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(OTG_I2CSEL_A::VALUE1) } } @@ -228,34 +205,37 @@ impl From for bool { impl TX_END_DELAY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TX_END_DELAY_A { + pub const fn variant(&self) -> TX_END_DELAY_A { match self.bits { false => TX_END_DELAY_A::VALUE1, true => TX_END_DELAY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TX_END_DELAY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Introduce Tx end delay timers"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TX_END_DELAY_A::VALUE2 } } #[doc = "Field `TxEndDelay` writer - Tx End Delay"] -pub type TX_END_DELAY_W<'a, const O: u8> = crate::BitWriter<'a, u32, GUSBCFG_SPEC, TX_END_DELAY_A, O>; -impl<'a, const O: u8> TX_END_DELAY_W<'a, O> { +pub type TX_END_DELAY_W<'a, REG> = crate::BitWriter<'a, REG, TX_END_DELAY_A>; +impl<'a, REG> TX_END_DELAY_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TX_END_DELAY_A::VALUE1) } #[doc = "Introduce Tx end delay timers"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TX_END_DELAY_A::VALUE2) } } @@ -278,34 +258,37 @@ impl From for bool { impl FORCE_HST_MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FORCE_HST_MODE_A { + pub const fn variant(&self) -> FORCE_HST_MODE_A { match self.bits { false => FORCE_HST_MODE_A::VALUE1, true => FORCE_HST_MODE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal Mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FORCE_HST_MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Force Host Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FORCE_HST_MODE_A::VALUE2 } } #[doc = "Field `ForceHstMode` writer - Force Host Mode"] -pub type FORCE_HST_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GUSBCFG_SPEC, FORCE_HST_MODE_A, O>; -impl<'a, const O: u8> FORCE_HST_MODE_W<'a, O> { +pub type FORCE_HST_MODE_W<'a, REG> = crate::BitWriter<'a, REG, FORCE_HST_MODE_A>; +impl<'a, REG> FORCE_HST_MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal Mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FORCE_HST_MODE_A::VALUE1) } #[doc = "Force Host Mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FORCE_HST_MODE_A::VALUE2) } } @@ -328,41 +311,44 @@ impl From for bool { impl FORCE_DEV_MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FORCE_DEV_MODE_A { + pub const fn variant(&self) -> FORCE_DEV_MODE_A { match self.bits { false => FORCE_DEV_MODE_A::VALUE1, true => FORCE_DEV_MODE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal Mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FORCE_DEV_MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Force Device Mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FORCE_DEV_MODE_A::VALUE2 } } #[doc = "Field `ForceDevMode` writer - Force Device Mode"] -pub type FORCE_DEV_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, GUSBCFG_SPEC, FORCE_DEV_MODE_A, O>; -impl<'a, const O: u8> FORCE_DEV_MODE_W<'a, O> { +pub type FORCE_DEV_MODE_W<'a, REG> = crate::BitWriter<'a, REG, FORCE_DEV_MODE_A>; +impl<'a, REG> FORCE_DEV_MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal Mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FORCE_DEV_MODE_A::VALUE1) } #[doc = "Force Device Mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FORCE_DEV_MODE_A::VALUE2) } } #[doc = "Field `CTP` reader - Corrupt Tx packet"] -pub type CTP_R = crate::BitReader; +pub type CTP_R = crate::BitReader; #[doc = "Field `CTP` writer - Corrupt Tx packet"] -pub type CTP_W<'a, const O: u8> = crate::BitWriter<'a, u32, GUSBCFG_SPEC, bool, O>; +pub type CTP_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:2 - FS Timeout Calibration"] #[inline(always)] @@ -419,76 +405,77 @@ impl W { #[doc = "Bits 0:2 - FS Timeout Calibration"] #[inline(always)] #[must_use] - pub fn tout_cal(&mut self) -> TOUT_CAL_W<0> { - TOUT_CAL_W::new(self) + pub fn tout_cal(&mut self) -> TOUT_CAL_W { + TOUT_CAL_W::new(self, 0) } #[doc = "Bit 8 - SRP-Capable"] #[inline(always)] #[must_use] - pub fn srpcap(&mut self) -> SRPCAP_W<8> { - SRPCAP_W::new(self) + pub fn srpcap(&mut self) -> SRPCAP_W { + SRPCAP_W::new(self, 8) } #[doc = "Bit 9 - HNP-Capable"] #[inline(always)] #[must_use] - pub fn hnpcap(&mut self) -> HNPCAP_W<9> { - HNPCAP_W::new(self) + pub fn hnpcap(&mut self) -> HNPCAP_W { + HNPCAP_W::new(self, 9) } #[doc = "Bits 10:13 - USB Turnaround Time"] #[inline(always)] #[must_use] - pub fn usbtrd_tim(&mut self) -> USBTRD_TIM_W<10> { - USBTRD_TIM_W::new(self) + pub fn usbtrd_tim(&mut self) -> USBTRD_TIM_W { + USBTRD_TIM_W::new(self, 10) } #[doc = "Bit 16 - UTMIFS Interface Select"] #[inline(always)] #[must_use] - pub fn otg_i2csel(&mut self) -> OTG_I2CSEL_W<16> { - OTG_I2CSEL_W::new(self) + pub fn otg_i2csel(&mut self) -> OTG_I2CSEL_W { + OTG_I2CSEL_W::new(self, 16) } #[doc = "Bit 28 - Tx End Delay"] #[inline(always)] #[must_use] - pub fn tx_end_delay(&mut self) -> TX_END_DELAY_W<28> { - TX_END_DELAY_W::new(self) + pub fn tx_end_delay(&mut self) -> TX_END_DELAY_W { + TX_END_DELAY_W::new(self, 28) } #[doc = "Bit 29 - Force Host Mode"] #[inline(always)] #[must_use] - pub fn force_hst_mode(&mut self) -> FORCE_HST_MODE_W<29> { - FORCE_HST_MODE_W::new(self) + pub fn force_hst_mode(&mut self) -> FORCE_HST_MODE_W { + FORCE_HST_MODE_W::new(self, 29) } #[doc = "Bit 30 - Force Device Mode"] #[inline(always)] #[must_use] - pub fn force_dev_mode(&mut self) -> FORCE_DEV_MODE_W<30> { - FORCE_DEV_MODE_W::new(self) + pub fn force_dev_mode(&mut self) -> FORCE_DEV_MODE_W { + FORCE_DEV_MODE_W::new(self, 30) } #[doc = "Bit 31 - Corrupt Tx packet"] #[inline(always)] #[must_use] - pub fn ctp(&mut self) -> CTP_W<31> { - CTP_W::new(self) + pub fn ctp(&mut self) -> CTP_W { + CTP_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "USB Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`gusbcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`gusbcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`gusbcfg::R`](R) reader structure"] +impl crate::Readable for GUSBCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`gusbcfg::W`](W) writer structure"] impl crate::Writable for GUSBCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/haint.rs b/src/usb0/haint.rs index cf826387..98a06a52 100644 --- a/src/usb0/haint.rs +++ b/src/usb0/haint.rs @@ -1,20 +1,7 @@ #[doc = "Register `HAINT` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `HAINT` reader - Channel Interrupts"] -pub type HAINT_R = crate::FieldReader; +pub type HAINT_R = crate::FieldReader; impl R { #[doc = "Bits 0:13 - Channel Interrupts"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { HAINT_R::new((self.bits & 0x3fff) as u16) } } -#[doc = "Host All Channels 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 [haint](index.html) module"] +#[doc = "Host All Channels Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`haint::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HAINT_SPEC; impl crate::RegisterSpec for HAINT_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [haint::R](R) reader structure"] -impl crate::Readable for HAINT_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`haint::R`](R) reader structure"] +impl crate::Readable for HAINT_SPEC {} #[doc = "`reset()` method sets HAINT to value 0"] impl crate::Resettable for HAINT_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0/haintmsk.rs b/src/usb0/haintmsk.rs index f11bbcaf..099c9b24 100644 --- a/src/usb0/haintmsk.rs +++ b/src/usb0/haintmsk.rs @@ -1,43 +1,11 @@ #[doc = "Register `HAINTMSK` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HAINTMSK` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `HAINTMsk` reader - Channel Interrupt Mask"] -pub type HAINTMSK_R = crate::FieldReader; +pub type HAINTMSK_R = crate::FieldReader; #[doc = "Field `HAINTMsk` writer - Channel Interrupt Mask"] -pub type HAINTMSK_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HAINTMSK_SPEC, u16, u16, 14, O>; +pub type HAINTMSK_W<'a, REG> = crate::FieldWriter<'a, REG, 14, u16>; impl R { #[doc = "Bits 0:13 - Channel Interrupt Mask"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:13 - Channel Interrupt Mask"] #[inline(always)] #[must_use] - pub fn haintmsk(&mut self) -> HAINTMSK_W<0> { - HAINTMSK_W::new(self) + pub fn haintmsk(&mut self) -> HAINTMSK_W { + HAINTMSK_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host All Channels 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 [haintmsk](index.html) module"] +#[doc = "Host All Channels Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`haintmsk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`haintmsk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HAINTMSK_SPEC; impl crate::RegisterSpec for HAINTMSK_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [haintmsk::R](R) reader structure"] -impl crate::Readable for HAINTMSK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [haintmsk::W](W) writer structure"] +#[doc = "`read()` method returns [`haintmsk::R`](R) reader structure"] +impl crate::Readable for HAINTMSK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`haintmsk::W`](W) writer structure"] impl crate::Writable for HAINTMSK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/hcfg.rs b/src/usb0/hcfg.rs index 7c4a1660..e0d0e2dd 100644 --- a/src/usb0/hcfg.rs +++ b/src/usb0/hcfg.rs @@ -1,41 +1,9 @@ #[doc = "Register `HCFG` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HCFG` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `FSLSPclkSel` reader - FS PHY Clock Select"] -pub type FSLSPCLK_SEL_R = crate::FieldReader; +pub type FSLSPCLK_SEL_R = crate::FieldReader; #[doc = "FS PHY Clock Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -49,27 +17,34 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for FSLSPCLK_SEL_A { + type Ux = u8; +} impl FSLSPCLK_SEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(FSLSPCLK_SEL_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "PHY clock is running at 48 MHz"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FSLSPCLK_SEL_A::VALUE1 } } #[doc = "Field `FSLSPclkSel` writer - FS PHY Clock Select"] -pub type FSLSPCLK_SEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCFG_SPEC, u8, FSLSPCLK_SEL_A, 2, O>; -impl<'a, const O: u8> FSLSPCLK_SEL_W<'a, O> { +pub type FSLSPCLK_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FSLSPCLK_SEL_A>; +impl<'a, REG> FSLSPCLK_SEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "PHY clock is running at 48 MHz"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FSLSPCLK_SEL_A::VALUE1) } } @@ -92,43 +67,46 @@ impl From for bool { impl FSLSSUPP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FSLSSUPP_A { + pub const fn variant(&self) -> FSLSSUPP_A { match self.bits { false => FSLSSUPP_A::VALUE1, true => FSLSSUPP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "FS-only, connected device can supports also only FS."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FSLSSUPP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "FS-only, even if the connected device can support HS"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FSLSSUPP_A::VALUE2 } } #[doc = "Field `FSLSSupp` writer - FS-Only Support"] -pub type FSLSSUPP_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCFG_SPEC, FSLSSUPP_A, O>; -impl<'a, const O: u8> FSLSSUPP_W<'a, O> { +pub type FSLSSUPP_W<'a, REG> = crate::BitWriter<'a, REG, FSLSSUPP_A>; +impl<'a, REG> FSLSSUPP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "FS-only, connected device can supports also only FS."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FSLSSUPP_A::VALUE1) } #[doc = "FS-only, even if the connected device can support HS"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FSLSSUPP_A::VALUE2) } } #[doc = "Field `DescDMA` reader - Enable Scatter/gather DMA in Host mode"] -pub type DESC_DMA_R = crate::BitReader; +pub type DESC_DMA_R = crate::BitReader; #[doc = "Field `DescDMA` writer - Enable Scatter/gather DMA in Host mode"] -pub type DESC_DMA_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCFG_SPEC, bool, O>; +pub type DESC_DMA_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FrListEn` reader - Frame List Entries"] -pub type FR_LIST_EN_R = crate::FieldReader; +pub type FR_LIST_EN_R = crate::FieldReader; #[doc = "Frame List Entries\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -148,10 +126,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for FR_LIST_EN_A { + type Ux = u8; +} impl FR_LIST_EN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FR_LIST_EN_A { + pub const fn variant(&self) -> FR_LIST_EN_A { match self.bits { 0 => FR_LIST_EN_A::VALUE1, 1 => FR_LIST_EN_A::VALUE2, @@ -160,55 +141,59 @@ impl FR_LIST_EN_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "8 Entries"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FR_LIST_EN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "16 Entries"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FR_LIST_EN_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "32 Entries"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == FR_LIST_EN_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "64 Entries"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == FR_LIST_EN_A::VALUE4 } } #[doc = "Field `FrListEn` writer - Frame List Entries"] -pub type FR_LIST_EN_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, HCFG_SPEC, u8, FR_LIST_EN_A, 2, O>; -impl<'a, const O: u8> FR_LIST_EN_W<'a, O> { +pub type FR_LIST_EN_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, FR_LIST_EN_A>; +impl<'a, REG> FR_LIST_EN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "8 Entries"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FR_LIST_EN_A::VALUE1) } #[doc = "16 Entries"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FR_LIST_EN_A::VALUE2) } #[doc = "32 Entries"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(FR_LIST_EN_A::VALUE3) } #[doc = "64 Entries"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(FR_LIST_EN_A::VALUE4) } } #[doc = "Field `PerSchedEna` reader - Enable Periodic Scheduling"] -pub type PER_SCHED_ENA_R = crate::BitReader; +pub type PER_SCHED_ENA_R = crate::BitReader; #[doc = "Field `PerSchedEna` writer - Enable Periodic Scheduling"] -pub type PER_SCHED_ENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCFG_SPEC, bool, O>; +pub type PER_SCHED_ENA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:1 - FS PHY Clock Select"] #[inline(always)] @@ -240,52 +225,53 @@ impl W { #[doc = "Bits 0:1 - FS PHY Clock Select"] #[inline(always)] #[must_use] - pub fn fslspclk_sel(&mut self) -> FSLSPCLK_SEL_W<0> { - FSLSPCLK_SEL_W::new(self) + pub fn fslspclk_sel(&mut self) -> FSLSPCLK_SEL_W { + FSLSPCLK_SEL_W::new(self, 0) } #[doc = "Bit 2 - FS-Only Support"] #[inline(always)] #[must_use] - pub fn fslssupp(&mut self) -> FSLSSUPP_W<2> { - FSLSSUPP_W::new(self) + pub fn fslssupp(&mut self) -> FSLSSUPP_W { + FSLSSUPP_W::new(self, 2) } #[doc = "Bit 23 - Enable Scatter/gather DMA in Host mode"] #[inline(always)] #[must_use] - pub fn desc_dma(&mut self) -> DESC_DMA_W<23> { - DESC_DMA_W::new(self) + pub fn desc_dma(&mut self) -> DESC_DMA_W { + DESC_DMA_W::new(self, 23) } #[doc = "Bits 24:25 - Frame List Entries"] #[inline(always)] #[must_use] - pub fn fr_list_en(&mut self) -> FR_LIST_EN_W<24> { - FR_LIST_EN_W::new(self) + pub fn fr_list_en(&mut self) -> FR_LIST_EN_W { + FR_LIST_EN_W::new(self, 24) } #[doc = "Bit 26 - Enable Periodic Scheduling"] #[inline(always)] #[must_use] - pub fn per_sched_ena(&mut self) -> PER_SCHED_ENA_W<26> { - PER_SCHED_ENA_W::new(self) + pub fn per_sched_ena(&mut self) -> PER_SCHED_ENA_W { + PER_SCHED_ENA_W::new(self, 26) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host 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 [hcfg](index.html) module"] +#[doc = "Host Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCFG_SPEC; impl crate::RegisterSpec for HCFG_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hcfg::R](R) reader structure"] -impl crate::Readable for HCFG_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hcfg::W](W) writer structure"] +#[doc = "`read()` method returns [`hcfg::R`](R) reader structure"] +impl crate::Readable for HCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hcfg::W`](W) writer structure"] impl crate::Writable for HCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/hfir.rs b/src/usb0/hfir.rs index a389ba12..a7189663 100644 --- a/src/usb0/hfir.rs +++ b/src/usb0/hfir.rs @@ -1,43 +1,11 @@ #[doc = "Register `HFIR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HFIR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `FrInt` reader - Frame Interval"] -pub type FR_INT_R = crate::FieldReader; +pub type FR_INT_R = crate::FieldReader; #[doc = "Field `FrInt` writer - Frame Interval"] -pub type FR_INT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HFIR_SPEC, u16, u16, 16, O>; +pub type FR_INT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `HFIRRldCtrl` reader - Reload Control"] pub type HFIRRLD_CTRL_R = crate::BitReader; #[doc = "Reload Control\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl HFIRRLD_CTRL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HFIRRLD_CTRL_A { + pub const fn variant(&self) -> HFIRRLD_CTRL_A { match self.bits { false => HFIRRLD_CTRL_A::VALUE1, true => HFIRRLD_CTRL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "HFIR cannot be reloaded dynamically"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HFIRRLD_CTRL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "HFIR can be dynamically reloaded during runtime"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HFIRRLD_CTRL_A::VALUE2 } } #[doc = "Field `HFIRRldCtrl` writer - Reload Control"] -pub type HFIRRLD_CTRL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HFIR_SPEC, HFIRRLD_CTRL_A, O>; -impl<'a, const O: u8> HFIRRLD_CTRL_W<'a, O> { +pub type HFIRRLD_CTRL_W<'a, REG> = crate::BitWriter<'a, REG, HFIRRLD_CTRL_A>; +impl<'a, REG> HFIRRLD_CTRL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "HFIR cannot be reloaded dynamically"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HFIRRLD_CTRL_A::VALUE1) } #[doc = "HFIR can be dynamically reloaded during runtime"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HFIRRLD_CTRL_A::VALUE2) } } @@ -104,34 +75,35 @@ impl W { #[doc = "Bits 0:15 - Frame Interval"] #[inline(always)] #[must_use] - pub fn fr_int(&mut self) -> FR_INT_W<0> { - FR_INT_W::new(self) + pub fn fr_int(&mut self) -> FR_INT_W { + FR_INT_W::new(self, 0) } #[doc = "Bit 16 - Reload Control"] #[inline(always)] #[must_use] - pub fn hfirrld_ctrl(&mut self) -> HFIRRLD_CTRL_W<16> { - HFIRRLD_CTRL_W::new(self) + pub fn hfirrld_ctrl(&mut self) -> HFIRRLD_CTRL_W { + HFIRRLD_CTRL_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Frame Interval 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 [hfir](index.html) module"] +#[doc = "Host Frame Interval Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hfir::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hfir::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HFIR_SPEC; impl crate::RegisterSpec for HFIR_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hfir::R](R) reader structure"] -impl crate::Readable for HFIR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hfir::W](W) writer structure"] +#[doc = "`read()` method returns [`hfir::R`](R) reader structure"] +impl crate::Readable for HFIR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hfir::W`](W) writer structure"] impl crate::Writable for HFIR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/hflbaddr.rs b/src/usb0/hflbaddr.rs index cac0ca11..6ce4480b 100644 --- a/src/usb0/hflbaddr.rs +++ b/src/usb0/hflbaddr.rs @@ -1,43 +1,11 @@ #[doc = "Register `HFLBADDR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HFLBADDR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `Starting_Address` reader - Starting Address"] -pub type STARTING_ADDRESS_R = crate::FieldReader; +pub type STARTING_ADDRESS_R = crate::FieldReader; #[doc = "Field `Starting_Address` writer - Starting Address"] -pub type STARTING_ADDRESS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HFLBADDR_SPEC, u32, u32, 32, O>; +pub type STARTING_ADDRESS_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Starting Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Starting Address"] #[inline(always)] #[must_use] - pub fn starting_address(&mut self) -> STARTING_ADDRESS_W<0> { - STARTING_ADDRESS_W::new(self) + pub fn starting_address(&mut self) -> STARTING_ADDRESS_W { + STARTING_ADDRESS_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Frame List 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 [hflbaddr](index.html) module"] +#[doc = "Host Frame List Base Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hflbaddr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hflbaddr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HFLBADDR_SPEC; impl crate::RegisterSpec for HFLBADDR_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hflbaddr::R](R) reader structure"] -impl crate::Readable for HFLBADDR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hflbaddr::W](W) writer structure"] +#[doc = "`read()` method returns [`hflbaddr::R`](R) reader structure"] +impl crate::Readable for HFLBADDR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hflbaddr::W`](W) writer structure"] impl crate::Writable for HFLBADDR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/hfnum.rs b/src/usb0/hfnum.rs index 6e4c9782..e3a54fec 100644 --- a/src/usb0/hfnum.rs +++ b/src/usb0/hfnum.rs @@ -1,45 +1,13 @@ #[doc = "Register `HFNUM` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HFNUM` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `FrNum` reader - Frame Number"] -pub type FR_NUM_R = crate::FieldReader; +pub type FR_NUM_R = crate::FieldReader; #[doc = "Field `FrNum` writer - Frame Number"] -pub type FR_NUM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HFNUM_SPEC, u16, u16, 16, O>; +pub type FR_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `FrRem` reader - Frame Time Remaining"] -pub type FR_REM_R = crate::FieldReader; +pub type FR_REM_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Frame Number"] #[inline(always)] @@ -56,28 +24,29 @@ impl W { #[doc = "Bits 0:15 - Frame Number"] #[inline(always)] #[must_use] - pub fn fr_num(&mut self) -> FR_NUM_W<0> { - FR_NUM_W::new(self) + pub fn fr_num(&mut self) -> FR_NUM_W { + FR_NUM_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Frame Number/Frame Time Remaining 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 [hfnum](index.html) module"] +#[doc = "Host Frame Number/Frame Time Remaining Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hfnum::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hfnum::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HFNUM_SPEC; impl crate::RegisterSpec for HFNUM_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hfnum::R](R) reader structure"] -impl crate::Readable for HFNUM_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hfnum::W](W) writer structure"] +#[doc = "`read()` method returns [`hfnum::R`](R) reader structure"] +impl crate::Readable for HFNUM_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hfnum::W`](W) writer structure"] impl crate::Writable for HFNUM_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/hprt.rs b/src/usb0/hprt.rs index a35f78d7..af6cafda 100644 --- a/src/usb0/hprt.rs +++ b/src/usb0/hprt.rs @@ -1,39 +1,7 @@ #[doc = "Register `HPRT` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HPRT` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PrtConnSts` reader - Port Connect Status"] pub type PRT_CONN_STS_R = crate::BitReader; #[doc = "Port Connect Status\n\nValue on reset: 0"] @@ -53,27 +21,27 @@ impl From for bool { impl PRT_CONN_STS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRT_CONN_STS_A { + pub const fn variant(&self) -> PRT_CONN_STS_A { match self.bits { false => PRT_CONN_STS_A::VALUE1, true => PRT_CONN_STS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No device is attached to the port."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRT_CONN_STS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A device is attached to the port."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRT_CONN_STS_A::VALUE2 } } #[doc = "Field `PrtConnDet` reader - Port Connect Detected"] -pub type PRT_CONN_DET_R = crate::BitReader; +pub type PRT_CONN_DET_R = crate::BitReader; #[doc = "Field `PrtConnDet` writer - Port Connect Detected"] -pub type PRT_CONN_DET_W<'a, const O: u8> = crate::BitWriter<'a, u32, HPRT_SPEC, bool, O>; +pub type PRT_CONN_DET_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PrtEna` reader - Port Enable"] pub type PRT_ENA_R = crate::BitReader; #[doc = "Port Enable\n\nValue on reset: 0"] @@ -93,41 +61,44 @@ impl From for bool { impl PRT_ENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRT_ENA_A { + pub const fn variant(&self) -> PRT_ENA_A { match self.bits { false => PRT_ENA_A::VALUE1, true => PRT_ENA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Port disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRT_ENA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Port enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRT_ENA_A::VALUE2 } } #[doc = "Field `PrtEna` writer - Port Enable"] -pub type PRT_ENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, HPRT_SPEC, PRT_ENA_A, O>; -impl<'a, const O: u8> PRT_ENA_W<'a, O> { +pub type PRT_ENA_W<'a, REG> = crate::BitWriter<'a, REG, PRT_ENA_A>; +impl<'a, REG> PRT_ENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Port disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRT_ENA_A::VALUE1) } #[doc = "Port enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRT_ENA_A::VALUE2) } } #[doc = "Field `PrtEnChng` reader - Port Enable/Disable Change"] -pub type PRT_EN_CHNG_R = crate::BitReader; +pub type PRT_EN_CHNG_R = crate::BitReader; #[doc = "Field `PrtEnChng` writer - Port Enable/Disable Change"] -pub type PRT_EN_CHNG_W<'a, const O: u8> = crate::BitWriter<'a, u32, HPRT_SPEC, bool, O>; +pub type PRT_EN_CHNG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PrtOvrCurrAct` reader - Port Overcurrent Active"] pub type PRT_OVR_CURR_ACT_R = crate::BitReader; #[doc = "Port Overcurrent Active\n\nValue on reset: 0"] @@ -147,27 +118,27 @@ impl From for bool { impl PRT_OVR_CURR_ACT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRT_OVR_CURR_ACT_A { + pub const fn variant(&self) -> PRT_OVR_CURR_ACT_A { match self.bits { false => PRT_OVR_CURR_ACT_A::VALUE1, true => PRT_OVR_CURR_ACT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No overcurrent condition"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRT_OVR_CURR_ACT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Overcurrent condition"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRT_OVR_CURR_ACT_A::VALUE2 } } #[doc = "Field `PrtOvrCurrChng` reader - Port Overcurrent Change"] -pub type PRT_OVR_CURR_CHNG_R = crate::BitReader; +pub type PRT_OVR_CURR_CHNG_R = crate::BitReader; #[doc = "Field `PrtOvrCurrChng` writer - Port Overcurrent Change"] -pub type PRT_OVR_CURR_CHNG_W<'a, const O: u8> = crate::BitWriter<'a, u32, HPRT_SPEC, bool, O>; +pub type PRT_OVR_CURR_CHNG_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PrtRes` reader - Port Resume"] pub type PRT_RES_R = crate::BitReader; #[doc = "Port Resume\n\nValue on reset: 0"] @@ -187,34 +158,37 @@ impl From for bool { impl PRT_RES_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRT_RES_A { + pub const fn variant(&self) -> PRT_RES_A { match self.bits { false => PRT_RES_A::VALUE1, true => PRT_RES_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No resume driven"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRT_RES_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Resume driven"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRT_RES_A::VALUE2 } } #[doc = "Field `PrtRes` writer - Port Resume"] -pub type PRT_RES_W<'a, const O: u8> = crate::BitWriter<'a, u32, HPRT_SPEC, PRT_RES_A, O>; -impl<'a, const O: u8> PRT_RES_W<'a, O> { +pub type PRT_RES_W<'a, REG> = crate::BitWriter<'a, REG, PRT_RES_A>; +impl<'a, REG> PRT_RES_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No resume driven"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRT_RES_A::VALUE1) } #[doc = "Resume driven"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRT_RES_A::VALUE2) } } @@ -237,34 +211,37 @@ impl From for bool { impl PRT_SUSP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRT_SUSP_A { + pub const fn variant(&self) -> PRT_SUSP_A { match self.bits { false => PRT_SUSP_A::VALUE1, true => PRT_SUSP_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Port not in Suspend mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRT_SUSP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Port in Suspend mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRT_SUSP_A::VALUE2 } } #[doc = "Field `PrtSusp` writer - Port Suspend"] -pub type PRT_SUSP_W<'a, const O: u8> = crate::BitWriter<'a, u32, HPRT_SPEC, PRT_SUSP_A, O>; -impl<'a, const O: u8> PRT_SUSP_W<'a, O> { +pub type PRT_SUSP_W<'a, REG> = crate::BitWriter<'a, REG, PRT_SUSP_A>; +impl<'a, REG> PRT_SUSP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Port not in Suspend mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRT_SUSP_A::VALUE1) } #[doc = "Port in Suspend mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRT_SUSP_A::VALUE2) } } @@ -287,39 +264,42 @@ impl From for bool { impl PRT_RST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRT_RST_A { + pub const fn variant(&self) -> PRT_RST_A { match self.bits { false => PRT_RST_A::VALUE1, true => PRT_RST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Port not in reset"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRT_RST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Port in reset"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRT_RST_A::VALUE2 } } #[doc = "Field `PrtRst` writer - Port Reset"] -pub type PRT_RST_W<'a, const O: u8> = crate::BitWriter<'a, u32, HPRT_SPEC, PRT_RST_A, O>; -impl<'a, const O: u8> PRT_RST_W<'a, O> { +pub type PRT_RST_W<'a, REG> = crate::BitWriter<'a, REG, PRT_RST_A>; +impl<'a, REG> PRT_RST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Port not in reset"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRT_RST_A::VALUE1) } #[doc = "Port in reset"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRT_RST_A::VALUE2) } } #[doc = "Field `PrtLnSts` reader - Port Line Status"] -pub type PRT_LN_STS_R = crate::FieldReader; +pub type PRT_LN_STS_R = crate::FieldReader; #[doc = "Field `PrtPwr` reader - Port Power"] pub type PRT_PWR_R = crate::BitReader; #[doc = "Port Power\n\nValue on reset: 0"] @@ -339,39 +319,42 @@ impl From for bool { impl PRT_PWR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PRT_PWR_A { + pub const fn variant(&self) -> PRT_PWR_A { match self.bits { false => PRT_PWR_A::VALUE1, true => PRT_PWR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Power off"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRT_PWR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Power on"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRT_PWR_A::VALUE2 } } #[doc = "Field `PrtPwr` writer - Port Power"] -pub type PRT_PWR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HPRT_SPEC, PRT_PWR_A, O>; -impl<'a, const O: u8> PRT_PWR_W<'a, O> { +pub type PRT_PWR_W<'a, REG> = crate::BitWriter<'a, REG, PRT_PWR_A>; +impl<'a, REG> PRT_PWR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Power off"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRT_PWR_A::VALUE1) } #[doc = "Power on"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRT_PWR_A::VALUE2) } } #[doc = "Field `PrtSpd` reader - Port Speed"] -pub type PRT_SPD_R = crate::FieldReader; +pub type PRT_SPD_R = crate::FieldReader; #[doc = "Port Speed\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -385,16 +368,19 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PRT_SPD_A { + type Ux = u8; +} impl PRT_SPD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(PRT_SPD_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Full speed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRT_SPD_A::VALUE1 @@ -466,70 +452,71 @@ impl W { #[doc = "Bit 1 - Port Connect Detected"] #[inline(always)] #[must_use] - pub fn prt_conn_det(&mut self) -> PRT_CONN_DET_W<1> { - PRT_CONN_DET_W::new(self) + pub fn prt_conn_det(&mut self) -> PRT_CONN_DET_W { + PRT_CONN_DET_W::new(self, 1) } #[doc = "Bit 2 - Port Enable"] #[inline(always)] #[must_use] - pub fn prt_ena(&mut self) -> PRT_ENA_W<2> { - PRT_ENA_W::new(self) + pub fn prt_ena(&mut self) -> PRT_ENA_W { + PRT_ENA_W::new(self, 2) } #[doc = "Bit 3 - Port Enable/Disable Change"] #[inline(always)] #[must_use] - pub fn prt_en_chng(&mut self) -> PRT_EN_CHNG_W<3> { - PRT_EN_CHNG_W::new(self) + pub fn prt_en_chng(&mut self) -> PRT_EN_CHNG_W { + PRT_EN_CHNG_W::new(self, 3) } #[doc = "Bit 5 - Port Overcurrent Change"] #[inline(always)] #[must_use] - pub fn prt_ovr_curr_chng(&mut self) -> PRT_OVR_CURR_CHNG_W<5> { - PRT_OVR_CURR_CHNG_W::new(self) + pub fn prt_ovr_curr_chng(&mut self) -> PRT_OVR_CURR_CHNG_W { + PRT_OVR_CURR_CHNG_W::new(self, 5) } #[doc = "Bit 6 - Port Resume"] #[inline(always)] #[must_use] - pub fn prt_res(&mut self) -> PRT_RES_W<6> { - PRT_RES_W::new(self) + pub fn prt_res(&mut self) -> PRT_RES_W { + PRT_RES_W::new(self, 6) } #[doc = "Bit 7 - Port Suspend"] #[inline(always)] #[must_use] - pub fn prt_susp(&mut self) -> PRT_SUSP_W<7> { - PRT_SUSP_W::new(self) + pub fn prt_susp(&mut self) -> PRT_SUSP_W { + PRT_SUSP_W::new(self, 7) } #[doc = "Bit 8 - Port Reset"] #[inline(always)] #[must_use] - pub fn prt_rst(&mut self) -> PRT_RST_W<8> { - PRT_RST_W::new(self) + pub fn prt_rst(&mut self) -> PRT_RST_W { + PRT_RST_W::new(self, 8) } #[doc = "Bit 12 - Port Power"] #[inline(always)] #[must_use] - pub fn prt_pwr(&mut self) -> PRT_PWR_W<12> { - PRT_PWR_W::new(self) + pub fn prt_pwr(&mut self) -> PRT_PWR_W { + PRT_PWR_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Port 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 [hprt](index.html) module"] +#[doc = "Host Port Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hprt::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hprt::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HPRT_SPEC; impl crate::RegisterSpec for HPRT_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hprt::R](R) reader structure"] -impl crate::Readable for HPRT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hprt::W](W) writer structure"] +#[doc = "`read()` method returns [`hprt::R`](R) reader structure"] +impl crate::Readable for HPRT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hprt::W`](W) writer structure"] impl crate::Writable for HPRT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/hptxfsiz.rs b/src/usb0/hptxfsiz.rs index 115f6cbd..6ecae45c 100644 --- a/src/usb0/hptxfsiz.rs +++ b/src/usb0/hptxfsiz.rs @@ -1,47 +1,15 @@ #[doc = "Register `HPTXFSIZ` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HPTXFSIZ` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PTxFStAddr` reader - Host Periodic TxFIFO Start Address"] -pub type PTX_FST_ADDR_R = crate::FieldReader; +pub type PTX_FST_ADDR_R = crate::FieldReader; #[doc = "Field `PTxFStAddr` writer - Host Periodic TxFIFO Start Address"] -pub type PTX_FST_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HPTXFSIZ_SPEC, u16, u16, 16, O>; +pub type PTX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `PTxFSize` reader - Host Periodic TxFIFO Depth"] -pub type PTX_FSIZE_R = crate::FieldReader; +pub type PTX_FSIZE_R = crate::FieldReader; #[doc = "Field `PTxFSize` writer - Host Periodic TxFIFO Depth"] -pub type PTX_FSIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HPTXFSIZ_SPEC, u16, u16, 16, O>; +pub type PTX_FSIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Host Periodic TxFIFO Start Address"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:15 - Host Periodic TxFIFO Start Address"] #[inline(always)] #[must_use] - pub fn ptx_fst_addr(&mut self) -> PTX_FST_ADDR_W<0> { - PTX_FST_ADDR_W::new(self) + pub fn ptx_fst_addr(&mut self) -> PTX_FST_ADDR_W { + PTX_FST_ADDR_W::new(self, 0) } #[doc = "Bits 16:31 - Host Periodic TxFIFO Depth"] #[inline(always)] #[must_use] - pub fn ptx_fsize(&mut self) -> PTX_FSIZE_W<16> { - PTX_FSIZE_W::new(self) + pub fn ptx_fsize(&mut self) -> PTX_FSIZE_W { + PTX_FSIZE_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host 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 [hptxfsiz](index.html) module"] +#[doc = "Host Periodic Transmit FIFO Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hptxfsiz::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hptxfsiz::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HPTXFSIZ_SPEC; impl crate::RegisterSpec for HPTXFSIZ_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hptxfsiz::R](R) reader structure"] -impl crate::Readable for HPTXFSIZ_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hptxfsiz::W](W) writer structure"] +#[doc = "`read()` method returns [`hptxfsiz::R`](R) reader structure"] +impl crate::Readable for HPTXFSIZ_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hptxfsiz::W`](W) writer structure"] impl crate::Writable for HPTXFSIZ_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/hptxsts.rs b/src/usb0/hptxsts.rs index a1b8c508..6a26ddda 100644 --- a/src/usb0/hptxsts.rs +++ b/src/usb0/hptxsts.rs @@ -1,41 +1,9 @@ #[doc = "Register `HPTXSTS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HPTXSTS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `PTxFSpcAvail` reader - Periodic Transmit Data FIFO Space Available"] -pub type PTX_FSPC_AVAIL_R = crate::FieldReader; +pub type PTX_FSPC_AVAIL_R = crate::FieldReader; #[doc = "Periodic Transmit Data FIFO Space Available\n\nValue on reset: 256"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u16)] @@ -53,10 +21,13 @@ impl From for u16 { variant as _ } } +impl crate::FieldSpec for PTX_FSPC_AVAIL_A { + type Ux = u16; +} impl PTX_FSPC_AVAIL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PTX_FSPC_AVAIL_A::VALUE1), 1 => Some(PTX_FSPC_AVAIL_A::VALUE2), @@ -64,43 +35,47 @@ impl PTX_FSPC_AVAIL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Periodic TxFIFO is full"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PTX_FSPC_AVAIL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "1 word available"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PTX_FSPC_AVAIL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "2 words available"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PTX_FSPC_AVAIL_A::VALUE3 } } #[doc = "Field `PTxFSpcAvail` writer - Periodic Transmit Data FIFO Space Available"] -pub type PTX_FSPC_AVAIL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HPTXSTS_SPEC, u16, PTX_FSPC_AVAIL_A, 16, O>; -impl<'a, const O: u8> PTX_FSPC_AVAIL_W<'a, O> { +pub type PTX_FSPC_AVAIL_W<'a, REG> = crate::FieldWriter<'a, REG, 16, PTX_FSPC_AVAIL_A>; +impl<'a, REG> PTX_FSPC_AVAIL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Periodic TxFIFO is full"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PTX_FSPC_AVAIL_A::VALUE1) } #[doc = "1 word available"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PTX_FSPC_AVAIL_A::VALUE2) } #[doc = "2 words available"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PTX_FSPC_AVAIL_A::VALUE3) } } #[doc = "Field `PTxQSpcAvail` reader - Periodic Transmit Request Queue Space Available"] -pub type PTX_QSPC_AVAIL_R = crate::FieldReader; +pub type PTX_QSPC_AVAIL_R = crate::FieldReader; #[doc = "Periodic Transmit Request Queue Space Available\n\nValue on reset: 8"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -118,10 +93,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PTX_QSPC_AVAIL_A { + type Ux = u8; +} impl PTX_QSPC_AVAIL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PTX_QSPC_AVAIL_A::VALUE1), 1 => Some(PTX_QSPC_AVAIL_A::VALUE2), @@ -129,24 +107,24 @@ impl PTX_QSPC_AVAIL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Periodic Transmit Request Queue is full"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PTX_QSPC_AVAIL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "1 location available"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PTX_QSPC_AVAIL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "2 locations available"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PTX_QSPC_AVAIL_A::VALUE3 } } #[doc = "Field `PTxQTop` reader - Top of the Periodic Transmit Request Queue"] -pub type PTX_QTOP_R = crate::FieldReader; +pub type PTX_QTOP_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Periodic Transmit Data FIFO Space Available"] #[inline(always)] @@ -168,28 +146,29 @@ impl W { #[doc = "Bits 0:15 - Periodic Transmit Data FIFO Space Available"] #[inline(always)] #[must_use] - pub fn ptx_fspc_avail(&mut self) -> PTX_FSPC_AVAIL_W<0> { - PTX_FSPC_AVAIL_W::new(self) + pub fn ptx_fspc_avail(&mut self) -> PTX_FSPC_AVAIL_W { + PTX_FSPC_AVAIL_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Periodic Transmit FIFO/ Queue 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 [hptxsts](index.html) module"] +#[doc = "Host Periodic Transmit FIFO/ Queue Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hptxsts::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hptxsts::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HPTXSTS_SPEC; impl crate::RegisterSpec for HPTXSTS_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hptxsts::R](R) reader structure"] -impl crate::Readable for HPTXSTS_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hptxsts::W](W) writer structure"] +#[doc = "`read()` method returns [`hptxsts::R`](R) reader structure"] +impl crate::Readable for HPTXSTS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hptxsts::W`](W) writer structure"] impl crate::Writable for HPTXSTS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0/pcgcctl.rs b/src/usb0/pcgcctl.rs index 818bd6cd..1c0c947c 100644 --- a/src/usb0/pcgcctl.rs +++ b/src/usb0/pcgcctl.rs @@ -1,47 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `StopPclk` reader - Stop Pclk"] -pub type STOP_PCLK_R = crate::BitReader; +pub type STOP_PCLK_R = crate::BitReader; #[doc = "Field `StopPclk` writer - Stop Pclk"] -pub type STOP_PCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCGCCTL_SPEC, bool, O>; +pub type STOP_PCLK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `GateHclk` reader - Gate Hclk"] -pub type GATE_HCLK_R = crate::BitReader; +pub type GATE_HCLK_R = crate::BitReader; #[doc = "Field `GateHclk` writer - Gate Hclk"] -pub type GATE_HCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCGCCTL_SPEC, bool, O>; +pub type GATE_HCLK_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Stop Pclk"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bit 0 - Stop Pclk"] #[inline(always)] #[must_use] - pub fn stop_pclk(&mut self) -> STOP_PCLK_W<0> { - STOP_PCLK_W::new(self) + pub fn stop_pclk(&mut self) -> STOP_PCLK_W { + STOP_PCLK_W::new(self, 0) } #[doc = "Bit 1 - Gate Hclk"] #[inline(always)] #[must_use] - pub fn gate_hclk(&mut self) -> GATE_HCLK_W<1> { - GATE_HCLK_W::new(self) + pub fn gate_hclk(&mut self) -> GATE_HCLK_W { + GATE_HCLK_W::new(self, 1) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Power and Clock Gating Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcgcctl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcgcctl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pcgcctl::R`](R) reader structure"] +impl crate::Readable for PCGCCTL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pcgcctl::W`](W) writer structure"] impl crate::Writable for PCGCCTL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ch0.rs b/src/usb0_ch0.rs index bfdef3d4..514840aa 100644 --- a/src/usb0_ch0.rs +++ b/src/usb0_ch0.rs @@ -1,70 +1,94 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Host Channel Characteristics Register"] - pub hcchar: HCCHAR, + hcchar: HCCHAR, _reserved1: [u8; 0x04], - #[doc = "0x08 - Host Channel Interrupt Register"] - pub hcint: HCINT, - #[doc = "0x0c - Host Channel Interrupt Mask Register"] - pub hcintmsk: HCINTMSK, + hcint: HCINT, + hcintmsk: HCINTMSK, _reserved_3_hctsiz: [u8; 0x04], _reserved_4_hcdma: [u8; 0x04], _reserved5: [u8; 0x04], - #[doc = "0x1c - Host Channel DMA Buffer Address Register"] - pub hcdmab: HCDMAB, + hcdmab: HCDMAB, } impl RegisterBlock { + #[doc = "0x00 - Host Channel Characteristics Register"] + #[inline(always)] + pub const fn hcchar(&self) -> &HCCHAR { + &self.hcchar + } + #[doc = "0x08 - Host Channel Interrupt Register"] + #[inline(always)] + pub const fn hcint(&self) -> &HCINT { + &self.hcint + } + #[doc = "0x0c - Host Channel Interrupt Mask Register"] + #[inline(always)] + pub const fn hcintmsk(&self) -> &HCINTMSK { + &self.hcintmsk + } #[doc = "0x10 - Host Channel Transfer Size Register \\[SCATGATHER\\]"] #[inline(always)] pub const fn hctsiz_scatgather(&self) -> &HCTSIZ_SCATGATHER { - unsafe { &*(self as *const Self).cast::().add(16usize).cast() } + unsafe { &*(self as *const Self).cast::().add(16).cast() } } #[doc = "0x10 - Host Channel Transfer Size Register \\[BUFFERMODE\\]"] #[inline(always)] pub const fn hctsiz_buffermode(&self) -> &HCTSIZ_BUFFERMODE { - unsafe { &*(self as *const Self).cast::().add(16usize).cast() } + unsafe { &*(self as *const Self).cast::().add(16).cast() } } #[doc = "0x14 - Host Channel DMA Address Register \\[SCATGATHER\\]"] #[inline(always)] pub const fn hcdma_scatgather(&self) -> &HCDMA_SCATGATHER { - unsafe { &*(self as *const Self).cast::().add(20usize).cast() } + unsafe { &*(self as *const Self).cast::().add(20).cast() } } #[doc = "0x14 - Host Channel DMA Address Register \\[BUFFERMODE\\]"] #[inline(always)] pub const fn hcdma_buffermode(&self) -> &HCDMA_BUFFERMODE { - unsafe { &*(self as *const Self).cast::().add(20usize).cast() } + unsafe { &*(self as *const Self).cast::().add(20).cast() } + } + #[doc = "0x1c - Host Channel DMA Buffer Address Register"] + #[inline(always)] + pub const fn hcdmab(&self) -> &HCDMAB { + &self.hcdmab } } -#[doc = "HCCHAR (rw) register accessor: an alias for `Reg`"] +#[doc = "HCCHAR (rw) register accessor: Host Channel Characteristics Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcchar::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcchar::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hcchar`] +module"] pub type HCCHAR = crate::Reg; #[doc = "Host Channel Characteristics Register"] pub mod hcchar; -#[doc = "HCINT (rw) register accessor: an alias for `Reg`"] +#[doc = "HCINT (rw) register accessor: Host Channel Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcint::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcint::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hcint`] +module"] pub type HCINT = crate::Reg; #[doc = "Host Channel Interrupt Register"] pub mod hcint; -#[doc = "HCINTMSK (rw) register accessor: an alias for `Reg`"] +#[doc = "HCINTMSK (rw) register accessor: Host Channel Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcintmsk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcintmsk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hcintmsk`] +module"] pub type HCINTMSK = crate::Reg; #[doc = "Host Channel Interrupt Mask Register"] pub mod hcintmsk; -#[doc = "HCTSIZ_BUFFERMODE (rw) register accessor: an alias for `Reg`"] +#[doc = "HCTSIZ_BUFFERMODE (rw) register accessor: Host Channel Transfer Size Register \\[BUFFERMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hctsiz_buffermode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hctsiz_buffermode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hctsiz_buffermode`] +module"] pub type HCTSIZ_BUFFERMODE = crate::Reg; #[doc = "Host Channel Transfer Size Register \\[BUFFERMODE\\]"] pub mod hctsiz_buffermode; -#[doc = "HCTSIZ_SCATGATHER (rw) register accessor: an alias for `Reg`"] +#[doc = "HCTSIZ_SCATGATHER (rw) register accessor: Host Channel Transfer Size Register \\[SCATGATHER\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hctsiz_scatgather::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hctsiz_scatgather::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hctsiz_scatgather`] +module"] pub type HCTSIZ_SCATGATHER = crate::Reg; #[doc = "Host Channel Transfer Size Register \\[SCATGATHER\\]"] pub mod hctsiz_scatgather; -#[doc = "HCDMA_BUFFERMODE (rw) register accessor: an alias for `Reg`"] +#[doc = "HCDMA_BUFFERMODE (rw) register accessor: Host Channel DMA Address Register \\[BUFFERMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcdma_buffermode::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcdma_buffermode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hcdma_buffermode`] +module"] pub type HCDMA_BUFFERMODE = crate::Reg; #[doc = "Host Channel DMA Address Register \\[BUFFERMODE\\]"] pub mod hcdma_buffermode; -#[doc = "HCDMA_SCATGATHER (rw) register accessor: an alias for `Reg`"] +#[doc = "HCDMA_SCATGATHER (rw) register accessor: Host Channel DMA Address Register \\[SCATGATHER\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcdma_scatgather::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcdma_scatgather::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hcdma_scatgather`] +module"] pub type HCDMA_SCATGATHER = crate::Reg; #[doc = "Host Channel DMA Address Register \\[SCATGATHER\\]"] pub mod hcdma_scatgather; -#[doc = "HCDMAB (r) register accessor: an alias for `Reg`"] +#[doc = "HCDMAB (r) register accessor: Host Channel DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcdmab::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@hcdmab`] +module"] pub type HCDMAB = crate::Reg; #[doc = "Host Channel DMA Buffer Address Register"] pub mod hcdmab; diff --git a/src/usb0_ch0/hcchar.rs b/src/usb0_ch0/hcchar.rs index a7d47286..b48df230 100644 --- a/src/usb0_ch0/hcchar.rs +++ b/src/usb0_ch0/hcchar.rs @@ -1,47 +1,15 @@ #[doc = "Register `HCCHAR` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HCCHAR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `MPS` reader - Maximum Packet Size"] -pub type MPS_R = crate::FieldReader; +pub type MPS_R = crate::FieldReader; #[doc = "Field `MPS` writer - Maximum Packet Size"] -pub type MPS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCCHAR_SPEC, u16, u16, 11, O>; +pub type MPS_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>; #[doc = "Field `EPNum` reader - Endpoint Number"] -pub type EPNUM_R = crate::FieldReader; +pub type EPNUM_R = crate::FieldReader; #[doc = "Field `EPNum` writer - Endpoint Number"] -pub type EPNUM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCCHAR_SPEC, u8, u8, 4, O>; +pub type EPNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `EPDir` reader - Endpoint Direction"] pub type EPDIR_R = crate::BitReader; #[doc = "Endpoint Direction\n\nValue on reset: 0"] @@ -61,39 +29,42 @@ impl From for bool { impl EPDIR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPDIR_A { + pub const fn variant(&self) -> EPDIR_A { match self.bits { false => EPDIR_A::VALUE1, true => EPDIR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "OUT"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPDIR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "IN"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPDIR_A::VALUE2 } } #[doc = "Field `EPDir` writer - Endpoint Direction"] -pub type EPDIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCCHAR_SPEC, EPDIR_A, O>; -impl<'a, const O: u8> EPDIR_W<'a, O> { +pub type EPDIR_W<'a, REG> = crate::BitWriter<'a, REG, EPDIR_A>; +impl<'a, REG> EPDIR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "OUT"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPDIR_A::VALUE1) } #[doc = "IN"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPDIR_A::VALUE2) } } #[doc = "Field `EPType` reader - Endpoint Type"] -pub type EPTYPE_R = crate::FieldReader; +pub type EPTYPE_R = crate::FieldReader; #[doc = "Endpoint Type\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -113,10 +84,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EPTYPE_A { + type Ux = u8; +} impl EPTYPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPTYPE_A { + pub const fn variant(&self) -> EPTYPE_A { match self.bits { 0 => EPTYPE_A::VALUE1, 1 => EPTYPE_A::VALUE2, @@ -125,53 +99,57 @@ impl EPTYPE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Control"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPTYPE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Isochronous"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPTYPE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Bulk"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EPTYPE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Interrupt"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EPTYPE_A::VALUE4 } } #[doc = "Field `EPType` writer - Endpoint Type"] -pub type EPTYPE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, HCCHAR_SPEC, u8, EPTYPE_A, 2, O>; -impl<'a, const O: u8> EPTYPE_W<'a, O> { +pub type EPTYPE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EPTYPE_A>; +impl<'a, REG> EPTYPE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Control"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE1) } #[doc = "Isochronous"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE2) } #[doc = "Bulk"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE3) } #[doc = "Interrupt"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE4) } } #[doc = "Field `MC_EC` reader - Multi Count / Error Count"] -pub type MC_EC_R = crate::FieldReader; +pub type MC_EC_R = crate::FieldReader; #[doc = "Multi Count / Error Count\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -189,10 +167,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MC_EC_A { + type Ux = u8; +} impl MC_EC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(MC_EC_A::VALUE2), 2 => Some(MC_EC_A::VALUE3), @@ -200,45 +181,49 @@ impl MC_EC_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "1 transaction"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MC_EC_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "2 transactions to be issued for this endpoint per frame"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MC_EC_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "3 transactions to be issued for this endpoint per frame"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MC_EC_A::VALUE4 } } #[doc = "Field `MC_EC` writer - Multi Count / Error Count"] -pub type MC_EC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCCHAR_SPEC, u8, MC_EC_A, 2, O>; -impl<'a, const O: u8> MC_EC_W<'a, O> { +pub type MC_EC_W<'a, REG> = crate::FieldWriter<'a, REG, 2, MC_EC_A>; +impl<'a, REG> MC_EC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "1 transaction"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MC_EC_A::VALUE2) } #[doc = "2 transactions to be issued for this endpoint per frame"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MC_EC_A::VALUE3) } #[doc = "3 transactions to be issued for this endpoint per frame"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MC_EC_A::VALUE4) } } #[doc = "Field `DevAddr` reader - Device Address"] -pub type DEV_ADDR_R = crate::FieldReader; +pub type DEV_ADDR_R = crate::FieldReader; #[doc = "Field `DevAddr` writer - Device Address"] -pub type DEV_ADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCCHAR_SPEC, u8, u8, 7, O>; +pub type DEV_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `OddFrm` reader - Odd Frame"] pub type ODD_FRM_R = crate::BitReader; #[doc = "Odd Frame\n\nValue on reset: 0"] @@ -258,41 +243,44 @@ impl From for bool { impl ODD_FRM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ODD_FRM_A { + pub const fn variant(&self) -> ODD_FRM_A { match self.bits { false => ODD_FRM_A::VALUE1, true => ODD_FRM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Even frame"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ODD_FRM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Odd frame"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ODD_FRM_A::VALUE2 } } #[doc = "Field `OddFrm` writer - Odd Frame"] -pub type ODD_FRM_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCCHAR_SPEC, ODD_FRM_A, O>; -impl<'a, const O: u8> ODD_FRM_W<'a, O> { +pub type ODD_FRM_W<'a, REG> = crate::BitWriter<'a, REG, ODD_FRM_A>; +impl<'a, REG> ODD_FRM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Even frame"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ODD_FRM_A::VALUE1) } #[doc = "Odd frame"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ODD_FRM_A::VALUE2) } } #[doc = "Field `ChDis` reader - Channel Disable"] -pub type CH_DIS_R = crate::BitReader; +pub type CH_DIS_R = crate::BitReader; #[doc = "Field `ChDis` writer - Channel Disable"] -pub type CH_DIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCCHAR_SPEC, bool, O>; +pub type CH_DIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ChEna` reader - Channel Enable"] pub type CH_ENA_R = crate::BitReader; #[doc = "Channel Enable\n\nValue on reset: 0"] @@ -312,34 +300,37 @@ impl From for bool { impl CH_ENA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CH_ENA_A { + pub const fn variant(&self) -> CH_ENA_A { match self.bits { false => CH_ENA_A::VALUE1, true => CH_ENA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Scatter/Gather mode enabled: Indicates that the descriptor structure is not yet ready. Scatter/Gather mode disabled: Channel disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CH_ENA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Scatter/Gather mode enabled: Indicates that the descriptor structure and data buffer with data is setup and this channel can access the descriptor. Scatter/Gather mode disabled: Channel enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CH_ENA_A::VALUE2 } } #[doc = "Field `ChEna` writer - Channel Enable"] -pub type CH_ENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCCHAR_SPEC, CH_ENA_A, O>; -impl<'a, const O: u8> CH_ENA_W<'a, O> { +pub type CH_ENA_W<'a, REG> = crate::BitWriter<'a, REG, CH_ENA_A>; +impl<'a, REG> CH_ENA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Scatter/Gather mode enabled: Indicates that the descriptor structure is not yet ready. Scatter/Gather mode disabled: Channel disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CH_ENA_A::VALUE1) } #[doc = "Scatter/Gather mode enabled: Indicates that the descriptor structure and data buffer with data is setup and this channel can access the descriptor. Scatter/Gather mode disabled: Channel enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CH_ENA_A::VALUE2) } } @@ -394,76 +385,77 @@ impl W { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] #[must_use] - pub fn mps(&mut self) -> MPS_W<0> { - MPS_W::new(self) + pub fn mps(&mut self) -> MPS_W { + MPS_W::new(self, 0) } #[doc = "Bits 11:14 - Endpoint Number"] #[inline(always)] #[must_use] - pub fn epnum(&mut self) -> EPNUM_W<11> { - EPNUM_W::new(self) + pub fn epnum(&mut self) -> EPNUM_W { + EPNUM_W::new(self, 11) } #[doc = "Bit 15 - Endpoint Direction"] #[inline(always)] #[must_use] - pub fn epdir(&mut self) -> EPDIR_W<15> { - EPDIR_W::new(self) + pub fn epdir(&mut self) -> EPDIR_W { + EPDIR_W::new(self, 15) } #[doc = "Bits 18:19 - Endpoint Type"] #[inline(always)] #[must_use] - pub fn eptype(&mut self) -> EPTYPE_W<18> { - EPTYPE_W::new(self) + pub fn eptype(&mut self) -> EPTYPE_W { + EPTYPE_W::new(self, 18) } #[doc = "Bits 20:21 - Multi Count / Error Count"] #[inline(always)] #[must_use] - pub fn mc_ec(&mut self) -> MC_EC_W<20> { - MC_EC_W::new(self) + pub fn mc_ec(&mut self) -> MC_EC_W { + MC_EC_W::new(self, 20) } #[doc = "Bits 22:28 - Device Address"] #[inline(always)] #[must_use] - pub fn dev_addr(&mut self) -> DEV_ADDR_W<22> { - DEV_ADDR_W::new(self) + pub fn dev_addr(&mut self) -> DEV_ADDR_W { + DEV_ADDR_W::new(self, 22) } #[doc = "Bit 29 - Odd Frame"] #[inline(always)] #[must_use] - pub fn odd_frm(&mut self) -> ODD_FRM_W<29> { - ODD_FRM_W::new(self) + pub fn odd_frm(&mut self) -> ODD_FRM_W { + ODD_FRM_W::new(self, 29) } #[doc = "Bit 30 - Channel Disable"] #[inline(always)] #[must_use] - pub fn ch_dis(&mut self) -> CH_DIS_W<30> { - CH_DIS_W::new(self) + pub fn ch_dis(&mut self) -> CH_DIS_W { + CH_DIS_W::new(self, 30) } #[doc = "Bit 31 - Channel Enable"] #[inline(always)] #[must_use] - pub fn ch_ena(&mut self) -> CH_ENA_W<31> { - CH_ENA_W::new(self) + pub fn ch_ena(&mut self) -> CH_ENA_W { + CH_ENA_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Channel Characteristics 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 [hcchar](index.html) module"] +#[doc = "Host Channel Characteristics Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcchar::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcchar::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCCHAR_SPEC; impl crate::RegisterSpec for HCCHAR_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hcchar::R](R) reader structure"] -impl crate::Readable for HCCHAR_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hcchar::W](W) writer structure"] +#[doc = "`read()` method returns [`hcchar::R`](R) reader structure"] +impl crate::Readable for HCCHAR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hcchar::W`](W) writer structure"] impl crate::Writable for HCCHAR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ch0/hcdma_buffermode.rs b/src/usb0_ch0/hcdma_buffermode.rs index 3bc1ceeb..777e55d6 100644 --- a/src/usb0_ch0/hcdma_buffermode.rs +++ b/src/usb0_ch0/hcdma_buffermode.rs @@ -1,43 +1,11 @@ #[doc = "Register `HCDMA_BUFFERMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HCDMA_BUFFERMODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `DMAAddr` reader - DMA Address"] -pub type DMAADDR_R = crate::FieldReader; +pub type DMAADDR_R = crate::FieldReader; #[doc = "Field `DMAAddr` writer - DMA Address"] -pub type DMAADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCDMA_BUFFERMODE_SPEC, u32, u32, 32, O>; +pub type DMAADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] #[must_use] - pub fn dmaaddr(&mut self) -> DMAADDR_W<0> { - DMAADDR_W::new(self) + pub fn dmaaddr(&mut self) -> DMAADDR_W { + DMAADDR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Channel DMA Address Register \\[BUFFERMODE\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hcdma_buffermode](index.html) module\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Host Channel DMA Address Register \\[BUFFERMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcdma_buffermode::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcdma_buffermode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCDMA_BUFFERMODE_SPEC; impl crate::RegisterSpec for HCDMA_BUFFERMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hcdma_buffermode::R](R) reader structure"] -impl crate::Readable for HCDMA_BUFFERMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hcdma_buffermode::W](W) writer structure"] +#[doc = "`read()` method returns [`hcdma_buffermode::R`](R) reader structure"] +impl crate::Readable for HCDMA_BUFFERMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hcdma_buffermode::W`](W) writer structure"] impl crate::Writable for HCDMA_BUFFERMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ch0/hcdma_scatgather.rs b/src/usb0_ch0/hcdma_scatgather.rs index 51c45cee..2419669f 100644 --- a/src/usb0_ch0/hcdma_scatgather.rs +++ b/src/usb0_ch0/hcdma_scatgather.rs @@ -1,41 +1,9 @@ #[doc = "Register `HCDMA_SCATGATHER` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HCDMA_SCATGATHER` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CTD` reader - Current Transfer Desc:"] -pub type CTD_R = crate::FieldReader; +pub type CTD_R = crate::FieldReader; #[doc = "Current Transfer Desc:\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -51,45 +19,52 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CTD_A { + type Ux = u8; +} impl CTD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CTD_A::VALUE1), 63 => Some(CTD_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "1 descriptor"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CTD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "64 descriptors"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CTD_A::VALUE2 } } #[doc = "Field `CTD` writer - Current Transfer Desc:"] -pub type CTD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCDMA_SCATGATHER_SPEC, u8, CTD_A, 6, O>; -impl<'a, const O: u8> CTD_W<'a, O> { +pub type CTD_W<'a, REG> = crate::FieldWriter<'a, REG, 6, CTD_A>; +impl<'a, REG> CTD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "1 descriptor"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTD_A::VALUE1) } #[doc = "64 descriptors"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTD_A::VALUE2) } } #[doc = "Field `DMAAddr` reader - DMA Address"] -pub type DMAADDR_R = crate::FieldReader; +pub type DMAADDR_R = crate::FieldReader; #[doc = "Field `DMAAddr` writer - DMA Address"] -pub type DMAADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCDMA_SCATGATHER_SPEC, u32, u32, 23, O>; +pub type DMAADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 23, u32>; impl R { #[doc = "Bits 3:8 - Current Transfer Desc:"] #[inline(always)] @@ -106,34 +81,35 @@ impl W { #[doc = "Bits 3:8 - Current Transfer Desc:"] #[inline(always)] #[must_use] - pub fn ctd(&mut self) -> CTD_W<3> { - CTD_W::new(self) + pub fn ctd(&mut self) -> CTD_W { + CTD_W::new(self, 3) } #[doc = "Bits 9:31 - DMA Address"] #[inline(always)] #[must_use] - pub fn dmaaddr(&mut self) -> DMAADDR_W<9> { - DMAADDR_W::new(self) + pub fn dmaaddr(&mut self) -> DMAADDR_W { + DMAADDR_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Channel DMA Address Register \\[SCATGATHER\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hcdma_scatgather](index.html) module\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Host Channel DMA Address Register \\[SCATGATHER\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcdma_scatgather::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcdma_scatgather::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCDMA_SCATGATHER_SPEC; impl crate::RegisterSpec for HCDMA_SCATGATHER_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hcdma_scatgather::R](R) reader structure"] -impl crate::Readable for HCDMA_SCATGATHER_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hcdma_scatgather::W](W) writer structure"] +#[doc = "`read()` method returns [`hcdma_scatgather::R`](R) reader structure"] +impl crate::Readable for HCDMA_SCATGATHER_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hcdma_scatgather::W`](W) writer structure"] impl crate::Writable for HCDMA_SCATGATHER_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ch0/hcdmab.rs b/src/usb0_ch0/hcdmab.rs index 7652bb5a..fa180b41 100644 --- a/src/usb0_ch0/hcdmab.rs +++ b/src/usb0_ch0/hcdmab.rs @@ -1,20 +1,7 @@ #[doc = "Register `HCDMAB` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Field `Buffer_Address` reader - Buffer Address"] -pub type BUFFER_ADDRESS_R = crate::FieldReader; +pub type BUFFER_ADDRESS_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Buffer Address"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { BUFFER_ADDRESS_R::new(self.bits) } } -#[doc = "Host Channel 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 [hcdmab](index.html) module"] +#[doc = "Host Channel DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcdmab::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCDMAB_SPEC; impl crate::RegisterSpec for HCDMAB_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hcdmab::R](R) reader structure"] -impl crate::Readable for HCDMAB_SPEC { - type Reader = R; -} +#[doc = "`read()` method returns [`hcdmab::R`](R) reader structure"] +impl crate::Readable for HCDMAB_SPEC {} #[doc = "`reset()` method sets HCDMAB to value 0"] impl crate::Resettable for HCDMAB_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0_ch0/hcint.rs b/src/usb0_ch0/hcint.rs index 46863957..790b7947 100644 --- a/src/usb0_ch0/hcint.rs +++ b/src/usb0_ch0/hcint.rs @@ -1,95 +1,63 @@ #[doc = "Register `HCINT` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HCINT` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `XferCompl` reader - Transfer Completed"] -pub type XFER_COMPL_R = crate::BitReader; +pub type XFER_COMPL_R = crate::BitReader; #[doc = "Field `XferCompl` writer - Transfer Completed"] -pub type XFER_COMPL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type XFER_COMPL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ChHltd` reader - Channel Halted"] -pub type CH_HLTD_R = crate::BitReader; +pub type CH_HLTD_R = crate::BitReader; #[doc = "Field `ChHltd` writer - Channel Halted"] -pub type CH_HLTD_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type CH_HLTD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHBErr` reader - AHB Error"] -pub type AHBERR_R = crate::BitReader; +pub type AHBERR_R = crate::BitReader; #[doc = "Field `AHBErr` writer - AHB Error"] -pub type AHBERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type AHBERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `STALL` reader - STALL Response Received Interrupt"] -pub type STALL_R = crate::BitReader; +pub type STALL_R = crate::BitReader; #[doc = "Field `STALL` writer - STALL Response Received Interrupt"] -pub type STALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type STALL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NAK` reader - NAK Response Received Interrupt"] -pub type NAK_R = crate::BitReader; +pub type NAK_R = crate::BitReader; #[doc = "Field `NAK` writer - NAK Response Received Interrupt"] -pub type NAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type NAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ACK` reader - ACK Response Received/Transmitted Interrupt"] -pub type ACK_R = crate::BitReader; +pub type ACK_R = crate::BitReader; #[doc = "Field `ACK` writer - ACK Response Received/Transmitted Interrupt"] -pub type ACK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type ACK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NYET` reader - NYET Response Received Interrupt"] -pub type NYET_R = crate::BitReader; +pub type NYET_R = crate::BitReader; #[doc = "Field `NYET` writer - NYET Response Received Interrupt"] -pub type NYET_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type NYET_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `XactErr` reader - Transaction Error"] -pub type XACT_ERR_R = crate::BitReader; +pub type XACT_ERR_R = crate::BitReader; #[doc = "Field `XactErr` writer - Transaction Error"] -pub type XACT_ERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type XACT_ERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BblErr` reader - Babble Error"] -pub type BBL_ERR_R = crate::BitReader; +pub type BBL_ERR_R = crate::BitReader; #[doc = "Field `BblErr` writer - Babble Error"] -pub type BBL_ERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type BBL_ERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FrmOvrun` reader - Frame Overrun"] -pub type FRM_OVRUN_R = crate::BitReader; +pub type FRM_OVRUN_R = crate::BitReader; #[doc = "Field `FrmOvrun` writer - Frame Overrun"] -pub type FRM_OVRUN_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type FRM_OVRUN_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DataTglErr` reader - Data Toggle Error"] -pub type DATA_TGL_ERR_R = crate::BitReader; +pub type DATA_TGL_ERR_R = crate::BitReader; #[doc = "Field `DataTglErr` writer - Data Toggle Error"] -pub type DATA_TGL_ERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type DATA_TGL_ERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_R = crate::BitReader; +pub type BNAINTR_R = crate::BitReader; #[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type BNAINTR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `XCS_XACT_ERR` reader - Excessive Transaction Error"] -pub type XCS_XACT_ERR_R = crate::BitReader; +pub type XCS_XACT_ERR_R = crate::BitReader; #[doc = "Field `XCS_XACT_ERR` writer - Excessive Transaction Error"] -pub type XCS_XACT_ERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type XCS_XACT_ERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DESC_LST_ROLLIntr` reader - Descriptor rollover interrupt"] -pub type DESC_LST_ROLLINTR_R = crate::BitReader; +pub type DESC_LST_ROLLINTR_R = crate::BitReader; #[doc = "Field `DESC_LST_ROLLIntr` writer - Descriptor rollover interrupt"] -pub type DESC_LST_ROLLINTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINT_SPEC, bool, O>; +pub type DESC_LST_ROLLINTR_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transfer Completed"] #[inline(always)] @@ -166,106 +134,107 @@ impl W { #[doc = "Bit 0 - Transfer Completed"] #[inline(always)] #[must_use] - pub fn xfer_compl(&mut self) -> XFER_COMPL_W<0> { - XFER_COMPL_W::new(self) + pub fn xfer_compl(&mut self) -> XFER_COMPL_W { + XFER_COMPL_W::new(self, 0) } #[doc = "Bit 1 - Channel Halted"] #[inline(always)] #[must_use] - pub fn ch_hltd(&mut self) -> CH_HLTD_W<1> { - CH_HLTD_W::new(self) + pub fn ch_hltd(&mut self) -> CH_HLTD_W { + CH_HLTD_W::new(self, 1) } #[doc = "Bit 2 - AHB Error"] #[inline(always)] #[must_use] - pub fn ahberr(&mut self) -> AHBERR_W<2> { - AHBERR_W::new(self) + pub fn ahberr(&mut self) -> AHBERR_W { + AHBERR_W::new(self, 2) } #[doc = "Bit 3 - STALL Response Received Interrupt"] #[inline(always)] #[must_use] - pub fn stall(&mut self) -> STALL_W<3> { - STALL_W::new(self) + pub fn stall(&mut self) -> STALL_W { + STALL_W::new(self, 3) } #[doc = "Bit 4 - NAK Response Received Interrupt"] #[inline(always)] #[must_use] - pub fn nak(&mut self) -> NAK_W<4> { - NAK_W::new(self) + pub fn nak(&mut self) -> NAK_W { + NAK_W::new(self, 4) } #[doc = "Bit 5 - ACK Response Received/Transmitted Interrupt"] #[inline(always)] #[must_use] - pub fn ack(&mut self) -> ACK_W<5> { - ACK_W::new(self) + pub fn ack(&mut self) -> ACK_W { + ACK_W::new(self, 5) } #[doc = "Bit 6 - NYET Response Received Interrupt"] #[inline(always)] #[must_use] - pub fn nyet(&mut self) -> NYET_W<6> { - NYET_W::new(self) + pub fn nyet(&mut self) -> NYET_W { + NYET_W::new(self, 6) } #[doc = "Bit 7 - Transaction Error"] #[inline(always)] #[must_use] - pub fn xact_err(&mut self) -> XACT_ERR_W<7> { - XACT_ERR_W::new(self) + pub fn xact_err(&mut self) -> XACT_ERR_W { + XACT_ERR_W::new(self, 7) } #[doc = "Bit 8 - Babble Error"] #[inline(always)] #[must_use] - pub fn bbl_err(&mut self) -> BBL_ERR_W<8> { - BBL_ERR_W::new(self) + pub fn bbl_err(&mut self) -> BBL_ERR_W { + BBL_ERR_W::new(self, 8) } #[doc = "Bit 9 - Frame Overrun"] #[inline(always)] #[must_use] - pub fn frm_ovrun(&mut self) -> FRM_OVRUN_W<9> { - FRM_OVRUN_W::new(self) + pub fn frm_ovrun(&mut self) -> FRM_OVRUN_W { + FRM_OVRUN_W::new(self, 9) } #[doc = "Bit 10 - Data Toggle Error"] #[inline(always)] #[must_use] - pub fn data_tgl_err(&mut self) -> DATA_TGL_ERR_W<10> { - DATA_TGL_ERR_W::new(self) + pub fn data_tgl_err(&mut self) -> DATA_TGL_ERR_W { + DATA_TGL_ERR_W::new(self, 10) } #[doc = "Bit 11 - BNA (Buffer Not Available) Interrupt"] #[inline(always)] #[must_use] - pub fn bnaintr(&mut self) -> BNAINTR_W<11> { - BNAINTR_W::new(self) + pub fn bnaintr(&mut self) -> BNAINTR_W { + BNAINTR_W::new(self, 11) } #[doc = "Bit 12 - Excessive Transaction Error"] #[inline(always)] #[must_use] - pub fn xcs_xact_err(&mut self) -> XCS_XACT_ERR_W<12> { - XCS_XACT_ERR_W::new(self) + pub fn xcs_xact_err(&mut self) -> XCS_XACT_ERR_W { + XCS_XACT_ERR_W::new(self, 12) } #[doc = "Bit 13 - Descriptor rollover interrupt"] #[inline(always)] #[must_use] - pub fn desc_lst_rollintr(&mut self) -> DESC_LST_ROLLINTR_W<13> { - DESC_LST_ROLLINTR_W::new(self) + pub fn desc_lst_rollintr(&mut self) -> DESC_LST_ROLLINTR_W { + DESC_LST_ROLLINTR_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Channel 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 [hcint](index.html) module"] +#[doc = "Host Channel Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcint::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcint::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCINT_SPEC; impl crate::RegisterSpec for HCINT_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hcint::R](R) reader structure"] -impl crate::Readable for HCINT_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hcint::W](W) writer structure"] +#[doc = "`read()` method returns [`hcint::R`](R) reader structure"] +impl crate::Readable for HCINT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hcint::W`](W) writer structure"] impl crate::Writable for HCINT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ch0/hcintmsk.rs b/src/usb0_ch0/hcintmsk.rs index b554355d..a310159b 100644 --- a/src/usb0_ch0/hcintmsk.rs +++ b/src/usb0_ch0/hcintmsk.rs @@ -1,91 +1,59 @@ #[doc = "Register `HCINTMSK` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HCINTMSK` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `XferComplMsk` reader - Transfer Completed Mask"] -pub type XFER_COMPL_MSK_R = crate::BitReader; +pub type XFER_COMPL_MSK_R = crate::BitReader; #[doc = "Field `XferComplMsk` writer - Transfer Completed Mask"] -pub type XFER_COMPL_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type XFER_COMPL_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ChHltdMsk` reader - Channel Halted Mask"] -pub type CH_HLTD_MSK_R = crate::BitReader; +pub type CH_HLTD_MSK_R = crate::BitReader; #[doc = "Field `ChHltdMsk` writer - Channel Halted Mask"] -pub type CH_HLTD_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type CH_HLTD_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHBErrMsk` reader - AHB Error Mask"] -pub type AHBERR_MSK_R = crate::BitReader; +pub type AHBERR_MSK_R = crate::BitReader; #[doc = "Field `AHBErrMsk` writer - AHB Error Mask"] -pub type AHBERR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type AHBERR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `StallMsk` reader - STALL Response Received Interrupt Mask"] -pub type STALL_MSK_R = crate::BitReader; +pub type STALL_MSK_R = crate::BitReader; #[doc = "Field `StallMsk` writer - STALL Response Received Interrupt Mask"] -pub type STALL_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type STALL_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NakMsk` reader - NAK Response Received Interrupt Mask"] -pub type NAK_MSK_R = crate::BitReader; +pub type NAK_MSK_R = crate::BitReader; #[doc = "Field `NakMsk` writer - NAK Response Received Interrupt Mask"] -pub type NAK_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type NAK_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AckMsk` reader - ACK Response Received/Transmitted Interrupt Mask"] -pub type ACK_MSK_R = crate::BitReader; +pub type ACK_MSK_R = crate::BitReader; #[doc = "Field `AckMsk` writer - ACK Response Received/Transmitted Interrupt Mask"] -pub type ACK_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type ACK_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NyetMsk` reader - NYET Response Received Interrupt Mask"] -pub type NYET_MSK_R = crate::BitReader; +pub type NYET_MSK_R = crate::BitReader; #[doc = "Field `NyetMsk` writer - NYET Response Received Interrupt Mask"] -pub type NYET_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type NYET_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `XactErrMsk` reader - Transaction Error Mask"] -pub type XACT_ERR_MSK_R = crate::BitReader; +pub type XACT_ERR_MSK_R = crate::BitReader; #[doc = "Field `XactErrMsk` writer - Transaction Error Mask"] -pub type XACT_ERR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type XACT_ERR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BblErrMsk` reader - Babble Error Mask"] -pub type BBL_ERR_MSK_R = crate::BitReader; +pub type BBL_ERR_MSK_R = crate::BitReader; #[doc = "Field `BblErrMsk` writer - Babble Error Mask"] -pub type BBL_ERR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type BBL_ERR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `FrmOvrunMsk` reader - Frame Overrun Mask"] -pub type FRM_OVRUN_MSK_R = crate::BitReader; +pub type FRM_OVRUN_MSK_R = crate::BitReader; #[doc = "Field `FrmOvrunMsk` writer - Frame Overrun Mask"] -pub type FRM_OVRUN_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type FRM_OVRUN_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DataTglErrMsk` reader - Data Toggle Error Mask"] -pub type DATA_TGL_ERR_MSK_R = crate::BitReader; +pub type DATA_TGL_ERR_MSK_R = crate::BitReader; #[doc = "Field `DataTglErrMsk` writer - Data Toggle Error Mask"] -pub type DATA_TGL_ERR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type DATA_TGL_ERR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BNAIntrMsk` reader - BNA (Buffer Not Available) Interrupt mask register"] -pub type BNAINTR_MSK_R = crate::BitReader; +pub type BNAINTR_MSK_R = crate::BitReader; #[doc = "Field `BNAIntrMsk` writer - BNA (Buffer Not Available) Interrupt mask register"] -pub type BNAINTR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type BNAINTR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DESC_LST_ROLLIntrMsk` reader - Descriptor rollover interrupt Mask register"] -pub type DESC_LST_ROLLINTR_MSK_R = crate::BitReader; +pub type DESC_LST_ROLLINTR_MSK_R = crate::BitReader; #[doc = "Field `DESC_LST_ROLLIntrMsk` writer - Descriptor rollover interrupt Mask register"] -pub type DESC_LST_ROLLINTR_MSK_W<'a, const O: u8> = crate::BitWriter<'a, u32, HCINTMSK_SPEC, bool, O>; +pub type DESC_LST_ROLLINTR_MSK_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transfer Completed Mask"] #[inline(always)] @@ -157,100 +125,101 @@ impl W { #[doc = "Bit 0 - Transfer Completed Mask"] #[inline(always)] #[must_use] - pub fn xfer_compl_msk(&mut self) -> XFER_COMPL_MSK_W<0> { - XFER_COMPL_MSK_W::new(self) + pub fn xfer_compl_msk(&mut self) -> XFER_COMPL_MSK_W { + XFER_COMPL_MSK_W::new(self, 0) } #[doc = "Bit 1 - Channel Halted Mask"] #[inline(always)] #[must_use] - pub fn ch_hltd_msk(&mut self) -> CH_HLTD_MSK_W<1> { - CH_HLTD_MSK_W::new(self) + pub fn ch_hltd_msk(&mut self) -> CH_HLTD_MSK_W { + CH_HLTD_MSK_W::new(self, 1) } #[doc = "Bit 2 - AHB Error Mask"] #[inline(always)] #[must_use] - pub fn ahberr_msk(&mut self) -> AHBERR_MSK_W<2> { - AHBERR_MSK_W::new(self) + pub fn ahberr_msk(&mut self) -> AHBERR_MSK_W { + AHBERR_MSK_W::new(self, 2) } #[doc = "Bit 3 - STALL Response Received Interrupt Mask"] #[inline(always)] #[must_use] - pub fn stall_msk(&mut self) -> STALL_MSK_W<3> { - STALL_MSK_W::new(self) + pub fn stall_msk(&mut self) -> STALL_MSK_W { + STALL_MSK_W::new(self, 3) } #[doc = "Bit 4 - NAK Response Received Interrupt Mask"] #[inline(always)] #[must_use] - pub fn nak_msk(&mut self) -> NAK_MSK_W<4> { - NAK_MSK_W::new(self) + pub fn nak_msk(&mut self) -> NAK_MSK_W { + NAK_MSK_W::new(self, 4) } #[doc = "Bit 5 - ACK Response Received/Transmitted Interrupt Mask"] #[inline(always)] #[must_use] - pub fn ack_msk(&mut self) -> ACK_MSK_W<5> { - ACK_MSK_W::new(self) + pub fn ack_msk(&mut self) -> ACK_MSK_W { + ACK_MSK_W::new(self, 5) } #[doc = "Bit 6 - NYET Response Received Interrupt Mask"] #[inline(always)] #[must_use] - pub fn nyet_msk(&mut self) -> NYET_MSK_W<6> { - NYET_MSK_W::new(self) + pub fn nyet_msk(&mut self) -> NYET_MSK_W { + NYET_MSK_W::new(self, 6) } #[doc = "Bit 7 - Transaction Error Mask"] #[inline(always)] #[must_use] - pub fn xact_err_msk(&mut self) -> XACT_ERR_MSK_W<7> { - XACT_ERR_MSK_W::new(self) + pub fn xact_err_msk(&mut self) -> XACT_ERR_MSK_W { + XACT_ERR_MSK_W::new(self, 7) } #[doc = "Bit 8 - Babble Error Mask"] #[inline(always)] #[must_use] - pub fn bbl_err_msk(&mut self) -> BBL_ERR_MSK_W<8> { - BBL_ERR_MSK_W::new(self) + pub fn bbl_err_msk(&mut self) -> BBL_ERR_MSK_W { + BBL_ERR_MSK_W::new(self, 8) } #[doc = "Bit 9 - Frame Overrun Mask"] #[inline(always)] #[must_use] - pub fn frm_ovrun_msk(&mut self) -> FRM_OVRUN_MSK_W<9> { - FRM_OVRUN_MSK_W::new(self) + pub fn frm_ovrun_msk(&mut self) -> FRM_OVRUN_MSK_W { + FRM_OVRUN_MSK_W::new(self, 9) } #[doc = "Bit 10 - Data Toggle Error Mask"] #[inline(always)] #[must_use] - pub fn data_tgl_err_msk(&mut self) -> DATA_TGL_ERR_MSK_W<10> { - DATA_TGL_ERR_MSK_W::new(self) + pub fn data_tgl_err_msk(&mut self) -> DATA_TGL_ERR_MSK_W { + DATA_TGL_ERR_MSK_W::new(self, 10) } #[doc = "Bit 11 - BNA (Buffer Not Available) Interrupt mask register"] #[inline(always)] #[must_use] - pub fn bnaintr_msk(&mut self) -> BNAINTR_MSK_W<11> { - BNAINTR_MSK_W::new(self) + pub fn bnaintr_msk(&mut self) -> BNAINTR_MSK_W { + BNAINTR_MSK_W::new(self, 11) } #[doc = "Bit 13 - Descriptor rollover interrupt Mask register"] #[inline(always)] #[must_use] - pub fn desc_lst_rollintr_msk(&mut self) -> DESC_LST_ROLLINTR_MSK_W<13> { - DESC_LST_ROLLINTR_MSK_W::new(self) + pub fn desc_lst_rollintr_msk(&mut self) -> DESC_LST_ROLLINTR_MSK_W { + DESC_LST_ROLLINTR_MSK_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Channel 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 [hcintmsk](index.html) module"] +#[doc = "Host Channel Interrupt Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hcintmsk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hcintmsk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCINTMSK_SPEC; impl crate::RegisterSpec for HCINTMSK_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hcintmsk::R](R) reader structure"] -impl crate::Readable for HCINTMSK_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hcintmsk::W](W) writer structure"] +#[doc = "`read()` method returns [`hcintmsk::R`](R) reader structure"] +impl crate::Readable for HCINTMSK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hcintmsk::W`](W) writer structure"] impl crate::Writable for HCINTMSK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ch0/hctsiz_buffermode.rs b/src/usb0_ch0/hctsiz_buffermode.rs index d87ec5ab..5c8690df 100644 --- a/src/usb0_ch0/hctsiz_buffermode.rs +++ b/src/usb0_ch0/hctsiz_buffermode.rs @@ -1,49 +1,17 @@ #[doc = "Register `HCTSIZ_BUFFERMODE` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HCTSIZ_BUFFERMODE` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `XferSize` reader - Transfer Size"] -pub type XFER_SIZE_R = crate::FieldReader; +pub type XFER_SIZE_R = crate::FieldReader; #[doc = "Field `XferSize` writer - Transfer Size"] -pub type XFER_SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCTSIZ_BUFFERMODE_SPEC, u32, u32, 19, O>; +pub type XFER_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 19, u32>; #[doc = "Field `PktCnt` reader - Packet Count"] -pub type PKT_CNT_R = crate::FieldReader; +pub type PKT_CNT_R = crate::FieldReader; #[doc = "Field `PktCnt` writer - Packet Count"] -pub type PKT_CNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCTSIZ_BUFFERMODE_SPEC, u16, u16, 10, O>; +pub type PKT_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `Pid` reader - PID"] -pub type PID_R = crate::FieldReader; +pub type PID_R = crate::FieldReader; #[doc = "PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PID_A { + type Ux = u8; +} impl PID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PID_A { + pub const fn variant(&self) -> PID_A { match self.bits { 0 => PID_A::VALUE1, 1 => PID_A::VALUE2, @@ -75,48 +46,52 @@ impl PID_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PID_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PID_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "MDATA (non-control)/SETUP (control)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PID_A::VALUE4 } } #[doc = "Field `Pid` writer - PID"] -pub type PID_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, HCTSIZ_BUFFERMODE_SPEC, u8, PID_A, 2, O>; -impl<'a, const O: u8> PID_W<'a, O> { +pub type PID_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PID_A>; +impl<'a, REG> PID_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "DATA0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PID_A::VALUE1) } #[doc = "DATA2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PID_A::VALUE2) } #[doc = "DATA1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PID_A::VALUE3) } #[doc = "MDATA (non-control)/SETUP (control)"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PID_A::VALUE4) } } @@ -141,40 +116,41 @@ impl W { #[doc = "Bits 0:18 - Transfer Size"] #[inline(always)] #[must_use] - pub fn xfer_size(&mut self) -> XFER_SIZE_W<0> { - XFER_SIZE_W::new(self) + pub fn xfer_size(&mut self) -> XFER_SIZE_W { + XFER_SIZE_W::new(self, 0) } #[doc = "Bits 19:28 - Packet Count"] #[inline(always)] #[must_use] - pub fn pkt_cnt(&mut self) -> PKT_CNT_W<19> { - PKT_CNT_W::new(self) + pub fn pkt_cnt(&mut self) -> PKT_CNT_W { + PKT_CNT_W::new(self, 19) } #[doc = "Bits 29:30 - PID"] #[inline(always)] #[must_use] - pub fn pid(&mut self) -> PID_W<29> { - PID_W::new(self) + pub fn pid(&mut self) -> PID_W { + PID_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Channel Transfer Size Register \\[BUFFERMODE\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hctsiz_buffermode](index.html) module"] +#[doc = "Host Channel Transfer Size Register \\[BUFFERMODE\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hctsiz_buffermode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hctsiz_buffermode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCTSIZ_BUFFERMODE_SPEC; impl crate::RegisterSpec for HCTSIZ_BUFFERMODE_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hctsiz_buffermode::R](R) reader structure"] -impl crate::Readable for HCTSIZ_BUFFERMODE_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hctsiz_buffermode::W](W) writer structure"] +#[doc = "`read()` method returns [`hctsiz_buffermode::R`](R) reader structure"] +impl crate::Readable for HCTSIZ_BUFFERMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hctsiz_buffermode::W`](W) writer structure"] impl crate::Writable for HCTSIZ_BUFFERMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ch0/hctsiz_scatgather.rs b/src/usb0_ch0/hctsiz_scatgather.rs index 5c3e7be9..092ef50e 100644 --- a/src/usb0_ch0/hctsiz_scatgather.rs +++ b/src/usb0_ch0/hctsiz_scatgather.rs @@ -1,49 +1,17 @@ #[doc = "Register `HCTSIZ_SCATGATHER` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[doc = "Register `HCTSIZ_SCATGATHER` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SCHED_INFO` reader - Schedule information"] -pub type SCHED_INFO_R = crate::FieldReader; +pub type SCHED_INFO_R = crate::FieldReader; #[doc = "Field `SCHED_INFO` writer - Schedule information"] -pub type SCHED_INFO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCTSIZ_SCATGATHER_SPEC, u8, u8, 8, O>; +pub type SCHED_INFO_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `NTD` reader - Number of Transfer Descriptors: 0=1 descriptor, 63=64 descriptors, 1=2 descriptors, 3=4 descriptors, 7=8 descriptors, 15=16 descriptors, 31=32 descriptors, 63=64 descriptors,"] -pub type NTD_R = crate::FieldReader; +pub type NTD_R = crate::FieldReader; #[doc = "Field `NTD` writer - Number of Transfer Descriptors: 0=1 descriptor, 63=64 descriptors, 1=2 descriptors, 3=4 descriptors, 7=8 descriptors, 15=16 descriptors, 31=32 descriptors, 63=64 descriptors,"] -pub type NTD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HCTSIZ_SCATGATHER_SPEC, u8, u8, 8, O>; +pub type NTD_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; #[doc = "Field `Pid` reader - PID"] -pub type PID_R = crate::FieldReader; +pub type PID_R = crate::FieldReader; #[doc = "PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PID_A { + type Ux = u8; +} impl PID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PID_A { + pub const fn variant(&self) -> PID_A { match self.bits { 0 => PID_A::VALUE1, 1 => PID_A::VALUE2, @@ -75,48 +46,52 @@ impl PID_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PID_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PID_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "MDATA (non-control)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PID_A::VALUE4 } } #[doc = "Field `Pid` writer - PID"] -pub type PID_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, HCTSIZ_SCATGATHER_SPEC, u8, PID_A, 2, O>; -impl<'a, const O: u8> PID_W<'a, O> { +pub type PID_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, PID_A>; +impl<'a, REG> PID_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "DATA0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PID_A::VALUE1) } #[doc = "DATA2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PID_A::VALUE2) } #[doc = "DATA1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PID_A::VALUE3) } #[doc = "MDATA (non-control)"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PID_A::VALUE4) } } @@ -141,40 +116,41 @@ impl W { #[doc = "Bits 0:7 - Schedule information"] #[inline(always)] #[must_use] - pub fn sched_info(&mut self) -> SCHED_INFO_W<0> { - SCHED_INFO_W::new(self) + pub fn sched_info(&mut self) -> SCHED_INFO_W { + SCHED_INFO_W::new(self, 0) } #[doc = "Bits 8:15 - Number of Transfer Descriptors: 0=1 descriptor, 63=64 descriptors, 1=2 descriptors, 3=4 descriptors, 7=8 descriptors, 15=16 descriptors, 31=32 descriptors, 63=64 descriptors,"] #[inline(always)] #[must_use] - pub fn ntd(&mut self) -> NTD_W<8> { - NTD_W::new(self) + pub fn ntd(&mut self) -> NTD_W { + NTD_W::new(self, 8) } #[doc = "Bits 29:30 - PID"] #[inline(always)] #[must_use] - pub fn pid(&mut self) -> PID_W<29> { - PID_W::new(self) + pub fn pid(&mut self) -> PID_W { + PID_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "Host Channel Transfer Size Register \\[SCATGATHER\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hctsiz_scatgather](index.html) module"] +#[doc = "Host Channel Transfer Size Register \\[SCATGATHER\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hctsiz_scatgather::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hctsiz_scatgather::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct HCTSIZ_SCATGATHER_SPEC; impl crate::RegisterSpec for HCTSIZ_SCATGATHER_SPEC { type Ux = u32; } -#[doc = "`read()` method returns [hctsiz_scatgather::R](R) reader structure"] -impl crate::Readable for HCTSIZ_SCATGATHER_SPEC { - type Reader = R; -} -#[doc = "`write(|w| ..)` method takes [hctsiz_scatgather::W](W) writer structure"] +#[doc = "`read()` method returns [`hctsiz_scatgather::R`](R) reader structure"] +impl crate::Readable for HCTSIZ_SCATGATHER_SPEC {} +#[doc = "`write(|w| ..)` method takes [`hctsiz_scatgather::W`](W) writer structure"] impl crate::Writable for HCTSIZ_SCATGATHER_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0.rs b/src/usb0_ep0.rs index 97ae17dc..2a7a4740 100644 --- a/src/usb0_ep0.rs +++ b/src/usb0_ep0.rs @@ -1,76 +1,133 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Device Control IN Endpoint Control Register"] - pub diepctl0: DIEPCTL0, + diepctl0: DIEPCTL0, _reserved1: [u8; 0x04], - #[doc = "0x08 - Device Endpoint Interrupt Register"] - pub diepint0: DIEPINT0, + diepint0: DIEPINT0, _reserved2: [u8; 0x04], + dieptsiz0: DIEPTSIZ0, + diepdma0: DIEPDMA0, + dtxfsts0: DTXFSTS0, + diepdmab0: DIEPDMAB0, + _reserved6: [u8; 0x01e0], + doepctl0: DOEPCTL0, + _reserved7: [u8; 0x04], + doepint0: DOEPINT0, + _reserved8: [u8; 0x04], + doeptsiz0: DOEPTSIZ0, + doepdma0: DOEPDMA0, + _reserved10: [u8; 0x04], + doepdmab0: DOEPDMAB0, +} +impl RegisterBlock { + #[doc = "0x00 - Device Control IN Endpoint Control Register"] + #[inline(always)] + pub const fn diepctl0(&self) -> &DIEPCTL0 { + &self.diepctl0 + } + #[doc = "0x08 - Device Endpoint Interrupt Register"] + #[inline(always)] + pub const fn diepint0(&self) -> &DIEPINT0 { + &self.diepint0 + } #[doc = "0x10 - Device IN Endpoint Transfer Size Register"] - pub dieptsiz0: DIEPTSIZ0, + #[inline(always)] + pub const fn dieptsiz0(&self) -> &DIEPTSIZ0 { + &self.dieptsiz0 + } #[doc = "0x14 - Device Endpoint DMA Address Register"] - pub diepdma0: DIEPDMA0, + #[inline(always)] + pub const fn diepdma0(&self) -> &DIEPDMA0 { + &self.diepdma0 + } #[doc = "0x18 - Device IN Endpoint Transmit FIFO Status Register"] - pub dtxfsts0: DTXFSTS0, + #[inline(always)] + pub const fn dtxfsts0(&self) -> &DTXFSTS0 { + &self.dtxfsts0 + } #[doc = "0x1c - Device Endpoint DMA Buffer Address Register"] - pub diepdmab0: DIEPDMAB0, - _reserved6: [u8; 0x01e0], + #[inline(always)] + pub const fn diepdmab0(&self) -> &DIEPDMAB0 { + &self.diepdmab0 + } #[doc = "0x200 - Device Control OUT Endpoint Control Register"] - pub doepctl0: DOEPCTL0, - _reserved7: [u8; 0x04], + #[inline(always)] + pub const fn doepctl0(&self) -> &DOEPCTL0 { + &self.doepctl0 + } #[doc = "0x208 - Device Endpoint Interrupt Register"] - pub doepint0: DOEPINT0, - _reserved8: [u8; 0x04], + #[inline(always)] + pub const fn doepint0(&self) -> &DOEPINT0 { + &self.doepint0 + } #[doc = "0x210 - Device OUT Endpoint Transfer Size Register"] - pub doeptsiz0: DOEPTSIZ0, + #[inline(always)] + pub const fn doeptsiz0(&self) -> &DOEPTSIZ0 { + &self.doeptsiz0 + } #[doc = "0x214 - Device Endpoint DMA Address Register"] - pub doepdma0: DOEPDMA0, - _reserved10: [u8; 0x04], + #[inline(always)] + pub const fn doepdma0(&self) -> &DOEPDMA0 { + &self.doepdma0 + } #[doc = "0x21c - Device Endpoint DMA Buffer Address Register"] - pub doepdmab0: DOEPDMAB0, + #[inline(always)] + pub const fn doepdmab0(&self) -> &DOEPDMAB0 { + &self.doepdmab0 + } } -#[doc = "DIEPCTL0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPCTL0 (rw) register accessor: Device Control IN Endpoint Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepctl0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepctl0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepctl0`] +module"] pub type DIEPCTL0 = crate::Reg; #[doc = "Device Control IN Endpoint Control Register"] pub mod diepctl0; -#[doc = "DIEPINT0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPINT0 (rw) register accessor: Device Endpoint Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepint0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepint0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepint0`] +module"] pub type DIEPINT0 = crate::Reg; #[doc = "Device Endpoint Interrupt Register"] pub mod diepint0; -#[doc = "DIEPTSIZ0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPTSIZ0 (rw) register accessor: Device IN Endpoint Transfer Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptsiz0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptsiz0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dieptsiz0`] +module"] pub type DIEPTSIZ0 = crate::Reg; #[doc = "Device IN Endpoint Transfer Size Register"] pub mod dieptsiz0; -#[doc = "DIEPDMA0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPDMA0 (rw) register accessor: Device Endpoint DMA Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepdma0::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepdma0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepdma0`] +module"] pub type DIEPDMA0 = crate::Reg; #[doc = "Device Endpoint DMA Address Register"] pub mod diepdma0; -#[doc = "DTXFSTS0 (r) register accessor: an alias for `Reg`"] +#[doc = "DTXFSTS0 (r) register accessor: Device IN Endpoint Transmit FIFO Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtxfsts0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dtxfsts0`] +module"] pub type DTXFSTS0 = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Status Register"] pub mod dtxfsts0; -#[doc = "DIEPDMAB0 (r) register accessor: an alias for `Reg`"] +#[doc = "DIEPDMAB0 (r) register accessor: Device Endpoint DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepdmab0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepdmab0`] +module"] pub type DIEPDMAB0 = crate::Reg; #[doc = "Device Endpoint DMA Buffer Address Register"] pub mod diepdmab0; -#[doc = "DOEPCTL0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPCTL0 (rw) register accessor: Device Control OUT Endpoint Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepctl0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepctl0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepctl0`] +module"] pub type DOEPCTL0 = crate::Reg; #[doc = "Device Control OUT Endpoint Control Register"] pub mod doepctl0; -#[doc = "DOEPINT0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPINT0 (rw) register accessor: Device Endpoint Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepint0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepint0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepint0`] +module"] pub type DOEPINT0 = crate::Reg; #[doc = "Device Endpoint Interrupt Register"] pub mod doepint0; -#[doc = "DOEPTSIZ0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPTSIZ0 (rw) register accessor: Device OUT Endpoint Transfer Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doeptsiz0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doeptsiz0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doeptsiz0`] +module"] pub type DOEPTSIZ0 = crate::Reg; #[doc = "Device OUT Endpoint Transfer Size Register"] pub mod doeptsiz0; -#[doc = "DOEPDMA0 (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPDMA0 (rw) register accessor: Device Endpoint DMA Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepdma0::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepdma0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepdma0`] +module"] pub type DOEPDMA0 = crate::Reg; #[doc = "Device Endpoint DMA Address Register"] pub mod doepdma0; -#[doc = "DOEPDMAB0 (r) register accessor: an alias for `Reg`"] +#[doc = "DOEPDMAB0 (r) register accessor: Device Endpoint DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepdmab0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepdmab0`] +module"] 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 97388fa1..d0503b6b 100644 --- a/src/usb0_ep0/diepctl0.rs +++ b/src/usb0_ep0/diepctl0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MPS` reader - Maximum Packet Size"] -pub type MPS_R = crate::FieldReader; +pub type MPS_R = crate::FieldReader; #[doc = "Maximum Packet Size\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MPS_A { + type Ux = u8; +} impl MPS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MPS_A { + pub const fn variant(&self) -> MPS_A { match self.bits { 0 => MPS_A::VALUE1, 1 => MPS_A::VALUE2, @@ -67,53 +38,57 @@ impl MPS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "64 bytes"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MPS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "32 bytes"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MPS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "16 bytes"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MPS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "8 bytes"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MPS_A::VALUE4 } } #[doc = "Field `MPS` writer - Maximum Packet Size"] -pub type MPS_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DIEPCTL0_SPEC, u8, MPS_A, 2, O>; -impl<'a, const O: u8> MPS_W<'a, O> { +pub type MPS_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, MPS_A>; +impl<'a, REG> MPS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "64 bytes"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MPS_A::VALUE1) } #[doc = "32 bytes"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MPS_A::VALUE2) } #[doc = "16 bytes"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MPS_A::VALUE3) } #[doc = "8 bytes"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MPS_A::VALUE4) } } #[doc = "Field `USBActEP` reader - USB Active Endpoint"] -pub type USBACT_EP_R = crate::BitReader; +pub type USBACT_EP_R = crate::BitReader; #[doc = "Field `NAKSts` reader - NAK Status"] pub type NAKSTS_R = crate::BitReader; #[doc = "NAK Status\n\nValue on reset: 0"] @@ -133,45 +108,45 @@ impl From for bool { impl NAKSTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NAKSTS_A { + pub const fn variant(&self) -> NAKSTS_A { match self.bits { false => NAKSTS_A::VALUE1, true => NAKSTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The core is transmitting non-NAK handshakes based on the FIFO status"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NAKSTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The core is transmitting NAK handshakes on this endpoint."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NAKSTS_A::VALUE2 } } #[doc = "Field `EPType` reader - Endpoint Type"] -pub type EPTYPE_R = crate::FieldReader; +pub type EPTYPE_R = crate::FieldReader; #[doc = "Field `Stall` reader - STALL Handshake"] -pub type STALL_R = crate::BitReader; +pub type STALL_R = crate::BitReader; #[doc = "Field `Stall` writer - STALL Handshake"] -pub type STALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL0_SPEC, bool, O>; +pub type STALL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFNum` reader - TxFIFO Number"] -pub type TX_FNUM_R = crate::FieldReader; +pub type TX_FNUM_R = crate::FieldReader; #[doc = "Field `TxFNum` writer - TxFIFO Number"] -pub type TX_FNUM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPCTL0_SPEC, u8, u8, 4, O>; +pub type TX_FNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `CNAK` writer - Clear NAK"] -pub type CNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL0_SPEC, bool, O>; +pub type CNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SNAK` writer - Set NAK"] -pub type SNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL0_SPEC, bool, O>; +pub type SNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDis` reader - Endpoint Disable"] -pub type EPDIS_R = crate::BitReader; +pub type EPDIS_R = crate::BitReader; #[doc = "Field `EPDis` writer - Endpoint Disable"] -pub type EPDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL0_SPEC, bool, O>; +pub type EPDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPEna` reader - Endpoint Enable"] -pub type EPENA_R = crate::BitReader; +pub type EPENA_R = crate::BitReader; #[doc = "Field `EPEna` writer - Endpoint Enable"] -pub type EPENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL0_SPEC, bool, O>; +pub type EPENA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:1 - Maximum Packet Size"] #[inline(always)] @@ -218,64 +193,65 @@ impl W { #[doc = "Bits 0:1 - Maximum Packet Size"] #[inline(always)] #[must_use] - pub fn mps(&mut self) -> MPS_W<0> { - MPS_W::new(self) + pub fn mps(&mut self) -> MPS_W { + MPS_W::new(self, 0) } #[doc = "Bit 21 - STALL Handshake"] #[inline(always)] #[must_use] - pub fn stall(&mut self) -> STALL_W<21> { - STALL_W::new(self) + pub fn stall(&mut self) -> STALL_W { + STALL_W::new(self, 21) } #[doc = "Bits 22:25 - TxFIFO Number"] #[inline(always)] #[must_use] - pub fn tx_fnum(&mut self) -> TX_FNUM_W<22> { - TX_FNUM_W::new(self) + pub fn tx_fnum(&mut self) -> TX_FNUM_W { + TX_FNUM_W::new(self, 22) } #[doc = "Bit 26 - Clear NAK"] #[inline(always)] #[must_use] - pub fn cnak(&mut self) -> CNAK_W<26> { - CNAK_W::new(self) + pub fn cnak(&mut self) -> CNAK_W { + CNAK_W::new(self, 26) } #[doc = "Bit 27 - Set NAK"] #[inline(always)] #[must_use] - pub fn snak(&mut self) -> SNAK_W<27> { - SNAK_W::new(self) + pub fn snak(&mut self) -> SNAK_W { + SNAK_W::new(self, 27) } #[doc = "Bit 30 - Endpoint Disable"] #[inline(always)] #[must_use] - pub fn epdis(&mut self) -> EPDIS_W<30> { - EPDIS_W::new(self) + pub fn epdis(&mut self) -> EPDIS_W { + EPDIS_W::new(self, 30) } #[doc = "Bit 31 - Endpoint Enable"] #[inline(always)] #[must_use] - pub fn epena(&mut self) -> EPENA_W<31> { - EPENA_W::new(self) + pub fn epena(&mut self) -> EPENA_W { + EPENA_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Control IN Endpoint Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepctl0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepctl0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepctl0::R`](R) reader structure"] +impl crate::Readable for DIEPCTL0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepctl0::W`](W) writer structure"] impl crate::Writable for DIEPCTL0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0/diepdma0.rs b/src/usb0_ep0/diepdma0.rs index d5833fb1..b5c23747 100644 --- a/src/usb0_ep0/diepdma0.rs +++ b/src/usb0_ep0/diepdma0.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DMAAddr` reader - DMA Address"] -pub type DMAADDR_R = crate::FieldReader; +pub type DMAADDR_R = crate::FieldReader; #[doc = "Field `DMAAddr` writer - DMA Address"] -pub type DMAADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPDMA0_SPEC, u32, u32, 32, O>; +pub type DMAADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] #[must_use] - pub fn dmaaddr(&mut self) -> DMAADDR_W<0> { - DMAADDR_W::new(self) + pub fn dmaaddr(&mut self) -> DMAADDR_W { + DMAADDR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Device Endpoint DMA Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepdma0::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepdma0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepdma0::R`](R) reader structure"] +impl crate::Readable for DIEPDMA0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepdma0::W`](W) writer structure"] impl crate::Writable for DIEPDMA0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0/diepdmab0.rs b/src/usb0_ep0/diepdmab0.rs index 07c8ab81..d9b5921e 100644 --- a/src/usb0_ep0/diepdmab0.rs +++ b/src/usb0_ep0/diepdmab0.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DMABufferAddr` reader - DMA Buffer Address"] -pub type DMABUFFER_ADDR_R = crate::FieldReader; +pub type DMABUFFER_ADDR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - DMA Buffer Address"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { DMABUFFER_ADDR_R::new(self.bits) } } -#[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"] +#[doc = "Device Endpoint DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepdmab0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`diepdmab0::R`](R) reader structure"] +impl crate::Readable for DIEPDMAB0_SPEC {} #[doc = "`reset()` method sets DIEPDMAB0 to value 0"] impl crate::Resettable for DIEPDMAB0_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0_ep0/diepint0.rs b/src/usb0_ep0/diepint0.rs index 1fb5ea46..9f031f7f 100644 --- a/src/usb0_ep0/diepint0.rs +++ b/src/usb0_ep0/diepint0.rs @@ -1,69 +1,37 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferCompl` reader - Transfer Completed Interrupt"] -pub type XFER_COMPL_R = crate::BitReader; +pub type XFER_COMPL_R = crate::BitReader; #[doc = "Field `XferCompl` writer - Transfer Completed Interrupt"] -pub type XFER_COMPL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT0_SPEC, bool, O>; +pub type XFER_COMPL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDisbld` reader - Endpoint Disabled Interrupt"] -pub type EPDISBLD_R = crate::BitReader; +pub type EPDISBLD_R = crate::BitReader; #[doc = "Field `EPDisbld` writer - Endpoint Disabled Interrupt"] -pub type EPDISBLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT0_SPEC, bool, O>; +pub type EPDISBLD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHBErr` reader - AHB Error"] -pub type AHBERR_R = crate::BitReader; +pub type AHBERR_R = crate::BitReader; #[doc = "Field `AHBErr` writer - AHB Error"] -pub type AHBERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT0_SPEC, bool, O>; +pub type AHBERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TimeOUT` reader - Timeout Condition"] -pub type TIME_OUT_R = crate::BitReader; +pub type TIME_OUT_R = crate::BitReader; #[doc = "Field `TimeOUT` writer - Timeout Condition"] -pub type TIME_OUT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT0_SPEC, bool, O>; +pub type TIME_OUT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `INTknTXFEmp` reader - IN Token Received When TxFIFO is Empty"] -pub type INTKN_TXFEMP_R = crate::BitReader; +pub type INTKN_TXFEMP_R = crate::BitReader; #[doc = "Field `INTknTXFEmp` writer - IN Token Received When TxFIFO is Empty"] -pub type INTKN_TXFEMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT0_SPEC, bool, O>; +pub type INTKN_TXFEMP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `INEPNakEff` reader - IN Endpoint NAK Effective"] -pub type INEPNAK_EFF_R = crate::BitReader; +pub type INEPNAK_EFF_R = crate::BitReader; #[doc = "Field `INEPNakEff` writer - IN Endpoint NAK Effective"] -pub type INEPNAK_EFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT0_SPEC, bool, O>; +pub type INEPNAK_EFF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFEmp` reader - Transmit FIFO Empty"] -pub type TX_FEMP_R = crate::BitReader; +pub type TX_FEMP_R = crate::BitReader; #[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_R = crate::BitReader; +pub type BNAINTR_R = crate::BitReader; #[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT0_SPEC, bool, O>; +pub type BNAINTR_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transfer Completed Interrupt"] #[inline(always)] @@ -110,64 +78,65 @@ impl W { #[doc = "Bit 0 - Transfer Completed Interrupt"] #[inline(always)] #[must_use] - pub fn xfer_compl(&mut self) -> XFER_COMPL_W<0> { - XFER_COMPL_W::new(self) + pub fn xfer_compl(&mut self) -> XFER_COMPL_W { + XFER_COMPL_W::new(self, 0) } #[doc = "Bit 1 - Endpoint Disabled Interrupt"] #[inline(always)] #[must_use] - pub fn epdisbld(&mut self) -> EPDISBLD_W<1> { - EPDISBLD_W::new(self) + pub fn epdisbld(&mut self) -> EPDISBLD_W { + EPDISBLD_W::new(self, 1) } #[doc = "Bit 2 - AHB Error"] #[inline(always)] #[must_use] - pub fn ahberr(&mut self) -> AHBERR_W<2> { - AHBERR_W::new(self) + pub fn ahberr(&mut self) -> AHBERR_W { + AHBERR_W::new(self, 2) } #[doc = "Bit 3 - Timeout Condition"] #[inline(always)] #[must_use] - pub fn time_out(&mut self) -> TIME_OUT_W<3> { - TIME_OUT_W::new(self) + pub fn time_out(&mut self) -> TIME_OUT_W { + TIME_OUT_W::new(self, 3) } #[doc = "Bit 4 - IN Token Received When TxFIFO is Empty"] #[inline(always)] #[must_use] - pub fn intkn_txfemp(&mut self) -> INTKN_TXFEMP_W<4> { - INTKN_TXFEMP_W::new(self) + pub fn intkn_txfemp(&mut self) -> INTKN_TXFEMP_W { + INTKN_TXFEMP_W::new(self, 4) } #[doc = "Bit 6 - IN Endpoint NAK Effective"] #[inline(always)] #[must_use] - pub fn inepnak_eff(&mut self) -> INEPNAK_EFF_W<6> { - INEPNAK_EFF_W::new(self) + pub fn inepnak_eff(&mut self) -> INEPNAK_EFF_W { + INEPNAK_EFF_W::new(self, 6) } #[doc = "Bit 9 - BNA (Buffer Not Available) Interrupt"] #[inline(always)] #[must_use] - pub fn bnaintr(&mut self) -> BNAINTR_W<9> { - BNAINTR_W::new(self) + pub fn bnaintr(&mut self) -> BNAINTR_W { + BNAINTR_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepint0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepint0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepint0::R`](R) reader structure"] +impl crate::Readable for DIEPINT0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepint0::W`](W) writer structure"] impl crate::Writable for DIEPINT0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0/dieptsiz0.rs b/src/usb0_ep0/dieptsiz0.rs index bc73e271..bdca8bcd 100644 --- a/src/usb0_ep0/dieptsiz0.rs +++ b/src/usb0_ep0/dieptsiz0.rs @@ -1,47 +1,15 @@ #[doc = "Register `DIEPTSIZ0` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferSize` reader - Transfer Size"] -pub type XFER_SIZE_R = crate::FieldReader; +pub type XFER_SIZE_R = crate::FieldReader; #[doc = "Field `XferSize` writer - Transfer Size"] -pub type XFER_SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTSIZ0_SPEC, u8, u8, 7, O>; +pub type XFER_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `PktCnt` reader - Packet Count"] -pub type PKT_CNT_R = crate::FieldReader; +pub type PKT_CNT_R = crate::FieldReader; #[doc = "Field `PktCnt` writer - Packet Count"] -pub type PKT_CNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTSIZ0_SPEC, u8, u8, 2, O>; +pub type PKT_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; impl R { #[doc = "Bits 0:6 - Transfer Size"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:6 - Transfer Size"] #[inline(always)] #[must_use] - pub fn xfer_size(&mut self) -> XFER_SIZE_W<0> { - XFER_SIZE_W::new(self) + pub fn xfer_size(&mut self) -> XFER_SIZE_W { + XFER_SIZE_W::new(self, 0) } #[doc = "Bits 19:20 - Packet Count"] #[inline(always)] #[must_use] - pub fn pkt_cnt(&mut self) -> PKT_CNT_W<19> { - PKT_CNT_W::new(self) + pub fn pkt_cnt(&mut self) -> PKT_CNT_W { + PKT_CNT_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device IN Endpoint Transfer Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptsiz0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptsiz0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dieptsiz0::R`](R) reader structure"] +impl crate::Readable for DIEPTSIZ0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dieptsiz0::W`](W) writer structure"] impl crate::Writable for DIEPTSIZ0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0/doepctl0.rs b/src/usb0_ep0/doepctl0.rs index 280ccd4f..9c3bedd8 100644 --- a/src/usb0_ep0/doepctl0.rs +++ b/src/usb0_ep0/doepctl0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MPS` reader - Maximum Packet Size"] -pub type MPS_R = crate::FieldReader; +pub type MPS_R = crate::FieldReader; #[doc = "Maximum Packet Size\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MPS_A { + type Ux = u8; +} impl MPS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MPS_A { + pub const fn variant(&self) -> MPS_A { match self.bits { 0 => MPS_A::VALUE1, 1 => MPS_A::VALUE2, @@ -67,29 +38,29 @@ impl MPS_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "64 bytes"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MPS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "32 bytes"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MPS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "16 bytes"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MPS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "8 bytes"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MPS_A::VALUE4 } } #[doc = "Field `USBActEP` reader - USB Active Endpoint"] -pub type USBACT_EP_R = crate::BitReader; +pub type USBACT_EP_R = crate::BitReader; #[doc = "Field `NAKSts` reader - NAK Status"] pub type NAKSTS_R = crate::BitReader; #[doc = "NAK Status\n\nValue on reset: 0"] @@ -109,43 +80,43 @@ impl From for bool { impl NAKSTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NAKSTS_A { + pub const fn variant(&self) -> NAKSTS_A { match self.bits { false => NAKSTS_A::VALUE1, true => NAKSTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The core is transmitting non-NAK handshakes based on the FIFO status."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NAKSTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The core is transmitting NAK handshakes on this endpoint."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NAKSTS_A::VALUE2 } } #[doc = "Field `EPType` reader - Endpoint Type"] -pub type EPTYPE_R = crate::FieldReader; +pub type EPTYPE_R = crate::FieldReader; #[doc = "Field `Snp` reader - Snoop Mode"] -pub type SNP_R = crate::BitReader; +pub type SNP_R = crate::BitReader; #[doc = "Field `Snp` writer - Snoop Mode"] -pub type SNP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL0_SPEC, bool, O>; +pub type SNP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `Stall` reader - STALL Handshake"] -pub type STALL_R = crate::BitReader; +pub type STALL_R = crate::BitReader; #[doc = "Field `Stall` writer - STALL Handshake"] -pub type STALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL0_SPEC, bool, O>; +pub type STALL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CNAK` writer - Clear NAK"] -pub type CNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL0_SPEC, bool, O>; +pub type CNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SNAK` writer - Set NAK"] -pub type SNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL0_SPEC, bool, O>; +pub type SNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDis` reader - Endpoint Disable"] -pub type EPDIS_R = crate::BitReader; +pub type EPDIS_R = crate::BitReader; #[doc = "Field `EPEna` reader - Endpoint Enable"] -pub type EPENA_R = crate::BitReader; +pub type EPENA_R = crate::BitReader; #[doc = "Field `EPEna` writer - Endpoint Enable"] -pub type EPENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL0_SPEC, bool, O>; +pub type EPENA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:1 - Maximum Packet Size"] #[inline(always)] @@ -192,52 +163,53 @@ impl W { #[doc = "Bit 20 - Snoop Mode"] #[inline(always)] #[must_use] - pub fn snp(&mut self) -> SNP_W<20> { - SNP_W::new(self) + pub fn snp(&mut self) -> SNP_W { + SNP_W::new(self, 20) } #[doc = "Bit 21 - STALL Handshake"] #[inline(always)] #[must_use] - pub fn stall(&mut self) -> STALL_W<21> { - STALL_W::new(self) + pub fn stall(&mut self) -> STALL_W { + STALL_W::new(self, 21) } #[doc = "Bit 26 - Clear NAK"] #[inline(always)] #[must_use] - pub fn cnak(&mut self) -> CNAK_W<26> { - CNAK_W::new(self) + pub fn cnak(&mut self) -> CNAK_W { + CNAK_W::new(self, 26) } #[doc = "Bit 27 - Set NAK"] #[inline(always)] #[must_use] - pub fn snak(&mut self) -> SNAK_W<27> { - SNAK_W::new(self) + pub fn snak(&mut self) -> SNAK_W { + SNAK_W::new(self, 27) } #[doc = "Bit 31 - Endpoint Enable"] #[inline(always)] #[must_use] - pub fn epena(&mut self) -> EPENA_W<31> { - EPENA_W::new(self) + pub fn epena(&mut self) -> EPENA_W { + EPENA_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Control OUT Endpoint Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepctl0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepctl0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doepctl0::R`](R) reader structure"] +impl crate::Readable for DOEPCTL0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doepctl0::W`](W) writer structure"] impl crate::Writable for DOEPCTL0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0/doepdma0.rs b/src/usb0_ep0/doepdma0.rs index 87398a44..c1891102 100644 --- a/src/usb0_ep0/doepdma0.rs +++ b/src/usb0_ep0/doepdma0.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DMAAddr` reader - DMA Address"] -pub type DMAADDR_R = crate::FieldReader; +pub type DMAADDR_R = crate::FieldReader; #[doc = "Field `DMAAddr` writer - DMA Address"] -pub type DMAADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPDMA0_SPEC, u32, u32, 32, O>; +pub type DMAADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] #[must_use] - pub fn dmaaddr(&mut self) -> DMAADDR_W<0> { - DMAADDR_W::new(self) + pub fn dmaaddr(&mut self) -> DMAADDR_W { + DMAADDR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Device Endpoint DMA Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepdma0::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepdma0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doepdma0::R`](R) reader structure"] +impl crate::Readable for DOEPDMA0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doepdma0::W`](W) writer structure"] impl crate::Writable for DOEPDMA0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0/doepdmab0.rs b/src/usb0_ep0/doepdmab0.rs index 3c66a20b..66acbacd 100644 --- a/src/usb0_ep0/doepdmab0.rs +++ b/src/usb0_ep0/doepdmab0.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DMABufferAddr` reader - DMA Buffer Address"] -pub type DMABUFFER_ADDR_R = crate::FieldReader; +pub type DMABUFFER_ADDR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - DMA Buffer Address"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { DMABUFFER_ADDR_R::new(self.bits) } } -#[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"] +#[doc = "Device Endpoint DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepdmab0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`doepdmab0::R`](R) reader structure"] +impl crate::Readable for DOEPDMAB0_SPEC {} #[doc = "`reset()` method sets DOEPDMAB0 to value 0"] impl crate::Resettable for DOEPDMAB0_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0_ep0/doepint0.rs b/src/usb0_ep0/doepint0.rs index 29b34936..5d93a2a5 100644 --- a/src/usb0_ep0/doepint0.rs +++ b/src/usb0_ep0/doepint0.rs @@ -1,87 +1,55 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `XferCompl` reader - Transfer Completed Interrupt"] -pub type XFER_COMPL_R = crate::BitReader; +pub type XFER_COMPL_R = crate::BitReader; #[doc = "Field `XferCompl` writer - Transfer Completed Interrupt"] -pub type XFER_COMPL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type XFER_COMPL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDisbld` reader - Endpoint Disabled Interrupt"] -pub type EPDISBLD_R = crate::BitReader; +pub type EPDISBLD_R = crate::BitReader; #[doc = "Field `EPDisbld` writer - Endpoint Disabled Interrupt"] -pub type EPDISBLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type EPDISBLD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHBErr` reader - AHB Error"] -pub type AHBERR_R = crate::BitReader; +pub type AHBERR_R = crate::BitReader; #[doc = "Field `AHBErr` writer - AHB Error"] -pub type AHBERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type AHBERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetUp` reader - SETUP Phase Done"] -pub type SET_UP_R = crate::BitReader; +pub type SET_UP_R = crate::BitReader; #[doc = "Field `SetUp` writer - SETUP Phase Done"] -pub type SET_UP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type SET_UP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OUTTknEPdis` reader - OUT Token Received When Endpoint Disabled"] -pub type OUTTKN_EPDIS_R = crate::BitReader; +pub type OUTTKN_EPDIS_R = crate::BitReader; #[doc = "Field `OUTTknEPdis` writer - OUT Token Received When Endpoint Disabled"] -pub type OUTTKN_EPDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type OUTTKN_EPDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `StsPhseRcvd` reader - Status Phase Received For Control Write"] -pub type STS_PHSE_RCVD_R = crate::BitReader; +pub type STS_PHSE_RCVD_R = crate::BitReader; #[doc = "Field `StsPhseRcvd` writer - Status Phase Received For Control Write"] -pub type STS_PHSE_RCVD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type STS_PHSE_RCVD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `Back2BackSETup` reader - Back-to-Back SETUP Packets Received"] -pub type BACK2BACK_SETUP_R = crate::BitReader; +pub type BACK2BACK_SETUP_R = crate::BitReader; #[doc = "Field `Back2BackSETup` writer - Back-to-Back SETUP Packets Received"] -pub type BACK2BACK_SETUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type BACK2BACK_SETUP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_R = crate::BitReader; +pub type BNAINTR_R = crate::BitReader; #[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type BNAINTR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PktDrpSts` reader - Packet Dropped Status"] -pub type PKT_DRP_STS_R = crate::BitReader; +pub type PKT_DRP_STS_R = crate::BitReader; #[doc = "Field `PktDrpSts` writer - Packet Dropped Status"] -pub type PKT_DRP_STS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type PKT_DRP_STS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BbleErrIntrpt` reader - BbleErr (Babble Error) interrupt"] -pub type BBLE_ERR_INTRPT_R = crate::BitReader; +pub type BBLE_ERR_INTRPT_R = crate::BitReader; #[doc = "Field `BbleErrIntrpt` writer - BbleErr (Babble Error) interrupt"] -pub type BBLE_ERR_INTRPT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type BBLE_ERR_INTRPT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NAKIntrpt` reader - NAK interrupt"] -pub type NAKINTRPT_R = crate::BitReader; +pub type NAKINTRPT_R = crate::BitReader; #[doc = "Field `NAKIntrpt` writer - NAK interrupt"] -pub type NAKINTRPT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type NAKINTRPT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NYETIntrpt` reader - NYET interrupt"] -pub type NYETINTRPT_R = crate::BitReader; +pub type NYETINTRPT_R = crate::BitReader; #[doc = "Field `NYETIntrpt` writer - NYET interrupt"] -pub type NYETINTRPT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT0_SPEC, bool, O>; +pub type NYETINTRPT_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transfer Completed Interrupt"] #[inline(always)] @@ -148,94 +116,95 @@ impl W { #[doc = "Bit 0 - Transfer Completed Interrupt"] #[inline(always)] #[must_use] - pub fn xfer_compl(&mut self) -> XFER_COMPL_W<0> { - XFER_COMPL_W::new(self) + pub fn xfer_compl(&mut self) -> XFER_COMPL_W { + XFER_COMPL_W::new(self, 0) } #[doc = "Bit 1 - Endpoint Disabled Interrupt"] #[inline(always)] #[must_use] - pub fn epdisbld(&mut self) -> EPDISBLD_W<1> { - EPDISBLD_W::new(self) + pub fn epdisbld(&mut self) -> EPDISBLD_W { + EPDISBLD_W::new(self, 1) } #[doc = "Bit 2 - AHB Error"] #[inline(always)] #[must_use] - pub fn ahberr(&mut self) -> AHBERR_W<2> { - AHBERR_W::new(self) + pub fn ahberr(&mut self) -> AHBERR_W { + AHBERR_W::new(self, 2) } #[doc = "Bit 3 - SETUP Phase Done"] #[inline(always)] #[must_use] - pub fn set_up(&mut self) -> SET_UP_W<3> { - SET_UP_W::new(self) + pub fn set_up(&mut self) -> SET_UP_W { + SET_UP_W::new(self, 3) } #[doc = "Bit 4 - OUT Token Received When Endpoint Disabled"] #[inline(always)] #[must_use] - pub fn outtkn_epdis(&mut self) -> OUTTKN_EPDIS_W<4> { - OUTTKN_EPDIS_W::new(self) + pub fn outtkn_epdis(&mut self) -> OUTTKN_EPDIS_W { + OUTTKN_EPDIS_W::new(self, 4) } #[doc = "Bit 5 - Status Phase Received For Control Write"] #[inline(always)] #[must_use] - pub fn sts_phse_rcvd(&mut self) -> STS_PHSE_RCVD_W<5> { - STS_PHSE_RCVD_W::new(self) + pub fn sts_phse_rcvd(&mut self) -> STS_PHSE_RCVD_W { + STS_PHSE_RCVD_W::new(self, 5) } #[doc = "Bit 6 - Back-to-Back SETUP Packets Received"] #[inline(always)] #[must_use] - pub fn back2back_setup(&mut self) -> BACK2BACK_SETUP_W<6> { - BACK2BACK_SETUP_W::new(self) + pub fn back2back_setup(&mut self) -> BACK2BACK_SETUP_W { + BACK2BACK_SETUP_W::new(self, 6) } #[doc = "Bit 9 - BNA (Buffer Not Available) Interrupt"] #[inline(always)] #[must_use] - pub fn bnaintr(&mut self) -> BNAINTR_W<9> { - BNAINTR_W::new(self) + pub fn bnaintr(&mut self) -> BNAINTR_W { + BNAINTR_W::new(self, 9) } #[doc = "Bit 11 - Packet Dropped Status"] #[inline(always)] #[must_use] - pub fn pkt_drp_sts(&mut self) -> PKT_DRP_STS_W<11> { - PKT_DRP_STS_W::new(self) + pub fn pkt_drp_sts(&mut self) -> PKT_DRP_STS_W { + PKT_DRP_STS_W::new(self, 11) } #[doc = "Bit 12 - BbleErr (Babble Error) interrupt"] #[inline(always)] #[must_use] - pub fn bble_err_intrpt(&mut self) -> BBLE_ERR_INTRPT_W<12> { - BBLE_ERR_INTRPT_W::new(self) + pub fn bble_err_intrpt(&mut self) -> BBLE_ERR_INTRPT_W { + BBLE_ERR_INTRPT_W::new(self, 12) } #[doc = "Bit 13 - NAK interrupt"] #[inline(always)] #[must_use] - pub fn nakintrpt(&mut self) -> NAKINTRPT_W<13> { - NAKINTRPT_W::new(self) + pub fn nakintrpt(&mut self) -> NAKINTRPT_W { + NAKINTRPT_W::new(self, 13) } #[doc = "Bit 14 - NYET interrupt"] #[inline(always)] #[must_use] - pub fn nyetintrpt(&mut self) -> NYETINTRPT_W<14> { - NYETINTRPT_W::new(self) + pub fn nyetintrpt(&mut self) -> NYETINTRPT_W { + NYETINTRPT_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepint0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepint0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doepint0::R`](R) reader structure"] +impl crate::Readable for DOEPINT0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doepint0::W`](W) writer structure"] impl crate::Writable for DOEPINT0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0/doeptsiz0.rs b/src/usb0_ep0/doeptsiz0.rs index 497ba558..c4763d34 100644 --- a/src/usb0_ep0/doeptsiz0.rs +++ b/src/usb0_ep0/doeptsiz0.rs @@ -1,49 +1,17 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferSize` reader - Transfer Size"] -pub type XFER_SIZE_R = crate::FieldReader; +pub type XFER_SIZE_R = crate::FieldReader; #[doc = "Field `XferSize` writer - Transfer Size"] -pub type XFER_SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPTSIZ0_SPEC, u8, u8, 7, O>; +pub type XFER_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 7>; #[doc = "Field `PktCnt` reader - Packet Count"] -pub type PKT_CNT_R = crate::FieldReader; +pub type PKT_CNT_R = crate::FieldReader; #[doc = "Field `PktCnt` writer - Packet Count"] -pub type PKT_CNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPTSIZ0_SPEC, u8, u8, 2, O>; +pub type PKT_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `SUPCnt` reader - SETUP Packet Count"] -pub type SUPCNT_R = crate::FieldReader; +pub type SUPCNT_R = crate::FieldReader; #[doc = "SETUP Packet Count\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -61,10 +29,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SUPCNT_A { + type Ux = u8; +} impl SUPCNT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 1 => Some(SUPCNT_A::VALUE1), 2 => Some(SUPCNT_A::VALUE2), @@ -72,38 +43,42 @@ impl SUPCNT_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "1 packet"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUPCNT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "2 packets"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUPCNT_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "3 packets"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SUPCNT_A::VALUE3 } } #[doc = "Field `SUPCnt` writer - SETUP Packet Count"] -pub type SUPCNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPTSIZ0_SPEC, u8, SUPCNT_A, 2, O>; -impl<'a, const O: u8> SUPCNT_W<'a, O> { +pub type SUPCNT_W<'a, REG> = crate::FieldWriter<'a, REG, 2, SUPCNT_A>; +impl<'a, REG> SUPCNT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "1 packet"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUPCNT_A::VALUE1) } #[doc = "2 packets"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUPCNT_A::VALUE2) } #[doc = "3 packets"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SUPCNT_A::VALUE3) } } @@ -128,40 +103,41 @@ impl W { #[doc = "Bits 0:6 - Transfer Size"] #[inline(always)] #[must_use] - pub fn xfer_size(&mut self) -> XFER_SIZE_W<0> { - XFER_SIZE_W::new(self) + pub fn xfer_size(&mut self) -> XFER_SIZE_W { + XFER_SIZE_W::new(self, 0) } #[doc = "Bits 19:20 - Packet Count"] #[inline(always)] #[must_use] - pub fn pkt_cnt(&mut self) -> PKT_CNT_W<19> { - PKT_CNT_W::new(self) + pub fn pkt_cnt(&mut self) -> PKT_CNT_W { + PKT_CNT_W::new(self, 19) } #[doc = "Bits 29:30 - SETUP Packet Count"] #[inline(always)] #[must_use] - pub fn supcnt(&mut self) -> SUPCNT_W<29> { - SUPCNT_W::new(self) + pub fn supcnt(&mut self) -> SUPCNT_W { + SUPCNT_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device OUT Endpoint Transfer Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doeptsiz0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doeptsiz0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doeptsiz0::R`](R) reader structure"] +impl crate::Readable for DOEPTSIZ0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doeptsiz0::W`](W) writer structure"] impl crate::Writable for DOEPTSIZ0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep0/dtxfsts0.rs b/src/usb0_ep0/dtxfsts0.rs index e090fb83..9f0110af 100644 --- a/src/usb0_ep0/dtxfsts0.rs +++ b/src/usb0_ep0/dtxfsts0.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `INEPTxFSpcAvail` reader - IN Endpoint TxFIFO Space Avail"] -pub type INEPTX_FSPC_AVAIL_R = crate::FieldReader; +pub type INEPTX_FSPC_AVAIL_R = crate::FieldReader; #[doc = "IN Endpoint TxFIFO Space Avail\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u16)] @@ -32,10 +19,13 @@ impl From for u16 { variant as _ } } +impl crate::FieldSpec for INEPTX_FSPC_AVAIL_A { + type Ux = u16; +} impl INEPTX_FSPC_AVAIL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(INEPTX_FSPC_AVAIL_A::VALUE1), 1 => Some(INEPTX_FSPC_AVAIL_A::VALUE2), @@ -43,17 +33,17 @@ impl INEPTX_FSPC_AVAIL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Endpoint TxFIFO is full"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INEPTX_FSPC_AVAIL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "1 word available"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INEPTX_FSPC_AVAIL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "2 words available"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == INEPTX_FSPC_AVAIL_A::VALUE3 @@ -66,15 +56,13 @@ impl R { INEPTX_FSPC_AVAIL_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"] +#[doc = "Device IN Endpoint Transmit FIFO Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtxfsts0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dtxfsts0::R`](R) reader structure"] +impl crate::Readable for DTXFSTS0_SPEC {} #[doc = "`reset()` method sets DTXFSTS0 to value 0"] impl crate::Resettable for DTXFSTS0_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0_ep1.rs b/src/usb0_ep1.rs index b1d0f278..f3501ed2 100644 --- a/src/usb0_ep1.rs +++ b/src/usb0_ep1.rs @@ -3,115 +3,161 @@ pub struct RegisterBlock { _reserved_0_diepctl: [u8; 0x04], _reserved1: [u8; 0x04], - #[doc = "0x08 - Device Endpoint Interrupt Register"] - pub diepint: DIEPINT, + diepint: DIEPINT, _reserved2: [u8; 0x04], - #[doc = "0x10 - Device Endpoint Transfer Size Register"] - pub dieptsiz: DIEPTSIZ, - #[doc = "0x14 - Device Endpoint DMA Address Register"] - pub diepdma: DIEPDMA, - #[doc = "0x18 - Device IN Endpoint Transmit FIFO Status Register"] - pub dtxfsts: DTXFSTS, - #[doc = "0x1c - Device Endpoint DMA Buffer Address Register"] - pub diepdmab: DIEPDMAB, + dieptsiz: DIEPTSIZ, + diepdma: DIEPDMA, + dtxfsts: DTXFSTS, + diepdmab: DIEPDMAB, _reserved6: [u8; 0x01e0], _reserved_6_doepctl: [u8; 0x04], _reserved7: [u8; 0x04], - #[doc = "0x208 - Device Endpoint Interrupt Register"] - pub doepint: DOEPINT, + doepint: DOEPINT, _reserved8: [u8; 0x04], _reserved_8_doeptsiz: [u8; 0x04], - #[doc = "0x214 - Device Endpoint DMA Address Register"] - pub doepdma: DOEPDMA, + doepdma: DOEPDMA, _reserved10: [u8; 0x04], - #[doc = "0x21c - Device Endpoint DMA Buffer Address Register"] - pub doepdmab: DOEPDMAB, + doepdmab: DOEPDMAB, } impl RegisterBlock { #[doc = "0x00 - Device Endpoint Control Register \\[INTBULK\\]"] #[inline(always)] pub const fn diepctl_intbulk(&self) -> &DIEPCTL_INTBULK { - unsafe { &*(self as *const Self).cast::().add(0usize).cast() } + unsafe { &*(self as *const Self).cast::().add(0).cast() } } #[doc = "0x00 - Device Endpoint Control Register \\[ISOCONT\\]"] #[inline(always)] pub const fn diepctl_isocont(&self) -> &DIEPCTL_ISOCONT { - unsafe { &*(self as *const Self).cast::().add(0usize).cast() } + unsafe { &*(self as *const Self).cast::().add(0).cast() } + } + #[doc = "0x08 - Device Endpoint Interrupt Register"] + #[inline(always)] + pub const fn diepint(&self) -> &DIEPINT { + &self.diepint + } + #[doc = "0x10 - Device Endpoint Transfer Size Register"] + #[inline(always)] + pub const fn dieptsiz(&self) -> &DIEPTSIZ { + &self.dieptsiz + } + #[doc = "0x14 - Device Endpoint DMA Address Register"] + #[inline(always)] + pub const fn diepdma(&self) -> &DIEPDMA { + &self.diepdma + } + #[doc = "0x18 - Device IN Endpoint Transmit FIFO Status Register"] + #[inline(always)] + pub const fn dtxfsts(&self) -> &DTXFSTS { + &self.dtxfsts + } + #[doc = "0x1c - Device Endpoint DMA Buffer Address Register"] + #[inline(always)] + pub const fn diepdmab(&self) -> &DIEPDMAB { + &self.diepdmab } #[doc = "0x200 - Device Endpoint Control Register \\[INTBULK\\]"] #[inline(always)] pub const fn doepctl_intbulk(&self) -> &DOEPCTL_INTBULK { - unsafe { &*(self as *const Self).cast::().add(512usize).cast() } + unsafe { &*(self as *const Self).cast::().add(512).cast() } } #[doc = "0x200 - Device Endpoint Control Register \\[ISOCONT\\]"] #[inline(always)] pub const fn doepctl_isocont(&self) -> &DOEPCTL_ISOCONT { - unsafe { &*(self as *const Self).cast::().add(512usize).cast() } + unsafe { &*(self as *const Self).cast::().add(512).cast() } + } + #[doc = "0x208 - Device Endpoint Interrupt Register"] + #[inline(always)] + pub const fn doepint(&self) -> &DOEPINT { + &self.doepint } #[doc = "0x210 - Device Endpoint Transfer Size Register \\[CONT\\]"] #[inline(always)] pub const fn doeptsiz_control(&self) -> &DOEPTSIZ_CONTROL { - unsafe { &*(self as *const Self).cast::().add(528usize).cast() } + unsafe { &*(self as *const Self).cast::().add(528).cast() } } #[doc = "0x210 - Device Endpoint Transfer Size Register \\[ISO\\]"] #[inline(always)] pub const fn doeptsiz_iso(&self) -> &DOEPTSIZ_ISO { - unsafe { &*(self as *const Self).cast::().add(528usize).cast() } + unsafe { &*(self as *const Self).cast::().add(528).cast() } + } + #[doc = "0x214 - Device Endpoint DMA Address Register"] + #[inline(always)] + pub const fn doepdma(&self) -> &DOEPDMA { + &self.doepdma + } + #[doc = "0x21c - Device Endpoint DMA Buffer Address Register"] + #[inline(always)] + pub const fn doepdmab(&self) -> &DOEPDMAB { + &self.doepdmab } } -#[doc = "DIEPCTL_ISOCONT (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPCTL_ISOCONT (rw) register accessor: Device Endpoint Control Register \\[ISOCONT\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepctl_isocont::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepctl_isocont::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepctl_isocont`] +module"] pub type DIEPCTL_ISOCONT = crate::Reg; #[doc = "Device Endpoint Control Register \\[ISOCONT\\]"] pub mod diepctl_isocont; -#[doc = "DIEPCTL_INTBULK (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPCTL_INTBULK (rw) register accessor: Device Endpoint Control Register \\[INTBULK\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepctl_intbulk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepctl_intbulk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepctl_intbulk`] +module"] pub type DIEPCTL_INTBULK = crate::Reg; #[doc = "Device Endpoint Control Register \\[INTBULK\\]"] pub mod diepctl_intbulk; -#[doc = "DIEPINT (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPINT (rw) register accessor: Device Endpoint Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepint::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepint::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepint`] +module"] pub type DIEPINT = crate::Reg; #[doc = "Device Endpoint Interrupt Register"] pub mod diepint; -#[doc = "DIEPTSIZ (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPTSIZ (rw) register accessor: Device Endpoint Transfer Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptsiz::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptsiz::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dieptsiz`] +module"] pub type DIEPTSIZ = crate::Reg; #[doc = "Device Endpoint Transfer Size Register"] pub mod dieptsiz; -#[doc = "DIEPDMA (rw) register accessor: an alias for `Reg`"] +#[doc = "DIEPDMA (rw) register accessor: Device Endpoint DMA Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepdma::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepdma::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepdma`] +module"] pub type DIEPDMA = crate::Reg; #[doc = "Device Endpoint DMA Address Register"] pub mod diepdma; -#[doc = "DTXFSTS (r) register accessor: an alias for `Reg`"] +#[doc = "DTXFSTS (r) register accessor: Device IN Endpoint Transmit FIFO Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtxfsts::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dtxfsts`] +module"] pub type DTXFSTS = crate::Reg; #[doc = "Device IN Endpoint Transmit FIFO Status Register"] pub mod dtxfsts; -#[doc = "DIEPDMAB (r) register accessor: an alias for `Reg`"] +#[doc = "DIEPDMAB (r) register accessor: Device Endpoint DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepdmab::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@diepdmab`] +module"] pub type DIEPDMAB = crate::Reg; #[doc = "Device Endpoint DMA Buffer Address Register"] pub mod diepdmab; -#[doc = "DOEPCTL_ISOCONT (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPCTL_ISOCONT (rw) register accessor: Device Endpoint Control Register \\[ISOCONT\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepctl_isocont::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepctl_isocont::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepctl_isocont`] +module"] pub type DOEPCTL_ISOCONT = crate::Reg; #[doc = "Device Endpoint Control Register \\[ISOCONT\\]"] pub mod doepctl_isocont; -#[doc = "DOEPCTL_INTBULK (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPCTL_INTBULK (rw) register accessor: Device Endpoint Control Register \\[INTBULK\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepctl_intbulk::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepctl_intbulk::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepctl_intbulk`] +module"] pub type DOEPCTL_INTBULK = crate::Reg; #[doc = "Device Endpoint Control Register \\[INTBULK\\]"] pub mod doepctl_intbulk; -#[doc = "DOEPINT (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPINT (rw) register accessor: Device Endpoint Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepint::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepint::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepint`] +module"] pub type DOEPINT = crate::Reg; #[doc = "Device Endpoint Interrupt Register"] pub mod doepint; -#[doc = "DOEPTSIZ_ISO (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPTSIZ_ISO (rw) register accessor: Device Endpoint Transfer Size Register \\[ISO\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doeptsiz_iso::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doeptsiz_iso::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doeptsiz_iso`] +module"] pub type DOEPTSIZ_ISO = crate::Reg; #[doc = "Device Endpoint Transfer Size Register \\[ISO\\]"] pub mod doeptsiz_iso; -#[doc = "DOEPTSIZ_CONTROL (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPTSIZ_CONTROL (rw) register accessor: Device Endpoint Transfer Size Register \\[CONT\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doeptsiz_control::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doeptsiz_control::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doeptsiz_control`] +module"] pub type DOEPTSIZ_CONTROL = crate::Reg; #[doc = "Device Endpoint Transfer Size Register \\[CONT\\]"] pub mod doeptsiz_control; -#[doc = "DOEPDMA (rw) register accessor: an alias for `Reg`"] +#[doc = "DOEPDMA (rw) register accessor: Device Endpoint DMA Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepdma::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepdma::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepdma`] +module"] pub type DOEPDMA = crate::Reg; #[doc = "Device Endpoint DMA Address Register"] pub mod doepdma; -#[doc = "DOEPDMAB (r) register accessor: an alias for `Reg`"] +#[doc = "DOEPDMAB (r) register accessor: Device Endpoint DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepdmab::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@doepdmab`] +module"] 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 02ef64b9..cdb1e68a 100644 --- a/src/usb0_ep1/diepctl_intbulk.rs +++ b/src/usb0_ep1/diepctl_intbulk.rs @@ -1,47 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MPS` reader - Maximum Packet Size"] -pub type MPS_R = crate::FieldReader; +pub type MPS_R = crate::FieldReader; #[doc = "Field `MPS` writer - Maximum Packet Size"] -pub type MPS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPCTL_INTBULK_SPEC, u16, u16, 11, O>; +pub type MPS_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>; #[doc = "Field `USBActEP` reader - USB Active Endpoint"] -pub type USBACT_EP_R = crate::BitReader; +pub type USBACT_EP_R = crate::BitReader; #[doc = "Field `USBActEP` writer - USB Active Endpoint"] -pub type USBACT_EP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type USBACT_EP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DPID` reader - Endpoint Data PID"] pub type DPID_R = crate::BitReader; #[doc = "Endpoint Data PID\n\nValue on reset: 0"] @@ -61,18 +29,18 @@ impl From for bool { impl DPID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPID_A { + pub const fn variant(&self) -> DPID_A { match self.bits { false => DPID_A::VALUE1, true => DPID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPID_A::VALUE2 @@ -97,25 +65,25 @@ impl From for bool { impl NAKSTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NAKSTS_A { + pub const fn variant(&self) -> NAKSTS_A { match self.bits { false => NAKSTS_A::VALUE1, true => NAKSTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The core is transmitting non-NAK handshakes based on the FIFO status."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NAKSTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The core is transmitting NAK handshakes on this endpoint."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NAKSTS_A::VALUE2 } } #[doc = "Field `EPType` reader - Endpoint Type"] -pub type EPTYPE_R = crate::FieldReader; +pub type EPTYPE_R = crate::FieldReader; #[doc = "Endpoint Type\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -135,10 +103,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EPTYPE_A { + type Ux = u8; +} impl EPTYPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPTYPE_A { + pub const fn variant(&self) -> EPTYPE_A { match self.bits { 0 => EPTYPE_A::VALUE1, 1 => EPTYPE_A::VALUE2, @@ -147,79 +118,83 @@ impl EPTYPE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Control"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPTYPE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Isochronous"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPTYPE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Bulk"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EPTYPE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Interrupt"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EPTYPE_A::VALUE4 } } #[doc = "Field `EPType` writer - Endpoint Type"] -pub type EPTYPE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DIEPCTL_INTBULK_SPEC, u8, EPTYPE_A, 2, O>; -impl<'a, const O: u8> EPTYPE_W<'a, O> { +pub type EPTYPE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EPTYPE_A>; +impl<'a, REG> EPTYPE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Control"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE1) } #[doc = "Isochronous"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE2) } #[doc = "Bulk"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE3) } #[doc = "Interrupt"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE4) } } #[doc = "Field `Snp` reader - Snoop Mode"] -pub type SNP_R = crate::BitReader; +pub type SNP_R = crate::BitReader; #[doc = "Field `Snp` writer - Snoop Mode"] -pub type SNP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type SNP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `Stall` reader - STALL Handshake"] -pub type STALL_R = crate::BitReader; +pub type STALL_R = crate::BitReader; #[doc = "Field `Stall` writer - STALL Handshake"] -pub type STALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type STALL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFNum` reader - TxFIFO Number"] -pub type TX_FNUM_R = crate::FieldReader; +pub type TX_FNUM_R = crate::FieldReader; #[doc = "Field `TxFNum` writer - TxFIFO Number"] -pub type TX_FNUM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPCTL_INTBULK_SPEC, u8, u8, 4, O>; +pub type TX_FNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `CNAK` writer - Clear NAK"] -pub type CNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type CNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SNAK` writer - Set NAK"] -pub type SNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type SNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetD0PID` writer - Set DATA0 PID"] -pub type SET_D0PID_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type SET_D0PID_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetD1PID` writer - 29 Set DATA1 PID"] -pub type SET_D1PID_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type SET_D1PID_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDis` reader - Endpoint Disable"] -pub type EPDIS_R = crate::BitReader; +pub type EPDIS_R = crate::BitReader; #[doc = "Field `EPDis` writer - Endpoint Disable"] -pub type EPDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type EPDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPEna` reader - Endpoint Enable"] -pub type EPENA_R = crate::BitReader; +pub type EPENA_R = crate::BitReader; #[doc = "Field `EPEna` writer - Endpoint Enable"] -pub type EPENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_INTBULK_SPEC, bool, O>; +pub type EPENA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] @@ -276,94 +251,95 @@ impl W { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] #[must_use] - pub fn mps(&mut self) -> MPS_W<0> { - MPS_W::new(self) + pub fn mps(&mut self) -> MPS_W { + MPS_W::new(self, 0) } #[doc = "Bit 15 - USB Active Endpoint"] #[inline(always)] #[must_use] - pub fn usbact_ep(&mut self) -> USBACT_EP_W<15> { - USBACT_EP_W::new(self) + pub fn usbact_ep(&mut self) -> USBACT_EP_W { + USBACT_EP_W::new(self, 15) } #[doc = "Bits 18:19 - Endpoint Type"] #[inline(always)] #[must_use] - pub fn eptype(&mut self) -> EPTYPE_W<18> { - EPTYPE_W::new(self) + pub fn eptype(&mut self) -> EPTYPE_W { + EPTYPE_W::new(self, 18) } #[doc = "Bit 20 - Snoop Mode"] #[inline(always)] #[must_use] - pub fn snp(&mut self) -> SNP_W<20> { - SNP_W::new(self) + pub fn snp(&mut self) -> SNP_W { + SNP_W::new(self, 20) } #[doc = "Bit 21 - STALL Handshake"] #[inline(always)] #[must_use] - pub fn stall(&mut self) -> STALL_W<21> { - STALL_W::new(self) + pub fn stall(&mut self) -> STALL_W { + STALL_W::new(self, 21) } #[doc = "Bits 22:25 - TxFIFO Number"] #[inline(always)] #[must_use] - pub fn tx_fnum(&mut self) -> TX_FNUM_W<22> { - TX_FNUM_W::new(self) + pub fn tx_fnum(&mut self) -> TX_FNUM_W { + TX_FNUM_W::new(self, 22) } #[doc = "Bit 26 - Clear NAK"] #[inline(always)] #[must_use] - pub fn cnak(&mut self) -> CNAK_W<26> { - CNAK_W::new(self) + pub fn cnak(&mut self) -> CNAK_W { + CNAK_W::new(self, 26) } #[doc = "Bit 27 - Set NAK"] #[inline(always)] #[must_use] - pub fn snak(&mut self) -> SNAK_W<27> { - SNAK_W::new(self) + pub fn snak(&mut self) -> SNAK_W { + SNAK_W::new(self, 27) } #[doc = "Bit 28 - Set DATA0 PID"] #[inline(always)] #[must_use] - pub fn set_d0pid(&mut self) -> SET_D0PID_W<28> { - SET_D0PID_W::new(self) + pub fn set_d0pid(&mut self) -> SET_D0PID_W { + SET_D0PID_W::new(self, 28) } #[doc = "Bit 29 - 29 Set DATA1 PID"] #[inline(always)] #[must_use] - pub fn set_d1pid(&mut self) -> SET_D1PID_W<29> { - SET_D1PID_W::new(self) + pub fn set_d1pid(&mut self) -> SET_D1PID_W { + SET_D1PID_W::new(self, 29) } #[doc = "Bit 30 - Endpoint Disable"] #[inline(always)] #[must_use] - pub fn epdis(&mut self) -> EPDIS_W<30> { - EPDIS_W::new(self) + pub fn epdis(&mut self) -> EPDIS_W { + EPDIS_W::new(self, 30) } #[doc = "Bit 31 - Endpoint Enable"] #[inline(always)] #[must_use] - pub fn epena(&mut self) -> EPENA_W<31> { - EPENA_W::new(self) + pub fn epena(&mut self) -> EPENA_W { + EPENA_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Control Register \\[INTBULK\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepctl_intbulk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepctl_intbulk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepctl_intbulk::R`](R) reader structure"] +impl crate::Readable for DIEPCTL_INTBULK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepctl_intbulk::W`](W) writer structure"] impl crate::Writable for DIEPCTL_INTBULK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/diepctl_isocont.rs b/src/usb0_ep1/diepctl_isocont.rs index 176a8258..fc385409 100644 --- a/src/usb0_ep1/diepctl_isocont.rs +++ b/src/usb0_ep1/diepctl_isocont.rs @@ -1,47 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MPS` reader - Maximum Packet Size"] -pub type MPS_R = crate::FieldReader; +pub type MPS_R = crate::FieldReader; #[doc = "Field `MPS` writer - Maximum Packet Size"] -pub type MPS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, u16, u16, 11, O>; +pub type MPS_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>; #[doc = "Field `USBActEP` reader - USB Active Endpoint"] -pub type USBACT_EP_R = crate::BitReader; +pub type USBACT_EP_R = crate::BitReader; #[doc = "Field `USBActEP` writer - USB Active Endpoint"] -pub type USBACT_EP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type USBACT_EP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EO_FrNum` reader - Even/Odd Frame"] pub type EO_FR_NUM_R = crate::BitReader; #[doc = "Even/Odd Frame\n\nValue on reset: 0"] @@ -61,18 +29,18 @@ impl From for bool { impl EO_FR_NUM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EO_FR_NUM_A { + pub const fn variant(&self) -> EO_FR_NUM_A { match self.bits { false => EO_FR_NUM_A::VALUE1, true => EO_FR_NUM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Even frame"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EO_FR_NUM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Odd rame"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EO_FR_NUM_A::VALUE2 @@ -97,25 +65,25 @@ impl From for bool { impl NAKSTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NAKSTS_A { + pub const fn variant(&self) -> NAKSTS_A { match self.bits { false => NAKSTS_A::VALUE1, true => NAKSTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The core is transmitting non-NAK handshakes based on the FIFO status."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NAKSTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The core is transmitting NAK handshakes on this endpoint."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NAKSTS_A::VALUE2 } } #[doc = "Field `EPType` reader - Endpoint Type"] -pub type EPTYPE_R = crate::FieldReader; +pub type EPTYPE_R = crate::FieldReader; #[doc = "Endpoint Type\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -135,10 +103,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EPTYPE_A { + type Ux = u8; +} impl EPTYPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPTYPE_A { + pub const fn variant(&self) -> EPTYPE_A { match self.bits { 0 => EPTYPE_A::VALUE1, 1 => EPTYPE_A::VALUE2, @@ -147,79 +118,83 @@ impl EPTYPE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Control"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPTYPE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Isochronous"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPTYPE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Bulk"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EPTYPE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Interrupt"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EPTYPE_A::VALUE4 } } #[doc = "Field `EPType` writer - Endpoint Type"] -pub type EPTYPE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DIEPCTL_ISOCONT_SPEC, u8, EPTYPE_A, 2, O>; -impl<'a, const O: u8> EPTYPE_W<'a, O> { +pub type EPTYPE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EPTYPE_A>; +impl<'a, REG> EPTYPE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Control"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE1) } #[doc = "Isochronous"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE2) } #[doc = "Bulk"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE3) } #[doc = "Interrupt"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE4) } } #[doc = "Field `Snp` reader - Snoop Mode"] -pub type SNP_R = crate::BitReader; +pub type SNP_R = crate::BitReader; #[doc = "Field `Snp` writer - Snoop Mode"] -pub type SNP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type SNP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `Stall` reader - STALL Handshake"] -pub type STALL_R = crate::BitReader; +pub type STALL_R = crate::BitReader; #[doc = "Field `Stall` writer - STALL Handshake"] -pub type STALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type STALL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFNum` reader - TxFIFO Number"] -pub type TX_FNUM_R = crate::FieldReader; +pub type TX_FNUM_R = crate::FieldReader; #[doc = "Field `TxFNum` writer - TxFIFO Number"] -pub type TX_FNUM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, u8, u8, 4, O>; +pub type TX_FNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `CNAK` writer - Clear NAK"] -pub type CNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type CNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SNAK` writer - Set NAK"] -pub type SNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type SNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetEvenFr` writer - In non-Scatter/Gather DMA mode: Set Even frame"] -pub type SET_EVEN_FR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type SET_EVEN_FR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetOddFr` writer - Set Odd frame"] -pub type SET_ODD_FR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type SET_ODD_FR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDis` reader - Endpoint Disable"] -pub type EPDIS_R = crate::BitReader; +pub type EPDIS_R = crate::BitReader; #[doc = "Field `EPDis` writer - Endpoint Disable"] -pub type EPDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type EPDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPEna` reader - Endpoint Enable"] -pub type EPENA_R = crate::BitReader; +pub type EPENA_R = crate::BitReader; #[doc = "Field `EPEna` writer - Endpoint Enable"] -pub type EPENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPCTL_ISOCONT_SPEC, bool, O>; +pub type EPENA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] @@ -276,94 +251,95 @@ impl W { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] #[must_use] - pub fn mps(&mut self) -> MPS_W<0> { - MPS_W::new(self) + pub fn mps(&mut self) -> MPS_W { + MPS_W::new(self, 0) } #[doc = "Bit 15 - USB Active Endpoint"] #[inline(always)] #[must_use] - pub fn usbact_ep(&mut self) -> USBACT_EP_W<15> { - USBACT_EP_W::new(self) + pub fn usbact_ep(&mut self) -> USBACT_EP_W { + USBACT_EP_W::new(self, 15) } #[doc = "Bits 18:19 - Endpoint Type"] #[inline(always)] #[must_use] - pub fn eptype(&mut self) -> EPTYPE_W<18> { - EPTYPE_W::new(self) + pub fn eptype(&mut self) -> EPTYPE_W { + EPTYPE_W::new(self, 18) } #[doc = "Bit 20 - Snoop Mode"] #[inline(always)] #[must_use] - pub fn snp(&mut self) -> SNP_W<20> { - SNP_W::new(self) + pub fn snp(&mut self) -> SNP_W { + SNP_W::new(self, 20) } #[doc = "Bit 21 - STALL Handshake"] #[inline(always)] #[must_use] - pub fn stall(&mut self) -> STALL_W<21> { - STALL_W::new(self) + pub fn stall(&mut self) -> STALL_W { + STALL_W::new(self, 21) } #[doc = "Bits 22:25 - TxFIFO Number"] #[inline(always)] #[must_use] - pub fn tx_fnum(&mut self) -> TX_FNUM_W<22> { - TX_FNUM_W::new(self) + pub fn tx_fnum(&mut self) -> TX_FNUM_W { + TX_FNUM_W::new(self, 22) } #[doc = "Bit 26 - Clear NAK"] #[inline(always)] #[must_use] - pub fn cnak(&mut self) -> CNAK_W<26> { - CNAK_W::new(self) + pub fn cnak(&mut self) -> CNAK_W { + CNAK_W::new(self, 26) } #[doc = "Bit 27 - Set NAK"] #[inline(always)] #[must_use] - pub fn snak(&mut self) -> SNAK_W<27> { - SNAK_W::new(self) + pub fn snak(&mut self) -> SNAK_W { + SNAK_W::new(self, 27) } #[doc = "Bit 28 - In non-Scatter/Gather DMA mode: Set Even frame"] #[inline(always)] #[must_use] - pub fn set_even_fr(&mut self) -> SET_EVEN_FR_W<28> { - SET_EVEN_FR_W::new(self) + pub fn set_even_fr(&mut self) -> SET_EVEN_FR_W { + SET_EVEN_FR_W::new(self, 28) } #[doc = "Bit 29 - Set Odd frame"] #[inline(always)] #[must_use] - pub fn set_odd_fr(&mut self) -> SET_ODD_FR_W<29> { - SET_ODD_FR_W::new(self) + pub fn set_odd_fr(&mut self) -> SET_ODD_FR_W { + SET_ODD_FR_W::new(self, 29) } #[doc = "Bit 30 - Endpoint Disable"] #[inline(always)] #[must_use] - pub fn epdis(&mut self) -> EPDIS_W<30> { - EPDIS_W::new(self) + pub fn epdis(&mut self) -> EPDIS_W { + EPDIS_W::new(self, 30) } #[doc = "Bit 31 - Endpoint Enable"] #[inline(always)] #[must_use] - pub fn epena(&mut self) -> EPENA_W<31> { - EPENA_W::new(self) + pub fn epena(&mut self) -> EPENA_W { + EPENA_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Control Register \\[ISOCONT\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepctl_isocont::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepctl_isocont::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepctl_isocont::R`](R) reader structure"] +impl crate::Readable for DIEPCTL_ISOCONT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepctl_isocont::W`](W) writer structure"] impl crate::Writable for DIEPCTL_ISOCONT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/diepdma.rs b/src/usb0_ep1/diepdma.rs index 4c73737c..6a2dedc8 100644 --- a/src/usb0_ep1/diepdma.rs +++ b/src/usb0_ep1/diepdma.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DMAAddr` reader - DMA Address"] -pub type DMAADDR_R = crate::FieldReader; +pub type DMAADDR_R = crate::FieldReader; #[doc = "Field `DMAAddr` writer - DMA Address"] -pub type DMAADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPDMA_SPEC, u32, u32, 32, O>; +pub type DMAADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] #[must_use] - pub fn dmaaddr(&mut self) -> DMAADDR_W<0> { - DMAADDR_W::new(self) + pub fn dmaaddr(&mut self) -> DMAADDR_W { + DMAADDR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Device Endpoint DMA Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepdma::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepdma::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepdma::R`](R) reader structure"] +impl crate::Readable for DIEPDMA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepdma::W`](W) writer structure"] impl crate::Writable for DIEPDMA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/diepdmab.rs b/src/usb0_ep1/diepdmab.rs index d57ca27f..82d6cfc1 100644 --- a/src/usb0_ep1/diepdmab.rs +++ b/src/usb0_ep1/diepdmab.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DMABufferAddr` reader - DMA Buffer Address"] -pub type DMABUFFER_ADDR_R = crate::FieldReader; +pub type DMABUFFER_ADDR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - DMA Buffer Address"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { DMABUFFER_ADDR_R::new(self.bits) } } -#[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"] +#[doc = "Device Endpoint DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepdmab::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`diepdmab::R`](R) reader structure"] +impl crate::Readable for DIEPDMAB_SPEC {} #[doc = "`reset()` method sets DIEPDMAB to value 0"] impl crate::Resettable for DIEPDMAB_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0_ep1/diepint.rs b/src/usb0_ep1/diepint.rs index 79dd7e1c..1f94e137 100644 --- a/src/usb0_ep1/diepint.rs +++ b/src/usb0_ep1/diepint.rs @@ -1,69 +1,37 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferCompl` reader - Transfer Completed Interrupt"] -pub type XFER_COMPL_R = crate::BitReader; +pub type XFER_COMPL_R = crate::BitReader; #[doc = "Field `XferCompl` writer - Transfer Completed Interrupt"] -pub type XFER_COMPL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT_SPEC, bool, O>; +pub type XFER_COMPL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDisbld` reader - Endpoint Disabled Interrupt"] -pub type EPDISBLD_R = crate::BitReader; +pub type EPDISBLD_R = crate::BitReader; #[doc = "Field `EPDisbld` writer - Endpoint Disabled Interrupt"] -pub type EPDISBLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT_SPEC, bool, O>; +pub type EPDISBLD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHBErr` reader - AHB Error"] -pub type AHBERR_R = crate::BitReader; +pub type AHBERR_R = crate::BitReader; #[doc = "Field `AHBErr` writer - AHB Error"] -pub type AHBERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT_SPEC, bool, O>; +pub type AHBERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TimeOUT` reader - Timeout Condition"] -pub type TIME_OUT_R = crate::BitReader; +pub type TIME_OUT_R = crate::BitReader; #[doc = "Field `TimeOUT` writer - Timeout Condition"] -pub type TIME_OUT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT_SPEC, bool, O>; +pub type TIME_OUT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `INTknTXFEmp` reader - IN Token Received When TxFIFO is Empty"] -pub type INTKN_TXFEMP_R = crate::BitReader; +pub type INTKN_TXFEMP_R = crate::BitReader; #[doc = "Field `INTknTXFEmp` writer - IN Token Received When TxFIFO is Empty"] -pub type INTKN_TXFEMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT_SPEC, bool, O>; +pub type INTKN_TXFEMP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `INEPNakEff` reader - IN Endpoint NAK Effective"] -pub type INEPNAK_EFF_R = crate::BitReader; +pub type INEPNAK_EFF_R = crate::BitReader; #[doc = "Field `INEPNakEff` writer - IN Endpoint NAK Effective"] -pub type INEPNAK_EFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT_SPEC, bool, O>; +pub type INEPNAK_EFF_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFEmp` reader - Transmit FIFO Empty"] -pub type TX_FEMP_R = crate::BitReader; +pub type TX_FEMP_R = crate::BitReader; #[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_R = crate::BitReader; +pub type BNAINTR_R = crate::BitReader; #[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DIEPINT_SPEC, bool, O>; +pub type BNAINTR_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transfer Completed Interrupt"] #[inline(always)] @@ -110,64 +78,65 @@ impl W { #[doc = "Bit 0 - Transfer Completed Interrupt"] #[inline(always)] #[must_use] - pub fn xfer_compl(&mut self) -> XFER_COMPL_W<0> { - XFER_COMPL_W::new(self) + pub fn xfer_compl(&mut self) -> XFER_COMPL_W { + XFER_COMPL_W::new(self, 0) } #[doc = "Bit 1 - Endpoint Disabled Interrupt"] #[inline(always)] #[must_use] - pub fn epdisbld(&mut self) -> EPDISBLD_W<1> { - EPDISBLD_W::new(self) + pub fn epdisbld(&mut self) -> EPDISBLD_W { + EPDISBLD_W::new(self, 1) } #[doc = "Bit 2 - AHB Error"] #[inline(always)] #[must_use] - pub fn ahberr(&mut self) -> AHBERR_W<2> { - AHBERR_W::new(self) + pub fn ahberr(&mut self) -> AHBERR_W { + AHBERR_W::new(self, 2) } #[doc = "Bit 3 - Timeout Condition"] #[inline(always)] #[must_use] - pub fn time_out(&mut self) -> TIME_OUT_W<3> { - TIME_OUT_W::new(self) + pub fn time_out(&mut self) -> TIME_OUT_W { + TIME_OUT_W::new(self, 3) } #[doc = "Bit 4 - IN Token Received When TxFIFO is Empty"] #[inline(always)] #[must_use] - pub fn intkn_txfemp(&mut self) -> INTKN_TXFEMP_W<4> { - INTKN_TXFEMP_W::new(self) + pub fn intkn_txfemp(&mut self) -> INTKN_TXFEMP_W { + INTKN_TXFEMP_W::new(self, 4) } #[doc = "Bit 6 - IN Endpoint NAK Effective"] #[inline(always)] #[must_use] - pub fn inepnak_eff(&mut self) -> INEPNAK_EFF_W<6> { - INEPNAK_EFF_W::new(self) + pub fn inepnak_eff(&mut self) -> INEPNAK_EFF_W { + INEPNAK_EFF_W::new(self, 6) } #[doc = "Bit 9 - BNA (Buffer Not Available) Interrupt"] #[inline(always)] #[must_use] - pub fn bnaintr(&mut self) -> BNAINTR_W<9> { - BNAINTR_W::new(self) + pub fn bnaintr(&mut self) -> BNAINTR_W { + BNAINTR_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`diepint::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`diepint::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`diepint::R`](R) reader structure"] +impl crate::Readable for DIEPINT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`diepint::W`](W) writer structure"] impl crate::Writable for DIEPINT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/dieptsiz.rs b/src/usb0_ep1/dieptsiz.rs index df011c0b..351804ab 100644 --- a/src/usb0_ep1/dieptsiz.rs +++ b/src/usb0_ep1/dieptsiz.rs @@ -1,47 +1,15 @@ #[doc = "Register `DIEPTSIZ` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferSize` reader - Transfer Size"] -pub type XFER_SIZE_R = crate::FieldReader; +pub type XFER_SIZE_R = crate::FieldReader; #[doc = "Field `XferSize` writer - Transfer Size"] -pub type XFER_SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTSIZ_SPEC, u32, u32, 19, O>; +pub type XFER_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 19, u32>; #[doc = "Field `PktCnt` reader - Packet Count"] -pub type PKT_CNT_R = crate::FieldReader; +pub type PKT_CNT_R = crate::FieldReader; #[doc = "Field `PktCnt` writer - Packet Count"] -pub type PKT_CNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DIEPTSIZ_SPEC, u16, u16, 10, O>; +pub type PKT_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; impl R { #[doc = "Bits 0:18 - Transfer Size"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:18 - Transfer Size"] #[inline(always)] #[must_use] - pub fn xfer_size(&mut self) -> XFER_SIZE_W<0> { - XFER_SIZE_W::new(self) + pub fn xfer_size(&mut self) -> XFER_SIZE_W { + XFER_SIZE_W::new(self, 0) } #[doc = "Bits 19:28 - Packet Count"] #[inline(always)] #[must_use] - pub fn pkt_cnt(&mut self) -> PKT_CNT_W<19> { - PKT_CNT_W::new(self) + pub fn pkt_cnt(&mut self) -> PKT_CNT_W { + PKT_CNT_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Transfer Size Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dieptsiz::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dieptsiz::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dieptsiz::R`](R) reader structure"] +impl crate::Readable for DIEPTSIZ_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dieptsiz::W`](W) writer structure"] impl crate::Writable for DIEPTSIZ_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/doepctl_intbulk.rs b/src/usb0_ep1/doepctl_intbulk.rs index 912708e8..d14e5e0f 100644 --- a/src/usb0_ep1/doepctl_intbulk.rs +++ b/src/usb0_ep1/doepctl_intbulk.rs @@ -1,47 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MPS` reader - Maximum Packet Size"] -pub type MPS_R = crate::FieldReader; +pub type MPS_R = crate::FieldReader; #[doc = "Field `MPS` writer - Maximum Packet Size"] -pub type MPS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPCTL_INTBULK_SPEC, u16, u16, 11, O>; +pub type MPS_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>; #[doc = "Field `USBActEP` reader - USB Active Endpoint"] -pub type USBACT_EP_R = crate::BitReader; +pub type USBACT_EP_R = crate::BitReader; #[doc = "Field `USBActEP` writer - USB Active Endpoint"] -pub type USBACT_EP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type USBACT_EP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DPID` reader - Endpoint Data PID"] pub type DPID_R = crate::BitReader; #[doc = "Endpoint Data PID\n\nValue on reset: 0"] @@ -61,18 +29,18 @@ impl From for bool { impl DPID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPID_A { + pub const fn variant(&self) -> DPID_A { match self.bits { false => DPID_A::VALUE1, true => DPID_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPID_A::VALUE2 @@ -97,25 +65,25 @@ impl From for bool { impl NAKSTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NAKSTS_A { + pub const fn variant(&self) -> NAKSTS_A { match self.bits { false => NAKSTS_A::VALUE1, true => NAKSTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The core is transmitting non-NAK handshakes based on the FIFO status."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NAKSTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The core is transmitting NAK handshakes on this endpoint."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NAKSTS_A::VALUE2 } } #[doc = "Field `EPType` reader - Endpoint Type"] -pub type EPTYPE_R = crate::FieldReader; +pub type EPTYPE_R = crate::FieldReader; #[doc = "Endpoint Type\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -135,10 +103,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EPTYPE_A { + type Ux = u8; +} impl EPTYPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPTYPE_A { + pub const fn variant(&self) -> EPTYPE_A { match self.bits { 0 => EPTYPE_A::VALUE1, 1 => EPTYPE_A::VALUE2, @@ -147,79 +118,83 @@ impl EPTYPE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Control"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPTYPE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Isochronous"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPTYPE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Bulk"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EPTYPE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Interrupt"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EPTYPE_A::VALUE4 } } #[doc = "Field `EPType` writer - Endpoint Type"] -pub type EPTYPE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DOEPCTL_INTBULK_SPEC, u8, EPTYPE_A, 2, O>; -impl<'a, const O: u8> EPTYPE_W<'a, O> { +pub type EPTYPE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EPTYPE_A>; +impl<'a, REG> EPTYPE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Control"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE1) } #[doc = "Isochronous"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE2) } #[doc = "Bulk"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE3) } #[doc = "Interrupt"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE4) } } #[doc = "Field `Snp` reader - Snoop Mode"] -pub type SNP_R = crate::BitReader; +pub type SNP_R = crate::BitReader; #[doc = "Field `Snp` writer - Snoop Mode"] -pub type SNP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type SNP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `Stall` reader - STALL Handshake"] -pub type STALL_R = crate::BitReader; +pub type STALL_R = crate::BitReader; #[doc = "Field `Stall` writer - STALL Handshake"] -pub type STALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type STALL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFNum` reader - TxFIFO Number"] -pub type TX_FNUM_R = crate::FieldReader; +pub type TX_FNUM_R = crate::FieldReader; #[doc = "Field `TxFNum` writer - TxFIFO Number"] -pub type TX_FNUM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPCTL_INTBULK_SPEC, u8, u8, 4, O>; +pub type TX_FNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `CNAK` writer - Clear NAK"] -pub type CNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type CNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SNAK` writer - Set NAK"] -pub type SNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type SNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetD0PID` writer - Set DATA0 PID"] -pub type SET_D0PID_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type SET_D0PID_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetD1PID` writer - 29 Set DATA1 PID"] -pub type SET_D1PID_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type SET_D1PID_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDis` reader - Endpoint Disable"] -pub type EPDIS_R = crate::BitReader; +pub type EPDIS_R = crate::BitReader; #[doc = "Field `EPDis` writer - Endpoint Disable"] -pub type EPDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type EPDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPEna` reader - Endpoint Enable"] -pub type EPENA_R = crate::BitReader; +pub type EPENA_R = crate::BitReader; #[doc = "Field `EPEna` writer - Endpoint Enable"] -pub type EPENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_INTBULK_SPEC, bool, O>; +pub type EPENA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] @@ -276,94 +251,95 @@ impl W { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] #[must_use] - pub fn mps(&mut self) -> MPS_W<0> { - MPS_W::new(self) + pub fn mps(&mut self) -> MPS_W { + MPS_W::new(self, 0) } #[doc = "Bit 15 - USB Active Endpoint"] #[inline(always)] #[must_use] - pub fn usbact_ep(&mut self) -> USBACT_EP_W<15> { - USBACT_EP_W::new(self) + pub fn usbact_ep(&mut self) -> USBACT_EP_W { + USBACT_EP_W::new(self, 15) } #[doc = "Bits 18:19 - Endpoint Type"] #[inline(always)] #[must_use] - pub fn eptype(&mut self) -> EPTYPE_W<18> { - EPTYPE_W::new(self) + pub fn eptype(&mut self) -> EPTYPE_W { + EPTYPE_W::new(self, 18) } #[doc = "Bit 20 - Snoop Mode"] #[inline(always)] #[must_use] - pub fn snp(&mut self) -> SNP_W<20> { - SNP_W::new(self) + pub fn snp(&mut self) -> SNP_W { + SNP_W::new(self, 20) } #[doc = "Bit 21 - STALL Handshake"] #[inline(always)] #[must_use] - pub fn stall(&mut self) -> STALL_W<21> { - STALL_W::new(self) + pub fn stall(&mut self) -> STALL_W { + STALL_W::new(self, 21) } #[doc = "Bits 22:25 - TxFIFO Number"] #[inline(always)] #[must_use] - pub fn tx_fnum(&mut self) -> TX_FNUM_W<22> { - TX_FNUM_W::new(self) + pub fn tx_fnum(&mut self) -> TX_FNUM_W { + TX_FNUM_W::new(self, 22) } #[doc = "Bit 26 - Clear NAK"] #[inline(always)] #[must_use] - pub fn cnak(&mut self) -> CNAK_W<26> { - CNAK_W::new(self) + pub fn cnak(&mut self) -> CNAK_W { + CNAK_W::new(self, 26) } #[doc = "Bit 27 - Set NAK"] #[inline(always)] #[must_use] - pub fn snak(&mut self) -> SNAK_W<27> { - SNAK_W::new(self) + pub fn snak(&mut self) -> SNAK_W { + SNAK_W::new(self, 27) } #[doc = "Bit 28 - Set DATA0 PID"] #[inline(always)] #[must_use] - pub fn set_d0pid(&mut self) -> SET_D0PID_W<28> { - SET_D0PID_W::new(self) + pub fn set_d0pid(&mut self) -> SET_D0PID_W { + SET_D0PID_W::new(self, 28) } #[doc = "Bit 29 - 29 Set DATA1 PID"] #[inline(always)] #[must_use] - pub fn set_d1pid(&mut self) -> SET_D1PID_W<29> { - SET_D1PID_W::new(self) + pub fn set_d1pid(&mut self) -> SET_D1PID_W { + SET_D1PID_W::new(self, 29) } #[doc = "Bit 30 - Endpoint Disable"] #[inline(always)] #[must_use] - pub fn epdis(&mut self) -> EPDIS_W<30> { - EPDIS_W::new(self) + pub fn epdis(&mut self) -> EPDIS_W { + EPDIS_W::new(self, 30) } #[doc = "Bit 31 - Endpoint Enable"] #[inline(always)] #[must_use] - pub fn epena(&mut self) -> EPENA_W<31> { - EPENA_W::new(self) + pub fn epena(&mut self) -> EPENA_W { + EPENA_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Control Register \\[INTBULK\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepctl_intbulk::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepctl_intbulk::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doepctl_intbulk::R`](R) reader structure"] +impl crate::Readable for DOEPCTL_INTBULK_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doepctl_intbulk::W`](W) writer structure"] impl crate::Writable for DOEPCTL_INTBULK_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/doepctl_isocont.rs b/src/usb0_ep1/doepctl_isocont.rs index b74cb0ad..b7e36cba 100644 --- a/src/usb0_ep1/doepctl_isocont.rs +++ b/src/usb0_ep1/doepctl_isocont.rs @@ -1,47 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MPS` reader - Maximum Packet Size"] -pub type MPS_R = crate::FieldReader; +pub type MPS_R = crate::FieldReader; #[doc = "Field `MPS` writer - Maximum Packet Size"] -pub type MPS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, u16, u16, 11, O>; +pub type MPS_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>; #[doc = "Field `USBActEP` reader - USB Active Endpoint"] -pub type USBACT_EP_R = crate::BitReader; +pub type USBACT_EP_R = crate::BitReader; #[doc = "Field `USBActEP` writer - USB Active Endpoint"] -pub type USBACT_EP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type USBACT_EP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EO_FrNum` reader - Even/Odd Frame"] pub type EO_FR_NUM_R = crate::BitReader; #[doc = "Even/Odd Frame\n\nValue on reset: 0"] @@ -61,18 +29,18 @@ impl From for bool { impl EO_FR_NUM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EO_FR_NUM_A { + pub const fn variant(&self) -> EO_FR_NUM_A { match self.bits { false => EO_FR_NUM_A::VALUE1, true => EO_FR_NUM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Even frame"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EO_FR_NUM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Odd rame"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EO_FR_NUM_A::VALUE2 @@ -97,25 +65,25 @@ impl From for bool { impl NAKSTS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NAKSTS_A { + pub const fn variant(&self) -> NAKSTS_A { match self.bits { false => NAKSTS_A::VALUE1, true => NAKSTS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The core is transmitting non-NAK handshakes based on the FIFO status."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NAKSTS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The core is transmitting NAK handshakes on this endpoint."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NAKSTS_A::VALUE2 } } #[doc = "Field `EPType` reader - Endpoint Type"] -pub type EPTYPE_R = crate::FieldReader; +pub type EPTYPE_R = crate::FieldReader; #[doc = "Endpoint Type\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -135,10 +103,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EPTYPE_A { + type Ux = u8; +} impl EPTYPE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EPTYPE_A { + pub const fn variant(&self) -> EPTYPE_A { match self.bits { 0 => EPTYPE_A::VALUE1, 1 => EPTYPE_A::VALUE2, @@ -147,79 +118,83 @@ impl EPTYPE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Control"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EPTYPE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Isochronous"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EPTYPE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Bulk"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EPTYPE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Interrupt"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EPTYPE_A::VALUE4 } } #[doc = "Field `EPType` writer - Endpoint Type"] -pub type EPTYPE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DOEPCTL_ISOCONT_SPEC, u8, EPTYPE_A, 2, O>; -impl<'a, const O: u8> EPTYPE_W<'a, O> { +pub type EPTYPE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EPTYPE_A>; +impl<'a, REG> EPTYPE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Control"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE1) } #[doc = "Isochronous"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE2) } #[doc = "Bulk"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE3) } #[doc = "Interrupt"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EPTYPE_A::VALUE4) } } #[doc = "Field `Snp` reader - Snoop Mode"] -pub type SNP_R = crate::BitReader; +pub type SNP_R = crate::BitReader; #[doc = "Field `Snp` writer - Snoop Mode"] -pub type SNP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type SNP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `Stall` reader - STALL Handshake"] -pub type STALL_R = crate::BitReader; +pub type STALL_R = crate::BitReader; #[doc = "Field `Stall` writer - STALL Handshake"] -pub type STALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type STALL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `TxFNum` reader - TxFIFO Number"] -pub type TX_FNUM_R = crate::FieldReader; +pub type TX_FNUM_R = crate::FieldReader; #[doc = "Field `TxFNum` writer - TxFIFO Number"] -pub type TX_FNUM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, u8, u8, 4, O>; +pub type TX_FNUM_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `CNAK` writer - Clear NAK"] -pub type CNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type CNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SNAK` writer - Set NAK"] -pub type SNAK_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type SNAK_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetEvenFr` writer - In non-Scatter/Gather DMA mode: Set Even frame"] -pub type SET_EVEN_FR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type SET_EVEN_FR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetOddFr` writer - Set Odd frame"] -pub type SET_ODD_FR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type SET_ODD_FR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDis` reader - Endpoint Disable"] -pub type EPDIS_R = crate::BitReader; +pub type EPDIS_R = crate::BitReader; #[doc = "Field `EPDis` writer - Endpoint Disable"] -pub type EPDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type EPDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPEna` reader - Endpoint Enable"] -pub type EPENA_R = crate::BitReader; +pub type EPENA_R = crate::BitReader; #[doc = "Field `EPEna` writer - Endpoint Enable"] -pub type EPENA_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPCTL_ISOCONT_SPEC, bool, O>; +pub type EPENA_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] @@ -276,94 +251,95 @@ impl W { #[doc = "Bits 0:10 - Maximum Packet Size"] #[inline(always)] #[must_use] - pub fn mps(&mut self) -> MPS_W<0> { - MPS_W::new(self) + pub fn mps(&mut self) -> MPS_W { + MPS_W::new(self, 0) } #[doc = "Bit 15 - USB Active Endpoint"] #[inline(always)] #[must_use] - pub fn usbact_ep(&mut self) -> USBACT_EP_W<15> { - USBACT_EP_W::new(self) + pub fn usbact_ep(&mut self) -> USBACT_EP_W { + USBACT_EP_W::new(self, 15) } #[doc = "Bits 18:19 - Endpoint Type"] #[inline(always)] #[must_use] - pub fn eptype(&mut self) -> EPTYPE_W<18> { - EPTYPE_W::new(self) + pub fn eptype(&mut self) -> EPTYPE_W { + EPTYPE_W::new(self, 18) } #[doc = "Bit 20 - Snoop Mode"] #[inline(always)] #[must_use] - pub fn snp(&mut self) -> SNP_W<20> { - SNP_W::new(self) + pub fn snp(&mut self) -> SNP_W { + SNP_W::new(self, 20) } #[doc = "Bit 21 - STALL Handshake"] #[inline(always)] #[must_use] - pub fn stall(&mut self) -> STALL_W<21> { - STALL_W::new(self) + pub fn stall(&mut self) -> STALL_W { + STALL_W::new(self, 21) } #[doc = "Bits 22:25 - TxFIFO Number"] #[inline(always)] #[must_use] - pub fn tx_fnum(&mut self) -> TX_FNUM_W<22> { - TX_FNUM_W::new(self) + pub fn tx_fnum(&mut self) -> TX_FNUM_W { + TX_FNUM_W::new(self, 22) } #[doc = "Bit 26 - Clear NAK"] #[inline(always)] #[must_use] - pub fn cnak(&mut self) -> CNAK_W<26> { - CNAK_W::new(self) + pub fn cnak(&mut self) -> CNAK_W { + CNAK_W::new(self, 26) } #[doc = "Bit 27 - Set NAK"] #[inline(always)] #[must_use] - pub fn snak(&mut self) -> SNAK_W<27> { - SNAK_W::new(self) + pub fn snak(&mut self) -> SNAK_W { + SNAK_W::new(self, 27) } #[doc = "Bit 28 - In non-Scatter/Gather DMA mode: Set Even frame"] #[inline(always)] #[must_use] - pub fn set_even_fr(&mut self) -> SET_EVEN_FR_W<28> { - SET_EVEN_FR_W::new(self) + pub fn set_even_fr(&mut self) -> SET_EVEN_FR_W { + SET_EVEN_FR_W::new(self, 28) } #[doc = "Bit 29 - Set Odd frame"] #[inline(always)] #[must_use] - pub fn set_odd_fr(&mut self) -> SET_ODD_FR_W<29> { - SET_ODD_FR_W::new(self) + pub fn set_odd_fr(&mut self) -> SET_ODD_FR_W { + SET_ODD_FR_W::new(self, 29) } #[doc = "Bit 30 - Endpoint Disable"] #[inline(always)] #[must_use] - pub fn epdis(&mut self) -> EPDIS_W<30> { - EPDIS_W::new(self) + pub fn epdis(&mut self) -> EPDIS_W { + EPDIS_W::new(self, 30) } #[doc = "Bit 31 - Endpoint Enable"] #[inline(always)] #[must_use] - pub fn epena(&mut self) -> EPENA_W<31> { - EPENA_W::new(self) + pub fn epena(&mut self) -> EPENA_W { + EPENA_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Control Register \\[ISOCONT\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepctl_isocont::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepctl_isocont::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doepctl_isocont::R`](R) reader structure"] +impl crate::Readable for DOEPCTL_ISOCONT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doepctl_isocont::W`](W) writer structure"] impl crate::Writable for DOEPCTL_ISOCONT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/doepdma.rs b/src/usb0_ep1/doepdma.rs index b4c1a4d3..ad31e6e8 100644 --- a/src/usb0_ep1/doepdma.rs +++ b/src/usb0_ep1/doepdma.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DMAAddr` reader - DMA Address"] -pub type DMAADDR_R = crate::FieldReader; +pub type DMAADDR_R = crate::FieldReader; #[doc = "Field `DMAAddr` writer - DMA Address"] -pub type DMAADDR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPDMA_SPEC, u32, u32, 32, O>; +pub type DMAADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - DMA Address"] #[inline(always)] #[must_use] - pub fn dmaaddr(&mut self) -> DMAADDR_W<0> { - DMAADDR_W::new(self) + pub fn dmaaddr(&mut self) -> DMAADDR_W { + DMAADDR_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Device Endpoint DMA Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepdma::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepdma::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doepdma::R`](R) reader structure"] +impl crate::Readable for DOEPDMA_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doepdma::W`](W) writer structure"] impl crate::Writable for DOEPDMA_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/doepdmab.rs b/src/usb0_ep1/doepdmab.rs index 96db9299..30e02234 100644 --- a/src/usb0_ep1/doepdmab.rs +++ b/src/usb0_ep1/doepdmab.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DMABufferAddr` reader - DMA Buffer Address"] -pub type DMABUFFER_ADDR_R = crate::FieldReader; +pub type DMABUFFER_ADDR_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - DMA Buffer Address"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { DMABUFFER_ADDR_R::new(self.bits) } } -#[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"] +#[doc = "Device Endpoint DMA Buffer Address Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepdmab::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`doepdmab::R`](R) reader structure"] +impl crate::Readable for DOEPDMAB_SPEC {} #[doc = "`reset()` method sets DOEPDMAB to value 0"] impl crate::Resettable for DOEPDMAB_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usb0_ep1/doepint.rs b/src/usb0_ep1/doepint.rs index 61d4c45f..8b6a96ec 100644 --- a/src/usb0_ep1/doepint.rs +++ b/src/usb0_ep1/doepint.rs @@ -1,87 +1,55 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `XferCompl` reader - Transfer Completed Interrupt"] -pub type XFER_COMPL_R = crate::BitReader; +pub type XFER_COMPL_R = crate::BitReader; #[doc = "Field `XferCompl` writer - Transfer Completed Interrupt"] -pub type XFER_COMPL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type XFER_COMPL_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `EPDisbld` reader - Endpoint Disabled Interrupt"] -pub type EPDISBLD_R = crate::BitReader; +pub type EPDISBLD_R = crate::BitReader; #[doc = "Field `EPDisbld` writer - Endpoint Disabled Interrupt"] -pub type EPDISBLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type EPDISBLD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `AHBErr` reader - AHB Error"] -pub type AHBERR_R = crate::BitReader; +pub type AHBERR_R = crate::BitReader; #[doc = "Field `AHBErr` writer - AHB Error"] -pub type AHBERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type AHBERR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SetUp` reader - SETUP Phase Done"] -pub type SET_UP_R = crate::BitReader; +pub type SET_UP_R = crate::BitReader; #[doc = "Field `SetUp` writer - SETUP Phase Done"] -pub type SET_UP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type SET_UP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `OUTTknEPdis` reader - OUT Token Received When Endpoint Disabled"] -pub type OUTTKN_EPDIS_R = crate::BitReader; +pub type OUTTKN_EPDIS_R = crate::BitReader; #[doc = "Field `OUTTknEPdis` writer - OUT Token Received When Endpoint Disabled"] -pub type OUTTKN_EPDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type OUTTKN_EPDIS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `StsPhseRcvd` reader - Status Phase Received For Control Write"] -pub type STS_PHSE_RCVD_R = crate::BitReader; +pub type STS_PHSE_RCVD_R = crate::BitReader; #[doc = "Field `StsPhseRcvd` writer - Status Phase Received For Control Write"] -pub type STS_PHSE_RCVD_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type STS_PHSE_RCVD_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `Back2BackSETup` reader - Back-to-Back SETUP Packets Received"] -pub type BACK2BACK_SETUP_R = crate::BitReader; +pub type BACK2BACK_SETUP_R = crate::BitReader; #[doc = "Field `Back2BackSETup` writer - Back-to-Back SETUP Packets Received"] -pub type BACK2BACK_SETUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type BACK2BACK_SETUP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BNAIntr` reader - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_R = crate::BitReader; +pub type BNAINTR_R = crate::BitReader; #[doc = "Field `BNAIntr` writer - BNA (Buffer Not Available) Interrupt"] -pub type BNAINTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type BNAINTR_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PktDrpSts` reader - Packet Dropped Status"] -pub type PKT_DRP_STS_R = crate::BitReader; +pub type PKT_DRP_STS_R = crate::BitReader; #[doc = "Field `PktDrpSts` writer - Packet Dropped Status"] -pub type PKT_DRP_STS_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type PKT_DRP_STS_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `BbleErrIntrpt` reader - BbleErr (Babble Error) interrupt"] -pub type BBLE_ERR_INTRPT_R = crate::BitReader; +pub type BBLE_ERR_INTRPT_R = crate::BitReader; #[doc = "Field `BbleErrIntrpt` writer - BbleErr (Babble Error) interrupt"] -pub type BBLE_ERR_INTRPT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type BBLE_ERR_INTRPT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NAKIntrpt` reader - NAK interrupt"] -pub type NAKINTRPT_R = crate::BitReader; +pub type NAKINTRPT_R = crate::BitReader; #[doc = "Field `NAKIntrpt` writer - NAK interrupt"] -pub type NAKINTRPT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type NAKINTRPT_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `NYETIntrpt` reader - NYET interrupt"] -pub type NYETINTRPT_R = crate::BitReader; +pub type NYETINTRPT_R = crate::BitReader; #[doc = "Field `NYETIntrpt` writer - NYET interrupt"] -pub type NYETINTRPT_W<'a, const O: u8> = crate::BitWriter<'a, u32, DOEPINT_SPEC, bool, O>; +pub type NYETINTRPT_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Transfer Completed Interrupt"] #[inline(always)] @@ -148,94 +116,95 @@ impl W { #[doc = "Bit 0 - Transfer Completed Interrupt"] #[inline(always)] #[must_use] - pub fn xfer_compl(&mut self) -> XFER_COMPL_W<0> { - XFER_COMPL_W::new(self) + pub fn xfer_compl(&mut self) -> XFER_COMPL_W { + XFER_COMPL_W::new(self, 0) } #[doc = "Bit 1 - Endpoint Disabled Interrupt"] #[inline(always)] #[must_use] - pub fn epdisbld(&mut self) -> EPDISBLD_W<1> { - EPDISBLD_W::new(self) + pub fn epdisbld(&mut self) -> EPDISBLD_W { + EPDISBLD_W::new(self, 1) } #[doc = "Bit 2 - AHB Error"] #[inline(always)] #[must_use] - pub fn ahberr(&mut self) -> AHBERR_W<2> { - AHBERR_W::new(self) + pub fn ahberr(&mut self) -> AHBERR_W { + AHBERR_W::new(self, 2) } #[doc = "Bit 3 - SETUP Phase Done"] #[inline(always)] #[must_use] - pub fn set_up(&mut self) -> SET_UP_W<3> { - SET_UP_W::new(self) + pub fn set_up(&mut self) -> SET_UP_W { + SET_UP_W::new(self, 3) } #[doc = "Bit 4 - OUT Token Received When Endpoint Disabled"] #[inline(always)] #[must_use] - pub fn outtkn_epdis(&mut self) -> OUTTKN_EPDIS_W<4> { - OUTTKN_EPDIS_W::new(self) + pub fn outtkn_epdis(&mut self) -> OUTTKN_EPDIS_W { + OUTTKN_EPDIS_W::new(self, 4) } #[doc = "Bit 5 - Status Phase Received For Control Write"] #[inline(always)] #[must_use] - pub fn sts_phse_rcvd(&mut self) -> STS_PHSE_RCVD_W<5> { - STS_PHSE_RCVD_W::new(self) + pub fn sts_phse_rcvd(&mut self) -> STS_PHSE_RCVD_W { + STS_PHSE_RCVD_W::new(self, 5) } #[doc = "Bit 6 - Back-to-Back SETUP Packets Received"] #[inline(always)] #[must_use] - pub fn back2back_setup(&mut self) -> BACK2BACK_SETUP_W<6> { - BACK2BACK_SETUP_W::new(self) + pub fn back2back_setup(&mut self) -> BACK2BACK_SETUP_W { + BACK2BACK_SETUP_W::new(self, 6) } #[doc = "Bit 9 - BNA (Buffer Not Available) Interrupt"] #[inline(always)] #[must_use] - pub fn bnaintr(&mut self) -> BNAINTR_W<9> { - BNAINTR_W::new(self) + pub fn bnaintr(&mut self) -> BNAINTR_W { + BNAINTR_W::new(self, 9) } #[doc = "Bit 11 - Packet Dropped Status"] #[inline(always)] #[must_use] - pub fn pkt_drp_sts(&mut self) -> PKT_DRP_STS_W<11> { - PKT_DRP_STS_W::new(self) + pub fn pkt_drp_sts(&mut self) -> PKT_DRP_STS_W { + PKT_DRP_STS_W::new(self, 11) } #[doc = "Bit 12 - BbleErr (Babble Error) interrupt"] #[inline(always)] #[must_use] - pub fn bble_err_intrpt(&mut self) -> BBLE_ERR_INTRPT_W<12> { - BBLE_ERR_INTRPT_W::new(self) + pub fn bble_err_intrpt(&mut self) -> BBLE_ERR_INTRPT_W { + BBLE_ERR_INTRPT_W::new(self, 12) } #[doc = "Bit 13 - NAK interrupt"] #[inline(always)] #[must_use] - pub fn nakintrpt(&mut self) -> NAKINTRPT_W<13> { - NAKINTRPT_W::new(self) + pub fn nakintrpt(&mut self) -> NAKINTRPT_W { + NAKINTRPT_W::new(self, 13) } #[doc = "Bit 14 - NYET interrupt"] #[inline(always)] #[must_use] - pub fn nyetintrpt(&mut self) -> NYETINTRPT_W<14> { - NYETINTRPT_W::new(self) + pub fn nyetintrpt(&mut self) -> NYETINTRPT_W { + NYETINTRPT_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Interrupt Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doepint::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doepint::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doepint::R`](R) reader structure"] +impl crate::Readable for DOEPINT_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doepint::W`](W) writer structure"] impl crate::Writable for DOEPINT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/doeptsiz_control.rs b/src/usb0_ep1/doeptsiz_control.rs index b2f80b7f..c172583d 100644 --- a/src/usb0_ep1/doeptsiz_control.rs +++ b/src/usb0_ep1/doeptsiz_control.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferSize` reader - Transfer Size"] -pub type XFER_SIZE_R = crate::FieldReader; +pub type XFER_SIZE_R = crate::FieldReader; #[doc = "Field `XferSize` writer - Transfer Size"] -pub type XFER_SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPTSIZ_CONTROL_SPEC, u32, u32, 19, O>; +pub type XFER_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 19, u32>; #[doc = "Field `PktCnt` reader - Packet Count"] -pub type PKT_CNT_R = crate::FieldReader; +pub type PKT_CNT_R = crate::FieldReader; #[doc = "Field `PktCnt` writer - Packet Count"] -pub type PKT_CNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPTSIZ_CONTROL_SPEC, u16, u16, 10, O>; +pub type PKT_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `SUPCnt` reader - SETUP Packet Count: 0b00=1 packet, 0b00=2 packets, 0b00=3 packets,"] -pub type SUPCNT_R = crate::FieldReader; +pub type SUPCNT_R = crate::FieldReader; #[doc = "Field `SUPCnt` writer - SETUP Packet Count: 0b00=1 packet, 0b00=2 packets, 0b00=3 packets,"] -pub type SUPCNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPTSIZ_CONTROL_SPEC, u8, u8, 2, O>; +pub type SUPCNT_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; impl R { #[doc = "Bits 0:18 - Transfer Size"] #[inline(always)] @@ -67,40 +35,41 @@ impl W { #[doc = "Bits 0:18 - Transfer Size"] #[inline(always)] #[must_use] - pub fn xfer_size(&mut self) -> XFER_SIZE_W<0> { - XFER_SIZE_W::new(self) + pub fn xfer_size(&mut self) -> XFER_SIZE_W { + XFER_SIZE_W::new(self, 0) } #[doc = "Bits 19:28 - Packet Count"] #[inline(always)] #[must_use] - pub fn pkt_cnt(&mut self) -> PKT_CNT_W<19> { - PKT_CNT_W::new(self) + pub fn pkt_cnt(&mut self) -> PKT_CNT_W { + PKT_CNT_W::new(self, 19) } #[doc = "Bits 29:30 - SETUP Packet Count: 0b00=1 packet, 0b00=2 packets, 0b00=3 packets,"] #[inline(always)] #[must_use] - pub fn supcnt(&mut self) -> SUPCNT_W<29> { - SUPCNT_W::new(self) + pub fn supcnt(&mut self) -> SUPCNT_W { + SUPCNT_W::new(self, 29) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Transfer Size Register \\[CONT\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doeptsiz_control::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doeptsiz_control::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doeptsiz_control::R`](R) reader structure"] +impl crate::Readable for DOEPTSIZ_CONTROL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doeptsiz_control::W`](W) writer structure"] impl crate::Writable for DOEPTSIZ_CONTROL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/doeptsiz_iso.rs b/src/usb0_ep1/doeptsiz_iso.rs index bca8210e..17a03030 100644 --- a/src/usb0_ep1/doeptsiz_iso.rs +++ b/src/usb0_ep1/doeptsiz_iso.rs @@ -1,49 +1,17 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `XferSize` reader - Transfer Size"] -pub type XFER_SIZE_R = crate::FieldReader; +pub type XFER_SIZE_R = crate::FieldReader; #[doc = "Field `XferSize` writer - Transfer Size"] -pub type XFER_SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPTSIZ_ISO_SPEC, u32, u32, 19, O>; +pub type XFER_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 19, u32>; #[doc = "Field `PktCnt` reader - Packet Count"] -pub type PKT_CNT_R = crate::FieldReader; +pub type PKT_CNT_R = crate::FieldReader; #[doc = "Field `PktCnt` writer - Packet Count"] -pub type PKT_CNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, DOEPTSIZ_ISO_SPEC, u16, u16, 10, O>; +pub type PKT_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `RxDPID` reader - Received Data PID"] -pub type RX_DPID_R = crate::FieldReader; +pub type RX_DPID_R = crate::FieldReader; #[doc = "Received Data PID\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RX_DPID_A { + type Ux = u8; +} impl RX_DPID_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RX_DPID_A { + pub const fn variant(&self) -> RX_DPID_A { match self.bits { 0 => RX_DPID_A::VALUE1, 1 => RX_DPID_A::VALUE2, @@ -75,22 +46,22 @@ impl RX_DPID_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DATA0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RX_DPID_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DATA2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RX_DPID_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "DATA1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RX_DPID_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "MDATA"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == RX_DPID_A::VALUE4 @@ -117,34 +88,35 @@ impl W { #[doc = "Bits 0:18 - Transfer Size"] #[inline(always)] #[must_use] - pub fn xfer_size(&mut self) -> XFER_SIZE_W<0> { - XFER_SIZE_W::new(self) + pub fn xfer_size(&mut self) -> XFER_SIZE_W { + XFER_SIZE_W::new(self, 0) } #[doc = "Bits 19:28 - Packet Count"] #[inline(always)] #[must_use] - pub fn pkt_cnt(&mut self) -> PKT_CNT_W<19> { - PKT_CNT_W::new(self) + pub fn pkt_cnt(&mut self) -> PKT_CNT_W { + PKT_CNT_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Device Endpoint Transfer Size Register \\[ISO\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`doeptsiz_iso::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`doeptsiz_iso::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`doeptsiz_iso::R`](R) reader structure"] +impl crate::Readable for DOEPTSIZ_ISO_SPEC {} +#[doc = "`write(|w| ..)` method takes [`doeptsiz_iso::W`](W) writer structure"] impl crate::Writable for DOEPTSIZ_ISO_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usb0_ep1/dtxfsts.rs b/src/usb0_ep1/dtxfsts.rs index 88aab59b..eab4e95e 100644 --- a/src/usb0_ep1/dtxfsts.rs +++ b/src/usb0_ep1/dtxfsts.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `INEPTxFSpcAvail` reader - IN Endpoint TxFIFO Space Avail"] -pub type INEPTX_FSPC_AVAIL_R = crate::FieldReader; +pub type INEPTX_FSPC_AVAIL_R = crate::FieldReader; #[doc = "IN Endpoint TxFIFO Space Avail\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u16)] @@ -32,10 +19,13 @@ impl From for u16 { variant as _ } } +impl crate::FieldSpec for INEPTX_FSPC_AVAIL_A { + type Ux = u16; +} impl INEPTX_FSPC_AVAIL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(INEPTX_FSPC_AVAIL_A::VALUE1), 1 => Some(INEPTX_FSPC_AVAIL_A::VALUE2), @@ -43,17 +33,17 @@ impl INEPTX_FSPC_AVAIL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Endpoint TxFIFO is full"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INEPTX_FSPC_AVAIL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "1 word available"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INEPTX_FSPC_AVAIL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "2 words available"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == INEPTX_FSPC_AVAIL_A::VALUE3 @@ -66,15 +56,13 @@ impl R { INEPTX_FSPC_AVAIL_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"] +#[doc = "Device IN Endpoint Transmit FIFO Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dtxfsts::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`dtxfsts::R`](R) reader structure"] +impl crate::Readable for DTXFSTS_SPEC {} #[doc = "`reset()` method sets DTXFSTS to value 0"] impl crate::Resettable for DTXFSTS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0.rs b/src/usic0.rs index 393170af..8c24db6e 100644 --- a/src/usic0.rs +++ b/src/usic0.rs @@ -1,10 +1,17 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + id: ID, +} +impl RegisterBlock { #[doc = "0x00 - Module Identification Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } } -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] 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 2c5843d5..9b9824da 100644 --- a/src/usic0/id.rs +++ b/src/usic0/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision Number"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number Value"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision Number"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00aa_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00aa_c000; diff --git a/src/usic0_ch0.rs b/src/usic0_ch0.rs index cf6b80f1..1a0e6083 100644 --- a/src/usic0_ch0.rs +++ b/src/usic0_ch0.rs @@ -2,305 +2,485 @@ #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 0x04], - #[doc = "0x04 - Channel Configuration Register"] - pub ccfg: CCFG, + ccfg: CCFG, _reserved1: [u8; 0x04], + kscfg: KSCFG, + fdr: FDR, + brg: BRG, + inpr: INPR, + dx0cr: DX0CR, + dx1cr: DX1CR, + dx2cr: DX2CR, + dx3cr: DX3CR, + dx4cr: DX4CR, + dx5cr: DX5CR, + sctr: SCTR, + tcsr: TCSR, + _reserved_13_pcr: [u8; 0x04], + ccr: CCR, + cmtr: CMTR, + _reserved_16_psr: [u8; 0x04], + pscr: PSCR, + rbufsr: RBUFSR, + rbuf: RBUF, + rbufd: RBUFD, + rbuf0: RBUF0, + rbuf1: RBUF1, + rbuf01sr: RBUF01SR, + fmr: FMR, + _reserved25: [u8; 0x14], + tbuf: [TBUF; 32], + byp: BYP, + bypcr: BYPCR, + tbctr: TBCTR, + rbctr: RBCTR, + trbptr: TRBPTR, + trbsr: TRBSR, + trbscr: TRBSCR, + outr: OUTR, + outdr: OUTDR, + _reserved35: [u8; 0x5c], + in_: [IN; 32], +} +impl RegisterBlock { + #[doc = "0x04 - Channel Configuration Register"] + #[inline(always)] + pub const fn ccfg(&self) -> &CCFG { + &self.ccfg + } #[doc = "0x0c - Kernel State Configuration Register"] - pub kscfg: KSCFG, + #[inline(always)] + pub const fn kscfg(&self) -> &KSCFG { + &self.kscfg + } #[doc = "0x10 - Fractional Divider Register"] - pub fdr: FDR, + #[inline(always)] + pub const fn fdr(&self) -> &FDR { + &self.fdr + } #[doc = "0x14 - Baud Rate Generator Register"] - pub brg: BRG, + #[inline(always)] + pub const fn brg(&self) -> &BRG { + &self.brg + } #[doc = "0x18 - Interrupt Node Pointer Register"] - pub inpr: INPR, + #[inline(always)] + pub const fn inpr(&self) -> &INPR { + &self.inpr + } #[doc = "0x1c - Input Control Register 0"] - pub dx0cr: DX0CR, + #[inline(always)] + pub const fn dx0cr(&self) -> &DX0CR { + &self.dx0cr + } #[doc = "0x20 - Input Control Register 1"] - pub dx1cr: DX1CR, + #[inline(always)] + pub const fn dx1cr(&self) -> &DX1CR { + &self.dx1cr + } #[doc = "0x24 - Input Control Register 2"] - pub dx2cr: DX2CR, + #[inline(always)] + pub const fn dx2cr(&self) -> &DX2CR { + &self.dx2cr + } #[doc = "0x28 - Input Control Register 3"] - pub dx3cr: DX3CR, + #[inline(always)] + pub const fn dx3cr(&self) -> &DX3CR { + &self.dx3cr + } #[doc = "0x2c - Input Control Register 4"] - pub dx4cr: DX4CR, + #[inline(always)] + pub const fn dx4cr(&self) -> &DX4CR { + &self.dx4cr + } #[doc = "0x30 - Input Control Register 5"] - pub dx5cr: DX5CR, + #[inline(always)] + pub const fn dx5cr(&self) -> &DX5CR { + &self.dx5cr + } #[doc = "0x34 - Shift Control Register"] - pub sctr: SCTR, + #[inline(always)] + pub const fn sctr(&self) -> &SCTR { + &self.sctr + } #[doc = "0x38 - Transmit Control/Status Register"] - pub tcsr: TCSR, - _reserved_13_pcr: [u8; 0x04], - #[doc = "0x40 - Channel Control Register"] - pub ccr: CCR, - #[doc = "0x44 - Capture Mode Timer Register"] - pub cmtr: CMTR, - _reserved_16_psr: [u8; 0x04], - #[doc = "0x4c - Protocol Status Clear Register"] - pub pscr: PSCR, - #[doc = "0x50 - Receiver Buffer Status Register"] - pub rbufsr: RBUFSR, - #[doc = "0x54 - Receiver Buffer Register"] - pub rbuf: RBUF, - #[doc = "0x58 - Receiver Buffer Register for Debugger"] - pub rbufd: RBUFD, - #[doc = "0x5c - Receiver Buffer Register 0"] - pub rbuf0: RBUF0, - #[doc = "0x60 - Receiver Buffer Register 1"] - pub rbuf1: RBUF1, - #[doc = "0x64 - Receiver Buffer 01 Status Register"] - pub rbuf01sr: RBUF01SR, - #[doc = "0x68 - Flag Modification Register"] - pub fmr: FMR, - _reserved25: [u8; 0x14], - #[doc = "0x80..0x100 - Transmit Buffer"] - pub tbuf: [TBUF; 32], - #[doc = "0x100 - Bypass Data Register"] - pub byp: BYP, - #[doc = "0x104 - Bypass Control Register"] - pub bypcr: BYPCR, - #[doc = "0x108 - Transmitter Buffer Control Register"] - pub tbctr: TBCTR, - #[doc = "0x10c - Receiver Buffer Control Register"] - pub rbctr: RBCTR, - #[doc = "0x110 - Transmit/Receive Buffer Pointer Register"] - pub trbptr: TRBPTR, - #[doc = "0x114 - Transmit/Receive Buffer Status Register"] - pub trbsr: TRBSR, - #[doc = "0x118 - Transmit/Receive Buffer Status Clear Register"] - pub trbscr: TRBSCR, - #[doc = "0x11c - Receiver Buffer Output Register"] - pub outr: OUTR, - #[doc = "0x120 - Receiver Buffer Output Register L for Debugger"] - pub outdr: OUTDR, - _reserved35: [u8; 0x5c], - #[doc = "0x180..0x200 - Transmit FIFO Buffer"] - pub in_: [IN; 32], -} -impl RegisterBlock { + #[inline(always)] + pub const fn tcsr(&self) -> &TCSR { + &self.tcsr + } #[doc = "0x3c - Protocol Control Register \\[IIS Mode\\]"] #[inline(always)] pub const fn pcr_iismode(&self) -> &PCR_IISMODE { - unsafe { &*(self as *const Self).cast::().add(60usize).cast() } + unsafe { &*(self as *const Self).cast::().add(60).cast() } } #[doc = "0x3c - Protocol Control Register \\[IIC Mode\\]"] #[inline(always)] pub const fn pcr_iicmode(&self) -> &PCR_IICMODE { - unsafe { &*(self as *const Self).cast::().add(60usize).cast() } + unsafe { &*(self as *const Self).cast::().add(60).cast() } } #[doc = "0x3c - Protocol Control Register \\[SSC Mode\\]"] #[inline(always)] pub const fn pcr_sscmode(&self) -> &PCR_SSCMODE { - unsafe { &*(self as *const Self).cast::().add(60usize).cast() } + unsafe { &*(self as *const Self).cast::().add(60).cast() } } #[doc = "0x3c - Protocol Control Register \\[ASC Mode\\]"] #[inline(always)] pub const fn pcr_ascmode(&self) -> &PCR_ASCMODE { - unsafe { &*(self as *const Self).cast::().add(60usize).cast() } + unsafe { &*(self as *const Self).cast::().add(60).cast() } } #[doc = "0x3c - Protocol Control Register"] #[inline(always)] pub const fn pcr(&self) -> &PCR { - unsafe { &*(self as *const Self).cast::().add(60usize).cast() } + unsafe { &*(self as *const Self).cast::().add(60).cast() } + } + #[doc = "0x40 - Channel Control Register"] + #[inline(always)] + pub const fn ccr(&self) -> &CCR { + &self.ccr + } + #[doc = "0x44 - Capture Mode Timer Register"] + #[inline(always)] + pub const fn cmtr(&self) -> &CMTR { + &self.cmtr } #[doc = "0x48 - Protocol Status Register \\[IIS Mode\\]"] #[inline(always)] pub const fn psr_iismode(&self) -> &PSR_IISMODE { - unsafe { &*(self as *const Self).cast::().add(72usize).cast() } + unsafe { &*(self as *const Self).cast::().add(72).cast() } } #[doc = "0x48 - Protocol Status Register \\[IIC Mode\\]"] #[inline(always)] pub const fn psr_iicmode(&self) -> &PSR_IICMODE { - unsafe { &*(self as *const Self).cast::().add(72usize).cast() } + unsafe { &*(self as *const Self).cast::().add(72).cast() } } #[doc = "0x48 - Protocol Status Register \\[SSC Mode\\]"] #[inline(always)] pub const fn psr_sscmode(&self) -> &PSR_SSCMODE { - unsafe { &*(self as *const Self).cast::().add(72usize).cast() } + unsafe { &*(self as *const Self).cast::().add(72).cast() } } #[doc = "0x48 - Protocol Status Register \\[ASC Mode\\]"] #[inline(always)] pub const fn psr_ascmode(&self) -> &PSR_ASCMODE { - unsafe { &*(self as *const Self).cast::().add(72usize).cast() } + unsafe { &*(self as *const Self).cast::().add(72).cast() } } #[doc = "0x48 - Protocol Status Register"] #[inline(always)] pub const fn psr(&self) -> &PSR { - unsafe { &*(self as *const Self).cast::().add(72usize).cast() } + unsafe { &*(self as *const Self).cast::().add(72).cast() } + } + #[doc = "0x4c - Protocol Status Clear Register"] + #[inline(always)] + pub const fn pscr(&self) -> &PSCR { + &self.pscr + } + #[doc = "0x50 - Receiver Buffer Status Register"] + #[inline(always)] + pub const fn rbufsr(&self) -> &RBUFSR { + &self.rbufsr + } + #[doc = "0x54 - Receiver Buffer Register"] + #[inline(always)] + pub const fn rbuf(&self) -> &RBUF { + &self.rbuf + } + #[doc = "0x58 - Receiver Buffer Register for Debugger"] + #[inline(always)] + pub const fn rbufd(&self) -> &RBUFD { + &self.rbufd + } + #[doc = "0x5c - Receiver Buffer Register 0"] + #[inline(always)] + pub const fn rbuf0(&self) -> &RBUF0 { + &self.rbuf0 + } + #[doc = "0x60 - Receiver Buffer Register 1"] + #[inline(always)] + pub const fn rbuf1(&self) -> &RBUF1 { + &self.rbuf1 + } + #[doc = "0x64 - Receiver Buffer 01 Status Register"] + #[inline(always)] + pub const fn rbuf01sr(&self) -> &RBUF01SR { + &self.rbuf01sr + } + #[doc = "0x68 - Flag Modification Register"] + #[inline(always)] + pub const fn fmr(&self) -> &FMR { + &self.fmr + } + #[doc = "0x80..0x100 - Transmit Buffer"] + #[inline(always)] + pub const fn tbuf(&self, n: usize) -> &TBUF { + &self.tbuf[n] + } + #[doc = "0x100 - Bypass Data Register"] + #[inline(always)] + pub const fn byp(&self) -> &BYP { + &self.byp + } + #[doc = "0x104 - Bypass Control Register"] + #[inline(always)] + pub const fn bypcr(&self) -> &BYPCR { + &self.bypcr + } + #[doc = "0x108 - Transmitter Buffer Control Register"] + #[inline(always)] + pub const fn tbctr(&self) -> &TBCTR { + &self.tbctr + } + #[doc = "0x10c - Receiver Buffer Control Register"] + #[inline(always)] + pub const fn rbctr(&self) -> &RBCTR { + &self.rbctr + } + #[doc = "0x110 - Transmit/Receive Buffer Pointer Register"] + #[inline(always)] + pub const fn trbptr(&self) -> &TRBPTR { + &self.trbptr + } + #[doc = "0x114 - Transmit/Receive Buffer Status Register"] + #[inline(always)] + pub const fn trbsr(&self) -> &TRBSR { + &self.trbsr + } + #[doc = "0x118 - Transmit/Receive Buffer Status Clear Register"] + #[inline(always)] + pub const fn trbscr(&self) -> &TRBSCR { + &self.trbscr + } + #[doc = "0x11c - Receiver Buffer Output Register"] + #[inline(always)] + pub const fn outr(&self) -> &OUTR { + &self.outr + } + #[doc = "0x120 - Receiver Buffer Output Register L for Debugger"] + #[inline(always)] + pub const fn outdr(&self) -> &OUTDR { + &self.outdr + } + #[doc = "0x180..0x200 - Transmit FIFO Buffer"] + #[inline(always)] + pub const fn in_(&self, n: usize) -> &IN { + &self.in_[n] } } -#[doc = "CCFG (r) register accessor: an alias for `Reg`"] +#[doc = "CCFG (r) register accessor: Channel Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccfg::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ccfg`] +module"] pub type CCFG = crate::Reg; #[doc = "Channel Configuration Register"] pub mod ccfg; -#[doc = "KSCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "KSCFG (rw) register accessor: Kernel State Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`kscfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`kscfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@kscfg`] +module"] pub type KSCFG = crate::Reg; #[doc = "Kernel State Configuration Register"] pub mod kscfg; -#[doc = "FDR (rw) register accessor: an alias for `Reg`"] +#[doc = "FDR (rw) register accessor: Fractional Divider Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fdr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fdr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fdr`] +module"] pub type FDR = crate::Reg; #[doc = "Fractional Divider Register"] pub mod fdr; -#[doc = "BRG (rw) register accessor: an alias for `Reg`"] +#[doc = "BRG (rw) register accessor: Baud Rate Generator Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@brg`] +module"] pub type BRG = crate::Reg; #[doc = "Baud Rate Generator Register"] pub mod brg; -#[doc = "INPR (rw) register accessor: an alias for `Reg`"] +#[doc = "INPR (rw) register accessor: Interrupt Node Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`inpr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`inpr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@inpr`] +module"] pub type INPR = crate::Reg; #[doc = "Interrupt Node Pointer Register"] pub mod inpr; -#[doc = "DX0CR (rw) register accessor: an alias for `Reg`"] +#[doc = "DX0CR (rw) register accessor: Input Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx0cr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx0cr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dx0cr`] +module"] pub type DX0CR = crate::Reg; #[doc = "Input Control Register 0"] pub mod dx0cr; -#[doc = "DX1CR (rw) register accessor: an alias for `Reg`"] +#[doc = "DX1CR (rw) register accessor: Input Control Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx1cr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx1cr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dx1cr`] +module"] pub type DX1CR = crate::Reg; #[doc = "Input Control Register 1"] pub mod dx1cr; -#[doc = "DX2CR (rw) register accessor: an alias for `Reg`"] +#[doc = "DX2CR (rw) register accessor: Input Control Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx2cr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx2cr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dx2cr`] +module"] pub type DX2CR = crate::Reg; #[doc = "Input Control Register 2"] pub mod dx2cr; -#[doc = "DX3CR (rw) register accessor: an alias for `Reg`"] +#[doc = "DX3CR (rw) register accessor: Input Control Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx3cr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx3cr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dx3cr`] +module"] pub type DX3CR = crate::Reg; #[doc = "Input Control Register 3"] pub mod dx3cr; -#[doc = "DX4CR (rw) register accessor: an alias for `Reg`"] +#[doc = "DX4CR (rw) register accessor: Input Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx4cr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx4cr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dx4cr`] +module"] pub type DX4CR = crate::Reg; #[doc = "Input Control Register 4"] pub mod dx4cr; -#[doc = "DX5CR (rw) register accessor: an alias for `Reg`"] +#[doc = "DX5CR (rw) register accessor: Input Control Register 5\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx5cr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx5cr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dx5cr`] +module"] pub type DX5CR = crate::Reg; #[doc = "Input Control Register 5"] pub mod dx5cr; -#[doc = "SCTR (rw) register accessor: an alias for `Reg`"] +#[doc = "SCTR (rw) register accessor: Shift Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sctr`] +module"] pub type SCTR = crate::Reg; #[doc = "Shift Control Register"] pub mod sctr; -#[doc = "TCSR (rw) register accessor: an alias for `Reg`"] +#[doc = "TCSR (rw) register accessor: Transmit Control/Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tcsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tcsr`] +module"] pub type TCSR = crate::Reg; #[doc = "Transmit Control/Status Register"] pub mod tcsr; -#[doc = "PCR (rw) register accessor: an alias for `Reg`"] +#[doc = "PCR (rw) register accessor: Protocol Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pcr`] +module"] pub type PCR = crate::Reg; #[doc = "Protocol Control Register"] pub mod pcr; -#[doc = "PCR_ASCMode (rw) register accessor: an alias for `Reg`"] +#[doc = "PCR_ASCMode (rw) register accessor: Protocol Control Register \\[ASC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr_ascmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr_ascmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pcr_ascmode`] +module"] pub type PCR_ASCMODE = crate::Reg; #[doc = "Protocol Control Register \\[ASC Mode\\]"] pub mod pcr_ascmode; -#[doc = "PCR_SSCMode (rw) register accessor: an alias for `Reg`"] +#[doc = "PCR_SSCMode (rw) register accessor: Protocol Control Register \\[SSC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr_sscmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr_sscmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pcr_sscmode`] +module"] pub type PCR_SSCMODE = crate::Reg; #[doc = "Protocol Control Register \\[SSC Mode\\]"] pub mod pcr_sscmode; -#[doc = "PCR_IICMode (rw) register accessor: an alias for `Reg`"] +#[doc = "PCR_IICMode (rw) register accessor: Protocol Control Register \\[IIC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr_iicmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr_iicmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pcr_iicmode`] +module"] pub type PCR_IICMODE = crate::Reg; #[doc = "Protocol Control Register \\[IIC Mode\\]"] pub mod pcr_iicmode; -#[doc = "PCR_IISMode (rw) register accessor: an alias for `Reg`"] +#[doc = "PCR_IISMode (rw) register accessor: Protocol Control Register \\[IIS Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr_iismode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr_iismode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pcr_iismode`] +module"] pub type PCR_IISMODE = crate::Reg; #[doc = "Protocol Control Register \\[IIS Mode\\]"] pub mod pcr_iismode; -#[doc = "CCR (rw) register accessor: an alias for `Reg`"] +#[doc = "CCR (rw) register accessor: Channel Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ccr`] +module"] pub type CCR = crate::Reg; #[doc = "Channel Control Register"] pub mod ccr; -#[doc = "CMTR (rw) register accessor: an alias for `Reg`"] +#[doc = "CMTR (rw) register accessor: Capture Mode Timer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cmtr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cmtr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cmtr`] +module"] pub type CMTR = crate::Reg; #[doc = "Capture Mode Timer Register"] pub mod cmtr; -#[doc = "PSR (rw) register accessor: an alias for `Reg`"] +#[doc = "PSR (rw) register accessor: Protocol Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psr`] +module"] pub type PSR = crate::Reg; #[doc = "Protocol Status Register"] pub mod psr; -#[doc = "PSR_ASCMode (rw) register accessor: an alias for `Reg`"] +#[doc = "PSR_ASCMode (rw) register accessor: Protocol Status Register \\[ASC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr_ascmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr_ascmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psr_ascmode`] +module"] pub type PSR_ASCMODE = crate::Reg; #[doc = "Protocol Status Register \\[ASC Mode\\]"] pub mod psr_ascmode; -#[doc = "PSR_SSCMode (rw) register accessor: an alias for `Reg`"] +#[doc = "PSR_SSCMode (rw) register accessor: Protocol Status Register \\[SSC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr_sscmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr_sscmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psr_sscmode`] +module"] pub type PSR_SSCMODE = crate::Reg; #[doc = "Protocol Status Register \\[SSC Mode\\]"] pub mod psr_sscmode; -#[doc = "PSR_IICMode (rw) register accessor: an alias for `Reg`"] +#[doc = "PSR_IICMode (rw) register accessor: Protocol Status Register \\[IIC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr_iicmode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr_iicmode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psr_iicmode`] +module"] pub type PSR_IICMODE = crate::Reg; #[doc = "Protocol Status Register \\[IIC Mode\\]"] pub mod psr_iicmode; -#[doc = "PSR_IISMode (rw) register accessor: an alias for `Reg`"] +#[doc = "PSR_IISMode (rw) register accessor: Protocol Status Register \\[IIS Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr_iismode::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr_iismode::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@psr_iismode`] +module"] pub type PSR_IISMODE = crate::Reg; #[doc = "Protocol Status Register \\[IIS Mode\\]"] pub mod psr_iismode; -#[doc = "PSCR (w) register accessor: an alias for `Reg`"] +#[doc = "PSCR (w) register accessor: Protocol Status Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pscr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@pscr`] +module"] pub type PSCR = crate::Reg; #[doc = "Protocol Status Clear Register"] pub mod pscr; -#[doc = "RBUFSR (r) register accessor: an alias for `Reg`"] +#[doc = "RBUFSR (r) register accessor: Receiver Buffer Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbufsr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rbufsr`] +module"] pub type RBUFSR = crate::Reg; #[doc = "Receiver Buffer Status Register"] pub mod rbufsr; -#[doc = "RBUF (r) register accessor: an alias for `Reg`"] +#[doc = "RBUF (r) register accessor: Receiver Buffer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbuf::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rbuf`] +module"] pub type RBUF = crate::Reg; #[doc = "Receiver Buffer Register"] pub mod rbuf; -#[doc = "RBUFD (r) register accessor: an alias for `Reg`"] +#[doc = "RBUFD (r) register accessor: Receiver Buffer Register for Debugger\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbufd::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rbufd`] +module"] pub type RBUFD = crate::Reg; #[doc = "Receiver Buffer Register for Debugger"] pub mod rbufd; -#[doc = "RBUF0 (r) register accessor: an alias for `Reg`"] +#[doc = "RBUF0 (r) register accessor: Receiver Buffer Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbuf0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rbuf0`] +module"] pub type RBUF0 = crate::Reg; #[doc = "Receiver Buffer Register 0"] pub mod rbuf0; -#[doc = "RBUF1 (r) register accessor: an alias for `Reg`"] +#[doc = "RBUF1 (r) register accessor: Receiver Buffer Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbuf1::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rbuf1`] +module"] pub type RBUF1 = crate::Reg; #[doc = "Receiver Buffer Register 1"] pub mod rbuf1; -#[doc = "RBUF01SR (r) register accessor: an alias for `Reg`"] +#[doc = "RBUF01SR (r) register accessor: Receiver Buffer 01 Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbuf01sr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rbuf01sr`] +module"] pub type RBUF01SR = crate::Reg; #[doc = "Receiver Buffer 01 Status Register"] pub mod rbuf01sr; -#[doc = "FMR (w) register accessor: an alias for `Reg`"] +#[doc = "FMR (w) register accessor: Flag Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fmr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@fmr`] +module"] pub type FMR = crate::Reg; #[doc = "Flag Modification Register"] pub mod fmr; -#[doc = "TBUF (rw) register accessor: an alias for `Reg`"] +#[doc = "TBUF (rw) register accessor: Transmit Buffer\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tbuf::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tbuf::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tbuf`] +module"] pub type TBUF = crate::Reg; #[doc = "Transmit Buffer"] pub mod tbuf; -#[doc = "BYP (rw) register accessor: an alias for `Reg`"] +#[doc = "BYP (rw) register accessor: Bypass Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`byp::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`byp::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@byp`] +module"] pub type BYP = crate::Reg; #[doc = "Bypass Data Register"] pub mod byp; -#[doc = "BYPCR (rw) register accessor: an alias for `Reg`"] +#[doc = "BYPCR (rw) register accessor: Bypass Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bypcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bypcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bypcr`] +module"] pub type BYPCR = crate::Reg; #[doc = "Bypass Control Register"] pub mod bypcr; -#[doc = "TBCTR (rw) register accessor: an alias for `Reg`"] +#[doc = "TBCTR (rw) register accessor: Transmitter Buffer Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tbctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tbctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tbctr`] +module"] pub type TBCTR = crate::Reg; #[doc = "Transmitter Buffer Control Register"] pub mod tbctr; -#[doc = "RBCTR (rw) register accessor: an alias for `Reg`"] +#[doc = "RBCTR (rw) register accessor: Receiver Buffer Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rbctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rbctr`] +module"] pub type RBCTR = crate::Reg; #[doc = "Receiver Buffer Control Register"] pub mod rbctr; -#[doc = "TRBPTR (r) register accessor: an alias for `Reg`"] +#[doc = "TRBPTR (r) register accessor: Transmit/Receive Buffer Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trbptr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@trbptr`] +module"] pub type TRBPTR = crate::Reg; #[doc = "Transmit/Receive Buffer Pointer Register"] pub mod trbptr; -#[doc = "TRBSR (rw) register accessor: an alias for `Reg`"] +#[doc = "TRBSR (rw) register accessor: Transmit/Receive Buffer Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trbsr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trbsr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@trbsr`] +module"] pub type TRBSR = crate::Reg; #[doc = "Transmit/Receive Buffer Status Register"] pub mod trbsr; -#[doc = "TRBSCR (w) register accessor: an alias for `Reg`"] +#[doc = "TRBSCR (w) register accessor: Transmit/Receive Buffer Status Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trbscr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@trbscr`] +module"] pub type TRBSCR = crate::Reg; #[doc = "Transmit/Receive Buffer Status Clear Register"] pub mod trbscr; -#[doc = "OUTR (r) register accessor: an alias for `Reg`"] +#[doc = "OUTR (r) register accessor: Receiver Buffer Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`outr::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@outr`] +module"] pub type OUTR = crate::Reg; #[doc = "Receiver Buffer Output Register"] pub mod outr; -#[doc = "OUTDR (r) register accessor: an alias for `Reg`"] +#[doc = "OUTDR (r) register accessor: Receiver Buffer Output Register L for Debugger\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`outdr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@outdr`] +module"] pub type OUTDR = crate::Reg; #[doc = "Receiver Buffer Output Register L for Debugger"] pub mod outdr; -#[doc = "IN (w) register accessor: an alias for `Reg`"] +#[doc = "IN (w) register accessor: Transmit FIFO Buffer\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`in_::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@in_`] +module"] 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 d51202ff..1db4d5fb 100644 --- a/src/usic0_ch0/brg.rs +++ b/src/usic0_ch0/brg.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CLKSEL` reader - Clock Selection"] -pub type CLKSEL_R = crate::FieldReader; +pub type CLKSEL_R = crate::FieldReader; #[doc = "Clock Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CLKSEL_A { + type Ux = u8; +} impl CLKSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CLKSEL_A::VALUE1), 2 => Some(CLKSEL_A::VALUE3), @@ -64,38 +35,42 @@ impl CLKSEL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The fractional divider frequency fFD is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CLKSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The trigger signal DX1T defines fPIN. Signal MCLK toggles with fPIN."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CLKSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Signal MCLK corresponds to the DX1S signal and the frequency fPIN is derived from the rising edges of DX1S."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CLKSEL_A::VALUE4 } } #[doc = "Field `CLKSEL` writer - Clock Selection"] -pub type CLKSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BRG_SPEC, u8, CLKSEL_A, 2, O>; -impl<'a, const O: u8> CLKSEL_W<'a, O> { +pub type CLKSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 2, CLKSEL_A>; +impl<'a, REG> CLKSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The fractional divider frequency fFD is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CLKSEL_A::VALUE1) } #[doc = "The trigger signal DX1T defines fPIN. Signal MCLK toggles with fPIN."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CLKSEL_A::VALUE3) } #[doc = "Signal MCLK corresponds to the DX1S signal and the frequency fPIN is derived from the rising edges of DX1S."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CLKSEL_A::VALUE4) } } @@ -118,34 +93,37 @@ impl From for bool { impl TMEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TMEN_A { + pub const fn variant(&self) -> TMEN_A { match self.bits { false => TMEN_A::VALUE1, true => TMEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Timing measurement is disabled: The trigger signals DX0T and DX1T are ignored."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TMEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timing measurement is enabled: The 10-bit counter is incremented by 1 with fPPP and stops counting when reaching its maximum value. If one of the trigger signals DX0T or DX1T become active, the counter value is captured into bit field CTV, the counter is cleared and a transmit shift event is generated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TMEN_A::VALUE2 } } #[doc = "Field `TMEN` writer - Timing Measurement Enable"] -pub type TMEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRG_SPEC, TMEN_A, O>; -impl<'a, const O: u8> TMEN_W<'a, O> { +pub type TMEN_W<'a, REG> = crate::BitWriter<'a, REG, TMEN_A>; +impl<'a, REG> TMEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Timing measurement is disabled: The trigger signals DX0T and DX1T are ignored."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TMEN_A::VALUE1) } #[doc = "Timing measurement is enabled: The 10-bit counter is incremented by 1 with fPPP and stops counting when reaching its maximum value. If one of the trigger signals DX0T or DX1T become active, the counter value is captured into bit field CTV, the counter is cleared and a transmit shift event is generated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TMEN_A::VALUE2) } } @@ -168,39 +146,42 @@ impl From for bool { impl PPPEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PPPEN_A { + pub const fn variant(&self) -> PPPEN_A { match self.bits { false => PPPEN_A::VALUE1, true => PPPEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The 2:1 divider for fPPP is disabled. fPPP = fPIN"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PPPEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The 2:1 divider for fPPP is enabled. fPPP = fMCLK = fPIN / 2."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PPPEN_A::VALUE2 } } #[doc = "Field `PPPEN` writer - Enable 2:1 Divider for fPPP"] -pub type PPPEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRG_SPEC, PPPEN_A, O>; -impl<'a, const O: u8> PPPEN_W<'a, O> { +pub type PPPEN_W<'a, REG> = crate::BitWriter<'a, REG, PPPEN_A>; +impl<'a, REG> PPPEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The 2:1 divider for fPPP is disabled. fPPP = fPIN"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PPPEN_A::VALUE1) } #[doc = "The 2:1 divider for fPPP is enabled. fPPP = fMCLK = fPIN / 2."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PPPEN_A::VALUE2) } } #[doc = "Field `CTQSEL` reader - Input Selection for CTQ"] -pub type CTQSEL_R = crate::FieldReader; +pub type CTQSEL_R = crate::FieldReader; #[doc = "Input Selection for CTQ\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -220,10 +201,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CTQSEL_A { + type Ux = u8; +} impl CTQSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CTQSEL_A { + pub const fn variant(&self) -> CTQSEL_A { match self.bits { 0 => CTQSEL_A::VALUE1, 1 => CTQSEL_A::VALUE2, @@ -232,63 +216,67 @@ impl CTQSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fCTQIN = fPDIV"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CTQSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fCTQIN = fPPP"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CTQSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fCTQIN = fSCLK"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CTQSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "fCTQIN = fMCLK"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CTQSEL_A::VALUE4 } } #[doc = "Field `CTQSEL` writer - Input Selection for CTQ"] -pub type CTQSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, BRG_SPEC, u8, CTQSEL_A, 2, O>; -impl<'a, const O: u8> CTQSEL_W<'a, O> { +pub type CTQSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CTQSEL_A>; +impl<'a, REG> CTQSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fCTQIN = fPDIV"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTQSEL_A::VALUE1) } #[doc = "fCTQIN = fPPP"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTQSEL_A::VALUE2) } #[doc = "fCTQIN = fSCLK"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CTQSEL_A::VALUE3) } #[doc = "fCTQIN = fMCLK"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CTQSEL_A::VALUE4) } } #[doc = "Field `PCTQ` reader - Pre-Divider for Time Quanta Counter"] -pub type PCTQ_R = crate::FieldReader; +pub type PCTQ_R = crate::FieldReader; #[doc = "Field `PCTQ` writer - Pre-Divider for Time Quanta Counter"] -pub type PCTQ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BRG_SPEC, u8, u8, 2, O>; +pub type PCTQ_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `DCTQ` reader - Denominator for Time Quanta Counter"] -pub type DCTQ_R = crate::FieldReader; +pub type DCTQ_R = crate::FieldReader; #[doc = "Field `DCTQ` writer - Denominator for Time Quanta Counter"] -pub type DCTQ_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BRG_SPEC, u8, u8, 5, O>; +pub type DCTQ_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PDIV` reader - Divider Mode: Divider Factor to Generate fPDIV"] -pub type PDIV_R = crate::FieldReader; +pub type PDIV_R = crate::FieldReader; #[doc = "Field `PDIV` writer - Divider Mode: Divider Factor to Generate fPDIV"] -pub type PDIV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BRG_SPEC, u16, u16, 10, O>; +pub type PDIV_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `SCLKOSEL` reader - Shift Clock Output Select"] pub type SCLKOSEL_R = crate::BitReader; #[doc = "Shift Clock Output Select\n\nValue on reset: 0"] @@ -308,34 +296,37 @@ impl From for bool { impl SCLKOSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCLKOSEL_A { + pub const fn variant(&self) -> SCLKOSEL_A { match self.bits { false => SCLKOSEL_A::VALUE1, true => SCLKOSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "SCLK from the baud rate generator is selected as the SCLKOUT input source."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCLKOSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transmit shift clock from DX1 input stage is selected as the SCLKOUT input source."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCLKOSEL_A::VALUE2 } } #[doc = "Field `SCLKOSEL` writer - Shift Clock Output Select"] -pub type SCLKOSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRG_SPEC, SCLKOSEL_A, O>; -impl<'a, const O: u8> SCLKOSEL_W<'a, O> { +pub type SCLKOSEL_W<'a, REG> = crate::BitWriter<'a, REG, SCLKOSEL_A>; +impl<'a, REG> SCLKOSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "SCLK from the baud rate generator is selected as the SCLKOUT input source."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCLKOSEL_A::VALUE1) } #[doc = "The transmit shift clock from DX1 input stage is selected as the SCLKOUT input source."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCLKOSEL_A::VALUE2) } } @@ -358,39 +349,42 @@ impl From for bool { impl MCLKCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCLKCFG_A { + pub const fn variant(&self) -> MCLKCFG_A { match self.bits { false => MCLKCFG_A::VALUE1, true => MCLKCFG_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The passive level is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCLKCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The passive level is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCLKCFG_A::VALUE2 } } #[doc = "Field `MCLKCFG` writer - Master Clock Configuration"] -pub type MCLKCFG_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRG_SPEC, MCLKCFG_A, O>; -impl<'a, const O: u8> MCLKCFG_W<'a, O> { +pub type MCLKCFG_W<'a, REG> = crate::BitWriter<'a, REG, MCLKCFG_A>; +impl<'a, REG> MCLKCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The passive level is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCLKCFG_A::VALUE1) } #[doc = "The passive level is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCLKCFG_A::VALUE2) } } #[doc = "Field `SCLKCFG` reader - Shift Clock Output Configuration"] -pub type SCLKCFG_R = crate::FieldReader; +pub type SCLKCFG_R = crate::FieldReader; #[doc = "Shift Clock Output Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -410,10 +404,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SCLKCFG_A { + type Ux = u8; +} impl SCLKCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCLKCFG_A { + pub const fn variant(&self) -> SCLKCFG_A { match self.bits { 0 => SCLKCFG_A::VALUE1, 1 => SCLKCFG_A::VALUE2, @@ -422,48 +419,52 @@ impl SCLKCFG_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The passive level is 0 and the delay is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCLKCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The passive level is 1 and the delay is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCLKCFG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The passive level is 0 and the delay is enabled."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SCLKCFG_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The passive level is 1 and the delay is enabled."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SCLKCFG_A::VALUE4 } } #[doc = "Field `SCLKCFG` writer - Shift Clock Output Configuration"] -pub type SCLKCFG_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, BRG_SPEC, u8, SCLKCFG_A, 2, O>; -impl<'a, const O: u8> SCLKCFG_W<'a, O> { +pub type SCLKCFG_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, SCLKCFG_A>; +impl<'a, REG> SCLKCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The passive level is 0 and the delay is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCLKCFG_A::VALUE1) } #[doc = "The passive level is 1 and the delay is disabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCLKCFG_A::VALUE2) } #[doc = "The passive level is 0 and the delay is enabled."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SCLKCFG_A::VALUE3) } #[doc = "The passive level is 1 and the delay is enabled."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SCLKCFG_A::VALUE4) } } @@ -523,82 +524,83 @@ impl W { #[doc = "Bits 0:1 - Clock Selection"] #[inline(always)] #[must_use] - pub fn clksel(&mut self) -> CLKSEL_W<0> { - CLKSEL_W::new(self) + pub fn clksel(&mut self) -> CLKSEL_W { + CLKSEL_W::new(self, 0) } #[doc = "Bit 3 - Timing Measurement Enable"] #[inline(always)] #[must_use] - pub fn tmen(&mut self) -> TMEN_W<3> { - TMEN_W::new(self) + pub fn tmen(&mut self) -> TMEN_W { + TMEN_W::new(self, 3) } #[doc = "Bit 4 - Enable 2:1 Divider for fPPP"] #[inline(always)] #[must_use] - pub fn pppen(&mut self) -> PPPEN_W<4> { - PPPEN_W::new(self) + pub fn pppen(&mut self) -> PPPEN_W { + PPPEN_W::new(self, 4) } #[doc = "Bits 6:7 - Input Selection for CTQ"] #[inline(always)] #[must_use] - pub fn ctqsel(&mut self) -> CTQSEL_W<6> { - CTQSEL_W::new(self) + pub fn ctqsel(&mut self) -> CTQSEL_W { + CTQSEL_W::new(self, 6) } #[doc = "Bits 8:9 - Pre-Divider for Time Quanta Counter"] #[inline(always)] #[must_use] - pub fn pctq(&mut self) -> PCTQ_W<8> { - PCTQ_W::new(self) + pub fn pctq(&mut self) -> PCTQ_W { + PCTQ_W::new(self, 8) } #[doc = "Bits 10:14 - Denominator for Time Quanta Counter"] #[inline(always)] #[must_use] - pub fn dctq(&mut self) -> DCTQ_W<10> { - DCTQ_W::new(self) + pub fn dctq(&mut self) -> DCTQ_W { + DCTQ_W::new(self, 10) } #[doc = "Bits 16:25 - Divider Mode: Divider Factor to Generate fPDIV"] #[inline(always)] #[must_use] - pub fn pdiv(&mut self) -> PDIV_W<16> { - PDIV_W::new(self) + pub fn pdiv(&mut self) -> PDIV_W { + PDIV_W::new(self, 16) } #[doc = "Bit 28 - Shift Clock Output Select"] #[inline(always)] #[must_use] - pub fn sclkosel(&mut self) -> SCLKOSEL_W<28> { - SCLKOSEL_W::new(self) + pub fn sclkosel(&mut self) -> SCLKOSEL_W { + SCLKOSEL_W::new(self, 28) } #[doc = "Bit 29 - Master Clock Configuration"] #[inline(always)] #[must_use] - pub fn mclkcfg(&mut self) -> MCLKCFG_W<29> { - MCLKCFG_W::new(self) + pub fn mclkcfg(&mut self) -> MCLKCFG_W { + MCLKCFG_W::new(self, 29) } #[doc = "Bits 30:31 - Shift Clock Output Configuration"] #[inline(always)] #[must_use] - pub fn sclkcfg(&mut self) -> SCLKCFG_W<30> { - SCLKCFG_W::new(self) + pub fn sclkcfg(&mut self) -> SCLKCFG_W { + SCLKCFG_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Baud Rate Generator Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`brg::R`](R) reader structure"] +impl crate::Readable for BRG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`brg::W`](W) writer structure"] impl crate::Writable for BRG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/byp.rs b/src/usic0_ch0/byp.rs index a557300c..4738fc20 100644 --- a/src/usic0_ch0/byp.rs +++ b/src/usic0_ch0/byp.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BDATA` reader - Bypass Data"] -pub type BDATA_R = crate::FieldReader; +pub type BDATA_R = crate::FieldReader; #[doc = "Field `BDATA` writer - Bypass Data"] -pub type BDATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BYP_SPEC, u16, u16, 16, O>; +pub type BDATA_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Bypass Data"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Bypass Data"] #[inline(always)] #[must_use] - pub fn bdata(&mut self) -> BDATA_W<0> { - BDATA_W::new(self) + pub fn bdata(&mut self) -> BDATA_W { + BDATA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Bypass Data Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`byp::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`byp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`byp::R`](R) reader structure"] +impl crate::Readable for BYP_SPEC {} +#[doc = "`write(|w| ..)` method takes [`byp::W`](W) writer structure"] impl crate::Writable for BYP_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/bypcr.rs b/src/usic0_ch0/bypcr.rs index a6114b76..058e5bf5 100644 --- a/src/usic0_ch0/bypcr.rs +++ b/src/usic0_ch0/bypcr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BWLE` reader - Bypass Word Length"] -pub type BWLE_R = crate::FieldReader; +pub type BWLE_R = crate::FieldReader; #[doc = "Field `BWLE` writer - Bypass Word Length"] -pub type BWLE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BYPCR_SPEC, u8, u8, 4, O>; +pub type BWLE_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `BDSSM` reader - Bypass Data Single Shot Mode"] pub type BDSSM_R = crate::BitReader; #[doc = "Bypass Data Single Shot Mode\n\nValue on reset: 0"] @@ -57,39 +25,42 @@ impl From for bool { impl BDSSM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BDSSM_A { + pub const fn variant(&self) -> BDSSM_A { match self.bits { false => BDSSM_A::VALUE1, true => BDSSM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == BDSSM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The bypass data is considered as invalid after it has been loaded into TBUF. The loading of the data into TBUF clears BDV."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BDSSM_A::VALUE2 } } #[doc = "Field `BDSSM` writer - Bypass Data Single Shot Mode"] -pub type BDSSM_W<'a, const O: u8> = crate::BitWriter<'a, u32, BYPCR_SPEC, BDSSM_A, O>; -impl<'a, const O: u8> BDSSM_W<'a, O> { +pub type BDSSM_W<'a, REG> = crate::BitWriter<'a, REG, BDSSM_A>; +impl<'a, REG> BDSSM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BDSSM_A::VALUE1) } #[doc = "The bypass data is considered as invalid after it has been loaded into TBUF. The loading of the data into TBUF clears BDV."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BDSSM_A::VALUE2) } } #[doc = "Field `BDEN` reader - Bypass Data Enable"] -pub type BDEN_R = crate::FieldReader; +pub type BDEN_R = crate::FieldReader; #[doc = "Bypass Data Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -109,10 +80,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BDEN_A { + type Ux = u8; +} impl BDEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BDEN_A { + pub const fn variant(&self) -> BDEN_A { match self.bits { 0 => BDEN_A::VALUE1, 1 => BDEN_A::VALUE2, @@ -121,48 +95,52 @@ impl BDEN_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transfer of bypass data is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BDEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transfer of bypass data to TBUF is possible. Bypass data will be transferred to TBUF according to its priority if BDV = 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BDEN_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Gated bypass data transfer is enabled. Bypass data will be transferred to TBUF according to its priority if BDV = 1 and while DX2S = 0."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BDEN_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Gated bypass data transfer is enabled. Bypass data will be transferred to TBUF according to its priority if BDV = 1 and while DX2S = 1."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BDEN_A::VALUE4 } } #[doc = "Field `BDEN` writer - Bypass Data Enable"] -pub type BDEN_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, BYPCR_SPEC, u8, BDEN_A, 2, O>; -impl<'a, const O: u8> BDEN_W<'a, O> { +pub type BDEN_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, BDEN_A>; +impl<'a, REG> BDEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The transfer of bypass data is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BDEN_A::VALUE1) } #[doc = "The transfer of bypass data to TBUF is possible. Bypass data will be transferred to TBUF according to its priority if BDV = 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BDEN_A::VALUE2) } #[doc = "Gated bypass data transfer is enabled. Bypass data will be transferred to TBUF according to its priority if BDV = 1 and while DX2S = 0."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BDEN_A::VALUE3) } #[doc = "Gated bypass data transfer is enabled. Bypass data will be transferred to TBUF according to its priority if BDV = 1 and while DX2S = 1."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BDEN_A::VALUE4) } } @@ -185,34 +163,37 @@ impl From for bool { impl BDVTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BDVTR_A { + pub const fn variant(&self) -> BDVTR_A { match self.bits { false => BDVTR_A::VALUE1, true => BDVTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Bit BDV is not influenced by DX2T."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BDVTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bit BDV is set if DX2T is active."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BDVTR_A::VALUE2 } } #[doc = "Field `BDVTR` writer - Bypass Data Valid Trigger"] -pub type BDVTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, BYPCR_SPEC, BDVTR_A, O>; -impl<'a, const O: u8> BDVTR_W<'a, O> { +pub type BDVTR_W<'a, REG> = crate::BitWriter<'a, REG, BDVTR_A>; +impl<'a, REG> BDVTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Bit BDV is not influenced by DX2T."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BDVTR_A::VALUE1) } #[doc = "Bit BDV is set if DX2T is active."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BDVTR_A::VALUE2) } } @@ -235,34 +216,37 @@ impl From for bool { impl BPRIO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BPRIO_A { + pub const fn variant(&self) -> BPRIO_A { match self.bits { false => BPRIO_A::VALUE1, true => BPRIO_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmit FIFO data has a higher priority than the bypass data."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BPRIO_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The bypass data has a higher priority than the transmit FIFO data."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BPRIO_A::VALUE2 } } #[doc = "Field `BPRIO` writer - Bypass Priority"] -pub type BPRIO_W<'a, const O: u8> = crate::BitWriter<'a, u32, BYPCR_SPEC, BPRIO_A, O>; -impl<'a, const O: u8> BPRIO_W<'a, O> { +pub type BPRIO_W<'a, REG> = crate::BitWriter<'a, REG, BPRIO_A>; +impl<'a, REG> BPRIO_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The transmit FIFO data has a higher priority than the bypass data."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BPRIO_A::VALUE1) } #[doc = "The bypass data has a higher priority than the transmit FIFO data."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BPRIO_A::VALUE2) } } @@ -285,31 +269,31 @@ impl From for bool { impl BDV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BDV_A { + pub const fn variant(&self) -> BDV_A { match self.bits { false => BDV_A::VALUE1, true => BDV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The bypass data is not valid."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BDV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The bypass data is valid."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BDV_A::VALUE2 } } #[doc = "Field `BSELO` reader - Bypass Select Outputs"] -pub type BSELO_R = crate::FieldReader; +pub type BSELO_R = crate::FieldReader; #[doc = "Field `BSELO` writer - Bypass Select Outputs"] -pub type BSELO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BYPCR_SPEC, u8, u8, 5, O>; +pub type BSELO_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `BHPC` reader - Bypass Hardware Port Control"] -pub type BHPC_R = crate::FieldReader; +pub type BHPC_R = crate::FieldReader; #[doc = "Field `BHPC` writer - Bypass Hardware Port Control"] -pub type BHPC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BYPCR_SPEC, u8, u8, 3, O>; +pub type BHPC_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:3 - Bypass Word Length"] #[inline(always)] @@ -356,64 +340,65 @@ impl W { #[doc = "Bits 0:3 - Bypass Word Length"] #[inline(always)] #[must_use] - pub fn bwle(&mut self) -> BWLE_W<0> { - BWLE_W::new(self) + pub fn bwle(&mut self) -> BWLE_W { + BWLE_W::new(self, 0) } #[doc = "Bit 8 - Bypass Data Single Shot Mode"] #[inline(always)] #[must_use] - pub fn bdssm(&mut self) -> BDSSM_W<8> { - BDSSM_W::new(self) + pub fn bdssm(&mut self) -> BDSSM_W { + BDSSM_W::new(self, 8) } #[doc = "Bits 10:11 - Bypass Data Enable"] #[inline(always)] #[must_use] - pub fn bden(&mut self) -> BDEN_W<10> { - BDEN_W::new(self) + pub fn bden(&mut self) -> BDEN_W { + BDEN_W::new(self, 10) } #[doc = "Bit 12 - Bypass Data Valid Trigger"] #[inline(always)] #[must_use] - pub fn bdvtr(&mut self) -> BDVTR_W<12> { - BDVTR_W::new(self) + pub fn bdvtr(&mut self) -> BDVTR_W { + BDVTR_W::new(self, 12) } #[doc = "Bit 13 - Bypass Priority"] #[inline(always)] #[must_use] - pub fn bprio(&mut self) -> BPRIO_W<13> { - BPRIO_W::new(self) + pub fn bprio(&mut self) -> BPRIO_W { + BPRIO_W::new(self, 13) } #[doc = "Bits 16:20 - Bypass Select Outputs"] #[inline(always)] #[must_use] - pub fn bselo(&mut self) -> BSELO_W<16> { - BSELO_W::new(self) + pub fn bselo(&mut self) -> BSELO_W { + BSELO_W::new(self, 16) } #[doc = "Bits 21:23 - Bypass Hardware Port Control"] #[inline(always)] #[must_use] - pub fn bhpc(&mut self) -> BHPC_W<21> { - BHPC_W::new(self) + pub fn bhpc(&mut self) -> BHPC_W { + BHPC_W::new(self, 21) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Bypass Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bypcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bypcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`bypcr::R`](R) reader structure"] +impl crate::Readable for BYPCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`bypcr::W`](W) writer structure"] impl crate::Writable for BYPCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/ccfg.rs b/src/usic0_ch0/ccfg.rs index 2bd41eb3..b91c7fb2 100644 --- a/src/usic0_ch0/ccfg.rs +++ b/src/usic0_ch0/ccfg.rs @@ -1,18 +1,5 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `SSC` reader - SSC Protocol Available"] pub type SSC_R = crate::BitReader; #[doc = "SSC Protocol Available\n\nValue on reset: 1"] @@ -32,18 +19,18 @@ impl From for bool { impl SSC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SSC_A { + pub const fn variant(&self) -> SSC_A { match self.bits { false => SSC_A::VALUE1, true => SSC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The SSC protocol is not available."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SSC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The SSC protocol is available."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SSC_A::VALUE2 @@ -68,18 +55,18 @@ impl From for bool { impl ASC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASC_A { + pub const fn variant(&self) -> ASC_A { match self.bits { false => ASC_A::VALUE1, true => ASC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The ASC protocol is not available."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The ASC protocol is available."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASC_A::VALUE2 @@ -104,18 +91,18 @@ impl From for bool { impl IIC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IIC_A { + pub const fn variant(&self) -> IIC_A { match self.bits { false => IIC_A::VALUE1, true => IIC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The IIC protocol is not available."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IIC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The IIC protocol is available."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IIC_A::VALUE2 @@ -140,18 +127,18 @@ impl From for bool { impl IIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IIS_A { + pub const fn variant(&self) -> IIS_A { match self.bits { false => IIS_A::VALUE1, true => IIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The IIS protocol is not available."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == IIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The IIS protocol is available."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IIS_A::VALUE2 @@ -176,18 +163,18 @@ impl From for bool { impl RB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RB_A { + pub const fn variant(&self) -> RB_A { match self.bits { false => RB_A::VALUE1, true => RB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receive FIFO buffer is not available."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receive FIFO buffer is available."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RB_A::VALUE2 @@ -212,18 +199,18 @@ impl From for bool { impl TB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TB_A { + pub const fn variant(&self) -> TB_A { match self.bits { false => TB_A::VALUE1, true => TB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit FIFO buffer is not available."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit FIFO buffer is available."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TB_A::VALUE2 @@ -261,15 +248,13 @@ impl R { TB_R::new(((self.bits >> 7) & 1) != 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"] +#[doc = "Channel Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccfg::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`ccfg::R`](R) reader structure"] +impl crate::Readable for CCFG_SPEC {} #[doc = "`reset()` method sets CCFG to value 0xcf"] impl crate::Resettable for CCFG_SPEC { const RESET_VALUE: Self::Ux = 0xcf; diff --git a/src/usic0_ch0/ccr.rs b/src/usic0_ch0/ccr.rs index 94fed122..f3444b13 100644 --- a/src/usic0_ch0/ccr.rs +++ b/src/usic0_ch0/ccr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MODE` reader - Operating Mode"] -pub type MODE_R = crate::FieldReader; +pub type MODE_R = crate::FieldReader; #[doc = "Operating Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MODE_A { + type Ux = u8; +} impl MODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(MODE_A::VALUE1), 1 => Some(MODE_A::VALUE2), @@ -70,63 +41,67 @@ impl MODE_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The USIC channel is disabled. All protocol-related state machines are set to an idle state."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The SSC (SPI) protocol is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The ASC (SCI, UART) protocol is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == MODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The IIS protocol is selected."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == MODE_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The IIC protocol is selected."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == MODE_A::VALUE5 } } #[doc = "Field `MODE` writer - Operating Mode"] -pub type MODE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CCR_SPEC, u8, MODE_A, 4, O>; -impl<'a, const O: u8> MODE_W<'a, O> { +pub type MODE_W<'a, REG> = crate::FieldWriter<'a, REG, 4, MODE_A>; +impl<'a, REG> MODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The USIC channel is disabled. All protocol-related state machines are set to an idle state."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE1) } #[doc = "The SSC (SPI) protocol is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE2) } #[doc = "The ASC (SCI, UART) protocol is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE3) } #[doc = "The IIS protocol is selected."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE4) } #[doc = "The IIC protocol is selected."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(MODE_A::VALUE5) } } #[doc = "Field `HPCEN` reader - Hardware Port Control Enable"] -pub type HPCEN_R = crate::FieldReader; +pub type HPCEN_R = crate::FieldReader; #[doc = "Hardware Port Control Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -147,10 +122,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for HPCEN_A { + type Ux = u8; +} impl HPCEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HPCEN_A { + pub const fn variant(&self) -> HPCEN_A { match self.bits { 0 => HPCEN_A::VALUE1, 1 => HPCEN_A::VALUE2, @@ -159,54 +137,59 @@ impl HPCEN_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The hardware port control is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HPCEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The hardware port control is enabled for DX0 and DOUT0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HPCEN_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The hardware port control is enabled for DX3, DX0 and DOUT\\[1:0\\]."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == HPCEN_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The hardware port control is enabled for DX0, DX\\[5:3\\] +and DOUT\\[3:0\\]."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == HPCEN_A::VALUE4 } } #[doc = "Field `HPCEN` writer - Hardware Port Control Enable"] -pub type HPCEN_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CCR_SPEC, u8, HPCEN_A, 2, O>; -impl<'a, const O: u8> HPCEN_W<'a, O> { +pub type HPCEN_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, HPCEN_A>; +impl<'a, REG> HPCEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The hardware port control is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HPCEN_A::VALUE1) } #[doc = "The hardware port control is enabled for DX0 and DOUT0."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HPCEN_A::VALUE2) } #[doc = "The hardware port control is enabled for DX3, DX0 and DOUT\\[1:0\\]."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(HPCEN_A::VALUE3) } #[doc = "The hardware port control is enabled for DX0, DX\\[5:3\\] and DOUT\\[3:0\\]."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(HPCEN_A::VALUE4) } } #[doc = "Field `PM` reader - Parity Mode"] -pub type PM_R = crate::FieldReader; +pub type PM_R = crate::FieldReader; #[doc = "Parity Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -224,10 +207,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PM_A { + type Ux = u8; +} impl PM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PM_A::VALUE1), 2 => Some(PM_A::VALUE3), @@ -235,38 +221,42 @@ impl PM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The parity generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Even parity is selected (parity bit = 1 on odd number of 1s in data, parity bit = 0 on even number of 1s in data)."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Odd parity is selected (parity bit = 0 on odd number of 1s in data, parity bit = 1 on even number of 1s in data)."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PM_A::VALUE4 } } #[doc = "Field `PM` writer - Parity Mode"] -pub type PM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CCR_SPEC, u8, PM_A, 2, O>; -impl<'a, const O: u8> PM_W<'a, O> { +pub type PM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PM_A>; +impl<'a, REG> PM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The parity generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PM_A::VALUE1) } #[doc = "Even parity is selected (parity bit = 1 on odd number of 1s in data, parity bit = 0 on even number of 1s in data)."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PM_A::VALUE3) } #[doc = "Odd parity is selected (parity bit = 0 on odd number of 1s in data, parity bit = 1 on even number of 1s in data)."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PM_A::VALUE4) } } @@ -289,34 +279,37 @@ impl From for bool { impl RSIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSIEN_A { + pub const fn variant(&self) -> RSIEN_A { match self.bits { false => RSIEN_A::VALUE1, true => RSIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The receiver start interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The receiver start interrupt is enabled. In case of a receiver start event, the service request output SRx indicated by INPR.TBINP is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSIEN_A::VALUE2 } } #[doc = "Field `RSIEN` writer - Receiver Start Interrupt Enable"] -pub type RSIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, RSIEN_A, O>; -impl<'a, const O: u8> RSIEN_W<'a, O> { +pub type RSIEN_W<'a, REG> = crate::BitWriter<'a, REG, RSIEN_A>; +impl<'a, REG> RSIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The receiver start interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSIEN_A::VALUE1) } #[doc = "The receiver start interrupt is enabled. In case of a receiver start event, the service request output SRx indicated by INPR.TBINP is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSIEN_A::VALUE2) } } @@ -339,34 +332,37 @@ impl From for bool { impl DLIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DLIEN_A { + pub const fn variant(&self) -> DLIEN_A { match self.bits { false => DLIEN_A::VALUE1, true => DLIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data lost interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DLIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data lost interrupt is enabled. In case of a data lost event, the service request output SRx indicated by INPR.PINP is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DLIEN_A::VALUE2 } } #[doc = "Field `DLIEN` writer - Data Lost Interrupt Enable"] -pub type DLIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, DLIEN_A, O>; -impl<'a, const O: u8> DLIEN_W<'a, O> { +pub type DLIEN_W<'a, REG> = crate::BitWriter<'a, REG, DLIEN_A>; +impl<'a, REG> DLIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The data lost interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLIEN_A::VALUE1) } #[doc = "The data lost interrupt is enabled. In case of a data lost event, the service request output SRx indicated by INPR.PINP is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLIEN_A::VALUE2) } } @@ -389,34 +385,37 @@ impl From for bool { impl TSIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSIEN_A { + pub const fn variant(&self) -> TSIEN_A { match self.bits { false => TSIEN_A::VALUE1, true => TSIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmit shift interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transmit shift interrupt is enabled. In case of a transmit shift interrupt event, the service request output SRx indicated by INPR.TSINP is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSIEN_A::VALUE2 } } #[doc = "Field `TSIEN` writer - Transmit Shift Interrupt Enable"] -pub type TSIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, TSIEN_A, O>; -impl<'a, const O: u8> TSIEN_W<'a, O> { +pub type TSIEN_W<'a, REG> = crate::BitWriter<'a, REG, TSIEN_A>; +impl<'a, REG> TSIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The transmit shift interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSIEN_A::VALUE1) } #[doc = "The transmit shift interrupt is enabled. In case of a transmit shift interrupt event, the service request output SRx indicated by INPR.TSINP is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSIEN_A::VALUE2) } } @@ -439,34 +438,37 @@ impl From for bool { impl TBIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBIEN_A { + pub const fn variant(&self) -> TBIEN_A { match self.bits { false => TBIEN_A::VALUE1, true => TBIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmit buffer interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transmit buffer interrupt is enabled. In case of a transmit buffer event, the service request output SRx indicated by INPR.TBINP is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBIEN_A::VALUE2 } } #[doc = "Field `TBIEN` writer - Transmit Buffer Interrupt Enable"] -pub type TBIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, TBIEN_A, O>; -impl<'a, const O: u8> TBIEN_W<'a, O> { +pub type TBIEN_W<'a, REG> = crate::BitWriter<'a, REG, TBIEN_A>; +impl<'a, REG> TBIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The transmit buffer interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TBIEN_A::VALUE1) } #[doc = "The transmit buffer interrupt is enabled. In case of a transmit buffer event, the service request output SRx indicated by INPR.TBINP is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TBIEN_A::VALUE2) } } @@ -489,34 +491,37 @@ impl From for bool { impl RIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RIEN_A { + pub const fn variant(&self) -> RIEN_A { match self.bits { false => RIEN_A::VALUE1, true => RIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The receive interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The receive interrupt is enabled. In case of a receive event, the service request output SRx indicated by INPR.RINP is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RIEN_A::VALUE2 } } #[doc = "Field `RIEN` writer - Receive Interrupt Enable"] -pub type RIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, RIEN_A, O>; -impl<'a, const O: u8> RIEN_W<'a, O> { +pub type RIEN_W<'a, REG> = crate::BitWriter<'a, REG, RIEN_A>; +impl<'a, REG> RIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The receive interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RIEN_A::VALUE1) } #[doc = "The receive interrupt is enabled. In case of a receive event, the service request output SRx indicated by INPR.RINP is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RIEN_A::VALUE2) } } @@ -539,34 +544,37 @@ impl From for bool { impl AIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AIEN_A { + pub const fn variant(&self) -> AIEN_A { match self.bits { false => AIEN_A::VALUE1, true => AIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The alternative receive interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The alternative receive interrupt is enabled. In case of an alternative receive event, the service request output SRx indicated by INPR.AINP is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AIEN_A::VALUE2 } } #[doc = "Field `AIEN` writer - Alternative Receive Interrupt Enable"] -pub type AIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, AIEN_A, O>; -impl<'a, const O: u8> AIEN_W<'a, O> { +pub type AIEN_W<'a, REG> = crate::BitWriter<'a, REG, AIEN_A>; +impl<'a, REG> AIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The alternative receive interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AIEN_A::VALUE1) } #[doc = "The alternative receive interrupt is enabled. In case of an alternative receive event, the service request output SRx indicated by INPR.AINP is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AIEN_A::VALUE2) } } @@ -589,34 +597,37 @@ impl From for bool { impl BRGIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRGIEN_A { + pub const fn variant(&self) -> BRGIEN_A { match self.bits { false => BRGIEN_A::VALUE1, true => BRGIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The baud rate generator interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRGIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The baud rate generator interrupt is enabled. In case of a baud rate generator event, the service request output SRx indicated by INPR.PINP is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRGIEN_A::VALUE2 } } #[doc = "Field `BRGIEN` writer - Baud Rate Generator Interrupt Enable"] -pub type BRGIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CCR_SPEC, BRGIEN_A, O>; -impl<'a, const O: u8> BRGIEN_W<'a, O> { +pub type BRGIEN_W<'a, REG> = crate::BitWriter<'a, REG, BRGIEN_A>; +impl<'a, REG> BRGIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The baud rate generator interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRGIEN_A::VALUE1) } #[doc = "The baud rate generator interrupt is enabled. In case of a baud rate generator event, the service request output SRx indicated by INPR.PINP is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRGIEN_A::VALUE2) } } @@ -676,82 +687,83 @@ impl W { #[doc = "Bits 0:3 - Operating Mode"] #[inline(always)] #[must_use] - pub fn mode(&mut self) -> MODE_W<0> { - MODE_W::new(self) + pub fn mode(&mut self) -> MODE_W { + MODE_W::new(self, 0) } #[doc = "Bits 6:7 - Hardware Port Control Enable"] #[inline(always)] #[must_use] - pub fn hpcen(&mut self) -> HPCEN_W<6> { - HPCEN_W::new(self) + pub fn hpcen(&mut self) -> HPCEN_W { + HPCEN_W::new(self, 6) } #[doc = "Bits 8:9 - Parity Mode"] #[inline(always)] #[must_use] - pub fn pm(&mut self) -> PM_W<8> { - PM_W::new(self) + pub fn pm(&mut self) -> PM_W { + PM_W::new(self, 8) } #[doc = "Bit 10 - Receiver Start Interrupt Enable"] #[inline(always)] #[must_use] - pub fn rsien(&mut self) -> RSIEN_W<10> { - RSIEN_W::new(self) + pub fn rsien(&mut self) -> RSIEN_W { + RSIEN_W::new(self, 10) } #[doc = "Bit 11 - Data Lost Interrupt Enable"] #[inline(always)] #[must_use] - pub fn dlien(&mut self) -> DLIEN_W<11> { - DLIEN_W::new(self) + pub fn dlien(&mut self) -> DLIEN_W { + DLIEN_W::new(self, 11) } #[doc = "Bit 12 - Transmit Shift Interrupt Enable"] #[inline(always)] #[must_use] - pub fn tsien(&mut self) -> TSIEN_W<12> { - TSIEN_W::new(self) + pub fn tsien(&mut self) -> TSIEN_W { + TSIEN_W::new(self, 12) } #[doc = "Bit 13 - Transmit Buffer Interrupt Enable"] #[inline(always)] #[must_use] - pub fn tbien(&mut self) -> TBIEN_W<13> { - TBIEN_W::new(self) + pub fn tbien(&mut self) -> TBIEN_W { + TBIEN_W::new(self, 13) } #[doc = "Bit 14 - Receive Interrupt Enable"] #[inline(always)] #[must_use] - pub fn rien(&mut self) -> RIEN_W<14> { - RIEN_W::new(self) + pub fn rien(&mut self) -> RIEN_W { + RIEN_W::new(self, 14) } #[doc = "Bit 15 - Alternative Receive Interrupt Enable"] #[inline(always)] #[must_use] - pub fn aien(&mut self) -> AIEN_W<15> { - AIEN_W::new(self) + pub fn aien(&mut self) -> AIEN_W { + AIEN_W::new(self, 15) } #[doc = "Bit 16 - Baud Rate Generator Interrupt Enable"] #[inline(always)] #[must_use] - pub fn brgien(&mut self) -> BRGIEN_W<16> { - BRGIEN_W::new(self) + pub fn brgien(&mut self) -> BRGIEN_W { + BRGIEN_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ccr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ccr::R`](R) reader structure"] +impl crate::Readable for CCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ccr::W`](W) writer structure"] impl crate::Writable for CCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/cmtr.rs b/src/usic0_ch0/cmtr.rs index f8206a99..bcde5353 100644 --- a/src/usic0_ch0/cmtr.rs +++ b/src/usic0_ch0/cmtr.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CTV` reader - Captured Timer Value"] -pub type CTV_R = crate::FieldReader; +pub type CTV_R = crate::FieldReader; #[doc = "Field `CTV` writer - Captured Timer Value"] -pub type CTV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CMTR_SPEC, u16, u16, 10, O>; +pub type CTV_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; impl R { #[doc = "Bits 0:9 - Captured Timer Value"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:9 - Captured Timer Value"] #[inline(always)] #[must_use] - pub fn ctv(&mut self) -> CTV_W<0> { - CTV_W::new(self) + pub fn ctv(&mut self) -> CTV_W { + CTV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Capture Mode Timer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cmtr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cmtr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cmtr::R`](R) reader structure"] +impl crate::Readable for CMTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cmtr::W`](W) writer structure"] impl crate::Writable for CMTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/dx0cr.rs b/src/usic0_ch0/dx0cr.rs index 98c25633..23b87e3f 100644 --- a/src/usic0_ch0/dx0cr.rs +++ b/src/usic0_ch0/dx0cr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSEL` reader - Data Selection for Input Signal"] -pub type DSEL_R = crate::FieldReader; +pub type DSEL_R = crate::FieldReader; #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DSEL_A { + type Ux = u8; +} impl DSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEL_A { + pub const fn variant(&self) -> DSEL_A { match self.bits { 0 => DSEL_A::VALUE1, 1 => DSEL_A::VALUE2, @@ -79,88 +50,92 @@ impl DSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data input DXnA is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data input DXnB is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The data input DXnC is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The data input DXnD is selected."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DSEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The data input DXnE is selected."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == DSEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "The data input DXnF is selected."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == DSEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "The data input DXnG is selected."] #[inline(always)] pub fn is_value7(&self) -> bool { *self == DSEL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "The data input is always 1."] #[inline(always)] pub fn is_value8(&self) -> bool { *self == DSEL_A::VALUE8 } } #[doc = "Field `DSEL` writer - Data Selection for Input Signal"] -pub type DSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX0CR_SPEC, u8, DSEL_A, 3, O>; -impl<'a, const O: u8> DSEL_W<'a, O> { +pub type DSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, DSEL_A>; +impl<'a, REG> DSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The data input DXnA is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE1) } #[doc = "The data input DXnB is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE2) } #[doc = "The data input DXnC is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE3) } #[doc = "The data input DXnD is selected."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE4) } #[doc = "The data input DXnE is selected."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE5) } #[doc = "The data input DXnF is selected."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE6) } #[doc = "The data input DXnG is selected."] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE7) } #[doc = "The data input is always 1."] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE8) } } @@ -183,34 +158,37 @@ impl From for bool { impl INSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSW_A { + pub const fn variant(&self) -> INSW_A { match self.bits { false => INSW_A::VALUE1, true => INSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSW_A::VALUE2 } } #[doc = "Field `INSW` writer - Input Switch"] -pub type INSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX0CR_SPEC, INSW_A, O>; -impl<'a, const O: u8> INSW_W<'a, O> { +pub type INSW_W<'a, REG> = crate::BitWriter<'a, REG, INSW_A>; +impl<'a, REG> INSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE1) } #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE2) } } @@ -233,34 +211,37 @@ impl From for bool { impl DFEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DFEN_A { + pub const fn variant(&self) -> DFEN_A { match self.bits { false => DFEN_A::VALUE1, true => DFEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not digitally filtered."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DFEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is digitally filtered."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DFEN_A::VALUE2 } } #[doc = "Field `DFEN` writer - Digital Filter Enable"] -pub type DFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX0CR_SPEC, DFEN_A, O>; -impl<'a, const O: u8> DFEN_W<'a, O> { +pub type DFEN_W<'a, REG> = crate::BitWriter<'a, REG, DFEN_A>; +impl<'a, REG> DFEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not digitally filtered."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE1) } #[doc = "The input signal is digitally filtered."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE2) } } @@ -283,34 +264,37 @@ impl From for bool { impl DSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEN_A { + pub const fn variant(&self) -> DSEN_A { match self.bits { false => DSEN_A::VALUE1, true => DSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEN_A::VALUE2 } } #[doc = "Field `DSEN` writer - Data Synchronization Enable"] -pub type DSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX0CR_SPEC, DSEN_A, O>; -impl<'a, const O: u8> DSEN_W<'a, O> { +pub type DSEN_W<'a, REG> = crate::BitWriter<'a, REG, DSEN_A>; +impl<'a, REG> DSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE1) } #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE2) } } @@ -333,34 +317,37 @@ impl From for bool { impl DPOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPOL_A { + pub const fn variant(&self) -> DPOL_A { match self.bits { false => DPOL_A::VALUE1, true => DPOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not inverted."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is inverted."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPOL_A::VALUE2 } } #[doc = "Field `DPOL` writer - Data Polarity for DXn"] -pub type DPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX0CR_SPEC, DPOL_A, O>; -impl<'a, const O: u8> DPOL_W<'a, O> { +pub type DPOL_W<'a, REG> = crate::BitWriter<'a, REG, DPOL_A>; +impl<'a, REG> DPOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not inverted."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE1) } #[doc = "The input signal is inverted."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE2) } } @@ -383,39 +370,42 @@ impl From for bool { impl SFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SFSEL_A { + pub const fn variant(&self) -> SFSEL_A { match self.bits { false => SFSEL_A::VALUE1, true => SFSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The sampling frequency is fPB."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SFSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The sampling frequency is fFD."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SFSEL_A::VALUE2 } } #[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] -pub type SFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX0CR_SPEC, SFSEL_A, O>; -impl<'a, const O: u8> SFSEL_W<'a, O> { +pub type SFSEL_W<'a, REG> = crate::BitWriter<'a, REG, SFSEL_A>; +impl<'a, REG> SFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The sampling frequency is fPB."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE1) } #[doc = "The sampling frequency is fFD."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE2) } } #[doc = "Field `CM` reader - Combination Mode"] -pub type CM_R = crate::FieldReader; +pub type CM_R = crate::FieldReader; #[doc = "Combination Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -435,10 +425,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CM_A { + type Ux = u8; +} impl CM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CM_A { + pub const fn variant(&self) -> CM_A { match self.bits { 0 => CM_A::VALUE1, 1 => CM_A::VALUE2, @@ -447,48 +440,52 @@ impl CM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The trigger activation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A rising edge activates DXnT."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "A falling edge activates DXnT."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Both edges activate DXnT."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CM_A::VALUE4 } } #[doc = "Field `CM` writer - Combination Mode"] -pub type CM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX0CR_SPEC, u8, CM_A, 2, O>; -impl<'a, const O: u8> CM_W<'a, O> { +pub type CM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CM_A>; +impl<'a, REG> CM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The trigger activation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CM_A::VALUE1) } #[doc = "A rising edge activates DXnT."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CM_A::VALUE2) } #[doc = "A falling edge activates DXnT."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CM_A::VALUE3) } #[doc = "Both edges activate DXnT."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CM_A::VALUE4) } } @@ -511,18 +508,18 @@ impl From for bool { impl DXS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DXS_A { + pub const fn variant(&self) -> DXS_A { match self.bits { false => DXS_A::VALUE1, true => DXS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The current value of DXnS is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DXS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The current value of DXnS is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DXS_A::VALUE2 @@ -574,64 +571,65 @@ impl W { #[doc = "Bits 0:2 - Data Selection for Input Signal"] #[inline(always)] #[must_use] - pub fn dsel(&mut self) -> DSEL_W<0> { - DSEL_W::new(self) + pub fn dsel(&mut self) -> DSEL_W { + DSEL_W::new(self, 0) } #[doc = "Bit 4 - Input Switch"] #[inline(always)] #[must_use] - pub fn insw(&mut self) -> INSW_W<4> { - INSW_W::new(self) + pub fn insw(&mut self) -> INSW_W { + INSW_W::new(self, 4) } #[doc = "Bit 5 - Digital Filter Enable"] #[inline(always)] #[must_use] - pub fn dfen(&mut self) -> DFEN_W<5> { - DFEN_W::new(self) + pub fn dfen(&mut self) -> DFEN_W { + DFEN_W::new(self, 5) } #[doc = "Bit 6 - Data Synchronization Enable"] #[inline(always)] #[must_use] - pub fn dsen(&mut self) -> DSEN_W<6> { - DSEN_W::new(self) + pub fn dsen(&mut self) -> DSEN_W { + DSEN_W::new(self, 6) } #[doc = "Bit 8 - Data Polarity for DXn"] #[inline(always)] #[must_use] - pub fn dpol(&mut self) -> DPOL_W<8> { - DPOL_W::new(self) + pub fn dpol(&mut self) -> DPOL_W { + DPOL_W::new(self, 8) } #[doc = "Bit 9 - Sampling Frequency Selection"] #[inline(always)] #[must_use] - pub fn sfsel(&mut self) -> SFSEL_W<9> { - SFSEL_W::new(self) + pub fn sfsel(&mut self) -> SFSEL_W { + SFSEL_W::new(self, 9) } #[doc = "Bits 10:11 - Combination Mode"] #[inline(always)] #[must_use] - pub fn cm(&mut self) -> CM_W<10> { - CM_W::new(self) + pub fn cm(&mut self) -> CM_W { + CM_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Control Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx0cr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx0cr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dx0cr::R`](R) reader structure"] +impl crate::Readable for DX0CR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dx0cr::W`](W) writer structure"] impl crate::Writable for DX0CR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/dx1cr.rs b/src/usic0_ch0/dx1cr.rs index 5315e3da..57c6f697 100644 --- a/src/usic0_ch0/dx1cr.rs +++ b/src/usic0_ch0/dx1cr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSEL` reader - Data Selection for Input Signal"] -pub type DSEL_R = crate::FieldReader; +pub type DSEL_R = crate::FieldReader; #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DSEL_A { + type Ux = u8; +} impl DSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEL_A { + pub const fn variant(&self) -> DSEL_A { match self.bits { 0 => DSEL_A::VALUE1, 1 => DSEL_A::VALUE2, @@ -79,88 +50,92 @@ impl DSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data input DX1A is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data input DX1B is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The data input DX1C is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The data input DX1D is selected."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DSEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The data input DX1E is selected."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == DSEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "The data input DX1F is selected."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == DSEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "The data input DX1G is selected."] #[inline(always)] pub fn is_value7(&self) -> bool { *self == DSEL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "The data input is always 1."] #[inline(always)] pub fn is_value8(&self) -> bool { *self == DSEL_A::VALUE8 } } #[doc = "Field `DSEL` writer - Data Selection for Input Signal"] -pub type DSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX1CR_SPEC, u8, DSEL_A, 3, O>; -impl<'a, const O: u8> DSEL_W<'a, O> { +pub type DSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, DSEL_A>; +impl<'a, REG> DSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The data input DX1A is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE1) } #[doc = "The data input DX1B is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE2) } #[doc = "The data input DX1C is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE3) } #[doc = "The data input DX1D is selected."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE4) } #[doc = "The data input DX1E is selected."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE5) } #[doc = "The data input DX1F is selected."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE6) } #[doc = "The data input DX1G is selected."] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE7) } #[doc = "The data input is always 1."] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE8) } } @@ -183,34 +158,37 @@ impl From for bool { impl DCEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DCEN_A { + pub const fn variant(&self) -> DCEN_A { match self.bits { false => DCEN_A::VALUE1, true => DCEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The receive shift clock is dependent on INSW selection."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DCEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The receive shift clock is connected to the selected data input line. This setting is used if delay compensation is required in SSC and IIS protocols, else DCEN should always be 0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DCEN_A::VALUE2 } } #[doc = "Field `DCEN` writer - Delay Compensation Enable"] -pub type DCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX1CR_SPEC, DCEN_A, O>; -impl<'a, const O: u8> DCEN_W<'a, O> { +pub type DCEN_W<'a, REG> = crate::BitWriter<'a, REG, DCEN_A>; +impl<'a, REG> DCEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The receive shift clock is dependent on INSW selection."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DCEN_A::VALUE1) } #[doc = "The receive shift clock is connected to the selected data input line. This setting is used if delay compensation is required in SSC and IIS protocols, else DCEN should always be 0."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DCEN_A::VALUE2) } } @@ -233,34 +211,37 @@ impl From for bool { impl INSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSW_A { + pub const fn variant(&self) -> INSW_A { match self.bits { false => INSW_A::VALUE1, true => INSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSW_A::VALUE2 } } #[doc = "Field `INSW` writer - Input Switch"] -pub type INSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX1CR_SPEC, INSW_A, O>; -impl<'a, const O: u8> INSW_W<'a, O> { +pub type INSW_W<'a, REG> = crate::BitWriter<'a, REG, INSW_A>; +impl<'a, REG> INSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE1) } #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE2) } } @@ -283,34 +264,37 @@ impl From for bool { impl DFEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DFEN_A { + pub const fn variant(&self) -> DFEN_A { match self.bits { false => DFEN_A::VALUE1, true => DFEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not digitally filtered."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DFEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is digitally filtered."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DFEN_A::VALUE2 } } #[doc = "Field `DFEN` writer - Digital Filter Enable"] -pub type DFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX1CR_SPEC, DFEN_A, O>; -impl<'a, const O: u8> DFEN_W<'a, O> { +pub type DFEN_W<'a, REG> = crate::BitWriter<'a, REG, DFEN_A>; +impl<'a, REG> DFEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not digitally filtered."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE1) } #[doc = "The input signal is digitally filtered."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE2) } } @@ -333,34 +317,37 @@ impl From for bool { impl DSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEN_A { + pub const fn variant(&self) -> DSEN_A { match self.bits { false => DSEN_A::VALUE1, true => DSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEN_A::VALUE2 } } #[doc = "Field `DSEN` writer - Data Synchronization Enable"] -pub type DSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX1CR_SPEC, DSEN_A, O>; -impl<'a, const O: u8> DSEN_W<'a, O> { +pub type DSEN_W<'a, REG> = crate::BitWriter<'a, REG, DSEN_A>; +impl<'a, REG> DSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE1) } #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE2) } } @@ -383,34 +370,37 @@ impl From for bool { impl DPOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPOL_A { + pub const fn variant(&self) -> DPOL_A { match self.bits { false => DPOL_A::VALUE1, true => DPOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not inverted."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is inverted."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPOL_A::VALUE2 } } #[doc = "Field `DPOL` writer - Data Polarity for DXn"] -pub type DPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX1CR_SPEC, DPOL_A, O>; -impl<'a, const O: u8> DPOL_W<'a, O> { +pub type DPOL_W<'a, REG> = crate::BitWriter<'a, REG, DPOL_A>; +impl<'a, REG> DPOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not inverted."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE1) } #[doc = "The input signal is inverted."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE2) } } @@ -433,39 +423,42 @@ impl From for bool { impl SFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SFSEL_A { + pub const fn variant(&self) -> SFSEL_A { match self.bits { false => SFSEL_A::VALUE1, true => SFSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The sampling frequency is fPB."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SFSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The sampling frequency is fFD."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SFSEL_A::VALUE2 } } #[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] -pub type SFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX1CR_SPEC, SFSEL_A, O>; -impl<'a, const O: u8> SFSEL_W<'a, O> { +pub type SFSEL_W<'a, REG> = crate::BitWriter<'a, REG, SFSEL_A>; +impl<'a, REG> SFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The sampling frequency is fPB."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE1) } #[doc = "The sampling frequency is fFD."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE2) } } #[doc = "Field `CM` reader - Combination Mode"] -pub type CM_R = crate::FieldReader; +pub type CM_R = crate::FieldReader; #[doc = "Combination Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -485,10 +478,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CM_A { + type Ux = u8; +} impl CM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CM_A { + pub const fn variant(&self) -> CM_A { match self.bits { 0 => CM_A::VALUE1, 1 => CM_A::VALUE2, @@ -497,48 +493,52 @@ impl CM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The trigger activation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A rising edge activates DX1T."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "A falling edge activates DX1T."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Both edges activate DX1T."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CM_A::VALUE4 } } #[doc = "Field `CM` writer - Combination Mode"] -pub type CM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX1CR_SPEC, u8, CM_A, 2, O>; -impl<'a, const O: u8> CM_W<'a, O> { +pub type CM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CM_A>; +impl<'a, REG> CM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The trigger activation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CM_A::VALUE1) } #[doc = "A rising edge activates DX1T."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CM_A::VALUE2) } #[doc = "A falling edge activates DX1T."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CM_A::VALUE3) } #[doc = "Both edges activate DX1T."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CM_A::VALUE4) } } @@ -561,18 +561,18 @@ impl From for bool { impl DXS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DXS_A { + pub const fn variant(&self) -> DXS_A { match self.bits { false => DXS_A::VALUE1, true => DXS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The current value of DX1S is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DXS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The current value of DX1S is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DXS_A::VALUE2 @@ -629,70 +629,71 @@ impl W { #[doc = "Bits 0:2 - Data Selection for Input Signal"] #[inline(always)] #[must_use] - pub fn dsel(&mut self) -> DSEL_W<0> { - DSEL_W::new(self) + pub fn dsel(&mut self) -> DSEL_W { + DSEL_W::new(self, 0) } #[doc = "Bit 3 - Delay Compensation Enable"] #[inline(always)] #[must_use] - pub fn dcen(&mut self) -> DCEN_W<3> { - DCEN_W::new(self) + pub fn dcen(&mut self) -> DCEN_W { + DCEN_W::new(self, 3) } #[doc = "Bit 4 - Input Switch"] #[inline(always)] #[must_use] - pub fn insw(&mut self) -> INSW_W<4> { - INSW_W::new(self) + pub fn insw(&mut self) -> INSW_W { + INSW_W::new(self, 4) } #[doc = "Bit 5 - Digital Filter Enable"] #[inline(always)] #[must_use] - pub fn dfen(&mut self) -> DFEN_W<5> { - DFEN_W::new(self) + pub fn dfen(&mut self) -> DFEN_W { + DFEN_W::new(self, 5) } #[doc = "Bit 6 - Data Synchronization Enable"] #[inline(always)] #[must_use] - pub fn dsen(&mut self) -> DSEN_W<6> { - DSEN_W::new(self) + pub fn dsen(&mut self) -> DSEN_W { + DSEN_W::new(self, 6) } #[doc = "Bit 8 - Data Polarity for DXn"] #[inline(always)] #[must_use] - pub fn dpol(&mut self) -> DPOL_W<8> { - DPOL_W::new(self) + pub fn dpol(&mut self) -> DPOL_W { + DPOL_W::new(self, 8) } #[doc = "Bit 9 - Sampling Frequency Selection"] #[inline(always)] #[must_use] - pub fn sfsel(&mut self) -> SFSEL_W<9> { - SFSEL_W::new(self) + pub fn sfsel(&mut self) -> SFSEL_W { + SFSEL_W::new(self, 9) } #[doc = "Bits 10:11 - Combination Mode"] #[inline(always)] #[must_use] - pub fn cm(&mut self) -> CM_W<10> { - CM_W::new(self) + pub fn cm(&mut self) -> CM_W { + CM_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Control Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx1cr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx1cr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dx1cr::R`](R) reader structure"] +impl crate::Readable for DX1CR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dx1cr::W`](W) writer structure"] impl crate::Writable for DX1CR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/dx2cr.rs b/src/usic0_ch0/dx2cr.rs index 3d605cbd..a90f3fc0 100644 --- a/src/usic0_ch0/dx2cr.rs +++ b/src/usic0_ch0/dx2cr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSEL` reader - Data Selection for Input Signal"] -pub type DSEL_R = crate::FieldReader; +pub type DSEL_R = crate::FieldReader; #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DSEL_A { + type Ux = u8; +} impl DSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEL_A { + pub const fn variant(&self) -> DSEL_A { match self.bits { 0 => DSEL_A::VALUE1, 1 => DSEL_A::VALUE2, @@ -79,88 +50,92 @@ impl DSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data input DXnA is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data input DXnB is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The data input DXnC is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The data input DXnD is selected."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DSEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The data input DXnE is selected."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == DSEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "The data input DXnF is selected."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == DSEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "The data input DXnG is selected."] #[inline(always)] pub fn is_value7(&self) -> bool { *self == DSEL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "The data input is always 1."] #[inline(always)] pub fn is_value8(&self) -> bool { *self == DSEL_A::VALUE8 } } #[doc = "Field `DSEL` writer - Data Selection for Input Signal"] -pub type DSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX2CR_SPEC, u8, DSEL_A, 3, O>; -impl<'a, const O: u8> DSEL_W<'a, O> { +pub type DSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, DSEL_A>; +impl<'a, REG> DSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The data input DXnA is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE1) } #[doc = "The data input DXnB is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE2) } #[doc = "The data input DXnC is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE3) } #[doc = "The data input DXnD is selected."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE4) } #[doc = "The data input DXnE is selected."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE5) } #[doc = "The data input DXnF is selected."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE6) } #[doc = "The data input DXnG is selected."] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE7) } #[doc = "The data input is always 1."] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE8) } } @@ -183,34 +158,37 @@ impl From for bool { impl INSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSW_A { + pub const fn variant(&self) -> INSW_A { match self.bits { false => INSW_A::VALUE1, true => INSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSW_A::VALUE2 } } #[doc = "Field `INSW` writer - Input Switch"] -pub type INSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX2CR_SPEC, INSW_A, O>; -impl<'a, const O: u8> INSW_W<'a, O> { +pub type INSW_W<'a, REG> = crate::BitWriter<'a, REG, INSW_A>; +impl<'a, REG> INSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE1) } #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE2) } } @@ -233,34 +211,37 @@ impl From for bool { impl DFEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DFEN_A { + pub const fn variant(&self) -> DFEN_A { match self.bits { false => DFEN_A::VALUE1, true => DFEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not digitally filtered."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DFEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is digitally filtered."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DFEN_A::VALUE2 } } #[doc = "Field `DFEN` writer - Digital Filter Enable"] -pub type DFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX2CR_SPEC, DFEN_A, O>; -impl<'a, const O: u8> DFEN_W<'a, O> { +pub type DFEN_W<'a, REG> = crate::BitWriter<'a, REG, DFEN_A>; +impl<'a, REG> DFEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not digitally filtered."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE1) } #[doc = "The input signal is digitally filtered."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE2) } } @@ -283,34 +264,37 @@ impl From for bool { impl DSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEN_A { + pub const fn variant(&self) -> DSEN_A { match self.bits { false => DSEN_A::VALUE1, true => DSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEN_A::VALUE2 } } #[doc = "Field `DSEN` writer - Data Synchronization Enable"] -pub type DSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX2CR_SPEC, DSEN_A, O>; -impl<'a, const O: u8> DSEN_W<'a, O> { +pub type DSEN_W<'a, REG> = crate::BitWriter<'a, REG, DSEN_A>; +impl<'a, REG> DSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE1) } #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE2) } } @@ -333,34 +317,37 @@ impl From for bool { impl DPOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPOL_A { + pub const fn variant(&self) -> DPOL_A { match self.bits { false => DPOL_A::VALUE1, true => DPOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not inverted."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is inverted."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPOL_A::VALUE2 } } #[doc = "Field `DPOL` writer - Data Polarity for DXn"] -pub type DPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX2CR_SPEC, DPOL_A, O>; -impl<'a, const O: u8> DPOL_W<'a, O> { +pub type DPOL_W<'a, REG> = crate::BitWriter<'a, REG, DPOL_A>; +impl<'a, REG> DPOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not inverted."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE1) } #[doc = "The input signal is inverted."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE2) } } @@ -383,39 +370,42 @@ impl From for bool { impl SFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SFSEL_A { + pub const fn variant(&self) -> SFSEL_A { match self.bits { false => SFSEL_A::VALUE1, true => SFSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The sampling frequency is fPB."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SFSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The sampling frequency is fFD."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SFSEL_A::VALUE2 } } #[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] -pub type SFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX2CR_SPEC, SFSEL_A, O>; -impl<'a, const O: u8> SFSEL_W<'a, O> { +pub type SFSEL_W<'a, REG> = crate::BitWriter<'a, REG, SFSEL_A>; +impl<'a, REG> SFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The sampling frequency is fPB."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE1) } #[doc = "The sampling frequency is fFD."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE2) } } #[doc = "Field `CM` reader - Combination Mode"] -pub type CM_R = crate::FieldReader; +pub type CM_R = crate::FieldReader; #[doc = "Combination Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -435,10 +425,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CM_A { + type Ux = u8; +} impl CM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CM_A { + pub const fn variant(&self) -> CM_A { match self.bits { 0 => CM_A::VALUE1, 1 => CM_A::VALUE2, @@ -447,48 +440,52 @@ impl CM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The trigger activation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A rising edge activates DXnT."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "A falling edge activates DXnT."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Both edges activate DXnT."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CM_A::VALUE4 } } #[doc = "Field `CM` writer - Combination Mode"] -pub type CM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX2CR_SPEC, u8, CM_A, 2, O>; -impl<'a, const O: u8> CM_W<'a, O> { +pub type CM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CM_A>; +impl<'a, REG> CM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The trigger activation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CM_A::VALUE1) } #[doc = "A rising edge activates DXnT."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CM_A::VALUE2) } #[doc = "A falling edge activates DXnT."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CM_A::VALUE3) } #[doc = "Both edges activate DXnT."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CM_A::VALUE4) } } @@ -511,18 +508,18 @@ impl From for bool { impl DXS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DXS_A { + pub const fn variant(&self) -> DXS_A { match self.bits { false => DXS_A::VALUE1, true => DXS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The current value of DXnS is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DXS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The current value of DXnS is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DXS_A::VALUE2 @@ -574,64 +571,65 @@ impl W { #[doc = "Bits 0:2 - Data Selection for Input Signal"] #[inline(always)] #[must_use] - pub fn dsel(&mut self) -> DSEL_W<0> { - DSEL_W::new(self) + pub fn dsel(&mut self) -> DSEL_W { + DSEL_W::new(self, 0) } #[doc = "Bit 4 - Input Switch"] #[inline(always)] #[must_use] - pub fn insw(&mut self) -> INSW_W<4> { - INSW_W::new(self) + pub fn insw(&mut self) -> INSW_W { + INSW_W::new(self, 4) } #[doc = "Bit 5 - Digital Filter Enable"] #[inline(always)] #[must_use] - pub fn dfen(&mut self) -> DFEN_W<5> { - DFEN_W::new(self) + pub fn dfen(&mut self) -> DFEN_W { + DFEN_W::new(self, 5) } #[doc = "Bit 6 - Data Synchronization Enable"] #[inline(always)] #[must_use] - pub fn dsen(&mut self) -> DSEN_W<6> { - DSEN_W::new(self) + pub fn dsen(&mut self) -> DSEN_W { + DSEN_W::new(self, 6) } #[doc = "Bit 8 - Data Polarity for DXn"] #[inline(always)] #[must_use] - pub fn dpol(&mut self) -> DPOL_W<8> { - DPOL_W::new(self) + pub fn dpol(&mut self) -> DPOL_W { + DPOL_W::new(self, 8) } #[doc = "Bit 9 - Sampling Frequency Selection"] #[inline(always)] #[must_use] - pub fn sfsel(&mut self) -> SFSEL_W<9> { - SFSEL_W::new(self) + pub fn sfsel(&mut self) -> SFSEL_W { + SFSEL_W::new(self, 9) } #[doc = "Bits 10:11 - Combination Mode"] #[inline(always)] #[must_use] - pub fn cm(&mut self) -> CM_W<10> { - CM_W::new(self) + pub fn cm(&mut self) -> CM_W { + CM_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Control Register 2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx2cr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx2cr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dx2cr::R`](R) reader structure"] +impl crate::Readable for DX2CR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dx2cr::W`](W) writer structure"] impl crate::Writable for DX2CR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/dx3cr.rs b/src/usic0_ch0/dx3cr.rs index 1f7d943a..a99683b9 100644 --- a/src/usic0_ch0/dx3cr.rs +++ b/src/usic0_ch0/dx3cr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSEL` reader - Data Selection for Input Signal"] -pub type DSEL_R = crate::FieldReader; +pub type DSEL_R = crate::FieldReader; #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DSEL_A { + type Ux = u8; +} impl DSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEL_A { + pub const fn variant(&self) -> DSEL_A { match self.bits { 0 => DSEL_A::VALUE1, 1 => DSEL_A::VALUE2, @@ -79,88 +50,92 @@ impl DSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data input DXnA is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data input DXnB is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The data input DXnC is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The data input DXnD is selected."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DSEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The data input DXnE is selected."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == DSEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "The data input DXnF is selected."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == DSEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "The data input DXnG is selected."] #[inline(always)] pub fn is_value7(&self) -> bool { *self == DSEL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "The data input is always 1."] #[inline(always)] pub fn is_value8(&self) -> bool { *self == DSEL_A::VALUE8 } } #[doc = "Field `DSEL` writer - Data Selection for Input Signal"] -pub type DSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX3CR_SPEC, u8, DSEL_A, 3, O>; -impl<'a, const O: u8> DSEL_W<'a, O> { +pub type DSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, DSEL_A>; +impl<'a, REG> DSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The data input DXnA is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE1) } #[doc = "The data input DXnB is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE2) } #[doc = "The data input DXnC is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE3) } #[doc = "The data input DXnD is selected."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE4) } #[doc = "The data input DXnE is selected."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE5) } #[doc = "The data input DXnF is selected."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE6) } #[doc = "The data input DXnG is selected."] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE7) } #[doc = "The data input is always 1."] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE8) } } @@ -183,34 +158,37 @@ impl From for bool { impl INSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSW_A { + pub const fn variant(&self) -> INSW_A { match self.bits { false => INSW_A::VALUE1, true => INSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSW_A::VALUE2 } } #[doc = "Field `INSW` writer - Input Switch"] -pub type INSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX3CR_SPEC, INSW_A, O>; -impl<'a, const O: u8> INSW_W<'a, O> { +pub type INSW_W<'a, REG> = crate::BitWriter<'a, REG, INSW_A>; +impl<'a, REG> INSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE1) } #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE2) } } @@ -233,34 +211,37 @@ impl From for bool { impl DFEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DFEN_A { + pub const fn variant(&self) -> DFEN_A { match self.bits { false => DFEN_A::VALUE1, true => DFEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not digitally filtered."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DFEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is digitally filtered."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DFEN_A::VALUE2 } } #[doc = "Field `DFEN` writer - Digital Filter Enable"] -pub type DFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX3CR_SPEC, DFEN_A, O>; -impl<'a, const O: u8> DFEN_W<'a, O> { +pub type DFEN_W<'a, REG> = crate::BitWriter<'a, REG, DFEN_A>; +impl<'a, REG> DFEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not digitally filtered."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE1) } #[doc = "The input signal is digitally filtered."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE2) } } @@ -283,34 +264,37 @@ impl From for bool { impl DSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEN_A { + pub const fn variant(&self) -> DSEN_A { match self.bits { false => DSEN_A::VALUE1, true => DSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEN_A::VALUE2 } } #[doc = "Field `DSEN` writer - Data Synchronization Enable"] -pub type DSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX3CR_SPEC, DSEN_A, O>; -impl<'a, const O: u8> DSEN_W<'a, O> { +pub type DSEN_W<'a, REG> = crate::BitWriter<'a, REG, DSEN_A>; +impl<'a, REG> DSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE1) } #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE2) } } @@ -333,34 +317,37 @@ impl From for bool { impl DPOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPOL_A { + pub const fn variant(&self) -> DPOL_A { match self.bits { false => DPOL_A::VALUE1, true => DPOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not inverted."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is inverted."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPOL_A::VALUE2 } } #[doc = "Field `DPOL` writer - Data Polarity for DXn"] -pub type DPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX3CR_SPEC, DPOL_A, O>; -impl<'a, const O: u8> DPOL_W<'a, O> { +pub type DPOL_W<'a, REG> = crate::BitWriter<'a, REG, DPOL_A>; +impl<'a, REG> DPOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not inverted."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE1) } #[doc = "The input signal is inverted."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE2) } } @@ -383,39 +370,42 @@ impl From for bool { impl SFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SFSEL_A { + pub const fn variant(&self) -> SFSEL_A { match self.bits { false => SFSEL_A::VALUE1, true => SFSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The sampling frequency is fPB."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SFSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The sampling frequency is fFD."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SFSEL_A::VALUE2 } } #[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] -pub type SFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX3CR_SPEC, SFSEL_A, O>; -impl<'a, const O: u8> SFSEL_W<'a, O> { +pub type SFSEL_W<'a, REG> = crate::BitWriter<'a, REG, SFSEL_A>; +impl<'a, REG> SFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The sampling frequency is fPB."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE1) } #[doc = "The sampling frequency is fFD."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE2) } } #[doc = "Field `CM` reader - Combination Mode"] -pub type CM_R = crate::FieldReader; +pub type CM_R = crate::FieldReader; #[doc = "Combination Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -435,10 +425,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CM_A { + type Ux = u8; +} impl CM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CM_A { + pub const fn variant(&self) -> CM_A { match self.bits { 0 => CM_A::VALUE1, 1 => CM_A::VALUE2, @@ -447,48 +440,52 @@ impl CM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The trigger activation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A rising edge activates DXnT."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "A falling edge activates DXnT."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Both edges activate DXnT."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CM_A::VALUE4 } } #[doc = "Field `CM` writer - Combination Mode"] -pub type CM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX3CR_SPEC, u8, CM_A, 2, O>; -impl<'a, const O: u8> CM_W<'a, O> { +pub type CM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CM_A>; +impl<'a, REG> CM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The trigger activation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CM_A::VALUE1) } #[doc = "A rising edge activates DXnT."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CM_A::VALUE2) } #[doc = "A falling edge activates DXnT."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CM_A::VALUE3) } #[doc = "Both edges activate DXnT."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CM_A::VALUE4) } } @@ -511,18 +508,18 @@ impl From for bool { impl DXS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DXS_A { + pub const fn variant(&self) -> DXS_A { match self.bits { false => DXS_A::VALUE1, true => DXS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The current value of DXnS is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DXS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The current value of DXnS is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DXS_A::VALUE2 @@ -574,64 +571,65 @@ impl W { #[doc = "Bits 0:2 - Data Selection for Input Signal"] #[inline(always)] #[must_use] - pub fn dsel(&mut self) -> DSEL_W<0> { - DSEL_W::new(self) + pub fn dsel(&mut self) -> DSEL_W { + DSEL_W::new(self, 0) } #[doc = "Bit 4 - Input Switch"] #[inline(always)] #[must_use] - pub fn insw(&mut self) -> INSW_W<4> { - INSW_W::new(self) + pub fn insw(&mut self) -> INSW_W { + INSW_W::new(self, 4) } #[doc = "Bit 5 - Digital Filter Enable"] #[inline(always)] #[must_use] - pub fn dfen(&mut self) -> DFEN_W<5> { - DFEN_W::new(self) + pub fn dfen(&mut self) -> DFEN_W { + DFEN_W::new(self, 5) } #[doc = "Bit 6 - Data Synchronization Enable"] #[inline(always)] #[must_use] - pub fn dsen(&mut self) -> DSEN_W<6> { - DSEN_W::new(self) + pub fn dsen(&mut self) -> DSEN_W { + DSEN_W::new(self, 6) } #[doc = "Bit 8 - Data Polarity for DXn"] #[inline(always)] #[must_use] - pub fn dpol(&mut self) -> DPOL_W<8> { - DPOL_W::new(self) + pub fn dpol(&mut self) -> DPOL_W { + DPOL_W::new(self, 8) } #[doc = "Bit 9 - Sampling Frequency Selection"] #[inline(always)] #[must_use] - pub fn sfsel(&mut self) -> SFSEL_W<9> { - SFSEL_W::new(self) + pub fn sfsel(&mut self) -> SFSEL_W { + SFSEL_W::new(self, 9) } #[doc = "Bits 10:11 - Combination Mode"] #[inline(always)] #[must_use] - pub fn cm(&mut self) -> CM_W<10> { - CM_W::new(self) + pub fn cm(&mut self) -> CM_W { + CM_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Control Register 3\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx3cr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx3cr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dx3cr::R`](R) reader structure"] +impl crate::Readable for DX3CR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dx3cr::W`](W) writer structure"] impl crate::Writable for DX3CR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/dx4cr.rs b/src/usic0_ch0/dx4cr.rs index 30a7c1d0..f11e4584 100644 --- a/src/usic0_ch0/dx4cr.rs +++ b/src/usic0_ch0/dx4cr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSEL` reader - Data Selection for Input Signal"] -pub type DSEL_R = crate::FieldReader; +pub type DSEL_R = crate::FieldReader; #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DSEL_A { + type Ux = u8; +} impl DSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEL_A { + pub const fn variant(&self) -> DSEL_A { match self.bits { 0 => DSEL_A::VALUE1, 1 => DSEL_A::VALUE2, @@ -79,88 +50,92 @@ impl DSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data input DXnA is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data input DXnB is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The data input DXnC is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The data input DXnD is selected."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DSEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The data input DXnE is selected."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == DSEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "The data input DXnF is selected."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == DSEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "The data input DXnG is selected."] #[inline(always)] pub fn is_value7(&self) -> bool { *self == DSEL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "The data input is always 1."] #[inline(always)] pub fn is_value8(&self) -> bool { *self == DSEL_A::VALUE8 } } #[doc = "Field `DSEL` writer - Data Selection for Input Signal"] -pub type DSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX4CR_SPEC, u8, DSEL_A, 3, O>; -impl<'a, const O: u8> DSEL_W<'a, O> { +pub type DSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, DSEL_A>; +impl<'a, REG> DSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The data input DXnA is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE1) } #[doc = "The data input DXnB is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE2) } #[doc = "The data input DXnC is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE3) } #[doc = "The data input DXnD is selected."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE4) } #[doc = "The data input DXnE is selected."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE5) } #[doc = "The data input DXnF is selected."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE6) } #[doc = "The data input DXnG is selected."] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE7) } #[doc = "The data input is always 1."] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE8) } } @@ -183,34 +158,37 @@ impl From for bool { impl INSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSW_A { + pub const fn variant(&self) -> INSW_A { match self.bits { false => INSW_A::VALUE1, true => INSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSW_A::VALUE2 } } #[doc = "Field `INSW` writer - Input Switch"] -pub type INSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX4CR_SPEC, INSW_A, O>; -impl<'a, const O: u8> INSW_W<'a, O> { +pub type INSW_W<'a, REG> = crate::BitWriter<'a, REG, INSW_A>; +impl<'a, REG> INSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE1) } #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE2) } } @@ -233,34 +211,37 @@ impl From for bool { impl DFEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DFEN_A { + pub const fn variant(&self) -> DFEN_A { match self.bits { false => DFEN_A::VALUE1, true => DFEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not digitally filtered."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DFEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is digitally filtered."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DFEN_A::VALUE2 } } #[doc = "Field `DFEN` writer - Digital Filter Enable"] -pub type DFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX4CR_SPEC, DFEN_A, O>; -impl<'a, const O: u8> DFEN_W<'a, O> { +pub type DFEN_W<'a, REG> = crate::BitWriter<'a, REG, DFEN_A>; +impl<'a, REG> DFEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not digitally filtered."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE1) } #[doc = "The input signal is digitally filtered."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE2) } } @@ -283,34 +264,37 @@ impl From for bool { impl DSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEN_A { + pub const fn variant(&self) -> DSEN_A { match self.bits { false => DSEN_A::VALUE1, true => DSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEN_A::VALUE2 } } #[doc = "Field `DSEN` writer - Data Synchronization Enable"] -pub type DSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX4CR_SPEC, DSEN_A, O>; -impl<'a, const O: u8> DSEN_W<'a, O> { +pub type DSEN_W<'a, REG> = crate::BitWriter<'a, REG, DSEN_A>; +impl<'a, REG> DSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE1) } #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE2) } } @@ -333,34 +317,37 @@ impl From for bool { impl DPOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPOL_A { + pub const fn variant(&self) -> DPOL_A { match self.bits { false => DPOL_A::VALUE1, true => DPOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not inverted."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is inverted."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPOL_A::VALUE2 } } #[doc = "Field `DPOL` writer - Data Polarity for DXn"] -pub type DPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX4CR_SPEC, DPOL_A, O>; -impl<'a, const O: u8> DPOL_W<'a, O> { +pub type DPOL_W<'a, REG> = crate::BitWriter<'a, REG, DPOL_A>; +impl<'a, REG> DPOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not inverted."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE1) } #[doc = "The input signal is inverted."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE2) } } @@ -383,39 +370,42 @@ impl From for bool { impl SFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SFSEL_A { + pub const fn variant(&self) -> SFSEL_A { match self.bits { false => SFSEL_A::VALUE1, true => SFSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The sampling frequency is fPB."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SFSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The sampling frequency is fFD."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SFSEL_A::VALUE2 } } #[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] -pub type SFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX4CR_SPEC, SFSEL_A, O>; -impl<'a, const O: u8> SFSEL_W<'a, O> { +pub type SFSEL_W<'a, REG> = crate::BitWriter<'a, REG, SFSEL_A>; +impl<'a, REG> SFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The sampling frequency is fPB."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE1) } #[doc = "The sampling frequency is fFD."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE2) } } #[doc = "Field `CM` reader - Combination Mode"] -pub type CM_R = crate::FieldReader; +pub type CM_R = crate::FieldReader; #[doc = "Combination Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -435,10 +425,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CM_A { + type Ux = u8; +} impl CM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CM_A { + pub const fn variant(&self) -> CM_A { match self.bits { 0 => CM_A::VALUE1, 1 => CM_A::VALUE2, @@ -447,48 +440,52 @@ impl CM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The trigger activation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A rising edge activates DXnT."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "A falling edge activates DXnT."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Both edges activate DXnT."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CM_A::VALUE4 } } #[doc = "Field `CM` writer - Combination Mode"] -pub type CM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX4CR_SPEC, u8, CM_A, 2, O>; -impl<'a, const O: u8> CM_W<'a, O> { +pub type CM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CM_A>; +impl<'a, REG> CM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The trigger activation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CM_A::VALUE1) } #[doc = "A rising edge activates DXnT."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CM_A::VALUE2) } #[doc = "A falling edge activates DXnT."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CM_A::VALUE3) } #[doc = "Both edges activate DXnT."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CM_A::VALUE4) } } @@ -511,18 +508,18 @@ impl From for bool { impl DXS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DXS_A { + pub const fn variant(&self) -> DXS_A { match self.bits { false => DXS_A::VALUE1, true => DXS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The current value of DXnS is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DXS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The current value of DXnS is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DXS_A::VALUE2 @@ -574,64 +571,65 @@ impl W { #[doc = "Bits 0:2 - Data Selection for Input Signal"] #[inline(always)] #[must_use] - pub fn dsel(&mut self) -> DSEL_W<0> { - DSEL_W::new(self) + pub fn dsel(&mut self) -> DSEL_W { + DSEL_W::new(self, 0) } #[doc = "Bit 4 - Input Switch"] #[inline(always)] #[must_use] - pub fn insw(&mut self) -> INSW_W<4> { - INSW_W::new(self) + pub fn insw(&mut self) -> INSW_W { + INSW_W::new(self, 4) } #[doc = "Bit 5 - Digital Filter Enable"] #[inline(always)] #[must_use] - pub fn dfen(&mut self) -> DFEN_W<5> { - DFEN_W::new(self) + pub fn dfen(&mut self) -> DFEN_W { + DFEN_W::new(self, 5) } #[doc = "Bit 6 - Data Synchronization Enable"] #[inline(always)] #[must_use] - pub fn dsen(&mut self) -> DSEN_W<6> { - DSEN_W::new(self) + pub fn dsen(&mut self) -> DSEN_W { + DSEN_W::new(self, 6) } #[doc = "Bit 8 - Data Polarity for DXn"] #[inline(always)] #[must_use] - pub fn dpol(&mut self) -> DPOL_W<8> { - DPOL_W::new(self) + pub fn dpol(&mut self) -> DPOL_W { + DPOL_W::new(self, 8) } #[doc = "Bit 9 - Sampling Frequency Selection"] #[inline(always)] #[must_use] - pub fn sfsel(&mut self) -> SFSEL_W<9> { - SFSEL_W::new(self) + pub fn sfsel(&mut self) -> SFSEL_W { + SFSEL_W::new(self, 9) } #[doc = "Bits 10:11 - Combination Mode"] #[inline(always)] #[must_use] - pub fn cm(&mut self) -> CM_W<10> { - CM_W::new(self) + pub fn cm(&mut self) -> CM_W { + CM_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Control Register 4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx4cr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx4cr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dx4cr::R`](R) reader structure"] +impl crate::Readable for DX4CR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dx4cr::W`](W) writer structure"] impl crate::Writable for DX4CR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/dx5cr.rs b/src/usic0_ch0/dx5cr.rs index aa269883..8050e17a 100644 --- a/src/usic0_ch0/dx5cr.rs +++ b/src/usic0_ch0/dx5cr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DSEL` reader - Data Selection for Input Signal"] -pub type DSEL_R = crate::FieldReader; +pub type DSEL_R = crate::FieldReader; #[doc = "Data Selection for Input Signal\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DSEL_A { + type Ux = u8; +} impl DSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEL_A { + pub const fn variant(&self) -> DSEL_A { match self.bits { 0 => DSEL_A::VALUE1, 1 => DSEL_A::VALUE2, @@ -79,88 +50,92 @@ impl DSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data input DXnA is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data input DXnB is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The data input DXnC is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The data input DXnD is selected."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DSEL_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The data input DXnE is selected."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == DSEL_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "The data input DXnF is selected."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == DSEL_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "The data input DXnG is selected."] #[inline(always)] pub fn is_value7(&self) -> bool { *self == DSEL_A::VALUE7 } - #[doc = "Checks if the value of the field is `VALUE8`"] + #[doc = "The data input is always 1."] #[inline(always)] pub fn is_value8(&self) -> bool { *self == DSEL_A::VALUE8 } } #[doc = "Field `DSEL` writer - Data Selection for Input Signal"] -pub type DSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX5CR_SPEC, u8, DSEL_A, 3, O>; -impl<'a, const O: u8> DSEL_W<'a, O> { +pub type DSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 3, DSEL_A>; +impl<'a, REG> DSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The data input DXnA is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE1) } #[doc = "The data input DXnB is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE2) } #[doc = "The data input DXnC is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE3) } #[doc = "The data input DXnD is selected."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE4) } #[doc = "The data input DXnE is selected."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE5) } #[doc = "The data input DXnF is selected."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE6) } #[doc = "The data input DXnG is selected."] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE7) } #[doc = "The data input is always 1."] #[inline(always)] - pub fn value8(self) -> &'a mut W { + pub fn value8(self) -> &'a mut crate::W { self.variant(DSEL_A::VALUE8) } } @@ -183,34 +158,37 @@ impl From for bool { impl INSW_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> INSW_A { + pub const fn variant(&self) -> INSW_A { match self.bits { false => INSW_A::VALUE1, true => INSW_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == INSW_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == INSW_A::VALUE2 } } #[doc = "Field `INSW` writer - Input Switch"] -pub type INSW_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX5CR_SPEC, INSW_A, O>; -impl<'a, const O: u8> INSW_W<'a, O> { +pub type INSW_W<'a, REG> = crate::BitWriter<'a, REG, INSW_A>; +impl<'a, REG> INSW_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input of the data shift unit is controlled by the protocol pre-processor."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE1) } #[doc = "The input of the data shift unit is connected to the selected data input line. This setting is used if the signals are directly derived from an input pin without treatment by the protocol pre-processor."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(INSW_A::VALUE2) } } @@ -233,34 +211,37 @@ impl From for bool { impl DFEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DFEN_A { + pub const fn variant(&self) -> DFEN_A { match self.bits { false => DFEN_A::VALUE1, true => DFEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not digitally filtered."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DFEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is digitally filtered."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DFEN_A::VALUE2 } } #[doc = "Field `DFEN` writer - Digital Filter Enable"] -pub type DFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX5CR_SPEC, DFEN_A, O>; -impl<'a, const O: u8> DFEN_W<'a, O> { +pub type DFEN_W<'a, REG> = crate::BitWriter<'a, REG, DFEN_A>; +impl<'a, REG> DFEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not digitally filtered."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE1) } #[doc = "The input signal is digitally filtered."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DFEN_A::VALUE2) } } @@ -283,34 +264,37 @@ impl From for bool { impl DSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DSEN_A { + pub const fn variant(&self) -> DSEN_A { match self.bits { false => DSEN_A::VALUE1, true => DSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DSEN_A::VALUE2 } } #[doc = "Field `DSEN` writer - Data Synchronization Enable"] -pub type DSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX5CR_SPEC, DSEN_A, O>; -impl<'a, const O: u8> DSEN_W<'a, O> { +pub type DSEN_W<'a, REG> = crate::BitWriter<'a, REG, DSEN_A>; +impl<'a, REG> DSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The un-synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE1) } #[doc = "The synchronized signal can be taken as input for the data shift unit."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DSEN_A::VALUE2) } } @@ -333,34 +317,37 @@ impl From for bool { impl DPOL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPOL_A { + pub const fn variant(&self) -> DPOL_A { match self.bits { false => DPOL_A::VALUE1, true => DPOL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The input signal is not inverted."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPOL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The input signal is inverted."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPOL_A::VALUE2 } } #[doc = "Field `DPOL` writer - Data Polarity for DXn"] -pub type DPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX5CR_SPEC, DPOL_A, O>; -impl<'a, const O: u8> DPOL_W<'a, O> { +pub type DPOL_W<'a, REG> = crate::BitWriter<'a, REG, DPOL_A>; +impl<'a, REG> DPOL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The input signal is not inverted."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE1) } #[doc = "The input signal is inverted."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPOL_A::VALUE2) } } @@ -383,39 +370,42 @@ impl From for bool { impl SFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SFSEL_A { + pub const fn variant(&self) -> SFSEL_A { match self.bits { false => SFSEL_A::VALUE1, true => SFSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The sampling frequency is fPB."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SFSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The sampling frequency is fFD."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SFSEL_A::VALUE2 } } #[doc = "Field `SFSEL` writer - Sampling Frequency Selection"] -pub type SFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, DX5CR_SPEC, SFSEL_A, O>; -impl<'a, const O: u8> SFSEL_W<'a, O> { +pub type SFSEL_W<'a, REG> = crate::BitWriter<'a, REG, SFSEL_A>; +impl<'a, REG> SFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The sampling frequency is fPB."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE1) } #[doc = "The sampling frequency is fFD."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SFSEL_A::VALUE2) } } #[doc = "Field `CM` reader - Combination Mode"] -pub type CM_R = crate::FieldReader; +pub type CM_R = crate::FieldReader; #[doc = "Combination Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -435,10 +425,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CM_A { + type Ux = u8; +} impl CM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CM_A { + pub const fn variant(&self) -> CM_A { match self.bits { 0 => CM_A::VALUE1, 1 => CM_A::VALUE2, @@ -447,48 +440,52 @@ impl CM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The trigger activation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A rising edge activates DXnT."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "A falling edge activates DXnT."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Both edges activate DXnT."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CM_A::VALUE4 } } #[doc = "Field `CM` writer - Combination Mode"] -pub type CM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, DX5CR_SPEC, u8, CM_A, 2, O>; -impl<'a, const O: u8> CM_W<'a, O> { +pub type CM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CM_A>; +impl<'a, REG> CM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The trigger activation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CM_A::VALUE1) } #[doc = "A rising edge activates DXnT."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CM_A::VALUE2) } #[doc = "A falling edge activates DXnT."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CM_A::VALUE3) } #[doc = "Both edges activate DXnT."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CM_A::VALUE4) } } @@ -511,18 +508,18 @@ impl From for bool { impl DXS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DXS_A { + pub const fn variant(&self) -> DXS_A { match self.bits { false => DXS_A::VALUE1, true => DXS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The current value of DXnS is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DXS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The current value of DXnS is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DXS_A::VALUE2 @@ -574,64 +571,65 @@ impl W { #[doc = "Bits 0:2 - Data Selection for Input Signal"] #[inline(always)] #[must_use] - pub fn dsel(&mut self) -> DSEL_W<0> { - DSEL_W::new(self) + pub fn dsel(&mut self) -> DSEL_W { + DSEL_W::new(self, 0) } #[doc = "Bit 4 - Input Switch"] #[inline(always)] #[must_use] - pub fn insw(&mut self) -> INSW_W<4> { - INSW_W::new(self) + pub fn insw(&mut self) -> INSW_W { + INSW_W::new(self, 4) } #[doc = "Bit 5 - Digital Filter Enable"] #[inline(always)] #[must_use] - pub fn dfen(&mut self) -> DFEN_W<5> { - DFEN_W::new(self) + pub fn dfen(&mut self) -> DFEN_W { + DFEN_W::new(self, 5) } #[doc = "Bit 6 - Data Synchronization Enable"] #[inline(always)] #[must_use] - pub fn dsen(&mut self) -> DSEN_W<6> { - DSEN_W::new(self) + pub fn dsen(&mut self) -> DSEN_W { + DSEN_W::new(self, 6) } #[doc = "Bit 8 - Data Polarity for DXn"] #[inline(always)] #[must_use] - pub fn dpol(&mut self) -> DPOL_W<8> { - DPOL_W::new(self) + pub fn dpol(&mut self) -> DPOL_W { + DPOL_W::new(self, 8) } #[doc = "Bit 9 - Sampling Frequency Selection"] #[inline(always)] #[must_use] - pub fn sfsel(&mut self) -> SFSEL_W<9> { - SFSEL_W::new(self) + pub fn sfsel(&mut self) -> SFSEL_W { + SFSEL_W::new(self, 9) } #[doc = "Bits 10:11 - Combination Mode"] #[inline(always)] #[must_use] - pub fn cm(&mut self) -> CM_W<10> { - CM_W::new(self) + pub fn cm(&mut self) -> CM_W { + CM_W::new(self, 10) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Control Register 5\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dx5cr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dx5cr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`dx5cr::R`](R) reader structure"] +impl crate::Readable for DX5CR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`dx5cr::W`](W) writer structure"] impl crate::Writable for DX5CR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/fdr.rs b/src/usic0_ch0/fdr.rs index 17cbecc5..eafde56a 100644 --- a/src/usic0_ch0/fdr.rs +++ b/src/usic0_ch0/fdr.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `STEP` reader - Step Value"] -pub type STEP_R = crate::FieldReader; +pub type STEP_R = crate::FieldReader; #[doc = "Field `STEP` writer - Step Value"] -pub type STEP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FDR_SPEC, u16, u16, 10, O>; +pub type STEP_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `DM` reader - Divider Mode"] -pub type DM_R = crate::FieldReader; +pub type DM_R = crate::FieldReader; #[doc = "Divider Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DM_A { + type Ux = u8; +} impl DM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DM_A { + pub const fn variant(&self) -> DM_A { match self.bits { 0 => DM_A::VALUE1, 1 => DM_A::VALUE2, @@ -71,53 +42,57 @@ impl DM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The divider is switched off, fFD = 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Normal divider mode selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Fractional divider mode selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The divider is switched off, fFD = 0."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DM_A::VALUE4 } } #[doc = "Field `DM` writer - Divider Mode"] -pub type DM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, FDR_SPEC, u8, DM_A, 2, O>; -impl<'a, const O: u8> DM_W<'a, O> { +pub type DM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, DM_A>; +impl<'a, REG> DM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The divider is switched off, fFD = 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DM_A::VALUE1) } #[doc = "Normal divider mode selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DM_A::VALUE2) } #[doc = "Fractional divider mode selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DM_A::VALUE3) } #[doc = "The divider is switched off, fFD = 0."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DM_A::VALUE4) } } #[doc = "Field `RESULT` reader - Result Value"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; impl R { #[doc = "Bits 0:9 - Step Value"] #[inline(always)] @@ -139,34 +114,35 @@ impl W { #[doc = "Bits 0:9 - Step Value"] #[inline(always)] #[must_use] - pub fn step(&mut self) -> STEP_W<0> { - STEP_W::new(self) + pub fn step(&mut self) -> STEP_W { + STEP_W::new(self, 0) } #[doc = "Bits 14:15 - Divider Mode"] #[inline(always)] #[must_use] - pub fn dm(&mut self) -> DM_W<14> { - DM_W::new(self) + pub fn dm(&mut self) -> DM_W { + DM_W::new(self, 14) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Fractional Divider Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`fdr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fdr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`fdr::R`](R) reader structure"] +impl crate::Readable for FDR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`fdr::W`](W) writer structure"] impl crate::Writable for FDR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/fmr.rs b/src/usic0_ch0/fmr.rs index e718fda4..4e8a9f64 100644 --- a/src/usic0_ch0/fmr.rs +++ b/src/usic0_ch0/fmr.rs @@ -1,24 +1,5 @@ #[doc = "Register `FMR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Modify Transmit Data Valid\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -36,22 +17,29 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for MTDV_AW { + type Ux = u8; +} #[doc = "Field `MTDV` writer - Modify Transmit Data Valid"] -pub type MTDV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, FMR_SPEC, u8, MTDV_AW, 2, O>; -impl<'a, const O: u8> MTDV_W<'a, O> { +pub type MTDV_W<'a, REG> = crate::FieldWriter<'a, REG, 2, MTDV_AW>; +impl<'a, REG> MTDV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MTDV_AW::VALUE1) } #[doc = "Bit TDV is set, TE is unchanged."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MTDV_AW::VALUE2) } #[doc = "Bits TDV and TE are cleared."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(MTDV_AW::VALUE3) } } @@ -70,16 +58,19 @@ impl From for bool { } } #[doc = "Field `ATVC` writer - Activate Bit TVC"] -pub type ATVC_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, ATVC_AW, O>; -impl<'a, const O: u8> ATVC_W<'a, O> { +pub type ATVC_W<'a, REG> = crate::BitWriter<'a, REG, ATVC_AW>; +impl<'a, REG> ATVC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ATVC_AW::VALUE1) } #[doc = "Bit TCSR.TVC is set."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ATVC_AW::VALUE2) } } @@ -98,16 +89,19 @@ impl From for bool { } } #[doc = "Field `CRDV0` writer - Clear Bits RDV for RBUF0"] -pub type CRDV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, CRDV0_AW, O>; -impl<'a, const O: u8> CRDV0_W<'a, O> { +pub type CRDV0_W<'a, REG> = crate::BitWriter<'a, REG, CRDV0_AW>; +impl<'a, REG> CRDV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CRDV0_AW::VALUE1) } #[doc = "Bits RBUF01SR.RDV00 and RBUF01SR.RDV10 are cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CRDV0_AW::VALUE2) } } @@ -126,16 +120,19 @@ impl From for bool { } } #[doc = "Field `CRDV1` writer - Clear Bit RDV for RBUF1"] -pub type CRDV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, CRDV1_AW, O>; -impl<'a, const O: u8> CRDV1_W<'a, O> { +pub type CRDV1_W<'a, REG> = crate::BitWriter<'a, REG, CRDV1_AW>; +impl<'a, REG> CRDV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CRDV1_AW::VALUE1) } #[doc = "Bits RBUF01SR.RDV01 and RBUF01SR.RDV11 are cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CRDV1_AW::VALUE2) } } @@ -154,16 +151,19 @@ impl From for bool { } } #[doc = "Field `SIO0` writer - Set Interrupt Output SRx"] -pub type SIO0_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, SIO0_AW, O>; -impl<'a, const O: u8> SIO0_W<'a, O> { +pub type SIO0_W<'a, REG> = crate::BitWriter<'a, REG, SIO0_AW>; +impl<'a, REG> SIO0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIO0_AW::VALUE1) } #[doc = "The service request output SRx is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIO0_AW::VALUE2) } } @@ -182,16 +182,19 @@ impl From for bool { } } #[doc = "Field `SIO1` writer - Set Interrupt Output SRx"] -pub type SIO1_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, SIO1_AW, O>; -impl<'a, const O: u8> SIO1_W<'a, O> { +pub type SIO1_W<'a, REG> = crate::BitWriter<'a, REG, SIO1_AW>; +impl<'a, REG> SIO1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIO1_AW::VALUE1) } #[doc = "The service request output SRx is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIO1_AW::VALUE2) } } @@ -210,16 +213,19 @@ impl From for bool { } } #[doc = "Field `SIO2` writer - Set Interrupt Output SRx"] -pub type SIO2_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, SIO2_AW, O>; -impl<'a, const O: u8> SIO2_W<'a, O> { +pub type SIO2_W<'a, REG> = crate::BitWriter<'a, REG, SIO2_AW>; +impl<'a, REG> SIO2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIO2_AW::VALUE1) } #[doc = "The service request output SRx is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIO2_AW::VALUE2) } } @@ -238,16 +244,19 @@ impl From for bool { } } #[doc = "Field `SIO3` writer - Set Interrupt Output SRx"] -pub type SIO3_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, SIO3_AW, O>; -impl<'a, const O: u8> SIO3_W<'a, O> { +pub type SIO3_W<'a, REG> = crate::BitWriter<'a, REG, SIO3_AW>; +impl<'a, REG> SIO3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIO3_AW::VALUE1) } #[doc = "The service request output SRx is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIO3_AW::VALUE2) } } @@ -266,16 +275,19 @@ impl From for bool { } } #[doc = "Field `SIO4` writer - Set Interrupt Output SRx"] -pub type SIO4_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, SIO4_AW, O>; -impl<'a, const O: u8> SIO4_W<'a, O> { +pub type SIO4_W<'a, REG> = crate::BitWriter<'a, REG, SIO4_AW>; +impl<'a, REG> SIO4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIO4_AW::VALUE1) } #[doc = "The service request output SRx is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIO4_AW::VALUE2) } } @@ -294,16 +306,19 @@ impl From for bool { } } #[doc = "Field `SIO5` writer - Set Interrupt Output SRx"] -pub type SIO5_W<'a, const O: u8> = crate::BitWriter<'a, u32, FMR_SPEC, SIO5_AW, O>; -impl<'a, const O: u8> SIO5_W<'a, O> { +pub type SIO5_W<'a, REG> = crate::BitWriter<'a, REG, SIO5_AW>; +impl<'a, REG> SIO5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIO5_AW::VALUE1) } #[doc = "The service request output SRx is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIO5_AW::VALUE2) } } @@ -311,78 +326,81 @@ impl W { #[doc = "Bits 0:1 - Modify Transmit Data Valid"] #[inline(always)] #[must_use] - pub fn mtdv(&mut self) -> MTDV_W<0> { - MTDV_W::new(self) + pub fn mtdv(&mut self) -> MTDV_W { + MTDV_W::new(self, 0) } #[doc = "Bit 4 - Activate Bit TVC"] #[inline(always)] #[must_use] - pub fn atvc(&mut self) -> ATVC_W<4> { - ATVC_W::new(self) + pub fn atvc(&mut self) -> ATVC_W { + ATVC_W::new(self, 4) } #[doc = "Bit 14 - Clear Bits RDV for RBUF0"] #[inline(always)] #[must_use] - pub fn crdv0(&mut self) -> CRDV0_W<14> { - CRDV0_W::new(self) + pub fn crdv0(&mut self) -> CRDV0_W { + CRDV0_W::new(self, 14) } #[doc = "Bit 15 - Clear Bit RDV for RBUF1"] #[inline(always)] #[must_use] - pub fn crdv1(&mut self) -> CRDV1_W<15> { - CRDV1_W::new(self) + pub fn crdv1(&mut self) -> CRDV1_W { + CRDV1_W::new(self, 15) } #[doc = "Bit 16 - Set Interrupt Output SRx"] #[inline(always)] #[must_use] - pub fn sio0(&mut self) -> SIO0_W<16> { - SIO0_W::new(self) + pub fn sio0(&mut self) -> SIO0_W { + SIO0_W::new(self, 16) } #[doc = "Bit 17 - Set Interrupt Output SRx"] #[inline(always)] #[must_use] - pub fn sio1(&mut self) -> SIO1_W<17> { - SIO1_W::new(self) + pub fn sio1(&mut self) -> SIO1_W { + SIO1_W::new(self, 17) } #[doc = "Bit 18 - Set Interrupt Output SRx"] #[inline(always)] #[must_use] - pub fn sio2(&mut self) -> SIO2_W<18> { - SIO2_W::new(self) + pub fn sio2(&mut self) -> SIO2_W { + SIO2_W::new(self, 18) } #[doc = "Bit 19 - Set Interrupt Output SRx"] #[inline(always)] #[must_use] - pub fn sio3(&mut self) -> SIO3_W<19> { - SIO3_W::new(self) + pub fn sio3(&mut self) -> SIO3_W { + SIO3_W::new(self, 19) } #[doc = "Bit 20 - Set Interrupt Output SRx"] #[inline(always)] #[must_use] - pub fn sio4(&mut self) -> SIO4_W<20> { - SIO4_W::new(self) + pub fn sio4(&mut self) -> SIO4_W { + SIO4_W::new(self, 20) } #[doc = "Bit 21 - Set Interrupt Output SRx"] #[inline(always)] #[must_use] - pub fn sio5(&mut self) -> SIO5_W<21> { - SIO5_W::new(self) + pub fn sio5(&mut self) -> SIO5_W { + SIO5_W::new(self, 21) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Flag Modification Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`fmr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct FMR_SPEC; impl crate::RegisterSpec for FMR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [fmr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`fmr::W`](W) writer structure"] impl crate::Writable for FMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/in_.rs b/src/usic0_ch0/in_.rs index 06e93938..46535c62 100644 --- a/src/usic0_ch0/in_.rs +++ b/src/usic0_ch0/in_.rs @@ -1,48 +1,32 @@ #[doc = "Register `IN[%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) - } -} +pub type W = crate::W; #[doc = "Field `TDATA` writer - Transmit Data"] -pub type TDATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, IN_SPEC, u16, u16, 16, O>; +pub type TDATA_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl W { #[doc = "Bits 0:15 - Transmit Data"] #[inline(always)] #[must_use] - pub fn tdata(&mut self) -> TDATA_W<0> { - TDATA_W::new(self) + pub fn tdata(&mut self) -> TDATA_W { + TDATA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Transmit FIFO Buffer\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`in_::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct IN_SPEC; impl crate::RegisterSpec for IN_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [in_::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`in_::W`](W) writer structure"] impl crate::Writable for IN_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/inpr.rs b/src/usic0_ch0/inpr.rs index 00e1f0b8..ca0449f1 100644 --- a/src/usic0_ch0/inpr.rs +++ b/src/usic0_ch0/inpr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TSINP` reader - Transmit Shift Interrupt Node Pointer"] -pub type TSINP_R = crate::FieldReader; +pub type TSINP_R = crate::FieldReader; #[doc = "Transmit Shift Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TSINP_A { + type Ux = u8; +} impl TSINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TSINP_A::VALUE1), 1 => Some(TSINP_A::VALUE2), @@ -73,87 +44,91 @@ impl TSINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Output SR0 becomes activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Output SR1 becomes activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Output SR2 becomes activated."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TSINP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Output SR3 becomes activated."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TSINP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Output SR4 becomes activated."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == TSINP_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Output SR5 becomes activated."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == TSINP_A::VALUE6 } } #[doc = "Field `TSINP` writer - Transmit Shift Interrupt Node Pointer"] -pub type TSINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, INPR_SPEC, u8, TSINP_A, 3, O>; -impl<'a, const O: u8> TSINP_W<'a, O> { +pub type TSINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, TSINP_A>; +impl<'a, REG> TSINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Output SR0 becomes activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSINP_A::VALUE1) } #[doc = "Output SR1 becomes activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSINP_A::VALUE2) } #[doc = "Output SR2 becomes activated."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TSINP_A::VALUE3) } #[doc = "Output SR3 becomes activated."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TSINP_A::VALUE4) } #[doc = "Output SR4 becomes activated."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(TSINP_A::VALUE5) } #[doc = "Output SR5 becomes activated."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(TSINP_A::VALUE6) } } #[doc = "Field `TBINP` reader - Transmit Buffer Interrupt Node Pointer"] -pub type TBINP_R = crate::FieldReader; +pub type TBINP_R = crate::FieldReader; #[doc = "Field `TBINP` writer - Transmit Buffer Interrupt Node Pointer"] -pub type TBINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, INPR_SPEC, u8, u8, 3, O>; +pub type TBINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `RINP` reader - Receive Interrupt Node Pointer"] -pub type RINP_R = crate::FieldReader; +pub type RINP_R = crate::FieldReader; #[doc = "Field `RINP` writer - Receive Interrupt Node Pointer"] -pub type RINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, INPR_SPEC, u8, u8, 3, O>; +pub type RINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `AINP` reader - Alternative Receive Interrupt Node Pointer"] -pub type AINP_R = crate::FieldReader; +pub type AINP_R = crate::FieldReader; #[doc = "Field `AINP` writer - Alternative Receive Interrupt Node Pointer"] -pub type AINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, INPR_SPEC, u8, u8, 3, O>; +pub type AINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `PINP` reader - Transmit Shift Interrupt Node Pointer"] -pub type PINP_R = crate::FieldReader; +pub type PINP_R = crate::FieldReader; #[doc = "Field `PINP` writer - Transmit Shift Interrupt Node Pointer"] -pub type PINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, INPR_SPEC, u8, u8, 3, O>; +pub type PINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; impl R { #[doc = "Bits 0:2 - Transmit Shift Interrupt Node Pointer"] #[inline(always)] @@ -185,52 +160,53 @@ impl W { #[doc = "Bits 0:2 - Transmit Shift Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn tsinp(&mut self) -> TSINP_W<0> { - TSINP_W::new(self) + pub fn tsinp(&mut self) -> TSINP_W { + TSINP_W::new(self, 0) } #[doc = "Bits 4:6 - Transmit Buffer Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn tbinp(&mut self) -> TBINP_W<4> { - TBINP_W::new(self) + pub fn tbinp(&mut self) -> TBINP_W { + TBINP_W::new(self, 4) } #[doc = "Bits 8:10 - Receive Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn rinp(&mut self) -> RINP_W<8> { - RINP_W::new(self) + pub fn rinp(&mut self) -> RINP_W { + RINP_W::new(self, 8) } #[doc = "Bits 12:14 - Alternative Receive Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn ainp(&mut self) -> AINP_W<12> { - AINP_W::new(self) + pub fn ainp(&mut self) -> AINP_W { + AINP_W::new(self, 12) } #[doc = "Bits 16:18 - Transmit Shift Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn pinp(&mut self) -> PINP_W<16> { - PINP_W::new(self) + pub fn pinp(&mut self) -> PINP_W { + PINP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Interrupt Node Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`inpr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`inpr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`inpr::R`](R) reader structure"] +impl crate::Readable for INPR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`inpr::W`](W) writer structure"] impl crate::Writable for INPR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/kscfg.rs b/src/usic0_ch0/kscfg.rs index 3f87e02f..94fda22e 100644 --- a/src/usic0_ch0/kscfg.rs +++ b/src/usic0_ch0/kscfg.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MODEN` reader - Module Enable"] pub type MODEN_R = crate::BitReader; #[doc = "Module Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl MODEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MODEN_A { + pub const fn variant(&self) -> MODEN_A { match self.bits { false => MODEN_A::VALUE1, true => MODEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == MODEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The module is switched on and can operate. After writing 1 to MODEN, it is recommended to read register KSCFG to avoid pipeline effects in the control block before accessing other Service Request Processing registers."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MODEN_A::VALUE2 } } #[doc = "Field `MODEN` writer - Module Enable"] -pub type MODEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, KSCFG_SPEC, MODEN_A, O>; -impl<'a, const O: u8> MODEN_W<'a, O> { +pub type MODEN_W<'a, REG> = crate::BitWriter<'a, REG, MODEN_A>; +impl<'a, REG> MODEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MODEN_A::VALUE1) } #[doc = "The module is switched on and can operate. After writing 1 to MODEN, it is recommended to read register KSCFG to avoid pipeline effects in the control block before accessing other Service Request Processing registers."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MODEN_A::VALUE2) } } @@ -99,21 +70,24 @@ impl From for bool { } } #[doc = "Field `BPMODEN` writer - Bit Protection for MODEN"] -pub type BPMODEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, KSCFG_SPEC, BPMODEN_AW, O>; -impl<'a, const O: u8> BPMODEN_W<'a, O> { +pub type BPMODEN_W<'a, REG> = crate::BitWriter<'a, REG, BPMODEN_AW>; +impl<'a, REG> BPMODEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "MODEN is not changed."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BPMODEN_AW::VALUE1) } #[doc = "MODEN is updated with the written value."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BPMODEN_AW::VALUE2) } } #[doc = "Field `NOMCFG` reader - Normal Operation Mode Configuration"] -pub type NOMCFG_R = crate::FieldReader; +pub type NOMCFG_R = crate::FieldReader; #[doc = "Normal Operation Mode Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +107,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for NOMCFG_A { + type Ux = u8; +} impl NOMCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NOMCFG_A { + pub const fn variant(&self) -> NOMCFG_A { match self.bits { 0 => NOMCFG_A::VALUE1, 1 => NOMCFG_A::VALUE2, @@ -145,48 +122,52 @@ impl NOMCFG_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Run mode 0 is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NOMCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Run mode 1 is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NOMCFG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Stop mode 0 is selected."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == NOMCFG_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Stop mode 1 is selected."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == NOMCFG_A::VALUE4 } } #[doc = "Field `NOMCFG` writer - Normal Operation Mode Configuration"] -pub type NOMCFG_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, KSCFG_SPEC, u8, NOMCFG_A, 2, O>; -impl<'a, const O: u8> NOMCFG_W<'a, O> { +pub type NOMCFG_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, NOMCFG_A>; +impl<'a, REG> NOMCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Run mode 0 is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NOMCFG_A::VALUE1) } #[doc = "Run mode 1 is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NOMCFG_A::VALUE2) } #[doc = "Stop mode 0 is selected."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(NOMCFG_A::VALUE3) } #[doc = "Stop mode 1 is selected."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(NOMCFG_A::VALUE4) } } @@ -205,23 +186,26 @@ impl From for bool { } } #[doc = "Field `BPNOM` writer - Bit Protection for NOMCFG"] -pub type BPNOM_W<'a, const O: u8> = crate::BitWriter<'a, u32, KSCFG_SPEC, BPNOM_AW, O>; -impl<'a, const O: u8> BPNOM_W<'a, O> { +pub type BPNOM_W<'a, REG> = crate::BitWriter<'a, REG, BPNOM_AW>; +impl<'a, REG> BPNOM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "NOMCFG is not changed."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BPNOM_AW::VALUE1) } #[doc = "NOMCFG is updated with the written value."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BPNOM_AW::VALUE2) } } #[doc = "Field `SUMCFG` reader - Suspend Mode Configuration"] -pub type SUMCFG_R = crate::FieldReader; +pub type SUMCFG_R = crate::FieldReader; #[doc = "Field `SUMCFG` writer - Suspend Mode Configuration"] -pub type SUMCFG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, KSCFG_SPEC, u8, u8, 2, O>; +pub type SUMCFG_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Bit Protection for SUMCFG\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum BPSUM_AW { @@ -237,16 +221,19 @@ impl From for bool { } } #[doc = "Field `BPSUM` writer - Bit Protection for SUMCFG"] -pub type BPSUM_W<'a, const O: u8> = crate::BitWriter<'a, u32, KSCFG_SPEC, BPSUM_AW, O>; -impl<'a, const O: u8> BPSUM_W<'a, O> { +pub type BPSUM_W<'a, REG> = crate::BitWriter<'a, REG, BPSUM_AW>; +impl<'a, REG> BPSUM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "SUMCFG is not changed."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BPSUM_AW::VALUE1) } #[doc = "SUMCFG is updated with the written value."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BPSUM_AW::VALUE2) } } @@ -271,58 +258,59 @@ impl W { #[doc = "Bit 0 - Module Enable"] #[inline(always)] #[must_use] - pub fn moden(&mut self) -> MODEN_W<0> { - MODEN_W::new(self) + pub fn moden(&mut self) -> MODEN_W { + MODEN_W::new(self, 0) } #[doc = "Bit 1 - Bit Protection for MODEN"] #[inline(always)] #[must_use] - pub fn bpmoden(&mut self) -> BPMODEN_W<1> { - BPMODEN_W::new(self) + pub fn bpmoden(&mut self) -> BPMODEN_W { + BPMODEN_W::new(self, 1) } #[doc = "Bits 4:5 - Normal Operation Mode Configuration"] #[inline(always)] #[must_use] - pub fn nomcfg(&mut self) -> NOMCFG_W<4> { - NOMCFG_W::new(self) + pub fn nomcfg(&mut self) -> NOMCFG_W { + NOMCFG_W::new(self, 4) } #[doc = "Bit 7 - Bit Protection for NOMCFG"] #[inline(always)] #[must_use] - pub fn bpnom(&mut self) -> BPNOM_W<7> { - BPNOM_W::new(self) + pub fn bpnom(&mut self) -> BPNOM_W { + BPNOM_W::new(self, 7) } #[doc = "Bits 8:9 - Suspend Mode Configuration"] #[inline(always)] #[must_use] - pub fn sumcfg(&mut self) -> SUMCFG_W<8> { - SUMCFG_W::new(self) + pub fn sumcfg(&mut self) -> SUMCFG_W { + SUMCFG_W::new(self, 8) } #[doc = "Bit 11 - Bit Protection for SUMCFG"] #[inline(always)] #[must_use] - pub fn bpsum(&mut self) -> BPSUM_W<11> { - BPSUM_W::new(self) + pub fn bpsum(&mut self) -> BPSUM_W { + BPSUM_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Kernel State Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`kscfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`kscfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`kscfg::R`](R) reader structure"] +impl crate::Readable for KSCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`kscfg::W`](W) writer structure"] impl crate::Writable for KSCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/outdr.rs b/src/usic0_ch0/outdr.rs index e11b6a5e..71145e3d 100644 --- a/src/usic0_ch0/outdr.rs +++ b/src/usic0_ch0/outdr.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DSR` reader - Data from Shift Register"] -pub type DSR_R = crate::FieldReader; +pub type DSR_R = crate::FieldReader; #[doc = "Field `RCI` reader - Receive Control Information from Shift Register"] -pub type RCI_R = crate::FieldReader; +pub type RCI_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Data from Shift Register"] #[inline(always)] @@ -29,15 +16,13 @@ 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"] +#[doc = "Receiver Buffer Output Register L for Debugger\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`outdr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`outdr::R`](R) reader structure"] +impl crate::Readable for OUTDR_SPEC {} #[doc = "`reset()` method sets OUTDR to value 0"] impl crate::Resettable for OUTDR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/outr.rs b/src/usic0_ch0/outr.rs index 693c7416..2af72be6 100644 --- a/src/usic0_ch0/outr.rs +++ b/src/usic0_ch0/outr.rs @@ -1,22 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DSR` reader - Received Data"] -pub type DSR_R = crate::FieldReader; +pub type DSR_R = crate::FieldReader; #[doc = "Field `RCI` reader - Receiver Control Information"] -pub type RCI_R = crate::FieldReader; +pub type RCI_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Received Data"] #[inline(always)] @@ -29,15 +16,13 @@ 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Receiver Buffer Output Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`outr::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`outr::R`](R) reader structure"] +impl crate::Readable for OUTR_SPEC {} #[doc = "`reset()` method sets OUTR to value 0"] impl crate::Resettable for OUTR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/pcr.rs b/src/usic0_ch0/pcr.rs index 1b3006b8..b7b34cb0 100644 --- a/src/usic0_ch0/pcr.rs +++ b/src/usic0_ch0/pcr.rs @@ -1,167 +1,135 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CTR0` reader - Protocol Control Bit 0"] -pub type CTR0_R = crate::BitReader; +pub type CTR0_R = crate::BitReader; #[doc = "Field `CTR0` writer - Protocol Control Bit 0"] -pub type CTR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR1` reader - Protocol Control Bit 1"] -pub type CTR1_R = crate::BitReader; +pub type CTR1_R = crate::BitReader; #[doc = "Field `CTR1` writer - Protocol Control Bit 1"] -pub type CTR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR2` reader - Protocol Control Bit 2"] -pub type CTR2_R = crate::BitReader; +pub type CTR2_R = crate::BitReader; #[doc = "Field `CTR2` writer - Protocol Control Bit 2"] -pub type CTR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR3` reader - Protocol Control Bit 3"] -pub type CTR3_R = crate::BitReader; +pub type CTR3_R = crate::BitReader; #[doc = "Field `CTR3` writer - Protocol Control Bit 3"] -pub type CTR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR4` reader - Protocol Control Bit 4"] -pub type CTR4_R = crate::BitReader; +pub type CTR4_R = crate::BitReader; #[doc = "Field `CTR4` writer - Protocol Control Bit 4"] -pub type CTR4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR5` reader - Protocol Control Bit 5"] -pub type CTR5_R = crate::BitReader; +pub type CTR5_R = crate::BitReader; #[doc = "Field `CTR5` writer - Protocol Control Bit 5"] -pub type CTR5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR6` reader - Protocol Control Bit 6"] -pub type CTR6_R = crate::BitReader; +pub type CTR6_R = crate::BitReader; #[doc = "Field `CTR6` writer - Protocol Control Bit 6"] -pub type CTR6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR7` reader - Protocol Control Bit 7"] -pub type CTR7_R = crate::BitReader; +pub type CTR7_R = crate::BitReader; #[doc = "Field `CTR7` writer - Protocol Control Bit 7"] -pub type CTR7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR8` reader - Protocol Control Bit 8"] -pub type CTR8_R = crate::BitReader; +pub type CTR8_R = crate::BitReader; #[doc = "Field `CTR8` writer - Protocol Control Bit 8"] -pub type CTR8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR9` reader - Protocol Control Bit 9"] -pub type CTR9_R = crate::BitReader; +pub type CTR9_R = crate::BitReader; #[doc = "Field `CTR9` writer - Protocol Control Bit 9"] -pub type CTR9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR10` reader - Protocol Control Bit 10"] -pub type CTR10_R = crate::BitReader; +pub type CTR10_R = crate::BitReader; #[doc = "Field `CTR10` writer - Protocol Control Bit 10"] -pub type CTR10_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR10_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR11` reader - Protocol Control Bit 11"] -pub type CTR11_R = crate::BitReader; +pub type CTR11_R = crate::BitReader; #[doc = "Field `CTR11` writer - Protocol Control Bit 11"] -pub type CTR11_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR11_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR12` reader - Protocol Control Bit 12"] -pub type CTR12_R = crate::BitReader; +pub type CTR12_R = crate::BitReader; #[doc = "Field `CTR12` writer - Protocol Control Bit 12"] -pub type CTR12_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR12_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR13` reader - Protocol Control Bit 13"] -pub type CTR13_R = crate::BitReader; +pub type CTR13_R = crate::BitReader; #[doc = "Field `CTR13` writer - Protocol Control Bit 13"] -pub type CTR13_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR13_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR14` reader - Protocol Control Bit 14"] -pub type CTR14_R = crate::BitReader; +pub type CTR14_R = crate::BitReader; #[doc = "Field `CTR14` writer - Protocol Control Bit 14"] -pub type CTR14_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR14_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR15` reader - Protocol Control Bit 15"] -pub type CTR15_R = crate::BitReader; +pub type CTR15_R = crate::BitReader; #[doc = "Field `CTR15` writer - Protocol Control Bit 15"] -pub type CTR15_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR15_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR16` reader - Protocol Control Bit 16"] -pub type CTR16_R = crate::BitReader; +pub type CTR16_R = crate::BitReader; #[doc = "Field `CTR16` writer - Protocol Control Bit 16"] -pub type CTR16_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR16_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR17` reader - Protocol Control Bit 17"] -pub type CTR17_R = crate::BitReader; +pub type CTR17_R = crate::BitReader; #[doc = "Field `CTR17` writer - Protocol Control Bit 17"] -pub type CTR17_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR17_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR18` reader - Protocol Control Bit 18"] -pub type CTR18_R = crate::BitReader; +pub type CTR18_R = crate::BitReader; #[doc = "Field `CTR18` writer - Protocol Control Bit 18"] -pub type CTR18_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR18_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR19` reader - Protocol Control Bit 19"] -pub type CTR19_R = crate::BitReader; +pub type CTR19_R = crate::BitReader; #[doc = "Field `CTR19` writer - Protocol Control Bit 19"] -pub type CTR19_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR19_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR20` reader - Protocol Control Bit 20"] -pub type CTR20_R = crate::BitReader; +pub type CTR20_R = crate::BitReader; #[doc = "Field `CTR20` writer - Protocol Control Bit 20"] -pub type CTR20_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR20_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR21` reader - Protocol Control Bit 21"] -pub type CTR21_R = crate::BitReader; +pub type CTR21_R = crate::BitReader; #[doc = "Field `CTR21` writer - Protocol Control Bit 21"] -pub type CTR21_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR21_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR22` reader - Protocol Control Bit 22"] -pub type CTR22_R = crate::BitReader; +pub type CTR22_R = crate::BitReader; #[doc = "Field `CTR22` writer - Protocol Control Bit 22"] -pub type CTR22_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR22_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR23` reader - Protocol Control Bit 23"] -pub type CTR23_R = crate::BitReader; +pub type CTR23_R = crate::BitReader; #[doc = "Field `CTR23` writer - Protocol Control Bit 23"] -pub type CTR23_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR23_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR24` reader - Protocol Control Bit 24"] -pub type CTR24_R = crate::BitReader; +pub type CTR24_R = crate::BitReader; #[doc = "Field `CTR24` writer - Protocol Control Bit 24"] -pub type CTR24_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR24_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR25` reader - Protocol Control Bit 25"] -pub type CTR25_R = crate::BitReader; +pub type CTR25_R = crate::BitReader; #[doc = "Field `CTR25` writer - Protocol Control Bit 25"] -pub type CTR25_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR25_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR26` reader - Protocol Control Bit 26"] -pub type CTR26_R = crate::BitReader; +pub type CTR26_R = crate::BitReader; #[doc = "Field `CTR26` writer - Protocol Control Bit 26"] -pub type CTR26_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR26_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR27` reader - Protocol Control Bit 27"] -pub type CTR27_R = crate::BitReader; +pub type CTR27_R = crate::BitReader; #[doc = "Field `CTR27` writer - Protocol Control Bit 27"] -pub type CTR27_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR27_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR28` reader - Protocol Control Bit 28"] -pub type CTR28_R = crate::BitReader; +pub type CTR28_R = crate::BitReader; #[doc = "Field `CTR28` writer - Protocol Control Bit 28"] -pub type CTR28_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR28_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR29` reader - Protocol Control Bit 29"] -pub type CTR29_R = crate::BitReader; +pub type CTR29_R = crate::BitReader; #[doc = "Field `CTR29` writer - Protocol Control Bit 29"] -pub type CTR29_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR29_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR30` reader - Protocol Control Bit 30"] -pub type CTR30_R = crate::BitReader; +pub type CTR30_R = crate::BitReader; #[doc = "Field `CTR30` writer - Protocol Control Bit 30"] -pub type CTR30_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR30_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `CTR31` reader - Protocol Control Bit 31"] -pub type CTR31_R = crate::BitReader; +pub type CTR31_R = crate::BitReader; #[doc = "Field `CTR31` writer - Protocol Control Bit 31"] -pub type CTR31_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SPEC, bool, O>; +pub type CTR31_W<'a, REG> = crate::BitWriter<'a, REG>; impl R { #[doc = "Bit 0 - Protocol Control Bit 0"] #[inline(always)] @@ -328,214 +296,215 @@ impl W { #[doc = "Bit 0 - Protocol Control Bit 0"] #[inline(always)] #[must_use] - pub fn ctr0(&mut self) -> CTR0_W<0> { - CTR0_W::new(self) + pub fn ctr0(&mut self) -> CTR0_W { + CTR0_W::new(self, 0) } #[doc = "Bit 1 - Protocol Control Bit 1"] #[inline(always)] #[must_use] - pub fn ctr1(&mut self) -> CTR1_W<1> { - CTR1_W::new(self) + pub fn ctr1(&mut self) -> CTR1_W { + CTR1_W::new(self, 1) } #[doc = "Bit 2 - Protocol Control Bit 2"] #[inline(always)] #[must_use] - pub fn ctr2(&mut self) -> CTR2_W<2> { - CTR2_W::new(self) + pub fn ctr2(&mut self) -> CTR2_W { + CTR2_W::new(self, 2) } #[doc = "Bit 3 - Protocol Control Bit 3"] #[inline(always)] #[must_use] - pub fn ctr3(&mut self) -> CTR3_W<3> { - CTR3_W::new(self) + pub fn ctr3(&mut self) -> CTR3_W { + CTR3_W::new(self, 3) } #[doc = "Bit 4 - Protocol Control Bit 4"] #[inline(always)] #[must_use] - pub fn ctr4(&mut self) -> CTR4_W<4> { - CTR4_W::new(self) + pub fn ctr4(&mut self) -> CTR4_W { + CTR4_W::new(self, 4) } #[doc = "Bit 5 - Protocol Control Bit 5"] #[inline(always)] #[must_use] - pub fn ctr5(&mut self) -> CTR5_W<5> { - CTR5_W::new(self) + pub fn ctr5(&mut self) -> CTR5_W { + CTR5_W::new(self, 5) } #[doc = "Bit 6 - Protocol Control Bit 6"] #[inline(always)] #[must_use] - pub fn ctr6(&mut self) -> CTR6_W<6> { - CTR6_W::new(self) + pub fn ctr6(&mut self) -> CTR6_W { + CTR6_W::new(self, 6) } #[doc = "Bit 7 - Protocol Control Bit 7"] #[inline(always)] #[must_use] - pub fn ctr7(&mut self) -> CTR7_W<7> { - CTR7_W::new(self) + pub fn ctr7(&mut self) -> CTR7_W { + CTR7_W::new(self, 7) } #[doc = "Bit 8 - Protocol Control Bit 8"] #[inline(always)] #[must_use] - pub fn ctr8(&mut self) -> CTR8_W<8> { - CTR8_W::new(self) + pub fn ctr8(&mut self) -> CTR8_W { + CTR8_W::new(self, 8) } #[doc = "Bit 9 - Protocol Control Bit 9"] #[inline(always)] #[must_use] - pub fn ctr9(&mut self) -> CTR9_W<9> { - CTR9_W::new(self) + pub fn ctr9(&mut self) -> CTR9_W { + CTR9_W::new(self, 9) } #[doc = "Bit 10 - Protocol Control Bit 10"] #[inline(always)] #[must_use] - pub fn ctr10(&mut self) -> CTR10_W<10> { - CTR10_W::new(self) + pub fn ctr10(&mut self) -> CTR10_W { + CTR10_W::new(self, 10) } #[doc = "Bit 11 - Protocol Control Bit 11"] #[inline(always)] #[must_use] - pub fn ctr11(&mut self) -> CTR11_W<11> { - CTR11_W::new(self) + pub fn ctr11(&mut self) -> CTR11_W { + CTR11_W::new(self, 11) } #[doc = "Bit 12 - Protocol Control Bit 12"] #[inline(always)] #[must_use] - pub fn ctr12(&mut self) -> CTR12_W<12> { - CTR12_W::new(self) + pub fn ctr12(&mut self) -> CTR12_W { + CTR12_W::new(self, 12) } #[doc = "Bit 13 - Protocol Control Bit 13"] #[inline(always)] #[must_use] - pub fn ctr13(&mut self) -> CTR13_W<13> { - CTR13_W::new(self) + pub fn ctr13(&mut self) -> CTR13_W { + CTR13_W::new(self, 13) } #[doc = "Bit 14 - Protocol Control Bit 14"] #[inline(always)] #[must_use] - pub fn ctr14(&mut self) -> CTR14_W<14> { - CTR14_W::new(self) + pub fn ctr14(&mut self) -> CTR14_W { + CTR14_W::new(self, 14) } #[doc = "Bit 15 - Protocol Control Bit 15"] #[inline(always)] #[must_use] - pub fn ctr15(&mut self) -> CTR15_W<15> { - CTR15_W::new(self) + pub fn ctr15(&mut self) -> CTR15_W { + CTR15_W::new(self, 15) } #[doc = "Bit 16 - Protocol Control Bit 16"] #[inline(always)] #[must_use] - pub fn ctr16(&mut self) -> CTR16_W<16> { - CTR16_W::new(self) + pub fn ctr16(&mut self) -> CTR16_W { + CTR16_W::new(self, 16) } #[doc = "Bit 17 - Protocol Control Bit 17"] #[inline(always)] #[must_use] - pub fn ctr17(&mut self) -> CTR17_W<17> { - CTR17_W::new(self) + pub fn ctr17(&mut self) -> CTR17_W { + CTR17_W::new(self, 17) } #[doc = "Bit 18 - Protocol Control Bit 18"] #[inline(always)] #[must_use] - pub fn ctr18(&mut self) -> CTR18_W<18> { - CTR18_W::new(self) + pub fn ctr18(&mut self) -> CTR18_W { + CTR18_W::new(self, 18) } #[doc = "Bit 19 - Protocol Control Bit 19"] #[inline(always)] #[must_use] - pub fn ctr19(&mut self) -> CTR19_W<19> { - CTR19_W::new(self) + pub fn ctr19(&mut self) -> CTR19_W { + CTR19_W::new(self, 19) } #[doc = "Bit 20 - Protocol Control Bit 20"] #[inline(always)] #[must_use] - pub fn ctr20(&mut self) -> CTR20_W<20> { - CTR20_W::new(self) + pub fn ctr20(&mut self) -> CTR20_W { + CTR20_W::new(self, 20) } #[doc = "Bit 21 - Protocol Control Bit 21"] #[inline(always)] #[must_use] - pub fn ctr21(&mut self) -> CTR21_W<21> { - CTR21_W::new(self) + pub fn ctr21(&mut self) -> CTR21_W { + CTR21_W::new(self, 21) } #[doc = "Bit 22 - Protocol Control Bit 22"] #[inline(always)] #[must_use] - pub fn ctr22(&mut self) -> CTR22_W<22> { - CTR22_W::new(self) + pub fn ctr22(&mut self) -> CTR22_W { + CTR22_W::new(self, 22) } #[doc = "Bit 23 - Protocol Control Bit 23"] #[inline(always)] #[must_use] - pub fn ctr23(&mut self) -> CTR23_W<23> { - CTR23_W::new(self) + pub fn ctr23(&mut self) -> CTR23_W { + CTR23_W::new(self, 23) } #[doc = "Bit 24 - Protocol Control Bit 24"] #[inline(always)] #[must_use] - pub fn ctr24(&mut self) -> CTR24_W<24> { - CTR24_W::new(self) + pub fn ctr24(&mut self) -> CTR24_W { + CTR24_W::new(self, 24) } #[doc = "Bit 25 - Protocol Control Bit 25"] #[inline(always)] #[must_use] - pub fn ctr25(&mut self) -> CTR25_W<25> { - CTR25_W::new(self) + pub fn ctr25(&mut self) -> CTR25_W { + CTR25_W::new(self, 25) } #[doc = "Bit 26 - Protocol Control Bit 26"] #[inline(always)] #[must_use] - pub fn ctr26(&mut self) -> CTR26_W<26> { - CTR26_W::new(self) + pub fn ctr26(&mut self) -> CTR26_W { + CTR26_W::new(self, 26) } #[doc = "Bit 27 - Protocol Control Bit 27"] #[inline(always)] #[must_use] - pub fn ctr27(&mut self) -> CTR27_W<27> { - CTR27_W::new(self) + pub fn ctr27(&mut self) -> CTR27_W { + CTR27_W::new(self, 27) } #[doc = "Bit 28 - Protocol Control Bit 28"] #[inline(always)] #[must_use] - pub fn ctr28(&mut self) -> CTR28_W<28> { - CTR28_W::new(self) + pub fn ctr28(&mut self) -> CTR28_W { + CTR28_W::new(self, 28) } #[doc = "Bit 29 - Protocol Control Bit 29"] #[inline(always)] #[must_use] - pub fn ctr29(&mut self) -> CTR29_W<29> { - CTR29_W::new(self) + pub fn ctr29(&mut self) -> CTR29_W { + CTR29_W::new(self, 29) } #[doc = "Bit 30 - Protocol Control Bit 30"] #[inline(always)] #[must_use] - pub fn ctr30(&mut self) -> CTR30_W<30> { - CTR30_W::new(self) + pub fn ctr30(&mut self) -> CTR30_W { + CTR30_W::new(self, 30) } #[doc = "Bit 31 - Protocol Control Bit 31"] #[inline(always)] #[must_use] - pub fn ctr31(&mut self) -> CTR31_W<31> { - CTR31_W::new(self) + pub fn ctr31(&mut self) -> CTR31_W { + CTR31_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pcr::R`](R) reader structure"] +impl crate::Readable for PCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pcr::W`](W) writer structure"] impl crate::Writable for PCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/pcr_ascmode.rs b/src/usic0_ch0/pcr_ascmode.rs index cf5cfc24..2858eb67 100644 --- a/src/usic0_ch0/pcr_ascmode.rs +++ b/src/usic0_ch0/pcr_ascmode.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SMD` reader - Sample Mode"] pub type SMD_R = crate::BitReader; #[doc = "Sample Mode\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SMD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SMD_A { + pub const fn variant(&self) -> SMD_A { match self.bits { false => SMD_A::VALUE1, true => SMD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Only one sample is taken per bit time. The current input value is sampled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SMD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Three samples are taken per bit time and a majority decision is made."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SMD_A::VALUE2 } } #[doc = "Field `SMD` writer - Sample Mode"] -pub type SMD_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, SMD_A, O>; -impl<'a, const O: u8> SMD_W<'a, O> { +pub type SMD_W<'a, REG> = crate::BitWriter<'a, REG, SMD_A>; +impl<'a, REG> SMD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Only one sample is taken per bit time. The current input value is sampled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SMD_A::VALUE1) } #[doc = "Three samples are taken per bit time and a majority decision is made."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SMD_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl STPB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STPB_A { + pub const fn variant(&self) -> STPB_A { match self.bits { false => STPB_A::VALUE1, true => STPB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The number of stop bits is 1."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STPB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The number of stop bits is 2."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STPB_A::VALUE2 } } #[doc = "Field `STPB` writer - Stop Bits"] -pub type STPB_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, STPB_A, O>; -impl<'a, const O: u8> STPB_W<'a, O> { +pub type STPB_W<'a, REG> = crate::BitWriter<'a, REG, STPB_A>; +impl<'a, REG> STPB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The number of stop bits is 1."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STPB_A::VALUE1) } #[doc = "The number of stop bits is 2."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STPB_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl IDM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> IDM_A { + pub const fn variant(&self) -> IDM_A { match self.bits { false => IDM_A::VALUE1, true => IDM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == IDM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The bus is considered as idle after a number of consecutive passive bit times defined by SCTR.FLE plus 2 (in the case without parity bit) or plus 3 (in the case with parity bit)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == IDM_A::VALUE2 } } #[doc = "Field `IDM` writer - Idle Detection Mode"] -pub type IDM_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, IDM_A, O>; -impl<'a, const O: u8> IDM_W<'a, O> { +pub type IDM_W<'a, REG> = crate::BitWriter<'a, REG, IDM_A>; +impl<'a, REG> IDM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(IDM_A::VALUE1) } #[doc = "The bus is considered as idle after a number of consecutive passive bit times defined by SCTR.FLE plus 2 (in the case without parity bit) or plus 3 (in the case with parity bit)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(IDM_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl SBIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SBIEN_A { + pub const fn variant(&self) -> SBIEN_A { match self.bits { false => SBIEN_A::VALUE1, true => SBIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SBIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SBIEN_A::VALUE2 } } #[doc = "Field `SBIEN` writer - Synchronization Break Interrupt Enable"] -pub type SBIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, SBIEN_A, O>; -impl<'a, const O: u8> SBIEN_W<'a, O> { +pub type SBIEN_W<'a, REG> = crate::BitWriter<'a, REG, SBIEN_A>; +impl<'a, REG> SBIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SBIEN_A::VALUE1) } #[doc = "The interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SBIEN_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CDEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CDEN_A { + pub const fn variant(&self) -> CDEN_A { match self.bits { false => CDEN_A::VALUE1, true => CDEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The collision detection is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CDEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "If a collision is detected, the transmitter stops its data transmission, outputs a 1, sets bit PSR.COL and generates a protocol interrupt. In order to allow data transmission again, PSR.COL has to be cleared by software."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CDEN_A::VALUE2 } } #[doc = "Field `CDEN` writer - Collision Detection Enable"] -pub type CDEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, CDEN_A, O>; -impl<'a, const O: u8> CDEN_W<'a, O> { +pub type CDEN_W<'a, REG> = crate::BitWriter<'a, REG, CDEN_A>; +impl<'a, REG> CDEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The collision detection is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CDEN_A::VALUE1) } #[doc = "If a collision is detected, the transmitter stops its data transmission, outputs a 1, sets bit PSR.COL and generates a protocol interrupt. In order to allow data transmission again, PSR.COL has to be cleared by software."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CDEN_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl RNIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RNIEN_A { + pub const fn variant(&self) -> RNIEN_A { match self.bits { false => RNIEN_A::VALUE1, true => RNIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RNIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RNIEN_A::VALUE2 } } #[doc = "Field `RNIEN` writer - Receiver Noise Detection Interrupt Enable"] -pub type RNIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, RNIEN_A, O>; -impl<'a, const O: u8> RNIEN_W<'a, O> { +pub type RNIEN_W<'a, REG> = crate::BitWriter<'a, REG, RNIEN_A>; +impl<'a, REG> RNIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RNIEN_A::VALUE1) } #[doc = "The interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RNIEN_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl FEIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FEIEN_A { + pub const fn variant(&self) -> FEIEN_A { match self.bits { false => FEIEN_A::VALUE1, true => FEIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FEIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FEIEN_A::VALUE2 } } #[doc = "Field `FEIEN` writer - Format Error Interrupt Enable"] -pub type FEIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, FEIEN_A, O>; -impl<'a, const O: u8> FEIEN_W<'a, O> { +pub type FEIEN_W<'a, REG> = crate::BitWriter<'a, REG, FEIEN_A>; +impl<'a, REG> FEIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FEIEN_A::VALUE1) } #[doc = "The interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FEIEN_A::VALUE2) } } @@ -403,43 +392,46 @@ impl From for bool { impl FFIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FFIEN_A { + pub const fn variant(&self) -> FFIEN_A { match self.bits { false => FFIEN_A::VALUE1, true => FFIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FFIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FFIEN_A::VALUE2 } } #[doc = "Field `FFIEN` writer - Frame Finished Interrupt Enable"] -pub type FFIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, FFIEN_A, O>; -impl<'a, const O: u8> FFIEN_W<'a, O> { +pub type FFIEN_W<'a, REG> = crate::BitWriter<'a, REG, FFIEN_A>; +impl<'a, REG> FFIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FFIEN_A::VALUE1) } #[doc = "The interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FFIEN_A::VALUE2) } } #[doc = "Field `SP` reader - Sample Point"] -pub type SP_R = crate::FieldReader; +pub type SP_R = crate::FieldReader; #[doc = "Field `SP` writer - Sample Point"] -pub type SP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCR_ASCMODE_SPEC, u8, u8, 5, O>; +pub type SP_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PL` reader - Pulse Length"] -pub type PL_R = crate::FieldReader; +pub type PL_R = crate::FieldReader; #[doc = "Pulse Length\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -459,10 +451,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PL_A { + type Ux = u8; +} impl PL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PL_A::VALUE1), 1 => Some(PL_A::VALUE2), @@ -471,48 +466,52 @@ impl PL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The pulse length is equal to the bit length (no shortened 0)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The pulse length of a 0 bit is 2 time quanta."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The pulse length of a 0 bit is 3 time quanta."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == PL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The pulse length of a 0 bit is 8 time quanta."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == PL_A::VALUE4 } } #[doc = "Field `PL` writer - Pulse Length"] -pub type PL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCR_ASCMODE_SPEC, u8, PL_A, 3, O>; -impl<'a, const O: u8> PL_W<'a, O> { +pub type PL_W<'a, REG> = crate::FieldWriter<'a, REG, 3, PL_A>; +impl<'a, REG> PL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The pulse length is equal to the bit length (no shortened 0)."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PL_A::VALUE1) } #[doc = "The pulse length of a 0 bit is 2 time quanta."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PL_A::VALUE2) } #[doc = "The pulse length of a 0 bit is 3 time quanta."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(PL_A::VALUE3) } #[doc = "The pulse length of a 0 bit is 8 time quanta."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(PL_A::VALUE4) } } @@ -537,36 +536,41 @@ impl From for bool { impl RSTEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSTEN_A { + pub const fn variant(&self) -> RSTEN_A { match self.bits { false => RSTEN_A::VALUE1, true => RSTEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Flag PSR\\[9\\] +is not modified depending on the receiver status."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSTEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flag PSR\\[9\\] +is set during the complete reception of a frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSTEN_A::VALUE2 } } #[doc = "Field `RSTEN` writer - Receiver Status Enable"] -pub type RSTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, RSTEN_A, O>; -impl<'a, const O: u8> RSTEN_W<'a, O> { +pub type RSTEN_W<'a, REG> = crate::BitWriter<'a, REG, RSTEN_A>; +impl<'a, REG> RSTEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Flag PSR\\[9\\] is not modified depending on the receiver status."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSTEN_A::VALUE1) } #[doc = "Flag PSR\\[9\\] is set during the complete reception of a frame."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSTEN_A::VALUE2) } } @@ -591,36 +595,41 @@ impl From for bool { impl TSTEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSTEN_A { + pub const fn variant(&self) -> TSTEN_A { match self.bits { false => TSTEN_A::VALUE1, true => TSTEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Flag PSR\\[9\\] +is not modified depending on the transmitter status."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSTEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Flag PSR\\[9\\] +is set during the complete transmission of a frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSTEN_A::VALUE2 } } #[doc = "Field `TSTEN` writer - Transmitter Status Enable"] -pub type TSTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, TSTEN_A, O>; -impl<'a, const O: u8> TSTEN_W<'a, O> { +pub type TSTEN_W<'a, REG> = crate::BitWriter<'a, REG, TSTEN_A>; +impl<'a, REG> TSTEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Flag PSR\\[9\\] is not modified depending on the transmitter status."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSTEN_A::VALUE1) } #[doc = "Flag PSR\\[9\\] is set during the complete transmission of a frame."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSTEN_A::VALUE2) } } @@ -643,34 +652,37 @@ impl From for bool { impl MCLK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCLK_A { + pub const fn variant(&self) -> MCLK_A { match self.bits { false => MCLK_A::VALUE1, true => MCLK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The MCLK generation is disabled and the MCLK signal is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCLK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The MCLK generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCLK_A::VALUE2 } } #[doc = "Field `MCLK` writer - Master Clock Enable"] -pub type MCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_ASCMODE_SPEC, MCLK_A, O>; -impl<'a, const O: u8> MCLK_W<'a, O> { +pub type MCLK_W<'a, REG> = crate::BitWriter<'a, REG, MCLK_A>; +impl<'a, REG> MCLK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The MCLK generation is disabled and the MCLK signal is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCLK_A::VALUE1) } #[doc = "The MCLK generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCLK_A::VALUE2) } } @@ -745,100 +757,101 @@ impl W { #[doc = "Bit 0 - Sample Mode"] #[inline(always)] #[must_use] - pub fn smd(&mut self) -> SMD_W<0> { - SMD_W::new(self) + pub fn smd(&mut self) -> SMD_W { + SMD_W::new(self, 0) } #[doc = "Bit 1 - Stop Bits"] #[inline(always)] #[must_use] - pub fn stpb(&mut self) -> STPB_W<1> { - STPB_W::new(self) + pub fn stpb(&mut self) -> STPB_W { + STPB_W::new(self, 1) } #[doc = "Bit 2 - Idle Detection Mode"] #[inline(always)] #[must_use] - pub fn idm(&mut self) -> IDM_W<2> { - IDM_W::new(self) + pub fn idm(&mut self) -> IDM_W { + IDM_W::new(self, 2) } #[doc = "Bit 3 - Synchronization Break Interrupt Enable"] #[inline(always)] #[must_use] - pub fn sbien(&mut self) -> SBIEN_W<3> { - SBIEN_W::new(self) + pub fn sbien(&mut self) -> SBIEN_W { + SBIEN_W::new(self, 3) } #[doc = "Bit 4 - Collision Detection Enable"] #[inline(always)] #[must_use] - pub fn cden(&mut self) -> CDEN_W<4> { - CDEN_W::new(self) + pub fn cden(&mut self) -> CDEN_W { + CDEN_W::new(self, 4) } #[doc = "Bit 5 - Receiver Noise Detection Interrupt Enable"] #[inline(always)] #[must_use] - pub fn rnien(&mut self) -> RNIEN_W<5> { - RNIEN_W::new(self) + pub fn rnien(&mut self) -> RNIEN_W { + RNIEN_W::new(self, 5) } #[doc = "Bit 6 - Format Error Interrupt Enable"] #[inline(always)] #[must_use] - pub fn feien(&mut self) -> FEIEN_W<6> { - FEIEN_W::new(self) + pub fn feien(&mut self) -> FEIEN_W { + FEIEN_W::new(self, 6) } #[doc = "Bit 7 - Frame Finished Interrupt Enable"] #[inline(always)] #[must_use] - pub fn ffien(&mut self) -> FFIEN_W<7> { - FFIEN_W::new(self) + pub fn ffien(&mut self) -> FFIEN_W { + FFIEN_W::new(self, 7) } #[doc = "Bits 8:12 - Sample Point"] #[inline(always)] #[must_use] - pub fn sp(&mut self) -> SP_W<8> { - SP_W::new(self) + pub fn sp(&mut self) -> SP_W { + SP_W::new(self, 8) } #[doc = "Bits 13:15 - Pulse Length"] #[inline(always)] #[must_use] - pub fn pl(&mut self) -> PL_W<13> { - PL_W::new(self) + pub fn pl(&mut self) -> PL_W { + PL_W::new(self, 13) } #[doc = "Bit 16 - Receiver Status Enable"] #[inline(always)] #[must_use] - pub fn rsten(&mut self) -> RSTEN_W<16> { - RSTEN_W::new(self) + pub fn rsten(&mut self) -> RSTEN_W { + RSTEN_W::new(self, 16) } #[doc = "Bit 17 - Transmitter Status Enable"] #[inline(always)] #[must_use] - pub fn tsten(&mut self) -> TSTEN_W<17> { - TSTEN_W::new(self) + pub fn tsten(&mut self) -> TSTEN_W { + TSTEN_W::new(self, 17) } #[doc = "Bit 31 - Master Clock Enable"] #[inline(always)] #[must_use] - pub fn mclk(&mut self) -> MCLK_W<31> { - MCLK_W::new(self) + pub fn mclk(&mut self) -> MCLK_W { + MCLK_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Control Register \\[ASC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr_ascmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr_ascmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pcr_ascmode::R`](R) reader structure"] +impl crate::Readable for PCR_ASCMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pcr_ascmode::W`](W) writer structure"] impl crate::Writable for PCR_ASCMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/pcr_iicmode.rs b/src/usic0_ch0/pcr_iicmode.rs index 11ea17b6..ca9f2642 100644 --- a/src/usic0_ch0/pcr_iicmode.rs +++ b/src/usic0_ch0/pcr_iicmode.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SLAD` reader - Slave Address"] -pub type SLAD_R = crate::FieldReader; +pub type SLAD_R = crate::FieldReader; #[doc = "Field `SLAD` writer - Slave Address"] -pub type SLAD_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCR_IICMODE_SPEC, u16, u16, 16, O>; +pub type SLAD_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `ACK00` reader - Acknowledge 00H"] pub type ACK00_R = crate::BitReader; #[doc = "Acknowledge 00H\n\nValue on reset: 0"] @@ -57,34 +25,37 @@ impl From for bool { impl ACK00_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ACK00_A { + pub const fn variant(&self) -> ACK00_A { match self.bits { false => ACK00_A::VALUE1, true => ACK00_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The slave device is not sensitive to this address."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ACK00_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The slave device is sensitive to this address."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ACK00_A::VALUE2 } } #[doc = "Field `ACK00` writer - Acknowledge 00H"] -pub type ACK00_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, ACK00_A, O>; -impl<'a, const O: u8> ACK00_W<'a, O> { +pub type ACK00_W<'a, REG> = crate::BitWriter<'a, REG, ACK00_A>; +impl<'a, REG> ACK00_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The slave device is not sensitive to this address."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ACK00_A::VALUE1) } #[doc = "The slave device is sensitive to this address."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ACK00_A::VALUE2) } } @@ -107,34 +78,37 @@ impl From for bool { impl STIM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STIM_A { + pub const fn variant(&self) -> STIM_A { match self.bits { false => STIM_A::VALUE1, true => STIM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A symbol contains 10 time quanta. The timing is adapted for standard mode (100 kBaud)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STIM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A symbol contains 25 time quanta. The timing is adapted for fast mode (400 kBaud)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STIM_A::VALUE2 } } #[doc = "Field `STIM` writer - Symbol Timing"] -pub type STIM_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, STIM_A, O>; -impl<'a, const O: u8> STIM_W<'a, O> { +pub type STIM_W<'a, REG> = crate::BitWriter<'a, REG, STIM_A>; +impl<'a, REG> STIM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A symbol contains 10 time quanta. The timing is adapted for standard mode (100 kBaud)."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STIM_A::VALUE1) } #[doc = "A symbol contains 25 time quanta. The timing is adapted for fast mode (400 kBaud)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STIM_A::VALUE2) } } @@ -157,34 +131,37 @@ impl From for bool { impl SCRIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCRIEN_A { + pub const fn variant(&self) -> SCRIEN_A { match self.bits { false => SCRIEN_A::VALUE1, true => SCRIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The start condition interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCRIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The start condition interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCRIEN_A::VALUE2 } } #[doc = "Field `SCRIEN` writer - Start Condition Received Interrupt Enable"] -pub type SCRIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, SCRIEN_A, O>; -impl<'a, const O: u8> SCRIEN_W<'a, O> { +pub type SCRIEN_W<'a, REG> = crate::BitWriter<'a, REG, SCRIEN_A>; +impl<'a, REG> SCRIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The start condition interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCRIEN_A::VALUE1) } #[doc = "The start condition interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCRIEN_A::VALUE2) } } @@ -207,34 +184,37 @@ impl From for bool { impl RSCRIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSCRIEN_A { + pub const fn variant(&self) -> RSCRIEN_A { match self.bits { false => RSCRIEN_A::VALUE1, true => RSCRIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The repeated start condition interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSCRIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The repeated start condition interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSCRIEN_A::VALUE2 } } #[doc = "Field `RSCRIEN` writer - Repeated Start Condition Received Interrupt Enable"] -pub type RSCRIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, RSCRIEN_A, O>; -impl<'a, const O: u8> RSCRIEN_W<'a, O> { +pub type RSCRIEN_W<'a, REG> = crate::BitWriter<'a, REG, RSCRIEN_A>; +impl<'a, REG> RSCRIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The repeated start condition interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSCRIEN_A::VALUE1) } #[doc = "The repeated start condition interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSCRIEN_A::VALUE2) } } @@ -257,34 +237,37 @@ impl From for bool { impl PCRIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCRIEN_A { + pub const fn variant(&self) -> PCRIEN_A { match self.bits { false => PCRIEN_A::VALUE1, true => PCRIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The stop condition interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCRIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The stop condition interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCRIEN_A::VALUE2 } } #[doc = "Field `PCRIEN` writer - Stop Condition Received Interrupt Enable"] -pub type PCRIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, PCRIEN_A, O>; -impl<'a, const O: u8> PCRIEN_W<'a, O> { +pub type PCRIEN_W<'a, REG> = crate::BitWriter<'a, REG, PCRIEN_A>; +impl<'a, REG> PCRIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The stop condition interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PCRIEN_A::VALUE1) } #[doc = "The stop condition interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PCRIEN_A::VALUE2) } } @@ -307,34 +290,37 @@ impl From for bool { impl NACKIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NACKIEN_A { + pub const fn variant(&self) -> NACKIEN_A { match self.bits { false => NACKIEN_A::VALUE1, true => NACKIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The non-acknowledge interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NACKIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The non-acknowledge interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NACKIEN_A::VALUE2 } } #[doc = "Field `NACKIEN` writer - Non-Acknowledge Interrupt Enable"] -pub type NACKIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, NACKIEN_A, O>; -impl<'a, const O: u8> NACKIEN_W<'a, O> { +pub type NACKIEN_W<'a, REG> = crate::BitWriter<'a, REG, NACKIEN_A>; +impl<'a, REG> NACKIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The non-acknowledge interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NACKIEN_A::VALUE1) } #[doc = "The non-acknowledge interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NACKIEN_A::VALUE2) } } @@ -357,34 +343,37 @@ impl From for bool { impl ARLIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ARLIEN_A { + pub const fn variant(&self) -> ARLIEN_A { match self.bits { false => ARLIEN_A::VALUE1, true => ARLIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The arbitration lost interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ARLIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The arbitration lost interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ARLIEN_A::VALUE2 } } #[doc = "Field `ARLIEN` writer - Arbitration Lost Interrupt Enable"] -pub type ARLIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, ARLIEN_A, O>; -impl<'a, const O: u8> ARLIEN_W<'a, O> { +pub type ARLIEN_W<'a, REG> = crate::BitWriter<'a, REG, ARLIEN_A>; +impl<'a, REG> ARLIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The arbitration lost interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ARLIEN_A::VALUE1) } #[doc = "The arbitration lost interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ARLIEN_A::VALUE2) } } @@ -407,34 +396,37 @@ impl From for bool { impl SRRIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRRIEN_A { + pub const fn variant(&self) -> SRRIEN_A { match self.bits { false => SRRIEN_A::VALUE1, true => SRRIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The slave read request interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRRIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The slave read request interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRRIEN_A::VALUE2 } } #[doc = "Field `SRRIEN` writer - Slave Read Request Interrupt Enable"] -pub type SRRIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, SRRIEN_A, O>; -impl<'a, const O: u8> SRRIEN_W<'a, O> { +pub type SRRIEN_W<'a, REG> = crate::BitWriter<'a, REG, SRRIEN_A>; +impl<'a, REG> SRRIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The slave read request interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRRIEN_A::VALUE1) } #[doc = "The slave read request interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRRIEN_A::VALUE2) } } @@ -457,34 +449,37 @@ impl From for bool { impl ERRIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERRIEN_A { + pub const fn variant(&self) -> ERRIEN_A { match self.bits { false => ERRIEN_A::VALUE1, true => ERRIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The error interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERRIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The error interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERRIEN_A::VALUE2 } } #[doc = "Field `ERRIEN` writer - Error Interrupt Enable"] -pub type ERRIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, ERRIEN_A, O>; -impl<'a, const O: u8> ERRIEN_W<'a, O> { +pub type ERRIEN_W<'a, REG> = crate::BitWriter<'a, REG, ERRIEN_A>; +impl<'a, REG> ERRIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The error interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERRIEN_A::VALUE1) } #[doc = "The error interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERRIEN_A::VALUE2) } } @@ -507,41 +502,44 @@ impl From for bool { impl SACKDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SACKDIS_A { + pub const fn variant(&self) -> SACKDIS_A { match self.bits { false => SACKDIS_A::VALUE1, true => SACKDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The generation of an active slave acknowledge is enabled (slave acknowledge with 0 level = more bytes can be received)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SACKDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The generation of an active slave acknowledge is disabled (slave acknowledge with 1 level = reception stopped)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SACKDIS_A::VALUE2 } } #[doc = "Field `SACKDIS` writer - Slave Acknowledge Disable"] -pub type SACKDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, SACKDIS_A, O>; -impl<'a, const O: u8> SACKDIS_W<'a, O> { +pub type SACKDIS_W<'a, REG> = crate::BitWriter<'a, REG, SACKDIS_A>; +impl<'a, REG> SACKDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The generation of an active slave acknowledge is enabled (slave acknowledge with 0 level = more bytes can be received)."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SACKDIS_A::VALUE1) } #[doc = "The generation of an active slave acknowledge is disabled (slave acknowledge with 1 level = reception stopped)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SACKDIS_A::VALUE2) } } #[doc = "Field `HDEL` reader - Hardware Delay"] -pub type HDEL_R = crate::FieldReader; +pub type HDEL_R = crate::FieldReader; #[doc = "Field `HDEL` writer - Hardware Delay"] -pub type HDEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCR_IICMODE_SPEC, u8, u8, 4, O>; +pub type HDEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `ACKIEN` reader - Acknowledge Interrupt Enable"] pub type ACKIEN_R = crate::BitReader; #[doc = "Acknowledge Interrupt Enable\n\nValue on reset: 0"] @@ -561,34 +559,37 @@ impl From for bool { impl ACKIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ACKIEN_A { + pub const fn variant(&self) -> ACKIEN_A { match self.bits { false => ACKIEN_A::VALUE1, true => ACKIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The acknowledge interrupt is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ACKIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The acknowledge interrupt is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ACKIEN_A::VALUE2 } } #[doc = "Field `ACKIEN` writer - Acknowledge Interrupt Enable"] -pub type ACKIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, ACKIEN_A, O>; -impl<'a, const O: u8> ACKIEN_W<'a, O> { +pub type ACKIEN_W<'a, REG> = crate::BitWriter<'a, REG, ACKIEN_A>; +impl<'a, REG> ACKIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The acknowledge interrupt is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ACKIEN_A::VALUE1) } #[doc = "The acknowledge interrupt is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ACKIEN_A::VALUE2) } } @@ -611,34 +612,37 @@ impl From for bool { impl MCLK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCLK_A { + pub const fn variant(&self) -> MCLK_A { match self.bits { false => MCLK_A::VALUE1, true => MCLK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The MCLK generation is disabled and MCLK is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCLK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The MCLK generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCLK_A::VALUE2 } } #[doc = "Field `MCLK` writer - Master Clock Enable"] -pub type MCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IICMODE_SPEC, MCLK_A, O>; -impl<'a, const O: u8> MCLK_W<'a, O> { +pub type MCLK_W<'a, REG> = crate::BitWriter<'a, REG, MCLK_A>; +impl<'a, REG> MCLK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The MCLK generation is disabled and MCLK is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCLK_A::VALUE1) } #[doc = "The MCLK generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCLK_A::VALUE2) } } @@ -718,106 +722,107 @@ impl W { #[doc = "Bits 0:15 - Slave Address"] #[inline(always)] #[must_use] - pub fn slad(&mut self) -> SLAD_W<0> { - SLAD_W::new(self) + pub fn slad(&mut self) -> SLAD_W { + SLAD_W::new(self, 0) } #[doc = "Bit 16 - Acknowledge 00H"] #[inline(always)] #[must_use] - pub fn ack00(&mut self) -> ACK00_W<16> { - ACK00_W::new(self) + pub fn ack00(&mut self) -> ACK00_W { + ACK00_W::new(self, 16) } #[doc = "Bit 17 - Symbol Timing"] #[inline(always)] #[must_use] - pub fn stim(&mut self) -> STIM_W<17> { - STIM_W::new(self) + pub fn stim(&mut self) -> STIM_W { + STIM_W::new(self, 17) } #[doc = "Bit 18 - Start Condition Received Interrupt Enable"] #[inline(always)] #[must_use] - pub fn scrien(&mut self) -> SCRIEN_W<18> { - SCRIEN_W::new(self) + pub fn scrien(&mut self) -> SCRIEN_W { + SCRIEN_W::new(self, 18) } #[doc = "Bit 19 - Repeated Start Condition Received Interrupt Enable"] #[inline(always)] #[must_use] - pub fn rscrien(&mut self) -> RSCRIEN_W<19> { - RSCRIEN_W::new(self) + pub fn rscrien(&mut self) -> RSCRIEN_W { + RSCRIEN_W::new(self, 19) } #[doc = "Bit 20 - Stop Condition Received Interrupt Enable"] #[inline(always)] #[must_use] - pub fn pcrien(&mut self) -> PCRIEN_W<20> { - PCRIEN_W::new(self) + pub fn pcrien(&mut self) -> PCRIEN_W { + PCRIEN_W::new(self, 20) } #[doc = "Bit 21 - Non-Acknowledge Interrupt Enable"] #[inline(always)] #[must_use] - pub fn nackien(&mut self) -> NACKIEN_W<21> { - NACKIEN_W::new(self) + pub fn nackien(&mut self) -> NACKIEN_W { + NACKIEN_W::new(self, 21) } #[doc = "Bit 22 - Arbitration Lost Interrupt Enable"] #[inline(always)] #[must_use] - pub fn arlien(&mut self) -> ARLIEN_W<22> { - ARLIEN_W::new(self) + pub fn arlien(&mut self) -> ARLIEN_W { + ARLIEN_W::new(self, 22) } #[doc = "Bit 23 - Slave Read Request Interrupt Enable"] #[inline(always)] #[must_use] - pub fn srrien(&mut self) -> SRRIEN_W<23> { - SRRIEN_W::new(self) + pub fn srrien(&mut self) -> SRRIEN_W { + SRRIEN_W::new(self, 23) } #[doc = "Bit 24 - Error Interrupt Enable"] #[inline(always)] #[must_use] - pub fn errien(&mut self) -> ERRIEN_W<24> { - ERRIEN_W::new(self) + pub fn errien(&mut self) -> ERRIEN_W { + ERRIEN_W::new(self, 24) } #[doc = "Bit 25 - Slave Acknowledge Disable"] #[inline(always)] #[must_use] - pub fn sackdis(&mut self) -> SACKDIS_W<25> { - SACKDIS_W::new(self) + pub fn sackdis(&mut self) -> SACKDIS_W { + SACKDIS_W::new(self, 25) } #[doc = "Bits 26:29 - Hardware Delay"] #[inline(always)] #[must_use] - pub fn hdel(&mut self) -> HDEL_W<26> { - HDEL_W::new(self) + pub fn hdel(&mut self) -> HDEL_W { + HDEL_W::new(self, 26) } #[doc = "Bit 30 - Acknowledge Interrupt Enable"] #[inline(always)] #[must_use] - pub fn ackien(&mut self) -> ACKIEN_W<30> { - ACKIEN_W::new(self) + pub fn ackien(&mut self) -> ACKIEN_W { + ACKIEN_W::new(self, 30) } #[doc = "Bit 31 - Master Clock Enable"] #[inline(always)] #[must_use] - pub fn mclk(&mut self) -> MCLK_W<31> { - MCLK_W::new(self) + pub fn mclk(&mut self) -> MCLK_W { + MCLK_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Control Register \\[IIC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr_iicmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr_iicmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pcr_iicmode::R`](R) reader structure"] +impl crate::Readable for PCR_IICMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pcr_iicmode::W`](W) writer structure"] impl crate::Writable for PCR_IICMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/pcr_iismode.rs b/src/usic0_ch0/pcr_iismode.rs index bdc35af5..2380457b 100644 --- a/src/usic0_ch0/pcr_iismode.rs +++ b/src/usic0_ch0/pcr_iismode.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WAGEN` reader - WA Generation Enable"] pub type WAGEN_R = crate::BitReader; #[doc = "WA Generation Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl WAGEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WAGEN_A { + pub const fn variant(&self) -> WAGEN_A { match self.bits { false => WAGEN_A::VALUE1, true => WAGEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == WAGEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The IIS can be used as master. The generation of the word address signal is enabled. The signal starts with a 0 after being enabled. The generation of MCLK is enabled, independent of PCR.MCLK. After clearing WAGEN, the USIC module stops the generation of the WA signal within the next 4 WA periods."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WAGEN_A::VALUE2 } } #[doc = "Field `WAGEN` writer - WA Generation Enable"] -pub type WAGEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IISMODE_SPEC, WAGEN_A, O>; -impl<'a, const O: u8> WAGEN_W<'a, O> { +pub type WAGEN_W<'a, REG> = crate::BitWriter<'a, REG, WAGEN_A>; +impl<'a, REG> WAGEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WAGEN_A::VALUE1) } #[doc = "The IIS can be used as master. The generation of the word address signal is enabled. The signal starts with a 0 after being enabled. The generation of MCLK is enabled, independent of PCR.MCLK. After clearing WAGEN, the USIC module stops the generation of the WA signal within the next 4 WA periods."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WAGEN_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl DTEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DTEN_A { + pub const fn variant(&self) -> DTEN_A { match self.bits { false => DTEN_A::VALUE1, true => DTEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The changes of the WA input signal are ignored and no transfers take place."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DTEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Transfers are enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DTEN_A::VALUE2 } } #[doc = "Field `DTEN` writer - Data Transfers Enable"] -pub type DTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IISMODE_SPEC, DTEN_A, O>; -impl<'a, const O: u8> DTEN_W<'a, O> { +pub type DTEN_W<'a, REG> = crate::BitWriter<'a, REG, DTEN_A>; +impl<'a, REG> DTEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The changes of the WA input signal are ignored and no transfers take place."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DTEN_A::VALUE1) } #[doc = "Transfers are enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DTEN_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl SELINV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELINV_A { + pub const fn variant(&self) -> SELINV_A { match self.bits { false => SELINV_A::VALUE1, true => SELINV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The SELOx outputs have the same polarity as the WA signal."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELINV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The SELOx outputs have the inverted polarity to the WA signal."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELINV_A::VALUE2 } } #[doc = "Field `SELINV` writer - Select Inversion"] -pub type SELINV_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IISMODE_SPEC, SELINV_A, O>; -impl<'a, const O: u8> SELINV_W<'a, O> { +pub type SELINV_W<'a, REG> = crate::BitWriter<'a, REG, SELINV_A>; +impl<'a, REG> SELINV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The SELOx outputs have the same polarity as the WA signal."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELINV_A::VALUE1) } #[doc = "The SELOx outputs have the inverted polarity to the WA signal."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELINV_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl WAFEIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WAFEIEN_A { + pub const fn variant(&self) -> WAFEIEN_A { match self.bits { false => WAFEIEN_A::VALUE1, true => WAFEIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A protocol interrupt is not activated if a falling edge of WA is generated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WAFEIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A protocol interrupt is activated if a falling edge of WA is generated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WAFEIEN_A::VALUE2 } } #[doc = "Field `WAFEIEN` writer - WA Falling Edge Interrupt Enable"] -pub type WAFEIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IISMODE_SPEC, WAFEIEN_A, O>; -impl<'a, const O: u8> WAFEIEN_W<'a, O> { +pub type WAFEIEN_W<'a, REG> = crate::BitWriter<'a, REG, WAFEIEN_A>; +impl<'a, REG> WAFEIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A protocol interrupt is not activated if a falling edge of WA is generated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WAFEIEN_A::VALUE1) } #[doc = "A protocol interrupt is activated if a falling edge of WA is generated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WAFEIEN_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl WAREIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WAREIEN_A { + pub const fn variant(&self) -> WAREIEN_A { match self.bits { false => WAREIEN_A::VALUE1, true => WAREIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A protocol interrupt is not activated if a rising edge of WA is generated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WAREIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A protocol interrupt is activated if a rising edge of WA is generated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WAREIEN_A::VALUE2 } } #[doc = "Field `WAREIEN` writer - WA Rising Edge Interrupt Enable"] -pub type WAREIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IISMODE_SPEC, WAREIEN_A, O>; -impl<'a, const O: u8> WAREIEN_W<'a, O> { +pub type WAREIEN_W<'a, REG> = crate::BitWriter<'a, REG, WAREIEN_A>; +impl<'a, REG> WAREIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A protocol interrupt is not activated if a rising edge of WA is generated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WAREIEN_A::VALUE1) } #[doc = "A protocol interrupt is activated if a rising edge of WA is generated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WAREIEN_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl ENDIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENDIEN_A { + pub const fn variant(&self) -> ENDIEN_A { match self.bits { false => ENDIEN_A::VALUE1, true => ENDIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A protocol interrupt is not activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENDIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A protocol interrupt is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENDIEN_A::VALUE2 } } #[doc = "Field `ENDIEN` writer - END Interrupt Enable"] -pub type ENDIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IISMODE_SPEC, ENDIEN_A, O>; -impl<'a, const O: u8> ENDIEN_W<'a, O> { +pub type ENDIEN_W<'a, REG> = crate::BitWriter<'a, REG, ENDIEN_A>; +impl<'a, REG> ENDIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A protocol interrupt is not activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENDIEN_A::VALUE1) } #[doc = "A protocol interrupt is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENDIEN_A::VALUE2) } } @@ -353,41 +339,44 @@ impl From for bool { impl DX2TIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DX2TIEN_A { + pub const fn variant(&self) -> DX2TIEN_A { match self.bits { false => DX2TIEN_A::VALUE1, true => DX2TIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A protocol interrupt is not generated if DX2T is active."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DX2TIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A protocol interrupt is generated if DX2T is active."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DX2TIEN_A::VALUE2 } } #[doc = "Field `DX2TIEN` writer - DX2T Interrupt Enable"] -pub type DX2TIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IISMODE_SPEC, DX2TIEN_A, O>; -impl<'a, const O: u8> DX2TIEN_W<'a, O> { +pub type DX2TIEN_W<'a, REG> = crate::BitWriter<'a, REG, DX2TIEN_A>; +impl<'a, REG> DX2TIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A protocol interrupt is not generated if DX2T is active."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DX2TIEN_A::VALUE1) } #[doc = "A protocol interrupt is generated if DX2T is active."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DX2TIEN_A::VALUE2) } } #[doc = "Field `TDEL` reader - Transfer Delay"] -pub type TDEL_R = crate::FieldReader; +pub type TDEL_R = crate::FieldReader; #[doc = "Field `TDEL` writer - Transfer Delay"] -pub type TDEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCR_IISMODE_SPEC, u8, u8, 6, O>; +pub type TDEL_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `MCLK` reader - Master Clock Enable"] pub type MCLK_R = crate::BitReader; #[doc = "Master Clock Enable\n\nValue on reset: 0"] @@ -407,34 +396,37 @@ impl From for bool { impl MCLK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCLK_A { + pub const fn variant(&self) -> MCLK_A { match self.bits { false => MCLK_A::VALUE1, true => MCLK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The MCLK generation is disabled and MCLK is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCLK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The MCLK generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCLK_A::VALUE2 } } #[doc = "Field `MCLK` writer - Master Clock Enable"] -pub type MCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_IISMODE_SPEC, MCLK_A, O>; -impl<'a, const O: u8> MCLK_W<'a, O> { +pub type MCLK_W<'a, REG> = crate::BitWriter<'a, REG, MCLK_A>; +impl<'a, REG> MCLK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The MCLK generation is disabled and MCLK is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCLK_A::VALUE1) } #[doc = "The MCLK generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCLK_A::VALUE2) } } @@ -489,76 +481,77 @@ impl W { #[doc = "Bit 0 - WA Generation Enable"] #[inline(always)] #[must_use] - pub fn wagen(&mut self) -> WAGEN_W<0> { - WAGEN_W::new(self) + pub fn wagen(&mut self) -> WAGEN_W { + WAGEN_W::new(self, 0) } #[doc = "Bit 1 - Data Transfers Enable"] #[inline(always)] #[must_use] - pub fn dten(&mut self) -> DTEN_W<1> { - DTEN_W::new(self) + pub fn dten(&mut self) -> DTEN_W { + DTEN_W::new(self, 1) } #[doc = "Bit 2 - Select Inversion"] #[inline(always)] #[must_use] - pub fn selinv(&mut self) -> SELINV_W<2> { - SELINV_W::new(self) + pub fn selinv(&mut self) -> SELINV_W { + SELINV_W::new(self, 2) } #[doc = "Bit 4 - WA Falling Edge Interrupt Enable"] #[inline(always)] #[must_use] - pub fn wafeien(&mut self) -> WAFEIEN_W<4> { - WAFEIEN_W::new(self) + pub fn wafeien(&mut self) -> WAFEIEN_W { + WAFEIEN_W::new(self, 4) } #[doc = "Bit 5 - WA Rising Edge Interrupt Enable"] #[inline(always)] #[must_use] - pub fn wareien(&mut self) -> WAREIEN_W<5> { - WAREIEN_W::new(self) + pub fn wareien(&mut self) -> WAREIEN_W { + WAREIEN_W::new(self, 5) } #[doc = "Bit 6 - END Interrupt Enable"] #[inline(always)] #[must_use] - pub fn endien(&mut self) -> ENDIEN_W<6> { - ENDIEN_W::new(self) + pub fn endien(&mut self) -> ENDIEN_W { + ENDIEN_W::new(self, 6) } #[doc = "Bit 15 - DX2T Interrupt Enable"] #[inline(always)] #[must_use] - pub fn dx2tien(&mut self) -> DX2TIEN_W<15> { - DX2TIEN_W::new(self) + pub fn dx2tien(&mut self) -> DX2TIEN_W { + DX2TIEN_W::new(self, 15) } #[doc = "Bits 16:21 - Transfer Delay"] #[inline(always)] #[must_use] - pub fn tdel(&mut self) -> TDEL_W<16> { - TDEL_W::new(self) + pub fn tdel(&mut self) -> TDEL_W { + TDEL_W::new(self, 16) } #[doc = "Bit 31 - Master Clock Enable"] #[inline(always)] #[must_use] - pub fn mclk(&mut self) -> MCLK_W<31> { - MCLK_W::new(self) + pub fn mclk(&mut self) -> MCLK_W { + MCLK_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Control Register \\[IIS Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr_iismode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr_iismode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pcr_iismode::R`](R) reader structure"] +impl crate::Readable for PCR_IISMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pcr_iismode::W`](W) writer structure"] impl crate::Writable for PCR_IISMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/pcr_sscmode.rs b/src/usic0_ch0/pcr_sscmode.rs index d12c1dac..9cd2ecff 100644 --- a/src/usic0_ch0/pcr_sscmode.rs +++ b/src/usic0_ch0/pcr_sscmode.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MSLSEN` reader - MSLS Enable"] pub type MSLSEN_R = crate::BitReader; #[doc = "MSLS Enable\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl MSLSEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSLSEN_A { + pub const fn variant(&self) -> MSLSEN_A { match self.bits { false => MSLSEN_A::VALUE1, true => MSLSEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The MSLS generation is disabled (MSLS = 0). This is the setting for SSC slave mode."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSLSEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The MSLS generation is enabled. This is the setting for SSC master mode."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSLSEN_A::VALUE2 } } #[doc = "Field `MSLSEN` writer - MSLS Enable"] -pub type MSLSEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, MSLSEN_A, O>; -impl<'a, const O: u8> MSLSEN_W<'a, O> { +pub type MSLSEN_W<'a, REG> = crate::BitWriter<'a, REG, MSLSEN_A>; +impl<'a, REG> MSLSEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The MSLS generation is disabled (MSLS = 0). This is the setting for SSC slave mode."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSLSEN_A::VALUE1) } #[doc = "The MSLS generation is enabled. This is the setting for SSC master mode."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSLSEN_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl SELCTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELCTR_A { + pub const fn variant(&self) -> SELCTR_A { match self.bits { false => SELCTR_A::VALUE1, true => SELCTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The coded select mode is enabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELCTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The direct select mode is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELCTR_A::VALUE2 } } #[doc = "Field `SELCTR` writer - Select Control"] -pub type SELCTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, SELCTR_A, O>; -impl<'a, const O: u8> SELCTR_W<'a, O> { +pub type SELCTR_W<'a, REG> = crate::BitWriter<'a, REG, SELCTR_A>; +impl<'a, REG> SELCTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The coded select mode is enabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELCTR_A::VALUE1) } #[doc = "The direct select mode is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELCTR_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl SELINV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELINV_A { + pub const fn variant(&self) -> SELINV_A { match self.bits { false => SELINV_A::VALUE1, true => SELINV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The SELO outputs have the same polarity as the MSLS signal (active high)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELINV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The SELO outputs have the inverted polarity to the MSLS signal (active low)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELINV_A::VALUE2 } } #[doc = "Field `SELINV` writer - Select Inversion"] -pub type SELINV_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, SELINV_A, O>; -impl<'a, const O: u8> SELINV_W<'a, O> { +pub type SELINV_W<'a, REG> = crate::BitWriter<'a, REG, SELINV_A>; +impl<'a, REG> SELINV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The SELO outputs have the same polarity as the MSLS signal (active high)."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELINV_A::VALUE1) } #[doc = "The SELO outputs have the inverted polarity to the MSLS signal (active low)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELINV_A::VALUE2) } } @@ -203,39 +180,42 @@ impl From for bool { impl FEM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FEM_A { + pub const fn variant(&self) -> FEM_A { match self.bits { false => FEM_A::VALUE1, true => FEM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == FEM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The MSLS signal is kept active also while no new data is available and no other end of frame condition is reached. In this case, the software can accept delays in delivering the data without automatic deactivation of MSLS in multi-word data frames."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FEM_A::VALUE2 } } #[doc = "Field `FEM` writer - Frame End Mode"] -pub type FEM_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, FEM_A, O>; -impl<'a, const O: u8> FEM_W<'a, O> { +pub type FEM_W<'a, REG> = crate::BitWriter<'a, REG, FEM_A>; +impl<'a, REG> FEM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FEM_A::VALUE1) } #[doc = "The MSLS signal is kept active also while no new data is available and no other end of frame condition is reached. In this case, the software can accept delays in delivering the data without automatic deactivation of MSLS in multi-word data frames."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FEM_A::VALUE2) } } #[doc = "Field `CTQSEL1` reader - Input Frequency Selection"] -pub type CTQSEL1_R = crate::FieldReader; +pub type CTQSEL1_R = crate::FieldReader; #[doc = "Input Frequency Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -255,10 +235,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CTQSEL1_A { + type Ux = u8; +} impl CTQSEL1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CTQSEL1_A { + pub const fn variant(&self) -> CTQSEL1_A { match self.bits { 0 => CTQSEL1_A::VALUE1, 1 => CTQSEL1_A::VALUE2, @@ -267,59 +250,63 @@ impl CTQSEL1_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fCTQIN = fPDIV"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CTQSEL1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fCTQIN = fPPP"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CTQSEL1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fCTQIN = fSCLK"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CTQSEL1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "fCTQIN = fMCLK"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CTQSEL1_A::VALUE4 } } #[doc = "Field `CTQSEL1` writer - Input Frequency Selection"] -pub type CTQSEL1_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PCR_SSCMODE_SPEC, u8, CTQSEL1_A, 2, O>; -impl<'a, const O: u8> CTQSEL1_W<'a, O> { +pub type CTQSEL1_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CTQSEL1_A>; +impl<'a, REG> CTQSEL1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fCTQIN = fPDIV"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTQSEL1_A::VALUE1) } #[doc = "fCTQIN = fPPP"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTQSEL1_A::VALUE2) } #[doc = "fCTQIN = fSCLK"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CTQSEL1_A::VALUE3) } #[doc = "fCTQIN = fMCLK"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CTQSEL1_A::VALUE4) } } #[doc = "Field `PCTQ1` reader - Divider Factor PCTQ1 for Tiw and Tnf"] -pub type PCTQ1_R = crate::FieldReader; +pub type PCTQ1_R = crate::FieldReader; #[doc = "Field `PCTQ1` writer - Divider Factor PCTQ1 for Tiw and Tnf"] -pub type PCTQ1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCR_SSCMODE_SPEC, u8, u8, 2, O>; +pub type PCTQ1_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `DCTQ1` reader - Divider Factor DCTQ1 for Tiw and Tnf"] -pub type DCTQ1_R = crate::FieldReader; +pub type DCTQ1_R = crate::FieldReader; #[doc = "Field `DCTQ1` writer - Divider Factor DCTQ1 for Tiw and Tnf"] -pub type DCTQ1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCR_SSCMODE_SPEC, u8, u8, 5, O>; +pub type DCTQ1_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `PARIEN` reader - Parity Error Interrupt Enable"] pub type PARIEN_R = crate::BitReader; #[doc = "Parity Error Interrupt Enable\n\nValue on reset: 0"] @@ -339,34 +326,37 @@ impl From for bool { impl PARIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PARIEN_A { + pub const fn variant(&self) -> PARIEN_A { match self.bits { false => PARIEN_A::VALUE1, true => PARIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A protocol interrupt is not generated with the detection of a parity error."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PARIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A protocol interrupt is generated with the detection of a parity error."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PARIEN_A::VALUE2 } } #[doc = "Field `PARIEN` writer - Parity Error Interrupt Enable"] -pub type PARIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, PARIEN_A, O>; -impl<'a, const O: u8> PARIEN_W<'a, O> { +pub type PARIEN_W<'a, REG> = crate::BitWriter<'a, REG, PARIEN_A>; +impl<'a, REG> PARIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A protocol interrupt is not generated with the detection of a parity error."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PARIEN_A::VALUE1) } #[doc = "A protocol interrupt is generated with the detection of a parity error."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PARIEN_A::VALUE2) } } @@ -389,34 +379,37 @@ impl From for bool { impl MSLSIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSLSIEN_A { + pub const fn variant(&self) -> MSLSIEN_A { match self.bits { false => MSLSIEN_A::VALUE1, true => MSLSIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A protocol interrupt is not generated if a change of signal MSLS is detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSLSIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A protocol interrupt is generated if a change of signal MSLS is detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSLSIEN_A::VALUE2 } } #[doc = "Field `MSLSIEN` writer - MSLS Interrupt Enable"] -pub type MSLSIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, MSLSIEN_A, O>; -impl<'a, const O: u8> MSLSIEN_W<'a, O> { +pub type MSLSIEN_W<'a, REG> = crate::BitWriter<'a, REG, MSLSIEN_A>; +impl<'a, REG> MSLSIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A protocol interrupt is not generated if a change of signal MSLS is detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSLSIEN_A::VALUE1) } #[doc = "A protocol interrupt is generated if a change of signal MSLS is detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSLSIEN_A::VALUE2) } } @@ -439,39 +432,42 @@ impl From for bool { impl DX2TIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DX2TIEN_A { + pub const fn variant(&self) -> DX2TIEN_A { match self.bits { false => DX2TIEN_A::VALUE1, true => DX2TIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A protocol interrupt is not generated if DX2T is activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DX2TIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A protocol interrupt is generated if DX2T is activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DX2TIEN_A::VALUE2 } } #[doc = "Field `DX2TIEN` writer - DX2T Interrupt Enable"] -pub type DX2TIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, DX2TIEN_A, O>; -impl<'a, const O: u8> DX2TIEN_W<'a, O> { +pub type DX2TIEN_W<'a, REG> = crate::BitWriter<'a, REG, DX2TIEN_A>; +impl<'a, REG> DX2TIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A protocol interrupt is not generated if DX2T is activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DX2TIEN_A::VALUE1) } #[doc = "A protocol interrupt is generated if DX2T is activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DX2TIEN_A::VALUE2) } } #[doc = "Field `SELO` reader - Select Output"] -pub type SELO_R = crate::FieldReader; +pub type SELO_R = crate::FieldReader; #[doc = "Select Output\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -487,38 +483,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SELO_A { + type Ux = u8; +} impl SELO_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SELO_A::VALUE1), 1 => Some(SELO_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The corresponding SELOx line cannot be activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELO_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The corresponding SELOx line can be activated (according to the mode selected by SELCTR)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELO_A::VALUE2 } } #[doc = "Field `SELO` writer - Select Output"] -pub type SELO_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCR_SSCMODE_SPEC, u8, SELO_A, 8, O>; -impl<'a, const O: u8> SELO_W<'a, O> { +pub type SELO_W<'a, REG> = crate::FieldWriter<'a, REG, 8, SELO_A>; +impl<'a, REG> SELO_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The corresponding SELOx line cannot be activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELO_A::VALUE1) } #[doc = "The corresponding SELOx line can be activated (according to the mode selected by SELCTR)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELO_A::VALUE2) } } @@ -541,34 +544,37 @@ impl From for bool { impl TIWEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TIWEN_A { + pub const fn variant(&self) -> TIWEN_A { match self.bits { false => TIWEN_A::VALUE1, true => TIWEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No delay between data words of the same frame."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TIWEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The inter-word delay Tiw is enabled and introduced between data words of the same frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TIWEN_A::VALUE2 } } #[doc = "Field `TIWEN` writer - Enable Inter-Word Delay Tiw"] -pub type TIWEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, TIWEN_A, O>; -impl<'a, const O: u8> TIWEN_W<'a, O> { +pub type TIWEN_W<'a, REG> = crate::BitWriter<'a, REG, TIWEN_A>; +impl<'a, REG> TIWEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No delay between data words of the same frame."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TIWEN_A::VALUE1) } #[doc = "The inter-word delay Tiw is enabled and introduced between data words of the same frame."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TIWEN_A::VALUE2) } } @@ -591,34 +597,37 @@ impl From for bool { impl SLPHSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SLPHSEL_A { + pub const fn variant(&self) -> SLPHSEL_A { match self.bits { false => SLPHSEL_A::VALUE1, true => SLPHSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data bits are shifted out with the leading edge of the shift clock signal and latched in with the trailing edge."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SLPHSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The first data bit is shifted out when the data shift unit receives a low to high transition from the DX2 stage. Subsequent bits are shifted out with the trailing edge of the shift clock signal. Data bits are always latched in with the leading edge."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SLPHSEL_A::VALUE2 } } #[doc = "Field `SLPHSEL` writer - Slave Mode Clock Phase Select"] -pub type SLPHSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, SLPHSEL_A, O>; -impl<'a, const O: u8> SLPHSEL_W<'a, O> { +pub type SLPHSEL_W<'a, REG> = crate::BitWriter<'a, REG, SLPHSEL_A>; +impl<'a, REG> SLPHSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Data bits are shifted out with the leading edge of the shift clock signal and latched in with the trailing edge."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SLPHSEL_A::VALUE1) } #[doc = "The first data bit is shifted out when the data shift unit receives a low to high transition from the DX2 stage. Subsequent bits are shifted out with the trailing edge of the shift clock signal. Data bits are always latched in with the leading edge."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SLPHSEL_A::VALUE2) } } @@ -641,34 +650,37 @@ impl From for bool { impl MCLK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MCLK_A { + pub const fn variant(&self) -> MCLK_A { match self.bits { false => MCLK_A::VALUE1, true => MCLK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The MCLK generation is disabled and output MCLK = 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MCLK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The MCLK generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MCLK_A::VALUE2 } } #[doc = "Field `MCLK` writer - Master Clock Enable"] -pub type MCLK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCR_SSCMODE_SPEC, MCLK_A, O>; -impl<'a, const O: u8> MCLK_W<'a, O> { +pub type MCLK_W<'a, REG> = crate::BitWriter<'a, REG, MCLK_A>; +impl<'a, REG> MCLK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The MCLK generation is disabled and output MCLK = 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MCLK_A::VALUE1) } #[doc = "The MCLK generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MCLK_A::VALUE2) } } @@ -748,106 +760,107 @@ impl W { #[doc = "Bit 0 - MSLS Enable"] #[inline(always)] #[must_use] - pub fn mslsen(&mut self) -> MSLSEN_W<0> { - MSLSEN_W::new(self) + pub fn mslsen(&mut self) -> MSLSEN_W { + MSLSEN_W::new(self, 0) } #[doc = "Bit 1 - Select Control"] #[inline(always)] #[must_use] - pub fn selctr(&mut self) -> SELCTR_W<1> { - SELCTR_W::new(self) + pub fn selctr(&mut self) -> SELCTR_W { + SELCTR_W::new(self, 1) } #[doc = "Bit 2 - Select Inversion"] #[inline(always)] #[must_use] - pub fn selinv(&mut self) -> SELINV_W<2> { - SELINV_W::new(self) + pub fn selinv(&mut self) -> SELINV_W { + SELINV_W::new(self, 2) } #[doc = "Bit 3 - Frame End Mode"] #[inline(always)] #[must_use] - pub fn fem(&mut self) -> FEM_W<3> { - FEM_W::new(self) + pub fn fem(&mut self) -> FEM_W { + FEM_W::new(self, 3) } #[doc = "Bits 4:5 - Input Frequency Selection"] #[inline(always)] #[must_use] - pub fn ctqsel1(&mut self) -> CTQSEL1_W<4> { - CTQSEL1_W::new(self) + pub fn ctqsel1(&mut self) -> CTQSEL1_W { + CTQSEL1_W::new(self, 4) } #[doc = "Bits 6:7 - Divider Factor PCTQ1 for Tiw and Tnf"] #[inline(always)] #[must_use] - pub fn pctq1(&mut self) -> PCTQ1_W<6> { - PCTQ1_W::new(self) + pub fn pctq1(&mut self) -> PCTQ1_W { + PCTQ1_W::new(self, 6) } #[doc = "Bits 8:12 - Divider Factor DCTQ1 for Tiw and Tnf"] #[inline(always)] #[must_use] - pub fn dctq1(&mut self) -> DCTQ1_W<8> { - DCTQ1_W::new(self) + pub fn dctq1(&mut self) -> DCTQ1_W { + DCTQ1_W::new(self, 8) } #[doc = "Bit 13 - Parity Error Interrupt Enable"] #[inline(always)] #[must_use] - pub fn parien(&mut self) -> PARIEN_W<13> { - PARIEN_W::new(self) + pub fn parien(&mut self) -> PARIEN_W { + PARIEN_W::new(self, 13) } #[doc = "Bit 14 - MSLS Interrupt Enable"] #[inline(always)] #[must_use] - pub fn mslsien(&mut self) -> MSLSIEN_W<14> { - MSLSIEN_W::new(self) + pub fn mslsien(&mut self) -> MSLSIEN_W { + MSLSIEN_W::new(self, 14) } #[doc = "Bit 15 - DX2T Interrupt Enable"] #[inline(always)] #[must_use] - pub fn dx2tien(&mut self) -> DX2TIEN_W<15> { - DX2TIEN_W::new(self) + pub fn dx2tien(&mut self) -> DX2TIEN_W { + DX2TIEN_W::new(self, 15) } #[doc = "Bits 16:23 - Select Output"] #[inline(always)] #[must_use] - pub fn selo(&mut self) -> SELO_W<16> { - SELO_W::new(self) + pub fn selo(&mut self) -> SELO_W { + SELO_W::new(self, 16) } #[doc = "Bit 24 - Enable Inter-Word Delay Tiw"] #[inline(always)] #[must_use] - pub fn tiwen(&mut self) -> TIWEN_W<24> { - TIWEN_W::new(self) + pub fn tiwen(&mut self) -> TIWEN_W { + TIWEN_W::new(self, 24) } #[doc = "Bit 25 - Slave Mode Clock Phase Select"] #[inline(always)] #[must_use] - pub fn slphsel(&mut self) -> SLPHSEL_W<25> { - SLPHSEL_W::new(self) + pub fn slphsel(&mut self) -> SLPHSEL_W { + SLPHSEL_W::new(self, 25) } #[doc = "Bit 31 - Master Clock Enable"] #[inline(always)] #[must_use] - pub fn mclk(&mut self) -> MCLK_W<31> { - MCLK_W::new(self) + pub fn mclk(&mut self) -> MCLK_W { + MCLK_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Control Register \\[SSC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pcr_sscmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pcr_sscmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`pcr_sscmode::R`](R) reader structure"] +impl crate::Readable for PCR_SSCMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`pcr_sscmode::W`](W) writer structure"] impl crate::Writable for PCR_SSCMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/pscr.rs b/src/usic0_ch0/pscr.rs index c4f6d49c..3b230922 100644 --- a/src/usic0_ch0/pscr.rs +++ b/src/usic0_ch0/pscr.rs @@ -1,24 +1,5 @@ #[doc = "Register `PSCR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Status Flag 0 in PSR\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CST0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CST0` writer - Clear Status Flag 0 in PSR"] -pub type CST0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST0_AW, O>; -impl<'a, const O: u8> CST0_W<'a, O> { +pub type CST0_W<'a, REG> = crate::BitWriter<'a, REG, CST0_AW>; +impl<'a, REG> CST0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST0_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `CST1` writer - Clear Status Flag 1 in PSR"] -pub type CST1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST1_AW, O>; -impl<'a, const O: u8> CST1_W<'a, O> { +pub type CST1_W<'a, REG> = crate::BitWriter<'a, REG, CST1_AW>; +impl<'a, REG> CST1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST1_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CST2` writer - Clear Status Flag 2 in PSR"] -pub type CST2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST2_AW, O>; -impl<'a, const O: u8> CST2_W<'a, O> { +pub type CST2_W<'a, REG> = crate::BitWriter<'a, REG, CST2_AW>; +impl<'a, REG> CST2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST2_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CST3` writer - Clear Status Flag 3 in PSR"] -pub type CST3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST3_AW, O>; -impl<'a, const O: u8> CST3_W<'a, O> { +pub type CST3_W<'a, REG> = crate::BitWriter<'a, REG, CST3_AW>; +impl<'a, REG> CST3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST3_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CST4` writer - Clear Status Flag 4 in PSR"] -pub type CST4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST4_AW, O>; -impl<'a, const O: u8> CST4_W<'a, O> { +pub type CST4_W<'a, REG> = crate::BitWriter<'a, REG, CST4_AW>; +impl<'a, REG> CST4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST4_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST4_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CST5` writer - Clear Status Flag 5 in PSR"] -pub type CST5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST5_AW, O>; -impl<'a, const O: u8> CST5_W<'a, O> { +pub type CST5_W<'a, REG> = crate::BitWriter<'a, REG, CST5_AW>; +impl<'a, REG> CST5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST5_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST5_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CST6` writer - Clear Status Flag 6 in PSR"] -pub type CST6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST6_AW, O>; -impl<'a, const O: u8> CST6_W<'a, O> { +pub type CST6_W<'a, REG> = crate::BitWriter<'a, REG, CST6_AW>; +impl<'a, REG> CST6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST6_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST6_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `CST7` writer - Clear Status Flag 7 in PSR"] -pub type CST7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST7_AW, O>; -impl<'a, const O: u8> CST7_W<'a, O> { +pub type CST7_W<'a, REG> = crate::BitWriter<'a, REG, CST7_AW>; +impl<'a, REG> CST7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST7_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST7_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `CST8` writer - Clear Status Flag 8 in PSR"] -pub type CST8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST8_AW, O>; -impl<'a, const O: u8> CST8_W<'a, O> { +pub type CST8_W<'a, REG> = crate::BitWriter<'a, REG, CST8_AW>; +impl<'a, REG> CST8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST8_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST8_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `CST9` writer - Clear Status Flag 9 in PSR"] -pub type CST9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CST9_AW, O>; -impl<'a, const O: u8> CST9_W<'a, O> { +pub type CST9_W<'a, REG> = crate::BitWriter<'a, REG, CST9_AW>; +impl<'a, REG> CST9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CST9_AW::VALUE1) } #[doc = "Flag PSR.STx is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CST9_AW::VALUE2) } } @@ -314,16 +325,19 @@ impl From for bool { } } #[doc = "Field `CRSIF` writer - Clear Receiver Start Indication Flag"] -pub type CRSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CRSIF_AW, O>; -impl<'a, const O: u8> CRSIF_W<'a, O> { +pub type CRSIF_W<'a, REG> = crate::BitWriter<'a, REG, CRSIF_AW>; +impl<'a, REG> CRSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CRSIF_AW::VALUE1) } #[doc = "Flag PSR.RSIF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CRSIF_AW::VALUE2) } } @@ -342,16 +356,19 @@ impl From for bool { } } #[doc = "Field `CDLIF` writer - Clear Data Lost Indication Flag"] -pub type CDLIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CDLIF_AW, O>; -impl<'a, const O: u8> CDLIF_W<'a, O> { +pub type CDLIF_W<'a, REG> = crate::BitWriter<'a, REG, CDLIF_AW>; +impl<'a, REG> CDLIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CDLIF_AW::VALUE1) } #[doc = "Flag PSR.DLIF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CDLIF_AW::VALUE2) } } @@ -370,16 +387,19 @@ impl From for bool { } } #[doc = "Field `CTSIF` writer - Clear Transmit Shift Indication Flag"] -pub type CTSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CTSIF_AW, O>; -impl<'a, const O: u8> CTSIF_W<'a, O> { +pub type CTSIF_W<'a, REG> = crate::BitWriter<'a, REG, CTSIF_AW>; +impl<'a, REG> CTSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTSIF_AW::VALUE1) } #[doc = "Flag PSR.TSIF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTSIF_AW::VALUE2) } } @@ -398,16 +418,19 @@ impl From for bool { } } #[doc = "Field `CTBIF` writer - Clear Transmit Buffer Indication Flag"] -pub type CTBIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CTBIF_AW, O>; -impl<'a, const O: u8> CTBIF_W<'a, O> { +pub type CTBIF_W<'a, REG> = crate::BitWriter<'a, REG, CTBIF_AW>; +impl<'a, REG> CTBIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTBIF_AW::VALUE1) } #[doc = "Flag PSR.TBIF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTBIF_AW::VALUE2) } } @@ -426,16 +449,19 @@ impl From for bool { } } #[doc = "Field `CRIF` writer - Clear Receive Indication Flag"] -pub type CRIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CRIF_AW, O>; -impl<'a, const O: u8> CRIF_W<'a, O> { +pub type CRIF_W<'a, REG> = crate::BitWriter<'a, REG, CRIF_AW>; +impl<'a, REG> CRIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CRIF_AW::VALUE1) } #[doc = "Flag PSR.RIF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CRIF_AW::VALUE2) } } @@ -454,16 +480,19 @@ impl From for bool { } } #[doc = "Field `CAIF` writer - Clear Alternative Receive Indication Flag"] -pub type CAIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CAIF_AW, O>; -impl<'a, const O: u8> CAIF_W<'a, O> { +pub type CAIF_W<'a, REG> = crate::BitWriter<'a, REG, CAIF_AW>; +impl<'a, REG> CAIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CAIF_AW::VALUE1) } #[doc = "Flag PSR.AIF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CAIF_AW::VALUE2) } } @@ -482,16 +511,19 @@ impl From for bool { } } #[doc = "Field `CBRGIF` writer - Clear Baud Rate Generator Indication Flag"] -pub type CBRGIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSCR_SPEC, CBRGIF_AW, O>; -impl<'a, const O: u8> CBRGIF_W<'a, O> { +pub type CBRGIF_W<'a, REG> = crate::BitWriter<'a, REG, CBRGIF_AW>; +impl<'a, REG> CBRGIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CBRGIF_AW::VALUE1) } #[doc = "Flag PSR.BRGIF is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CBRGIF_AW::VALUE2) } } @@ -499,120 +531,123 @@ impl W { #[doc = "Bit 0 - Clear Status Flag 0 in PSR"] #[inline(always)] #[must_use] - pub fn cst0(&mut self) -> CST0_W<0> { - CST0_W::new(self) + pub fn cst0(&mut self) -> CST0_W { + CST0_W::new(self, 0) } #[doc = "Bit 1 - Clear Status Flag 1 in PSR"] #[inline(always)] #[must_use] - pub fn cst1(&mut self) -> CST1_W<1> { - CST1_W::new(self) + pub fn cst1(&mut self) -> CST1_W { + CST1_W::new(self, 1) } #[doc = "Bit 2 - Clear Status Flag 2 in PSR"] #[inline(always)] #[must_use] - pub fn cst2(&mut self) -> CST2_W<2> { - CST2_W::new(self) + pub fn cst2(&mut self) -> CST2_W { + CST2_W::new(self, 2) } #[doc = "Bit 3 - Clear Status Flag 3 in PSR"] #[inline(always)] #[must_use] - pub fn cst3(&mut self) -> CST3_W<3> { - CST3_W::new(self) + pub fn cst3(&mut self) -> CST3_W { + CST3_W::new(self, 3) } #[doc = "Bit 4 - Clear Status Flag 4 in PSR"] #[inline(always)] #[must_use] - pub fn cst4(&mut self) -> CST4_W<4> { - CST4_W::new(self) + pub fn cst4(&mut self) -> CST4_W { + CST4_W::new(self, 4) } #[doc = "Bit 5 - Clear Status Flag 5 in PSR"] #[inline(always)] #[must_use] - pub fn cst5(&mut self) -> CST5_W<5> { - CST5_W::new(self) + pub fn cst5(&mut self) -> CST5_W { + CST5_W::new(self, 5) } #[doc = "Bit 6 - Clear Status Flag 6 in PSR"] #[inline(always)] #[must_use] - pub fn cst6(&mut self) -> CST6_W<6> { - CST6_W::new(self) + pub fn cst6(&mut self) -> CST6_W { + CST6_W::new(self, 6) } #[doc = "Bit 7 - Clear Status Flag 7 in PSR"] #[inline(always)] #[must_use] - pub fn cst7(&mut self) -> CST7_W<7> { - CST7_W::new(self) + pub fn cst7(&mut self) -> CST7_W { + CST7_W::new(self, 7) } #[doc = "Bit 8 - Clear Status Flag 8 in PSR"] #[inline(always)] #[must_use] - pub fn cst8(&mut self) -> CST8_W<8> { - CST8_W::new(self) + pub fn cst8(&mut self) -> CST8_W { + CST8_W::new(self, 8) } #[doc = "Bit 9 - Clear Status Flag 9 in PSR"] #[inline(always)] #[must_use] - pub fn cst9(&mut self) -> CST9_W<9> { - CST9_W::new(self) + pub fn cst9(&mut self) -> CST9_W { + CST9_W::new(self, 9) } #[doc = "Bit 10 - Clear Receiver Start Indication Flag"] #[inline(always)] #[must_use] - pub fn crsif(&mut self) -> CRSIF_W<10> { - CRSIF_W::new(self) + pub fn crsif(&mut self) -> CRSIF_W { + CRSIF_W::new(self, 10) } #[doc = "Bit 11 - Clear Data Lost Indication Flag"] #[inline(always)] #[must_use] - pub fn cdlif(&mut self) -> CDLIF_W<11> { - CDLIF_W::new(self) + pub fn cdlif(&mut self) -> CDLIF_W { + CDLIF_W::new(self, 11) } #[doc = "Bit 12 - Clear Transmit Shift Indication Flag"] #[inline(always)] #[must_use] - pub fn ctsif(&mut self) -> CTSIF_W<12> { - CTSIF_W::new(self) + pub fn ctsif(&mut self) -> CTSIF_W { + CTSIF_W::new(self, 12) } #[doc = "Bit 13 - Clear Transmit Buffer Indication Flag"] #[inline(always)] #[must_use] - pub fn ctbif(&mut self) -> CTBIF_W<13> { - CTBIF_W::new(self) + pub fn ctbif(&mut self) -> CTBIF_W { + CTBIF_W::new(self, 13) } #[doc = "Bit 14 - Clear Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn crif(&mut self) -> CRIF_W<14> { - CRIF_W::new(self) + pub fn crif(&mut self) -> CRIF_W { + CRIF_W::new(self, 14) } #[doc = "Bit 15 - Clear Alternative Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn caif(&mut self) -> CAIF_W<15> { - CAIF_W::new(self) + pub fn caif(&mut self) -> CAIF_W { + CAIF_W::new(self, 15) } #[doc = "Bit 16 - Clear Baud Rate Generator Indication Flag"] #[inline(always)] #[must_use] - pub fn cbrgif(&mut self) -> CBRGIF_W<16> { - CBRGIF_W::new(self) + pub fn cbrgif(&mut self) -> CBRGIF_W { + CBRGIF_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Status Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`pscr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct PSCR_SPEC; impl crate::RegisterSpec for PSCR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [pscr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`pscr::W`](W) writer structure"] impl crate::Writable for PSCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/psr.rs b/src/usic0_ch0/psr.rs index 5795390d..0d6ee57e 100644 --- a/src/usic0_ch0/psr.rs +++ b/src/usic0_ch0/psr.rs @@ -1,79 +1,47 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ST0` reader - Protocol Status Flag 0"] -pub type ST0_R = crate::BitReader; +pub type ST0_R = crate::BitReader; #[doc = "Field `ST0` writer - Protocol Status Flag 0"] -pub type ST0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST0_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST1` reader - Protocol Status Flag 1"] -pub type ST1_R = crate::BitReader; +pub type ST1_R = crate::BitReader; #[doc = "Field `ST1` writer - Protocol Status Flag 1"] -pub type ST1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST1_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST2` reader - Protocol Status Flag 2"] -pub type ST2_R = crate::BitReader; +pub type ST2_R = crate::BitReader; #[doc = "Field `ST2` writer - Protocol Status Flag 2"] -pub type ST2_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST2_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST3` reader - Protocol Status Flag 3"] -pub type ST3_R = crate::BitReader; +pub type ST3_R = crate::BitReader; #[doc = "Field `ST3` writer - Protocol Status Flag 3"] -pub type ST3_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST3_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST4` reader - Protocol Status Flag 4"] -pub type ST4_R = crate::BitReader; +pub type ST4_R = crate::BitReader; #[doc = "Field `ST4` writer - Protocol Status Flag 4"] -pub type ST4_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST4_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST5` reader - Protocol Status Flag 5"] -pub type ST5_R = crate::BitReader; +pub type ST5_R = crate::BitReader; #[doc = "Field `ST5` writer - Protocol Status Flag 5"] -pub type ST5_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST5_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST6` reader - Protocol Status Flag 6"] -pub type ST6_R = crate::BitReader; +pub type ST6_R = crate::BitReader; #[doc = "Field `ST6` writer - Protocol Status Flag 6"] -pub type ST6_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST6_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST7` reader - Protocol Status Flag 7"] -pub type ST7_R = crate::BitReader; +pub type ST7_R = crate::BitReader; #[doc = "Field `ST7` writer - Protocol Status Flag 7"] -pub type ST7_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST7_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST8` reader - Protocol Status Flag 8"] -pub type ST8_R = crate::BitReader; +pub type ST8_R = crate::BitReader; #[doc = "Field `ST8` writer - Protocol Status Flag 8"] -pub type ST8_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST8_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `ST9` reader - Protocol Status Flag 9"] -pub type ST9_R = crate::BitReader; +pub type ST9_R = crate::BitReader; #[doc = "Field `ST9` writer - Protocol Status Flag 9"] -pub type ST9_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, bool, O>; +pub type ST9_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `RSIF` reader - Receiver Start Indication Flag"] pub type RSIF_R = crate::BitReader; #[doc = "Receiver Start Indication Flag\n\nValue on reset: 0"] @@ -93,34 +61,37 @@ impl From for bool { impl RSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSIF_A { + pub const fn variant(&self) -> RSIF_A { match self.bits { false => RSIF_A::VALUE1, true => RSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receiver start event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receiver start event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSIF_A::VALUE2 } } #[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] -pub type RSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, RSIF_A, O>; -impl<'a, const O: u8> RSIF_W<'a, O> { +pub type RSIF_W<'a, REG> = crate::BitWriter<'a, REG, RSIF_A>; +impl<'a, REG> RSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receiver start event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE1) } #[doc = "A receiver start event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE2) } } @@ -143,34 +114,37 @@ impl From for bool { impl DLIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DLIF_A { + pub const fn variant(&self) -> DLIF_A { match self.bits { false => DLIF_A::VALUE1, true => DLIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A data lost event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DLIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A data lost event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DLIF_A::VALUE2 } } #[doc = "Field `DLIF` writer - Data Lost Indication Flag"] -pub type DLIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, DLIF_A, O>; -impl<'a, const O: u8> DLIF_W<'a, O> { +pub type DLIF_W<'a, REG> = crate::BitWriter<'a, REG, DLIF_A>; +impl<'a, REG> DLIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A data lost event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE1) } #[doc = "A data lost event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE2) } } @@ -193,34 +167,37 @@ impl From for bool { impl TSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSIF_A { + pub const fn variant(&self) -> TSIF_A { match self.bits { false => TSIF_A::VALUE1, true => TSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit shift event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit shift event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSIF_A::VALUE2 } } #[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] -pub type TSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, TSIF_A, O>; -impl<'a, const O: u8> TSIF_W<'a, O> { +pub type TSIF_W<'a, REG> = crate::BitWriter<'a, REG, TSIF_A>; +impl<'a, REG> TSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit shift event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE1) } #[doc = "A transmit shift event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE2) } } @@ -243,34 +220,37 @@ impl From for bool { impl TBIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBIF_A { + pub const fn variant(&self) -> TBIF_A { match self.bits { false => TBIF_A::VALUE1, true => TBIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit buffer event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit buffer event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBIF_A::VALUE2 } } #[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] -pub type TBIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, TBIF_A, O>; -impl<'a, const O: u8> TBIF_W<'a, O> { +pub type TBIF_W<'a, REG> = crate::BitWriter<'a, REG, TBIF_A>; +impl<'a, REG> TBIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit buffer event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE1) } #[doc = "A transmit buffer event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE2) } } @@ -293,34 +273,37 @@ impl From for bool { impl RIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RIF_A { + pub const fn variant(&self) -> RIF_A { match self.bits { false => RIF_A::VALUE1, true => RIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RIF_A::VALUE2 } } #[doc = "Field `RIF` writer - Receive Indication Flag"] -pub type RIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, RIF_A, O>; -impl<'a, const O: u8> RIF_W<'a, O> { +pub type RIF_W<'a, REG> = crate::BitWriter<'a, REG, RIF_A>; +impl<'a, REG> RIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE1) } #[doc = "A receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE2) } } @@ -343,34 +326,37 @@ impl From for bool { impl AIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AIF_A { + pub const fn variant(&self) -> AIF_A { match self.bits { false => AIF_A::VALUE1, true => AIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An alternative receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alternative receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AIF_A::VALUE2 } } #[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] -pub type AIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, AIF_A, O>; -impl<'a, const O: u8> AIF_W<'a, O> { +pub type AIF_W<'a, REG> = crate::BitWriter<'a, REG, AIF_A>; +impl<'a, REG> AIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An alternative receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE1) } #[doc = "An alternative receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE2) } } @@ -393,34 +379,37 @@ impl From for bool { impl BRGIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRGIF_A { + pub const fn variant(&self) -> BRGIF_A { match self.bits { false => BRGIF_A::VALUE1, true => BRGIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A baud rate generator event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRGIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A baud rate generator event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRGIF_A::VALUE2 } } #[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] -pub type BRGIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SPEC, BRGIF_A, O>; -impl<'a, const O: u8> BRGIF_W<'a, O> { +pub type BRGIF_W<'a, REG> = crate::BitWriter<'a, REG, BRGIF_A>; +impl<'a, REG> BRGIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A baud rate generator event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE1) } #[doc = "A baud rate generator event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE2) } } @@ -515,124 +504,125 @@ impl W { #[doc = "Bit 0 - Protocol Status Flag 0"] #[inline(always)] #[must_use] - pub fn st0(&mut self) -> ST0_W<0> { - ST0_W::new(self) + pub fn st0(&mut self) -> ST0_W { + ST0_W::new(self, 0) } #[doc = "Bit 1 - Protocol Status Flag 1"] #[inline(always)] #[must_use] - pub fn st1(&mut self) -> ST1_W<1> { - ST1_W::new(self) + pub fn st1(&mut self) -> ST1_W { + ST1_W::new(self, 1) } #[doc = "Bit 2 - Protocol Status Flag 2"] #[inline(always)] #[must_use] - pub fn st2(&mut self) -> ST2_W<2> { - ST2_W::new(self) + pub fn st2(&mut self) -> ST2_W { + ST2_W::new(self, 2) } #[doc = "Bit 3 - Protocol Status Flag 3"] #[inline(always)] #[must_use] - pub fn st3(&mut self) -> ST3_W<3> { - ST3_W::new(self) + pub fn st3(&mut self) -> ST3_W { + ST3_W::new(self, 3) } #[doc = "Bit 4 - Protocol Status Flag 4"] #[inline(always)] #[must_use] - pub fn st4(&mut self) -> ST4_W<4> { - ST4_W::new(self) + pub fn st4(&mut self) -> ST4_W { + ST4_W::new(self, 4) } #[doc = "Bit 5 - Protocol Status Flag 5"] #[inline(always)] #[must_use] - pub fn st5(&mut self) -> ST5_W<5> { - ST5_W::new(self) + pub fn st5(&mut self) -> ST5_W { + ST5_W::new(self, 5) } #[doc = "Bit 6 - Protocol Status Flag 6"] #[inline(always)] #[must_use] - pub fn st6(&mut self) -> ST6_W<6> { - ST6_W::new(self) + pub fn st6(&mut self) -> ST6_W { + ST6_W::new(self, 6) } #[doc = "Bit 7 - Protocol Status Flag 7"] #[inline(always)] #[must_use] - pub fn st7(&mut self) -> ST7_W<7> { - ST7_W::new(self) + pub fn st7(&mut self) -> ST7_W { + ST7_W::new(self, 7) } #[doc = "Bit 8 - Protocol Status Flag 8"] #[inline(always)] #[must_use] - pub fn st8(&mut self) -> ST8_W<8> { - ST8_W::new(self) + pub fn st8(&mut self) -> ST8_W { + ST8_W::new(self, 8) } #[doc = "Bit 9 - Protocol Status Flag 9"] #[inline(always)] #[must_use] - pub fn st9(&mut self) -> ST9_W<9> { - ST9_W::new(self) + pub fn st9(&mut self) -> ST9_W { + ST9_W::new(self, 9) } #[doc = "Bit 10 - Receiver Start Indication Flag"] #[inline(always)] #[must_use] - pub fn rsif(&mut self) -> RSIF_W<10> { - RSIF_W::new(self) + pub fn rsif(&mut self) -> RSIF_W { + RSIF_W::new(self, 10) } #[doc = "Bit 11 - Data Lost Indication Flag"] #[inline(always)] #[must_use] - pub fn dlif(&mut self) -> DLIF_W<11> { - DLIF_W::new(self) + pub fn dlif(&mut self) -> DLIF_W { + DLIF_W::new(self, 11) } #[doc = "Bit 12 - Transmit Shift Indication Flag"] #[inline(always)] #[must_use] - pub fn tsif(&mut self) -> TSIF_W<12> { - TSIF_W::new(self) + pub fn tsif(&mut self) -> TSIF_W { + TSIF_W::new(self, 12) } #[doc = "Bit 13 - Transmit Buffer Indication Flag"] #[inline(always)] #[must_use] - pub fn tbif(&mut self) -> TBIF_W<13> { - TBIF_W::new(self) + pub fn tbif(&mut self) -> TBIF_W { + TBIF_W::new(self, 13) } #[doc = "Bit 14 - Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn rif(&mut self) -> RIF_W<14> { - RIF_W::new(self) + pub fn rif(&mut self) -> RIF_W { + RIF_W::new(self, 14) } #[doc = "Bit 15 - Alternative Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn aif(&mut self) -> AIF_W<15> { - AIF_W::new(self) + pub fn aif(&mut self) -> AIF_W { + AIF_W::new(self, 15) } #[doc = "Bit 16 - Baud Rate Generator Indication Flag"] #[inline(always)] #[must_use] - pub fn brgif(&mut self) -> BRGIF_W<16> { - BRGIF_W::new(self) + pub fn brgif(&mut self) -> BRGIF_W { + BRGIF_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psr::R`](R) reader structure"] +impl crate::Readable for PSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psr::W`](W) writer structure"] impl crate::Writable for PSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/psr_ascmode.rs b/src/usic0_ch0/psr_ascmode.rs index 83a7fce8..cc267598 100644 --- a/src/usic0_ch0/psr_ascmode.rs +++ b/src/usic0_ch0/psr_ascmode.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TXIDLE` reader - Transmission Idle"] pub type TXIDLE_R = crate::BitReader; #[doc = "Transmission Idle\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl TXIDLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TXIDLE_A { + pub const fn variant(&self) -> TXIDLE_A { match self.bits { false => TXIDLE_A::VALUE1, true => TXIDLE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmitter line has not yet been idle."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TXIDLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transmitter line has been idle and frame transmission is possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TXIDLE_A::VALUE2 } } #[doc = "Field `TXIDLE` writer - Transmission Idle"] -pub type TXIDLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, TXIDLE_A, O>; -impl<'a, const O: u8> TXIDLE_W<'a, O> { +pub type TXIDLE_W<'a, REG> = crate::BitWriter<'a, REG, TXIDLE_A>; +impl<'a, REG> TXIDLE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The transmitter line has not yet been idle."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TXIDLE_A::VALUE1) } #[doc = "The transmitter line has been idle and frame transmission is possible."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TXIDLE_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl RXIDLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RXIDLE_A { + pub const fn variant(&self) -> RXIDLE_A { match self.bits { false => RXIDLE_A::VALUE1, true => RXIDLE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The receiver line has not yet been idle."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RXIDLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The receiver line has been idle and frame reception is possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RXIDLE_A::VALUE2 } } #[doc = "Field `RXIDLE` writer - Reception Idle"] -pub type RXIDLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, RXIDLE_A, O>; -impl<'a, const O: u8> RXIDLE_W<'a, O> { +pub type RXIDLE_W<'a, REG> = crate::BitWriter<'a, REG, RXIDLE_A>; +impl<'a, REG> RXIDLE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The receiver line has not yet been idle."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RXIDLE_A::VALUE1) } #[doc = "The receiver line has been idle and frame reception is possible."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RXIDLE_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl SBD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SBD_A { + pub const fn variant(&self) -> SBD_A { match self.bits { false => SBD_A::VALUE1, true => SBD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A synchronization break has not yet been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SBD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A synchronization break has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SBD_A::VALUE2 } } #[doc = "Field `SBD` writer - Synchronization Break Detected"] -pub type SBD_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, SBD_A, O>; -impl<'a, const O: u8> SBD_W<'a, O> { +pub type SBD_W<'a, REG> = crate::BitWriter<'a, REG, SBD_A>; +impl<'a, REG> SBD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A synchronization break has not yet been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SBD_A::VALUE1) } #[doc = "A synchronization break has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SBD_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl COL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> COL_A { + pub const fn variant(&self) -> COL_A { match self.bits { false => COL_A::VALUE1, true => COL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A collision has not yet been detected and frame transmission is possible."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == COL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A collision has been detected and frame transmission is not possible."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == COL_A::VALUE2 } } #[doc = "Field `COL` writer - Collision Detected"] -pub type COL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, COL_A, O>; -impl<'a, const O: u8> COL_W<'a, O> { +pub type COL_W<'a, REG> = crate::BitWriter<'a, REG, COL_A>; +impl<'a, REG> COL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A collision has not yet been detected and frame transmission is possible."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(COL_A::VALUE1) } #[doc = "A collision has been detected and frame transmission is not possible."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(COL_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl RNS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RNS_A { + pub const fn variant(&self) -> RNS_A { match self.bits { false => RNS_A::VALUE1, true => RNS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Receiver noise has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RNS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Receiver noise has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RNS_A::VALUE2 } } #[doc = "Field `RNS` writer - Receiver Noise Detected"] -pub type RNS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, RNS_A, O>; -impl<'a, const O: u8> RNS_W<'a, O> { +pub type RNS_W<'a, REG> = crate::BitWriter<'a, REG, RNS_A>; +impl<'a, REG> RNS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Receiver noise has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RNS_A::VALUE1) } #[doc = "Receiver noise has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RNS_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl FER0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FER0_A { + pub const fn variant(&self) -> FER0_A { match self.bits { false => FER0_A::VALUE1, true => FER0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A format error 0 has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FER0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A format error 0 has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FER0_A::VALUE2 } } #[doc = "Field `FER0` writer - Format Error in Stop Bit 0"] -pub type FER0_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, FER0_A, O>; -impl<'a, const O: u8> FER0_W<'a, O> { +pub type FER0_W<'a, REG> = crate::BitWriter<'a, REG, FER0_A>; +impl<'a, REG> FER0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A format error 0 has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FER0_A::VALUE1) } #[doc = "A format error 0 has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FER0_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl FER1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FER1_A { + pub const fn variant(&self) -> FER1_A { match self.bits { false => FER1_A::VALUE1, true => FER1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A format error 1 has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FER1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A format error 1 has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FER1_A::VALUE2 } } #[doc = "Field `FER1` writer - Format Error in Stop Bit 1"] -pub type FER1_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, FER1_A, O>; -impl<'a, const O: u8> FER1_W<'a, O> { +pub type FER1_W<'a, REG> = crate::BitWriter<'a, REG, FER1_A>; +impl<'a, REG> FER1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A format error 1 has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FER1_A::VALUE1) } #[doc = "A format error 1 has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FER1_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl RFF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RFF_A { + pub const fn variant(&self) -> RFF_A { match self.bits { false => RFF_A::VALUE1, true => RFF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The received frame is not yet finished."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RFF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The received frame is finished."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RFF_A::VALUE2 } } #[doc = "Field `RFF` writer - Receive Frame Finished"] -pub type RFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, RFF_A, O>; -impl<'a, const O: u8> RFF_W<'a, O> { +pub type RFF_W<'a, REG> = crate::BitWriter<'a, REG, RFF_A>; +impl<'a, REG> RFF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The received frame is not yet finished."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RFF_A::VALUE1) } #[doc = "The received frame is finished."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RFF_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl TFF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TFF_A { + pub const fn variant(&self) -> TFF_A { match self.bits { false => TFF_A::VALUE1, true => TFF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmitter frame is not yet finished."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TFF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transmitter frame is finished."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TFF_A::VALUE2 } } #[doc = "Field `TFF` writer - Transmitter Frame Finished"] -pub type TFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, TFF_A, O>; -impl<'a, const O: u8> TFF_W<'a, O> { +pub type TFF_W<'a, REG> = crate::BitWriter<'a, REG, TFF_A>; +impl<'a, REG> TFF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The transmitter frame is not yet finished."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TFF_A::VALUE1) } #[doc = "The transmitter frame is finished."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TFF_A::VALUE2) } } @@ -503,18 +498,18 @@ impl From for bool { impl BUSY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BUSY_A { + pub const fn variant(&self) -> BUSY_A { match self.bits { false => BUSY_A::VALUE1, true => BUSY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A data transfer does not take place."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BUSY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A data transfer currently takes place."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BUSY_A::VALUE2 @@ -539,34 +534,37 @@ impl From for bool { impl RSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSIF_A { + pub const fn variant(&self) -> RSIF_A { match self.bits { false => RSIF_A::VALUE1, true => RSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receiver start event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receiver start event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSIF_A::VALUE2 } } #[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] -pub type RSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, RSIF_A, O>; -impl<'a, const O: u8> RSIF_W<'a, O> { +pub type RSIF_W<'a, REG> = crate::BitWriter<'a, REG, RSIF_A>; +impl<'a, REG> RSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receiver start event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE1) } #[doc = "A receiver start event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE2) } } @@ -589,34 +587,37 @@ impl From for bool { impl DLIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DLIF_A { + pub const fn variant(&self) -> DLIF_A { match self.bits { false => DLIF_A::VALUE1, true => DLIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A data lost event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DLIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A data lost event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DLIF_A::VALUE2 } } #[doc = "Field `DLIF` writer - Data Lost Indication Flag"] -pub type DLIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, DLIF_A, O>; -impl<'a, const O: u8> DLIF_W<'a, O> { +pub type DLIF_W<'a, REG> = crate::BitWriter<'a, REG, DLIF_A>; +impl<'a, REG> DLIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A data lost event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE1) } #[doc = "A data lost event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE2) } } @@ -639,34 +640,37 @@ impl From for bool { impl TSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSIF_A { + pub const fn variant(&self) -> TSIF_A { match self.bits { false => TSIF_A::VALUE1, true => TSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit shift event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit shift event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSIF_A::VALUE2 } } #[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] -pub type TSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, TSIF_A, O>; -impl<'a, const O: u8> TSIF_W<'a, O> { +pub type TSIF_W<'a, REG> = crate::BitWriter<'a, REG, TSIF_A>; +impl<'a, REG> TSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit shift event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE1) } #[doc = "A transmit shift event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE2) } } @@ -689,34 +693,37 @@ impl From for bool { impl TBIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBIF_A { + pub const fn variant(&self) -> TBIF_A { match self.bits { false => TBIF_A::VALUE1, true => TBIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit buffer event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit buffer event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBIF_A::VALUE2 } } #[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] -pub type TBIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, TBIF_A, O>; -impl<'a, const O: u8> TBIF_W<'a, O> { +pub type TBIF_W<'a, REG> = crate::BitWriter<'a, REG, TBIF_A>; +impl<'a, REG> TBIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit buffer event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE1) } #[doc = "A transmit buffer event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE2) } } @@ -739,34 +746,37 @@ impl From for bool { impl RIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RIF_A { + pub const fn variant(&self) -> RIF_A { match self.bits { false => RIF_A::VALUE1, true => RIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RIF_A::VALUE2 } } #[doc = "Field `RIF` writer - Receive Indication Flag"] -pub type RIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, RIF_A, O>; -impl<'a, const O: u8> RIF_W<'a, O> { +pub type RIF_W<'a, REG> = crate::BitWriter<'a, REG, RIF_A>; +impl<'a, REG> RIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE1) } #[doc = "A receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE2) } } @@ -789,34 +799,37 @@ impl From for bool { impl AIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AIF_A { + pub const fn variant(&self) -> AIF_A { match self.bits { false => AIF_A::VALUE1, true => AIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An alternative receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alternative receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AIF_A::VALUE2 } } #[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] -pub type AIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, AIF_A, O>; -impl<'a, const O: u8> AIF_W<'a, O> { +pub type AIF_W<'a, REG> = crate::BitWriter<'a, REG, AIF_A>; +impl<'a, REG> AIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An alternative receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE1) } #[doc = "An alternative receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE2) } } @@ -839,34 +852,37 @@ impl From for bool { impl BRGIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRGIF_A { + pub const fn variant(&self) -> BRGIF_A { match self.bits { false => BRGIF_A::VALUE1, true => BRGIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A baud rate generator event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRGIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A baud rate generator event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRGIF_A::VALUE2 } } #[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] -pub type BRGIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_ASCMODE_SPEC, BRGIF_A, O>; -impl<'a, const O: u8> BRGIF_W<'a, O> { +pub type BRGIF_W<'a, REG> = crate::BitWriter<'a, REG, BRGIF_A>; +impl<'a, REG> BRGIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A baud rate generator event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE1) } #[doc = "A baud rate generator event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE2) } } @@ -961,118 +977,119 @@ impl W { #[doc = "Bit 0 - Transmission Idle"] #[inline(always)] #[must_use] - pub fn txidle(&mut self) -> TXIDLE_W<0> { - TXIDLE_W::new(self) + pub fn txidle(&mut self) -> TXIDLE_W { + TXIDLE_W::new(self, 0) } #[doc = "Bit 1 - Reception Idle"] #[inline(always)] #[must_use] - pub fn rxidle(&mut self) -> RXIDLE_W<1> { - RXIDLE_W::new(self) + pub fn rxidle(&mut self) -> RXIDLE_W { + RXIDLE_W::new(self, 1) } #[doc = "Bit 2 - Synchronization Break Detected"] #[inline(always)] #[must_use] - pub fn sbd(&mut self) -> SBD_W<2> { - SBD_W::new(self) + pub fn sbd(&mut self) -> SBD_W { + SBD_W::new(self, 2) } #[doc = "Bit 3 - Collision Detected"] #[inline(always)] #[must_use] - pub fn col(&mut self) -> COL_W<3> { - COL_W::new(self) + pub fn col(&mut self) -> COL_W { + COL_W::new(self, 3) } #[doc = "Bit 4 - Receiver Noise Detected"] #[inline(always)] #[must_use] - pub fn rns(&mut self) -> RNS_W<4> { - RNS_W::new(self) + pub fn rns(&mut self) -> RNS_W { + RNS_W::new(self, 4) } #[doc = "Bit 5 - Format Error in Stop Bit 0"] #[inline(always)] #[must_use] - pub fn fer0(&mut self) -> FER0_W<5> { - FER0_W::new(self) + pub fn fer0(&mut self) -> FER0_W { + FER0_W::new(self, 5) } #[doc = "Bit 6 - Format Error in Stop Bit 1"] #[inline(always)] #[must_use] - pub fn fer1(&mut self) -> FER1_W<6> { - FER1_W::new(self) + pub fn fer1(&mut self) -> FER1_W { + FER1_W::new(self, 6) } #[doc = "Bit 7 - Receive Frame Finished"] #[inline(always)] #[must_use] - pub fn rff(&mut self) -> RFF_W<7> { - RFF_W::new(self) + pub fn rff(&mut self) -> RFF_W { + RFF_W::new(self, 7) } #[doc = "Bit 8 - Transmitter Frame Finished"] #[inline(always)] #[must_use] - pub fn tff(&mut self) -> TFF_W<8> { - TFF_W::new(self) + pub fn tff(&mut self) -> TFF_W { + TFF_W::new(self, 8) } #[doc = "Bit 10 - Receiver Start Indication Flag"] #[inline(always)] #[must_use] - pub fn rsif(&mut self) -> RSIF_W<10> { - RSIF_W::new(self) + pub fn rsif(&mut self) -> RSIF_W { + RSIF_W::new(self, 10) } #[doc = "Bit 11 - Data Lost Indication Flag"] #[inline(always)] #[must_use] - pub fn dlif(&mut self) -> DLIF_W<11> { - DLIF_W::new(self) + pub fn dlif(&mut self) -> DLIF_W { + DLIF_W::new(self, 11) } #[doc = "Bit 12 - Transmit Shift Indication Flag"] #[inline(always)] #[must_use] - pub fn tsif(&mut self) -> TSIF_W<12> { - TSIF_W::new(self) + pub fn tsif(&mut self) -> TSIF_W { + TSIF_W::new(self, 12) } #[doc = "Bit 13 - Transmit Buffer Indication Flag"] #[inline(always)] #[must_use] - pub fn tbif(&mut self) -> TBIF_W<13> { - TBIF_W::new(self) + pub fn tbif(&mut self) -> TBIF_W { + TBIF_W::new(self, 13) } #[doc = "Bit 14 - Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn rif(&mut self) -> RIF_W<14> { - RIF_W::new(self) + pub fn rif(&mut self) -> RIF_W { + RIF_W::new(self, 14) } #[doc = "Bit 15 - Alternative Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn aif(&mut self) -> AIF_W<15> { - AIF_W::new(self) + pub fn aif(&mut self) -> AIF_W { + AIF_W::new(self, 15) } #[doc = "Bit 16 - Baud Rate Generator Indication Flag"] #[inline(always)] #[must_use] - pub fn brgif(&mut self) -> BRGIF_W<16> { - BRGIF_W::new(self) + pub fn brgif(&mut self) -> BRGIF_W { + BRGIF_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Status Register \\[ASC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr_ascmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr_ascmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psr_ascmode::R`](R) reader structure"] +impl crate::Readable for PSR_ASCMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psr_ascmode::W`](W) writer structure"] impl crate::Writable for PSR_ASCMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/psr_iicmode.rs b/src/usic0_ch0/psr_iicmode.rs index 8d4ae5f3..abee6fa8 100644 --- a/src/usic0_ch0/psr_iicmode.rs +++ b/src/usic0_ch0/psr_iicmode.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SLSEL` reader - Slave Select"] pub type SLSEL_R = crate::BitReader; #[doc = "Slave Select\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SLSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SLSEL_A { + pub const fn variant(&self) -> SLSEL_A { match self.bits { false => SLSEL_A::VALUE1, true => SLSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The device is not selected as slave."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SLSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The device is selected as slave."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SLSEL_A::VALUE2 } } #[doc = "Field `SLSEL` writer - Slave Select"] -pub type SLSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, SLSEL_A, O>; -impl<'a, const O: u8> SLSEL_W<'a, O> { +pub type SLSEL_W<'a, REG> = crate::BitWriter<'a, REG, SLSEL_A>; +impl<'a, REG> SLSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The device is not selected as slave."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SLSEL_A::VALUE1) } #[doc = "The device is selected as slave."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SLSEL_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl WTDF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WTDF_A { + pub const fn variant(&self) -> WTDF_A { match self.bits { false => WTDF_A::VALUE1, true => WTDF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A wrong TDF code has not been found."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WTDF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A wrong TDF code has been found."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WTDF_A::VALUE2 } } #[doc = "Field `WTDF` writer - Wrong TDF Code Found"] -pub type WTDF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, WTDF_A, O>; -impl<'a, const O: u8> WTDF_W<'a, O> { +pub type WTDF_W<'a, REG> = crate::BitWriter<'a, REG, WTDF_A>; +impl<'a, REG> WTDF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A wrong TDF code has not been found."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WTDF_A::VALUE1) } #[doc = "A wrong TDF code has been found."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WTDF_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl SCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCR_A { + pub const fn variant(&self) -> SCR_A { match self.bits { false => SCR_A::VALUE1, true => SCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A start condition has not yet been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A start condition has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCR_A::VALUE2 } } #[doc = "Field `SCR` writer - Start Condition Received"] -pub type SCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, SCR_A, O>; -impl<'a, const O: u8> SCR_W<'a, O> { +pub type SCR_W<'a, REG> = crate::BitWriter<'a, REG, SCR_A>; +impl<'a, REG> SCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A start condition has not yet been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCR_A::VALUE1) } #[doc = "A start condition has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCR_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl RSCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSCR_A { + pub const fn variant(&self) -> RSCR_A { match self.bits { false => RSCR_A::VALUE1, true => RSCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A repeated start condition has not yet been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A repeated start condition has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSCR_A::VALUE2 } } #[doc = "Field `RSCR` writer - Repeated Start Condition Received"] -pub type RSCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, RSCR_A, O>; -impl<'a, const O: u8> RSCR_W<'a, O> { +pub type RSCR_W<'a, REG> = crate::BitWriter<'a, REG, RSCR_A>; +impl<'a, REG> RSCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A repeated start condition has not yet been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSCR_A::VALUE1) } #[doc = "A repeated start condition has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSCR_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PCR_A { + pub const fn variant(&self) -> PCR_A { match self.bits { false => PCR_A::VALUE1, true => PCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A stop condition has not yet been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A stop condition has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PCR_A::VALUE2 } } #[doc = "Field `PCR` writer - Stop Condition Received"] -pub type PCR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, PCR_A, O>; -impl<'a, const O: u8> PCR_W<'a, O> { +pub type PCR_W<'a, REG> = crate::BitWriter<'a, REG, PCR_A>; +impl<'a, REG> PCR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A stop condition has not yet been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PCR_A::VALUE1) } #[doc = "A stop condition has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PCR_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl NACK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> NACK_A { + pub const fn variant(&self) -> NACK_A { match self.bits { false => NACK_A::VALUE1, true => NACK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A non-acknowledge has not been received."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == NACK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A non-acknowledge has been received."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == NACK_A::VALUE2 } } #[doc = "Field `NACK` writer - Non-Acknowledge Received"] -pub type NACK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, NACK_A, O>; -impl<'a, const O: u8> NACK_W<'a, O> { +pub type NACK_W<'a, REG> = crate::BitWriter<'a, REG, NACK_A>; +impl<'a, REG> NACK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A non-acknowledge has not been received."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(NACK_A::VALUE1) } #[doc = "A non-acknowledge has been received."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(NACK_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl ARL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ARL_A { + pub const fn variant(&self) -> ARL_A { match self.bits { false => ARL_A::VALUE1, true => ARL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An arbitration has not been lost."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ARL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An arbitration has been lost."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ARL_A::VALUE2 } } #[doc = "Field `ARL` writer - Arbitration Lost"] -pub type ARL_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, ARL_A, O>; -impl<'a, const O: u8> ARL_W<'a, O> { +pub type ARL_W<'a, REG> = crate::BitWriter<'a, REG, ARL_A>; +impl<'a, REG> ARL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An arbitration has not been lost."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ARL_A::VALUE1) } #[doc = "An arbitration has been lost."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ARL_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl SRR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRR_A { + pub const fn variant(&self) -> SRR_A { match self.bits { false => SRR_A::VALUE1, true => SRR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A slave read request has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A slave read request has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRR_A::VALUE2 } } #[doc = "Field `SRR` writer - Slave Read Request"] -pub type SRR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, SRR_A, O>; -impl<'a, const O: u8> SRR_W<'a, O> { +pub type SRR_W<'a, REG> = crate::BitWriter<'a, REG, SRR_A>; +impl<'a, REG> SRR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A slave read request has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRR_A::VALUE1) } #[doc = "A slave read request has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRR_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl ERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ERR_A { + pub const fn variant(&self) -> ERR_A { match self.bits { false => ERR_A::VALUE1, true => ERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An IIC error has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An IIC error has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ERR_A::VALUE2 } } #[doc = "Field `ERR` writer - Error"] -pub type ERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, ERR_A, O>; -impl<'a, const O: u8> ERR_W<'a, O> { +pub type ERR_W<'a, REG> = crate::BitWriter<'a, REG, ERR_A>; +impl<'a, REG> ERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An IIC error has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ERR_A::VALUE1) } #[doc = "An IIC error has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ERR_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl ACK_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ACK_A { + pub const fn variant(&self) -> ACK_A { match self.bits { false => ACK_A::VALUE1, true => ACK_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An acknowledge has not been received."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ACK_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An acknowledge has been received."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ACK_A::VALUE2 } } #[doc = "Field `ACK` writer - Acknowledge Received"] -pub type ACK_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, ACK_A, O>; -impl<'a, const O: u8> ACK_W<'a, O> { +pub type ACK_W<'a, REG> = crate::BitWriter<'a, REG, ACK_A>; +impl<'a, REG> ACK_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An acknowledge has not been received."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ACK_A::VALUE1) } #[doc = "An acknowledge has been received."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ACK_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl RSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSIF_A { + pub const fn variant(&self) -> RSIF_A { match self.bits { false => RSIF_A::VALUE1, true => RSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receiver start event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receiver start event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSIF_A::VALUE2 } } #[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] -pub type RSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, RSIF_A, O>; -impl<'a, const O: u8> RSIF_W<'a, O> { +pub type RSIF_W<'a, REG> = crate::BitWriter<'a, REG, RSIF_A>; +impl<'a, REG> RSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receiver start event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE1) } #[doc = "A receiver start event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl DLIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DLIF_A { + pub const fn variant(&self) -> DLIF_A { match self.bits { false => DLIF_A::VALUE1, true => DLIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A data lost event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DLIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A data lost event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DLIF_A::VALUE2 } } #[doc = "Field `DLIF` writer - Data Lost Indication Flag"] -pub type DLIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, DLIF_A, O>; -impl<'a, const O: u8> DLIF_W<'a, O> { +pub type DLIF_W<'a, REG> = crate::BitWriter<'a, REG, DLIF_A>; +impl<'a, REG> DLIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A data lost event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE1) } #[doc = "A data lost event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl TSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSIF_A { + pub const fn variant(&self) -> TSIF_A { match self.bits { false => TSIF_A::VALUE1, true => TSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit shift event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit shift event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSIF_A::VALUE2 } } #[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] -pub type TSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, TSIF_A, O>; -impl<'a, const O: u8> TSIF_W<'a, O> { +pub type TSIF_W<'a, REG> = crate::BitWriter<'a, REG, TSIF_A>; +impl<'a, REG> TSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit shift event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE1) } #[doc = "A transmit shift event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl TBIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBIF_A { + pub const fn variant(&self) -> TBIF_A { match self.bits { false => TBIF_A::VALUE1, true => TBIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit buffer event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit buffer event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBIF_A::VALUE2 } } #[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] -pub type TBIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, TBIF_A, O>; -impl<'a, const O: u8> TBIF_W<'a, O> { +pub type TBIF_W<'a, REG> = crate::BitWriter<'a, REG, TBIF_A>; +impl<'a, REG> TBIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit buffer event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE1) } #[doc = "A transmit buffer event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl RIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RIF_A { + pub const fn variant(&self) -> RIF_A { match self.bits { false => RIF_A::VALUE1, true => RIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RIF_A::VALUE2 } } #[doc = "Field `RIF` writer - Receive Indication Flag"] -pub type RIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, RIF_A, O>; -impl<'a, const O: u8> RIF_W<'a, O> { +pub type RIF_W<'a, REG> = crate::BitWriter<'a, REG, RIF_A>; +impl<'a, REG> RIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE1) } #[doc = "A receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl AIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AIF_A { + pub const fn variant(&self) -> AIF_A { match self.bits { false => AIF_A::VALUE1, true => AIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An alternative receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alternative receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AIF_A::VALUE2 } } #[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] -pub type AIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, AIF_A, O>; -impl<'a, const O: u8> AIF_W<'a, O> { +pub type AIF_W<'a, REG> = crate::BitWriter<'a, REG, AIF_A>; +impl<'a, REG> AIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An alternative receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE1) } #[doc = "An alternative receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE2) } } @@ -853,34 +869,37 @@ impl From for bool { impl BRGIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRGIF_A { + pub const fn variant(&self) -> BRGIF_A { match self.bits { false => BRGIF_A::VALUE1, true => BRGIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A baud rate generator event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRGIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A baud rate generator event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRGIF_A::VALUE2 } } #[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] -pub type BRGIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IICMODE_SPEC, BRGIF_A, O>; -impl<'a, const O: u8> BRGIF_W<'a, O> { +pub type BRGIF_W<'a, REG> = crate::BitWriter<'a, REG, BRGIF_A>; +impl<'a, REG> BRGIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A baud rate generator event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE1) } #[doc = "A baud rate generator event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE2) } } @@ -975,124 +994,125 @@ impl W { #[doc = "Bit 0 - Slave Select"] #[inline(always)] #[must_use] - pub fn slsel(&mut self) -> SLSEL_W<0> { - SLSEL_W::new(self) + pub fn slsel(&mut self) -> SLSEL_W { + SLSEL_W::new(self, 0) } #[doc = "Bit 1 - Wrong TDF Code Found"] #[inline(always)] #[must_use] - pub fn wtdf(&mut self) -> WTDF_W<1> { - WTDF_W::new(self) + pub fn wtdf(&mut self) -> WTDF_W { + WTDF_W::new(self, 1) } #[doc = "Bit 2 - Start Condition Received"] #[inline(always)] #[must_use] - pub fn scr(&mut self) -> SCR_W<2> { - SCR_W::new(self) + pub fn scr(&mut self) -> SCR_W { + SCR_W::new(self, 2) } #[doc = "Bit 3 - Repeated Start Condition Received"] #[inline(always)] #[must_use] - pub fn rscr(&mut self) -> RSCR_W<3> { - RSCR_W::new(self) + pub fn rscr(&mut self) -> RSCR_W { + RSCR_W::new(self, 3) } #[doc = "Bit 4 - Stop Condition Received"] #[inline(always)] #[must_use] - pub fn pcr(&mut self) -> PCR_W<4> { - PCR_W::new(self) + pub fn pcr(&mut self) -> PCR_W { + PCR_W::new(self, 4) } #[doc = "Bit 5 - Non-Acknowledge Received"] #[inline(always)] #[must_use] - pub fn nack(&mut self) -> NACK_W<5> { - NACK_W::new(self) + pub fn nack(&mut self) -> NACK_W { + NACK_W::new(self, 5) } #[doc = "Bit 6 - Arbitration Lost"] #[inline(always)] #[must_use] - pub fn arl(&mut self) -> ARL_W<6> { - ARL_W::new(self) + pub fn arl(&mut self) -> ARL_W { + ARL_W::new(self, 6) } #[doc = "Bit 7 - Slave Read Request"] #[inline(always)] #[must_use] - pub fn srr(&mut self) -> SRR_W<7> { - SRR_W::new(self) + pub fn srr(&mut self) -> SRR_W { + SRR_W::new(self, 7) } #[doc = "Bit 8 - Error"] #[inline(always)] #[must_use] - pub fn err(&mut self) -> ERR_W<8> { - ERR_W::new(self) + pub fn err(&mut self) -> ERR_W { + ERR_W::new(self, 8) } #[doc = "Bit 9 - Acknowledge Received"] #[inline(always)] #[must_use] - pub fn ack(&mut self) -> ACK_W<9> { - ACK_W::new(self) + pub fn ack(&mut self) -> ACK_W { + ACK_W::new(self, 9) } #[doc = "Bit 10 - Receiver Start Indication Flag"] #[inline(always)] #[must_use] - pub fn rsif(&mut self) -> RSIF_W<10> { - RSIF_W::new(self) + pub fn rsif(&mut self) -> RSIF_W { + RSIF_W::new(self, 10) } #[doc = "Bit 11 - Data Lost Indication Flag"] #[inline(always)] #[must_use] - pub fn dlif(&mut self) -> DLIF_W<11> { - DLIF_W::new(self) + pub fn dlif(&mut self) -> DLIF_W { + DLIF_W::new(self, 11) } #[doc = "Bit 12 - Transmit Shift Indication Flag"] #[inline(always)] #[must_use] - pub fn tsif(&mut self) -> TSIF_W<12> { - TSIF_W::new(self) + pub fn tsif(&mut self) -> TSIF_W { + TSIF_W::new(self, 12) } #[doc = "Bit 13 - Transmit Buffer Indication Flag"] #[inline(always)] #[must_use] - pub fn tbif(&mut self) -> TBIF_W<13> { - TBIF_W::new(self) + pub fn tbif(&mut self) -> TBIF_W { + TBIF_W::new(self, 13) } #[doc = "Bit 14 - Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn rif(&mut self) -> RIF_W<14> { - RIF_W::new(self) + pub fn rif(&mut self) -> RIF_W { + RIF_W::new(self, 14) } #[doc = "Bit 15 - Alternative Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn aif(&mut self) -> AIF_W<15> { - AIF_W::new(self) + pub fn aif(&mut self) -> AIF_W { + AIF_W::new(self, 15) } #[doc = "Bit 16 - Baud Rate Generator Indication Flag"] #[inline(always)] #[must_use] - pub fn brgif(&mut self) -> BRGIF_W<16> { - BRGIF_W::new(self) + pub fn brgif(&mut self) -> BRGIF_W { + BRGIF_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Status Register \\[IIC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr_iicmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr_iicmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psr_iicmode::R`](R) reader structure"] +impl crate::Readable for PSR_IICMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psr_iicmode::W`](W) writer structure"] impl crate::Writable for PSR_IICMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/psr_iismode.rs b/src/usic0_ch0/psr_iismode.rs index 65d2592f..50acefaa 100644 --- a/src/usic0_ch0/psr_iismode.rs +++ b/src/usic0_ch0/psr_iismode.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WA` reader - Word Address"] pub type WA_R = crate::BitReader; #[doc = "Word Address\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl WA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WA_A { + pub const fn variant(&self) -> WA_A { match self.bits { false => WA_A::VALUE1, true => WA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "WA has been sampled 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "WA has been sampled 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WA_A::VALUE2 } } #[doc = "Field `WA` writer - Word Address"] -pub type WA_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, WA_A, O>; -impl<'a, const O: u8> WA_W<'a, O> { +pub type WA_W<'a, REG> = crate::BitWriter<'a, REG, WA_A>; +impl<'a, REG> WA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "WA has been sampled 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WA_A::VALUE1) } #[doc = "WA has been sampled 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WA_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl DX2S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DX2S_A { + pub const fn variant(&self) -> DX2S_A { match self.bits { false => DX2S_A::VALUE1, true => DX2S_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DX2S is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DX2S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DX2S is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DX2S_A::VALUE2 } } #[doc = "Field `DX2S` writer - DX2S Status"] -pub type DX2S_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, DX2S_A, O>; -impl<'a, const O: u8> DX2S_W<'a, O> { +pub type DX2S_W<'a, REG> = crate::BitWriter<'a, REG, DX2S_A>; +impl<'a, REG> DX2S_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DX2S is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DX2S_A::VALUE1) } #[doc = "DX2S is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DX2S_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl DX2TEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DX2TEV_A { + pub const fn variant(&self) -> DX2TEV_A { match self.bits { false => DX2TEV_A::VALUE1, true => DX2TEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The DX2T signal has not been activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DX2TEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The DX2T signal has been activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DX2TEV_A::VALUE2 } } #[doc = "Field `DX2TEV` writer - DX2T Event Detected"] -pub type DX2TEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, DX2TEV_A, O>; -impl<'a, const O: u8> DX2TEV_W<'a, O> { +pub type DX2TEV_W<'a, REG> = crate::BitWriter<'a, REG, DX2TEV_A>; +impl<'a, REG> DX2TEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The DX2T signal has not been activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DX2TEV_A::VALUE1) } #[doc = "The DX2T signal has been activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DX2TEV_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl WAFE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WAFE_A { + pub const fn variant(&self) -> WAFE_A { match self.bits { false => WAFE_A::VALUE1, true => WAFE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A WA falling edge has not been generated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WAFE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A WA falling edge has been generated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WAFE_A::VALUE2 } } #[doc = "Field `WAFE` writer - WA Falling Edge Event"] -pub type WAFE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, WAFE_A, O>; -impl<'a, const O: u8> WAFE_W<'a, O> { +pub type WAFE_W<'a, REG> = crate::BitWriter<'a, REG, WAFE_A>; +impl<'a, REG> WAFE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A WA falling edge has not been generated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WAFE_A::VALUE1) } #[doc = "A WA falling edge has been generated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WAFE_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl WARE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WARE_A { + pub const fn variant(&self) -> WARE_A { match self.bits { false => WARE_A::VALUE1, true => WARE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A WA rising edge has not been generated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WARE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A WA rising edge has been generated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WARE_A::VALUE2 } } #[doc = "Field `WARE` writer - WA Rising Edge Event"] -pub type WARE_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, WARE_A, O>; -impl<'a, const O: u8> WARE_W<'a, O> { +pub type WARE_W<'a, REG> = crate::BitWriter<'a, REG, WARE_A>; +impl<'a, REG> WARE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A WA rising edge has not been generated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WARE_A::VALUE1) } #[doc = "A WA rising edge has been generated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WARE_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl END_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> END_A { + pub const fn variant(&self) -> END_A { match self.bits { false => END_A::VALUE1, true => END_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The WA generation has not yet ended (if it is running and WAGEN has been cleared)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == END_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The WA generation has ended (if it has been running)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == END_A::VALUE2 } } #[doc = "Field `END` writer - WA Generation End"] -pub type END_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, END_A, O>; -impl<'a, const O: u8> END_W<'a, O> { +pub type END_W<'a, REG> = crate::BitWriter<'a, REG, END_A>; +impl<'a, REG> END_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The WA generation has not yet ended (if it is running and WAGEN has been cleared)."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(END_A::VALUE1) } #[doc = "The WA generation has ended (if it has been running)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(END_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl RSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSIF_A { + pub const fn variant(&self) -> RSIF_A { match self.bits { false => RSIF_A::VALUE1, true => RSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receiver start event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receiver start event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSIF_A::VALUE2 } } #[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] -pub type RSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, RSIF_A, O>; -impl<'a, const O: u8> RSIF_W<'a, O> { +pub type RSIF_W<'a, REG> = crate::BitWriter<'a, REG, RSIF_A>; +impl<'a, REG> RSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receiver start event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE1) } #[doc = "A receiver start event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl DLIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DLIF_A { + pub const fn variant(&self) -> DLIF_A { match self.bits { false => DLIF_A::VALUE1, true => DLIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A data lost event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DLIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A data lost event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DLIF_A::VALUE2 } } #[doc = "Field `DLIF` writer - Data Lost Indication Flag"] -pub type DLIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, DLIF_A, O>; -impl<'a, const O: u8> DLIF_W<'a, O> { +pub type DLIF_W<'a, REG> = crate::BitWriter<'a, REG, DLIF_A>; +impl<'a, REG> DLIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A data lost event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE1) } #[doc = "A data lost event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl TSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSIF_A { + pub const fn variant(&self) -> TSIF_A { match self.bits { false => TSIF_A::VALUE1, true => TSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit shift event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit shift event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSIF_A::VALUE2 } } #[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] -pub type TSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, TSIF_A, O>; -impl<'a, const O: u8> TSIF_W<'a, O> { +pub type TSIF_W<'a, REG> = crate::BitWriter<'a, REG, TSIF_A>; +impl<'a, REG> TSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit shift event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE1) } #[doc = "A transmit shift event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl TBIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBIF_A { + pub const fn variant(&self) -> TBIF_A { match self.bits { false => TBIF_A::VALUE1, true => TBIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit buffer event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit buffer event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBIF_A::VALUE2 } } #[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] -pub type TBIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, TBIF_A, O>; -impl<'a, const O: u8> TBIF_W<'a, O> { +pub type TBIF_W<'a, REG> = crate::BitWriter<'a, REG, TBIF_A>; +impl<'a, REG> TBIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit buffer event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE1) } #[doc = "A transmit buffer event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl RIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RIF_A { + pub const fn variant(&self) -> RIF_A { match self.bits { false => RIF_A::VALUE1, true => RIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RIF_A::VALUE2 } } #[doc = "Field `RIF` writer - Receive Indication Flag"] -pub type RIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, RIF_A, O>; -impl<'a, const O: u8> RIF_W<'a, O> { +pub type RIF_W<'a, REG> = crate::BitWriter<'a, REG, RIF_A>; +impl<'a, REG> RIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE1) } #[doc = "A receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl AIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AIF_A { + pub const fn variant(&self) -> AIF_A { match self.bits { false => AIF_A::VALUE1, true => AIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An alternative receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alternative receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AIF_A::VALUE2 } } #[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] -pub type AIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, AIF_A, O>; -impl<'a, const O: u8> AIF_W<'a, O> { +pub type AIF_W<'a, REG> = crate::BitWriter<'a, REG, AIF_A>; +impl<'a, REG> AIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An alternative receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE1) } #[doc = "An alternative receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl BRGIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRGIF_A { + pub const fn variant(&self) -> BRGIF_A { match self.bits { false => BRGIF_A::VALUE1, true => BRGIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A baud rate generator event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRGIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A baud rate generator event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRGIF_A::VALUE2 } } #[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] -pub type BRGIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_IISMODE_SPEC, BRGIF_A, O>; -impl<'a, const O: u8> BRGIF_W<'a, O> { +pub type BRGIF_W<'a, REG> = crate::BitWriter<'a, REG, BRGIF_A>; +impl<'a, REG> BRGIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A baud rate generator event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE1) } #[doc = "A baud rate generator event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE2) } } @@ -755,100 +762,101 @@ impl W { #[doc = "Bit 0 - Word Address"] #[inline(always)] #[must_use] - pub fn wa(&mut self) -> WA_W<0> { - WA_W::new(self) + pub fn wa(&mut self) -> WA_W { + WA_W::new(self, 0) } #[doc = "Bit 1 - DX2S Status"] #[inline(always)] #[must_use] - pub fn dx2s(&mut self) -> DX2S_W<1> { - DX2S_W::new(self) + pub fn dx2s(&mut self) -> DX2S_W { + DX2S_W::new(self, 1) } #[doc = "Bit 3 - DX2T Event Detected"] #[inline(always)] #[must_use] - pub fn dx2tev(&mut self) -> DX2TEV_W<3> { - DX2TEV_W::new(self) + pub fn dx2tev(&mut self) -> DX2TEV_W { + DX2TEV_W::new(self, 3) } #[doc = "Bit 4 - WA Falling Edge Event"] #[inline(always)] #[must_use] - pub fn wafe(&mut self) -> WAFE_W<4> { - WAFE_W::new(self) + pub fn wafe(&mut self) -> WAFE_W { + WAFE_W::new(self, 4) } #[doc = "Bit 5 - WA Rising Edge Event"] #[inline(always)] #[must_use] - pub fn ware(&mut self) -> WARE_W<5> { - WARE_W::new(self) + pub fn ware(&mut self) -> WARE_W { + WARE_W::new(self, 5) } #[doc = "Bit 6 - WA Generation End"] #[inline(always)] #[must_use] - pub fn end(&mut self) -> END_W<6> { - END_W::new(self) + pub fn end(&mut self) -> END_W { + END_W::new(self, 6) } #[doc = "Bit 10 - Receiver Start Indication Flag"] #[inline(always)] #[must_use] - pub fn rsif(&mut self) -> RSIF_W<10> { - RSIF_W::new(self) + pub fn rsif(&mut self) -> RSIF_W { + RSIF_W::new(self, 10) } #[doc = "Bit 11 - Data Lost Indication Flag"] #[inline(always)] #[must_use] - pub fn dlif(&mut self) -> DLIF_W<11> { - DLIF_W::new(self) + pub fn dlif(&mut self) -> DLIF_W { + DLIF_W::new(self, 11) } #[doc = "Bit 12 - Transmit Shift Indication Flag"] #[inline(always)] #[must_use] - pub fn tsif(&mut self) -> TSIF_W<12> { - TSIF_W::new(self) + pub fn tsif(&mut self) -> TSIF_W { + TSIF_W::new(self, 12) } #[doc = "Bit 13 - Transmit Buffer Indication Flag"] #[inline(always)] #[must_use] - pub fn tbif(&mut self) -> TBIF_W<13> { - TBIF_W::new(self) + pub fn tbif(&mut self) -> TBIF_W { + TBIF_W::new(self, 13) } #[doc = "Bit 14 - Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn rif(&mut self) -> RIF_W<14> { - RIF_W::new(self) + pub fn rif(&mut self) -> RIF_W { + RIF_W::new(self, 14) } #[doc = "Bit 15 - Alternative Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn aif(&mut self) -> AIF_W<15> { - AIF_W::new(self) + pub fn aif(&mut self) -> AIF_W { + AIF_W::new(self, 15) } #[doc = "Bit 16 - Baud Rate Generator Indication Flag"] #[inline(always)] #[must_use] - pub fn brgif(&mut self) -> BRGIF_W<16> { - BRGIF_W::new(self) + pub fn brgif(&mut self) -> BRGIF_W { + BRGIF_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Status Register \\[IIS Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr_iismode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr_iismode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psr_iismode::R`](R) reader structure"] +impl crate::Readable for PSR_IISMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psr_iismode::W`](W) writer structure"] impl crate::Writable for PSR_IISMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/psr_sscmode.rs b/src/usic0_ch0/psr_sscmode.rs index f307970c..25273f86 100644 --- a/src/usic0_ch0/psr_sscmode.rs +++ b/src/usic0_ch0/psr_sscmode.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `MSLS` reader - MSLS Status"] pub type MSLS_R = crate::BitReader; #[doc = "MSLS Status\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl MSLS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSLS_A { + pub const fn variant(&self) -> MSLS_A { match self.bits { false => MSLS_A::VALUE1, true => MSLS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The internal signal MSLS is inactive (0)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSLS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The internal signal MSLS is active (1)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSLS_A::VALUE2 } } #[doc = "Field `MSLS` writer - MSLS Status"] -pub type MSLS_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, MSLS_A, O>; -impl<'a, const O: u8> MSLS_W<'a, O> { +pub type MSLS_W<'a, REG> = crate::BitWriter<'a, REG, MSLS_A>; +impl<'a, REG> MSLS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The internal signal MSLS is inactive (0)."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSLS_A::VALUE1) } #[doc = "The internal signal MSLS is active (1)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSLS_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl DX2S_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DX2S_A { + pub const fn variant(&self) -> DX2S_A { match self.bits { false => DX2S_A::VALUE1, true => DX2S_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DX2S is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DX2S_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DX2S is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DX2S_A::VALUE2 } } #[doc = "Field `DX2S` writer - DX2S Status"] -pub type DX2S_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, DX2S_A, O>; -impl<'a, const O: u8> DX2S_W<'a, O> { +pub type DX2S_W<'a, REG> = crate::BitWriter<'a, REG, DX2S_A>; +impl<'a, REG> DX2S_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "DX2S is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DX2S_A::VALUE1) } #[doc = "DX2S is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DX2S_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl MSLSEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> MSLSEV_A { + pub const fn variant(&self) -> MSLSEV_A { match self.bits { false => MSLSEV_A::VALUE1, true => MSLSEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The MSLS signal has not changed its state."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == MSLSEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The MSLS signal has changed its state."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == MSLSEV_A::VALUE2 } } #[doc = "Field `MSLSEV` writer - MSLS Event Detected"] -pub type MSLSEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, MSLSEV_A, O>; -impl<'a, const O: u8> MSLSEV_W<'a, O> { +pub type MSLSEV_W<'a, REG> = crate::BitWriter<'a, REG, MSLSEV_A>; +impl<'a, REG> MSLSEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The MSLS signal has not changed its state."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MSLSEV_A::VALUE1) } #[doc = "The MSLS signal has changed its state."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MSLSEV_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl DX2TEV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DX2TEV_A { + pub const fn variant(&self) -> DX2TEV_A { match self.bits { false => DX2TEV_A::VALUE1, true => DX2TEV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The DX2T signal has not been activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DX2TEV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The DX2T signal has been activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DX2TEV_A::VALUE2 } } #[doc = "Field `DX2TEV` writer - DX2T Event Detected"] -pub type DX2TEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, DX2TEV_A, O>; -impl<'a, const O: u8> DX2TEV_W<'a, O> { +pub type DX2TEV_W<'a, REG> = crate::BitWriter<'a, REG, DX2TEV_A>; +impl<'a, REG> DX2TEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The DX2T signal has not been activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DX2TEV_A::VALUE1) } #[doc = "The DX2T signal has been activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DX2TEV_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl PARERR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PARERR_A { + pub const fn variant(&self) -> PARERR_A { match self.bits { false => PARERR_A::VALUE1, true => PARERR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A parity error event has not been activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PARERR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A parity error event has been activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PARERR_A::VALUE2 } } #[doc = "Field `PARERR` writer - Parity Error Event Detected"] -pub type PARERR_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, PARERR_A, O>; -impl<'a, const O: u8> PARERR_W<'a, O> { +pub type PARERR_W<'a, REG> = crate::BitWriter<'a, REG, PARERR_A>; +impl<'a, REG> PARERR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A parity error event has not been activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PARERR_A::VALUE1) } #[doc = "A parity error event has been activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PARERR_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl RSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RSIF_A { + pub const fn variant(&self) -> RSIF_A { match self.bits { false => RSIF_A::VALUE1, true => RSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receiver start event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receiver start event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RSIF_A::VALUE2 } } #[doc = "Field `RSIF` writer - Receiver Start Indication Flag"] -pub type RSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, RSIF_A, O>; -impl<'a, const O: u8> RSIF_W<'a, O> { +pub type RSIF_W<'a, REG> = crate::BitWriter<'a, REG, RSIF_A>; +impl<'a, REG> RSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receiver start event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE1) } #[doc = "A receiver start event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RSIF_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl DLIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DLIF_A { + pub const fn variant(&self) -> DLIF_A { match self.bits { false => DLIF_A::VALUE1, true => DLIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A data lost event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DLIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A data lost event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DLIF_A::VALUE2 } } #[doc = "Field `DLIF` writer - Data Lost Indication Flag"] -pub type DLIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, DLIF_A, O>; -impl<'a, const O: u8> DLIF_W<'a, O> { +pub type DLIF_W<'a, REG> = crate::BitWriter<'a, REG, DLIF_A>; +impl<'a, REG> DLIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A data lost event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE1) } #[doc = "A data lost event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DLIF_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl TSIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSIF_A { + pub const fn variant(&self) -> TSIF_A { match self.bits { false => TSIF_A::VALUE1, true => TSIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit shift event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit shift event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSIF_A::VALUE2 } } #[doc = "Field `TSIF` writer - Transmit Shift Indication Flag"] -pub type TSIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, TSIF_A, O>; -impl<'a, const O: u8> TSIF_W<'a, O> { +pub type TSIF_W<'a, REG> = crate::BitWriter<'a, REG, TSIF_A>; +impl<'a, REG> TSIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit shift event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE1) } #[doc = "A transmit shift event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TSIF_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl TBIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBIF_A { + pub const fn variant(&self) -> TBIF_A { match self.bits { false => TBIF_A::VALUE1, true => TBIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit buffer event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit buffer event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBIF_A::VALUE2 } } #[doc = "Field `TBIF` writer - Transmit Buffer Indication Flag"] -pub type TBIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, TBIF_A, O>; -impl<'a, const O: u8> TBIF_W<'a, O> { +pub type TBIF_W<'a, REG> = crate::BitWriter<'a, REG, TBIF_A>; +impl<'a, REG> TBIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit buffer event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE1) } #[doc = "A transmit buffer event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TBIF_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl RIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RIF_A { + pub const fn variant(&self) -> RIF_A { match self.bits { false => RIF_A::VALUE1, true => RIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RIF_A::VALUE2 } } #[doc = "Field `RIF` writer - Receive Indication Flag"] -pub type RIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, RIF_A, O>; -impl<'a, const O: u8> RIF_W<'a, O> { +pub type RIF_W<'a, REG> = crate::BitWriter<'a, REG, RIF_A>; +impl<'a, REG> RIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE1) } #[doc = "A receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RIF_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl AIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> AIF_A { + pub const fn variant(&self) -> AIF_A { match self.bits { false => AIF_A::VALUE1, true => AIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An alternative receive event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == AIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alternative receive event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == AIF_A::VALUE2 } } #[doc = "Field `AIF` writer - Alternative Receive Indication Flag"] -pub type AIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, AIF_A, O>; -impl<'a, const O: u8> AIF_W<'a, O> { +pub type AIF_W<'a, REG> = crate::BitWriter<'a, REG, AIF_A>; +impl<'a, REG> AIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An alternative receive event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE1) } #[doc = "An alternative receive event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AIF_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl BRGIF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BRGIF_A { + pub const fn variant(&self) -> BRGIF_A { match self.bits { false => BRGIF_A::VALUE1, true => BRGIF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A baud rate generator event has not occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BRGIF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A baud rate generator event has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BRGIF_A::VALUE2 } } #[doc = "Field `BRGIF` writer - Baud Rate Generator Indication Flag"] -pub type BRGIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, PSR_SSCMODE_SPEC, BRGIF_A, O>; -impl<'a, const O: u8> BRGIF_W<'a, O> { +pub type BRGIF_W<'a, REG> = crate::BitWriter<'a, REG, BRGIF_A>; +impl<'a, REG> BRGIF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A baud rate generator event has not occurred."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE1) } #[doc = "A baud rate generator event has occurred."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BRGIF_A::VALUE2) } } @@ -700,94 +704,95 @@ impl W { #[doc = "Bit 0 - MSLS Status"] #[inline(always)] #[must_use] - pub fn msls(&mut self) -> MSLS_W<0> { - MSLS_W::new(self) + pub fn msls(&mut self) -> MSLS_W { + MSLS_W::new(self, 0) } #[doc = "Bit 1 - DX2S Status"] #[inline(always)] #[must_use] - pub fn dx2s(&mut self) -> DX2S_W<1> { - DX2S_W::new(self) + pub fn dx2s(&mut self) -> DX2S_W { + DX2S_W::new(self, 1) } #[doc = "Bit 2 - MSLS Event Detected"] #[inline(always)] #[must_use] - pub fn mslsev(&mut self) -> MSLSEV_W<2> { - MSLSEV_W::new(self) + pub fn mslsev(&mut self) -> MSLSEV_W { + MSLSEV_W::new(self, 2) } #[doc = "Bit 3 - DX2T Event Detected"] #[inline(always)] #[must_use] - pub fn dx2tev(&mut self) -> DX2TEV_W<3> { - DX2TEV_W::new(self) + pub fn dx2tev(&mut self) -> DX2TEV_W { + DX2TEV_W::new(self, 3) } #[doc = "Bit 4 - Parity Error Event Detected"] #[inline(always)] #[must_use] - pub fn parerr(&mut self) -> PARERR_W<4> { - PARERR_W::new(self) + pub fn parerr(&mut self) -> PARERR_W { + PARERR_W::new(self, 4) } #[doc = "Bit 10 - Receiver Start Indication Flag"] #[inline(always)] #[must_use] - pub fn rsif(&mut self) -> RSIF_W<10> { - RSIF_W::new(self) + pub fn rsif(&mut self) -> RSIF_W { + RSIF_W::new(self, 10) } #[doc = "Bit 11 - Data Lost Indication Flag"] #[inline(always)] #[must_use] - pub fn dlif(&mut self) -> DLIF_W<11> { - DLIF_W::new(self) + pub fn dlif(&mut self) -> DLIF_W { + DLIF_W::new(self, 11) } #[doc = "Bit 12 - Transmit Shift Indication Flag"] #[inline(always)] #[must_use] - pub fn tsif(&mut self) -> TSIF_W<12> { - TSIF_W::new(self) + pub fn tsif(&mut self) -> TSIF_W { + TSIF_W::new(self, 12) } #[doc = "Bit 13 - Transmit Buffer Indication Flag"] #[inline(always)] #[must_use] - pub fn tbif(&mut self) -> TBIF_W<13> { - TBIF_W::new(self) + pub fn tbif(&mut self) -> TBIF_W { + TBIF_W::new(self, 13) } #[doc = "Bit 14 - Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn rif(&mut self) -> RIF_W<14> { - RIF_W::new(self) + pub fn rif(&mut self) -> RIF_W { + RIF_W::new(self, 14) } #[doc = "Bit 15 - Alternative Receive Indication Flag"] #[inline(always)] #[must_use] - pub fn aif(&mut self) -> AIF_W<15> { - AIF_W::new(self) + pub fn aif(&mut self) -> AIF_W { + AIF_W::new(self, 15) } #[doc = "Bit 16 - Baud Rate Generator Indication Flag"] #[inline(always)] #[must_use] - pub fn brgif(&mut self) -> BRGIF_W<16> { - BRGIF_W::new(self) + pub fn brgif(&mut self) -> BRGIF_W { + BRGIF_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Protocol Status Register \\[SSC Mode\\]\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`psr_sscmode::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`psr_sscmode::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`psr_sscmode::R`](R) reader structure"] +impl crate::Readable for PSR_SSCMODE_SPEC {} +#[doc = "`write(|w| ..)` method takes [`psr_sscmode::W`](W) writer structure"] impl crate::Writable for PSR_SSCMODE_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/rbctr.rs b/src/usic0_ch0/rbctr.rs index da71b2e1..27dfdc07 100644 --- a/src/usic0_ch0/rbctr.rs +++ b/src/usic0_ch0/rbctr.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `DPTR` writer - Data Pointer"] -pub type DPTR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RBCTR_SPEC, u8, u8, 6, O>; +pub type DPTR_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `LIMIT` reader - Limit For Interrupt Generation"] -pub type LIMIT_R = crate::FieldReader; +pub type LIMIT_R = crate::FieldReader; #[doc = "Field `LIMIT` writer - Limit For Interrupt Generation"] -pub type LIMIT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RBCTR_SPEC, u8, u8, 6, O>; +pub type LIMIT_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `SRBTM` reader - Standard Receive Buffer Trigger Mode"] pub type SRBTM_R = crate::BitReader; #[doc = "Standard Receive Buffer Trigger Mode\n\nValue on reset: 0"] @@ -59,34 +27,37 @@ impl From for bool { impl SRBTM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRBTM_A { + pub const fn variant(&self) -> SRBTM_A { match self.bits { false => SRBTM_A::VALUE1, true => SRBTM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == SRBTM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger mode 1: 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=0."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRBTM_A::VALUE2 } } #[doc = "Field `SRBTM` writer - Standard Receive Buffer Trigger Mode"] -pub type SRBTM_W<'a, const O: u8> = crate::BitWriter<'a, u32, RBCTR_SPEC, SRBTM_A, O>; -impl<'a, const O: u8> SRBTM_W<'a, O> { +pub type SRBTM_W<'a, REG> = crate::BitWriter<'a, REG, SRBTM_A>; +impl<'a, REG> SRBTM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRBTM_A::VALUE1) } #[doc = "Trigger mode 1: 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=0."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRBTM_A::VALUE2) } } @@ -109,39 +80,42 @@ impl From for bool { impl SRBTEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRBTEN_A { + pub const fn variant(&self) -> SRBTEN_A { match self.bits { false => SRBTEN_A::VALUE1, true => SRBTEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRBTEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRBTEN_A::VALUE2 } } #[doc = "Field `SRBTEN` writer - Standard Receive Buffer Trigger Enable"] -pub type SRBTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RBCTR_SPEC, SRBTEN_A, O>; -impl<'a, const O: u8> SRBTEN_W<'a, O> { +pub type SRBTEN_W<'a, REG> = crate::BitWriter<'a, REG, SRBTEN_A>; +impl<'a, REG> SRBTEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRBTEN_A::VALUE1) } #[doc = "The standard receive buffer event trigger through bit TRBSR.SRBT is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRBTEN_A::VALUE2) } } #[doc = "Field `SRBINP` reader - Standard Receive Buffer Interrupt Node Pointer"] -pub type SRBINP_R = crate::FieldReader; +pub type SRBINP_R = crate::FieldReader; #[doc = "Standard Receive Buffer Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -165,10 +139,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRBINP_A { + type Ux = u8; +} impl SRBINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRBINP_A::VALUE1), 1 => Some(SRBINP_A::VALUE2), @@ -179,73 +156,77 @@ impl SRBINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Output SR0 becomes activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRBINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Output SR1 becomes activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRBINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Output SR2 becomes activated."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SRBINP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Output SR3 becomes activated."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SRBINP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Output SR4 becomes activated."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == SRBINP_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Output SR5 becomes activated."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == SRBINP_A::VALUE6 } } #[doc = "Field `SRBINP` writer - Standard Receive Buffer Interrupt Node Pointer"] -pub type SRBINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RBCTR_SPEC, u8, SRBINP_A, 3, O>; -impl<'a, const O: u8> SRBINP_W<'a, O> { +pub type SRBINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SRBINP_A>; +impl<'a, REG> SRBINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Output SR0 becomes activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRBINP_A::VALUE1) } #[doc = "Output SR1 becomes activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRBINP_A::VALUE2) } #[doc = "Output SR2 becomes activated."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SRBINP_A::VALUE3) } #[doc = "Output SR3 becomes activated."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SRBINP_A::VALUE4) } #[doc = "Output SR4 becomes activated."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(SRBINP_A::VALUE5) } #[doc = "Output SR5 becomes activated."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(SRBINP_A::VALUE6) } } #[doc = "Field `ARBINP` reader - Alternative Receive Buffer Interrupt Node Pointer"] -pub type ARBINP_R = crate::FieldReader; +pub type ARBINP_R = crate::FieldReader; #[doc = "Alternative Receive Buffer Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -269,10 +250,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ARBINP_A { + type Ux = u8; +} impl ARBINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ARBINP_A::VALUE1), 1 => Some(ARBINP_A::VALUE2), @@ -283,73 +267,77 @@ impl ARBINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Output SR0 becomes activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ARBINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Output SR1 becomes activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ARBINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Output SR2 becomes activated."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ARBINP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Output SR3 becomes activated."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ARBINP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Output SR4 becomes activated."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == ARBINP_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Output SR5 becomes activated."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == ARBINP_A::VALUE6 } } #[doc = "Field `ARBINP` writer - Alternative Receive Buffer Interrupt Node Pointer"] -pub type ARBINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RBCTR_SPEC, u8, ARBINP_A, 3, O>; -impl<'a, const O: u8> ARBINP_W<'a, O> { +pub type ARBINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, ARBINP_A>; +impl<'a, REG> ARBINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Output SR0 becomes activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ARBINP_A::VALUE1) } #[doc = "Output SR1 becomes activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ARBINP_A::VALUE2) } #[doc = "Output SR2 becomes activated."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ARBINP_A::VALUE3) } #[doc = "Output SR3 becomes activated."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ARBINP_A::VALUE4) } #[doc = "Output SR4 becomes activated."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(ARBINP_A::VALUE5) } #[doc = "Output SR5 becomes activated."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(ARBINP_A::VALUE6) } } #[doc = "Field `RCIM` reader - Receiver Control Information Mode"] -pub type RCIM_R = crate::FieldReader; +pub type RCIM_R = crate::FieldReader; #[doc = "Receiver Control Information Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -379,10 +367,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RCIM_A { + type Ux = u8; +} impl RCIM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RCIM_A { + pub const fn variant(&self) -> RCIM_A { match self.bits { 0 => RCIM_A::VALUE1, 1 => RCIM_A::VALUE2, @@ -391,49 +382,63 @@ impl RCIM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "RCI\\[4\\] += PERR, RCI\\[3:0\\] += WLEN"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RCIM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "RCI\\[4\\] += SOF, RCI\\[3:0\\] += WLEN"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RCIM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "RCI\\[4\\] += 0, RCI\\[3:0\\] += WLEN"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == RCIM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "RCI\\[4\\] += PERR, RCI\\[3\\] += PAR, RCI\\[2:1\\] += 00B, RCI\\[0\\] += SOF"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == RCIM_A::VALUE4 } } #[doc = "Field `RCIM` writer - Receiver Control Information Mode"] -pub type RCIM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, RBCTR_SPEC, u8, RCIM_A, 2, O>; -impl<'a, const O: u8> RCIM_W<'a, O> { +pub type RCIM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, RCIM_A>; +impl<'a, REG> RCIM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "RCI\\[4\\] = PERR, RCI\\[3:0\\] = WLEN"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RCIM_A::VALUE1) } #[doc = "RCI\\[4\\] = SOF, RCI\\[3:0\\] = WLEN"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RCIM_A::VALUE2) } #[doc = "RCI\\[4\\] = 0, RCI\\[3:0\\] = WLEN"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(RCIM_A::VALUE3) } #[doc = "RCI\\[4\\] @@ -442,12 +447,12 @@ impl<'a, const O: u8> RCIM_W<'a, O> { = 00B, RCI\\[0\\] = SOF"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(RCIM_A::VALUE4) } } #[doc = "Field `SIZE` reader - Buffer Size"] -pub type SIZE_R = crate::FieldReader; +pub type SIZE_R = crate::FieldReader; #[doc = "Buffer Size\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -473,10 +478,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SIZE_A { + type Ux = u8; +} impl SIZE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SIZE_A::VALUE1), 1 => Some(SIZE_A::VALUE2), @@ -488,78 +496,82 @@ impl SIZE_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The FIFO mechanism is disabled. The buffer does not accept any request for data."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SIZE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The FIFO buffer contains 2 entries."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SIZE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The FIFO buffer contains 4 entries."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SIZE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The FIFO buffer contains 8 entries."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SIZE_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The FIFO buffer contains 16 entries."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == SIZE_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "The FIFO buffer contains 32 entries."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == SIZE_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "The FIFO buffer contains 64 entries."] #[inline(always)] pub fn is_value7(&self) -> bool { *self == SIZE_A::VALUE7 } } #[doc = "Field `SIZE` writer - Buffer Size"] -pub type SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RBCTR_SPEC, u8, SIZE_A, 3, O>; -impl<'a, const O: u8> SIZE_W<'a, O> { +pub type SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SIZE_A>; +impl<'a, REG> SIZE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The FIFO mechanism is disabled. The buffer does not accept any request for data."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE1) } #[doc = "The FIFO buffer contains 2 entries."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE2) } #[doc = "The FIFO buffer contains 4 entries."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE3) } #[doc = "The FIFO buffer contains 8 entries."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE4) } #[doc = "The FIFO buffer contains 16 entries."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE5) } #[doc = "The FIFO buffer contains 32 entries."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE6) } #[doc = "The FIFO buffer contains 64 entries."] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE7) } } @@ -584,36 +596,41 @@ impl From for bool { impl RNM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RNM_A { + pub const fn variant(&self) -> RNM_A { match self.bits { false => RNM_A::VALUE1, true => RNM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == RNM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "RCI mode: A standard receive buffer event occurs when register OUTR is updated with a new value if the corresponding value in OUTR.RCI\\[4\\] += 0. If OUTR.RCI\\[4\\] += 1, an alternative receive buffer event occurs instead of the standard receive buffer event."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RNM_A::VALUE2 } } #[doc = "Field `RNM` writer - Receiver Notification Mode"] -pub type RNM_W<'a, const O: u8> = crate::BitWriter<'a, u32, RBCTR_SPEC, RNM_A, O>; -impl<'a, const O: u8> RNM_W<'a, O> { +pub type RNM_W<'a, REG> = crate::BitWriter<'a, REG, RNM_A>; +impl<'a, REG> RNM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RNM_A::VALUE1) } #[doc = "RCI mode: A standard receive buffer event occurs when register OUTR is updated with a new value if the corresponding value in OUTR.RCI\\[4\\] = 0. If OUTR.RCI\\[4\\] = 1, an alternative receive buffer event occurs instead of the standard receive buffer event."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RNM_A::VALUE2) } } @@ -636,34 +653,37 @@ impl From for bool { impl LOF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LOF_A { + pub const fn variant(&self) -> LOF_A { match self.bits { false => LOF_A::VALUE1, true => LOF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == LOF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A standard receive buffer event occurs when the filling level equals the limit value and gets bigger due to the reception of a new data word."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LOF_A::VALUE2 } } #[doc = "Field `LOF` writer - Buffer Event on Limit Overflow"] -pub type LOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, RBCTR_SPEC, LOF_A, O>; -impl<'a, const O: u8> LOF_W<'a, O> { +pub type LOF_W<'a, REG> = crate::BitWriter<'a, REG, LOF_A>; +impl<'a, REG> LOF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LOF_A::VALUE1) } #[doc = "A standard receive buffer event occurs when the filling level equals the limit value and gets bigger due to the reception of a new data word."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LOF_A::VALUE2) } } @@ -686,34 +706,37 @@ impl From for bool { impl ARBIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ARBIEN_A { + pub const fn variant(&self) -> ARBIEN_A { match self.bits { false => ARBIEN_A::VALUE1, true => ARBIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The alternative receive buffer interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ARBIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The alternative receive buffer interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ARBIEN_A::VALUE2 } } #[doc = "Field `ARBIEN` writer - Alternative Receive Buffer Interrupt Enable"] -pub type ARBIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RBCTR_SPEC, ARBIEN_A, O>; -impl<'a, const O: u8> ARBIEN_W<'a, O> { +pub type ARBIEN_W<'a, REG> = crate::BitWriter<'a, REG, ARBIEN_A>; +impl<'a, REG> ARBIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The alternative receive buffer interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ARBIEN_A::VALUE1) } #[doc = "The alternative receive buffer interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ARBIEN_A::VALUE2) } } @@ -736,34 +759,37 @@ impl From for bool { impl SRBIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRBIEN_A { + pub const fn variant(&self) -> SRBIEN_A { match self.bits { false => SRBIEN_A::VALUE1, true => SRBIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The standard receive buffer interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRBIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The standard receive buffer interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRBIEN_A::VALUE2 } } #[doc = "Field `SRBIEN` writer - Standard Receive Buffer Interrupt Enable"] -pub type SRBIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RBCTR_SPEC, SRBIEN_A, O>; -impl<'a, const O: u8> SRBIEN_W<'a, O> { +pub type SRBIEN_W<'a, REG> = crate::BitWriter<'a, REG, SRBIEN_A>; +impl<'a, REG> SRBIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The standard receive buffer interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRBIEN_A::VALUE1) } #[doc = "The standard receive buffer interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRBIEN_A::VALUE2) } } @@ -786,34 +812,37 @@ impl From for bool { impl RBERIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RBERIEN_A { + pub const fn variant(&self) -> RBERIEN_A { match self.bits { false => RBERIEN_A::VALUE1, true => RBERIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The receive buffer error interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RBERIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The receive buffer error interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RBERIEN_A::VALUE2 } } #[doc = "Field `RBERIEN` writer - Receive Buffer Error Interrupt Enable"] -pub type RBERIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RBCTR_SPEC, RBERIEN_A, O>; -impl<'a, const O: u8> RBERIEN_W<'a, O> { +pub type RBERIEN_W<'a, REG> = crate::BitWriter<'a, REG, RBERIEN_A>; +impl<'a, REG> RBERIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The receive buffer error interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RBERIEN_A::VALUE1) } #[doc = "The receive buffer error interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RBERIEN_A::VALUE2) } } @@ -883,100 +912,101 @@ impl W { #[doc = "Bits 0:5 - Data Pointer"] #[inline(always)] #[must_use] - pub fn dptr(&mut self) -> DPTR_W<0> { - DPTR_W::new(self) + pub fn dptr(&mut self) -> DPTR_W { + DPTR_W::new(self, 0) } #[doc = "Bits 8:13 - Limit For Interrupt Generation"] #[inline(always)] #[must_use] - pub fn limit(&mut self) -> LIMIT_W<8> { - LIMIT_W::new(self) + pub fn limit(&mut self) -> LIMIT_W { + LIMIT_W::new(self, 8) } #[doc = "Bit 14 - Standard Receive Buffer Trigger Mode"] #[inline(always)] #[must_use] - pub fn srbtm(&mut self) -> SRBTM_W<14> { - SRBTM_W::new(self) + pub fn srbtm(&mut self) -> SRBTM_W { + SRBTM_W::new(self, 14) } #[doc = "Bit 15 - Standard Receive Buffer Trigger Enable"] #[inline(always)] #[must_use] - pub fn srbten(&mut self) -> SRBTEN_W<15> { - SRBTEN_W::new(self) + pub fn srbten(&mut self) -> SRBTEN_W { + SRBTEN_W::new(self, 15) } #[doc = "Bits 16:18 - Standard Receive Buffer Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn srbinp(&mut self) -> SRBINP_W<16> { - SRBINP_W::new(self) + pub fn srbinp(&mut self) -> SRBINP_W { + SRBINP_W::new(self, 16) } #[doc = "Bits 19:21 - Alternative Receive Buffer Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn arbinp(&mut self) -> ARBINP_W<19> { - ARBINP_W::new(self) + pub fn arbinp(&mut self) -> ARBINP_W { + ARBINP_W::new(self, 19) } #[doc = "Bits 22:23 - Receiver Control Information Mode"] #[inline(always)] #[must_use] - pub fn rcim(&mut self) -> RCIM_W<22> { - RCIM_W::new(self) + pub fn rcim(&mut self) -> RCIM_W { + RCIM_W::new(self, 22) } #[doc = "Bits 24:26 - Buffer Size"] #[inline(always)] #[must_use] - pub fn size(&mut self) -> SIZE_W<24> { - SIZE_W::new(self) + pub fn size(&mut self) -> SIZE_W { + SIZE_W::new(self, 24) } #[doc = "Bit 27 - Receiver Notification Mode"] #[inline(always)] #[must_use] - pub fn rnm(&mut self) -> RNM_W<27> { - RNM_W::new(self) + pub fn rnm(&mut self) -> RNM_W { + RNM_W::new(self, 27) } #[doc = "Bit 28 - Buffer Event on Limit Overflow"] #[inline(always)] #[must_use] - pub fn lof(&mut self) -> LOF_W<28> { - LOF_W::new(self) + pub fn lof(&mut self) -> LOF_W { + LOF_W::new(self, 28) } #[doc = "Bit 29 - Alternative Receive Buffer Interrupt Enable"] #[inline(always)] #[must_use] - pub fn arbien(&mut self) -> ARBIEN_W<29> { - ARBIEN_W::new(self) + pub fn arbien(&mut self) -> ARBIEN_W { + ARBIEN_W::new(self, 29) } #[doc = "Bit 30 - Standard Receive Buffer Interrupt Enable"] #[inline(always)] #[must_use] - pub fn srbien(&mut self) -> SRBIEN_W<30> { - SRBIEN_W::new(self) + pub fn srbien(&mut self) -> SRBIEN_W { + SRBIEN_W::new(self, 30) } #[doc = "Bit 31 - Receive Buffer Error Interrupt Enable"] #[inline(always)] #[must_use] - pub fn rberien(&mut self) -> RBERIEN_W<31> { - RBERIEN_W::new(self) + pub fn rberien(&mut self) -> RBERIEN_W { + RBERIEN_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Receiver Buffer Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rbctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rbctr::R`](R) reader structure"] +impl crate::Readable for RBCTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rbctr::W`](W) writer structure"] impl crate::Writable for RBCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/rbuf.rs b/src/usic0_ch0/rbuf.rs index 41420047..e011fb7b 100644 --- a/src/usic0_ch0/rbuf.rs +++ b/src/usic0_ch0/rbuf.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DSR` reader - Received Data"] -pub type DSR_R = crate::FieldReader; +pub type DSR_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Received Data"] #[inline(always)] @@ -22,15 +9,13 @@ 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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Receiver Buffer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbuf::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`rbuf::R`](R) reader structure"] +impl crate::Readable for RBUF_SPEC {} #[doc = "`reset()` method sets RBUF to value 0"] impl crate::Resettable for RBUF_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/rbuf0.rs b/src/usic0_ch0/rbuf0.rs index 66ba7f9c..a5db333a 100644 --- a/src/usic0_ch0/rbuf0.rs +++ b/src/usic0_ch0/rbuf0.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DSR0` reader - Data of Shift Registers 0\\[3:0\\]"] -pub type DSR0_R = crate::FieldReader; +pub type DSR0_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Data of Shift Registers 0\\[3:0\\]"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Receiver Buffer Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbuf0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`rbuf0::R`](R) reader structure"] +impl crate::Readable for RBUF0_SPEC {} #[doc = "`reset()` method sets RBUF0 to value 0"] impl crate::Resettable for RBUF0_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/rbuf01sr.rs b/src/usic0_ch0/rbuf01sr.rs index 8b31a564..275c6828 100644 --- a/src/usic0_ch0/rbuf01sr.rs +++ b/src/usic0_ch0/rbuf01sr.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `WLEN0` reader - Received Data Word Length in RBUF0"] -pub type WLEN0_R = crate::FieldReader; +pub type WLEN0_R = crate::FieldReader; #[doc = "Field `SOF0` reader - Start of Frame in RBUF0"] pub type SOF0_R = crate::BitReader; #[doc = "Start of Frame in RBUF0\n\nValue on reset: 0"] @@ -34,25 +21,25 @@ impl From for bool { impl SOF0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SOF0_A { + pub const fn variant(&self) -> SOF0_A { match self.bits { false => SOF0_A::VALUE1, true => SOF0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data in RBUF0 has not been the first data word of a data frame."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SOF0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data in RBUF0 has been the first data word of a data frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SOF0_A::VALUE2 } } #[doc = "Field `PAR0` reader - Protocol-Related Argument in RBUF0"] -pub type PAR0_R = crate::BitReader; +pub type PAR0_R = crate::BitReader; #[doc = "Field `PERR0` reader - Protocol-related Error in RBUF0"] pub type PERR0_R = crate::BitReader; #[doc = "Protocol-related Error in RBUF0\n\nValue on reset: 0"] @@ -72,18 +59,18 @@ impl From for bool { impl PERR0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PERR0_A { + pub const fn variant(&self) -> PERR0_A { match self.bits { false => PERR0_A::VALUE1, true => PERR0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The received protocol-related argument PAR matches the expected value. The reception of the data word sets bit PSR.RIF and can generate a receive interrupt."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PERR0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The received protocol-related argument PAR does not match the expected value. The reception of the data word sets bit PSR.AIF and can generate an alternative receive interrupt."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PERR0_A::VALUE2 @@ -108,18 +95,18 @@ impl From for bool { impl RDV00_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RDV00_A { + pub const fn variant(&self) -> RDV00_A { match self.bits { false => RDV00_A::VALUE1, true => RDV00_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Register RBUF0 does not contain data that has not yet been read out."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RDV00_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Register RBUF0 contains data that has not yet been read out."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RDV00_A::VALUE2 @@ -144,18 +131,18 @@ impl From for bool { impl RDV01_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RDV01_A { + pub const fn variant(&self) -> RDV01_A { match self.bits { false => RDV01_A::VALUE1, true => RDV01_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Register RBUF1 does not contain data that has not yet been read out."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RDV01_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Register RBUF1 contains data that has not yet been read out."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RDV01_A::VALUE2 @@ -180,25 +167,25 @@ impl From for bool { impl DS0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DS0_A { + pub const fn variant(&self) -> DS0_A { match self.bits { false => DS0_A::VALUE1, true => DS0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The register RBUF contains the data of RBUF0 (same for associated status information)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DS0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The register RBUF contains the data of RBUF1 (same for associated status information)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DS0_A::VALUE2 } } #[doc = "Field `WLEN1` reader - Received Data Word Length in RBUF1"] -pub type WLEN1_R = crate::FieldReader; +pub type WLEN1_R = crate::FieldReader; #[doc = "Received Data Word Length in RBUF1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -214,22 +201,25 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for WLEN1_A { + type Ux = u8; +} impl WLEN1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(WLEN1_A::VALUE1), 15 => Some(WLEN1_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "One bit has been received."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WLEN1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Sixteen bits have been received."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WLEN1_A::VALUE2 @@ -254,25 +244,25 @@ impl From for bool { impl SOF1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SOF1_A { + pub const fn variant(&self) -> SOF1_A { match self.bits { false => SOF1_A::VALUE1, true => SOF1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data in RBUF1 has not been the first data word of a data frame."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SOF1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data in RBUF1 has been the first data word of a data frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SOF1_A::VALUE2 } } #[doc = "Field `PAR1` reader - Protocol-Related Argument in RBUF1"] -pub type PAR1_R = crate::BitReader; +pub type PAR1_R = crate::BitReader; #[doc = "Field `PERR1` reader - Protocol-related Error in RBUF1"] pub type PERR1_R = crate::BitReader; #[doc = "Protocol-related Error in RBUF1\n\nValue on reset: 0"] @@ -292,18 +282,18 @@ impl From for bool { impl PERR1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PERR1_A { + pub const fn variant(&self) -> PERR1_A { match self.bits { false => PERR1_A::VALUE1, true => PERR1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The received protocol-related argument PAR matches the expected value. The reception of the data word sets bit PSR.RIF and can generate a receive interrupt."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PERR1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The received protocol-related argument PAR does not match the expected value. The reception of the data word sets bit PSR.AIF and can generate an alternative receive interrupt."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PERR1_A::VALUE2 @@ -328,18 +318,18 @@ impl From for bool { impl RDV10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RDV10_A { + pub const fn variant(&self) -> RDV10_A { match self.bits { false => RDV10_A::VALUE1, true => RDV10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Register RBUF0 does not contain data that has not yet been read out."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RDV10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Register RBUF0 contains data that has not yet been read out."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RDV10_A::VALUE2 @@ -364,18 +354,18 @@ impl From for bool { impl RDV11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RDV11_A { + pub const fn variant(&self) -> RDV11_A { match self.bits { false => RDV11_A::VALUE1, true => RDV11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Register RBUF1 does not contain data that has not yet been read out."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RDV11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Register RBUF1 contains data that has not yet been read out."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RDV11_A::VALUE2 @@ -400,18 +390,18 @@ impl From for bool { impl DS1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DS1_A { + pub const fn variant(&self) -> DS1_A { match self.bits { false => DS1_A::VALUE1, true => DS1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The register RBUF contains the data of RBUF0 (same for associated status information)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DS1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The register RBUF contains the data of RBUF1 (same for associated status information)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DS1_A::VALUE2 @@ -489,15 +479,13 @@ impl R { DS1_R::new(((self.bits >> 31) & 1) != 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"] +#[doc = "Receiver Buffer 01 Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbuf01sr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`rbuf01sr::R`](R) reader structure"] +impl crate::Readable for RBUF01SR_SPEC {} #[doc = "`reset()` method sets RBUF01SR to value 0"] impl crate::Resettable for RBUF01SR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/rbuf1.rs b/src/usic0_ch0/rbuf1.rs index e1cbf8a8..b602d7f2 100644 --- a/src/usic0_ch0/rbuf1.rs +++ b/src/usic0_ch0/rbuf1.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DSR1` reader - Data of Shift Registers 1\\[3:0\\]"] -pub type DSR1_R = crate::FieldReader; +pub type DSR1_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Data of Shift Registers 1\\[3:0\\]"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Receiver Buffer Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbuf1::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`rbuf1::R`](R) reader structure"] +impl crate::Readable for RBUF1_SPEC {} #[doc = "`reset()` method sets RBUF1 to value 0"] impl crate::Resettable for RBUF1_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/rbufd.rs b/src/usic0_ch0/rbufd.rs index 627731d7..f62c0927 100644 --- a/src/usic0_ch0/rbufd.rs +++ b/src/usic0_ch0/rbufd.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `DSR` reader - Data from Shift Register"] -pub type DSR_R = crate::FieldReader; +pub type DSR_R = crate::FieldReader; impl R { #[doc = "Bits 0:15 - Data from Shift Register"] #[inline(always)] @@ -22,15 +9,13 @@ 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"] +#[doc = "Receiver Buffer Register for Debugger\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbufd::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`rbufd::R`](R) reader structure"] +impl crate::Readable for RBUFD_SPEC {} #[doc = "`reset()` method sets RBUFD to value 0"] impl crate::Resettable for RBUFD_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/rbufsr.rs b/src/usic0_ch0/rbufsr.rs index 99cacc89..bfd8af35 100644 --- a/src/usic0_ch0/rbufsr.rs +++ b/src/usic0_ch0/rbufsr.rs @@ -1,32 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `WLEN` reader - Received Data Word Length in RBUF or RBUFD"] -pub type WLEN_R = crate::FieldReader; +pub type WLEN_R = crate::FieldReader; #[doc = "Field `SOF` reader - Start of Frame in RBUF or RBUFD"] -pub type SOF_R = crate::BitReader; +pub type SOF_R = crate::BitReader; #[doc = "Field `PAR` reader - Protocol-Related Argument in RBUF or RBUFD"] -pub type PAR_R = crate::BitReader; +pub type PAR_R = crate::BitReader; #[doc = "Field `PERR` reader - Protocol-related Error in RBUF or RBUFD"] -pub type PERR_R = crate::BitReader; +pub type PERR_R = crate::BitReader; #[doc = "Field `RDV0` reader - Receive Data Valid in RBUF or RBUFD"] -pub type RDV0_R = crate::BitReader; +pub type RDV0_R = crate::BitReader; #[doc = "Field `RDV1` reader - Receive Data Valid in RBUF or RBUFD"] -pub type RDV1_R = crate::BitReader; +pub type RDV1_R = crate::BitReader; #[doc = "Field `DS` reader - Data Source of RBUF or RBUFD"] -pub type DS_R = crate::BitReader; +pub type DS_R = crate::BitReader; impl R { #[doc = "Bits 0:3 - Received Data Word Length in RBUF or RBUFD"] #[inline(always)] @@ -64,15 +51,13 @@ impl R { DS_R::new(((self.bits >> 15) & 1) != 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"] +#[doc = "Receiver Buffer Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rbufsr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`rbufsr::R`](R) reader structure"] +impl crate::Readable for RBUFSR_SPEC {} #[doc = "`reset()` method sets RBUFSR to value 0"] impl crate::Resettable for RBUFSR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/sctr.rs b/src/usic0_ch0/sctr.rs index de37c09c..5df9b95d 100644 --- a/src/usic0_ch0/sctr.rs +++ b/src/usic0_ch0/sctr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SDIR` reader - Shift Direction"] pub type SDIR_R = crate::BitReader; #[doc = "Shift Direction\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SDIR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SDIR_A { + pub const fn variant(&self) -> SDIR_A { match self.bits { false => SDIR_A::VALUE1, true => SDIR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Shift LSB first. The first data bit of a data word is located at bit position 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SDIR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Shift MSB first. The first data bit of a data word is located at the bit position given by bit field SCTR.WLE."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SDIR_A::VALUE2 } } #[doc = "Field `SDIR` writer - Shift Direction"] -pub type SDIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SCTR_SPEC, SDIR_A, O>; -impl<'a, const O: u8> SDIR_W<'a, O> { +pub type SDIR_W<'a, REG> = crate::BitWriter<'a, REG, SDIR_A>; +impl<'a, REG> SDIR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Shift LSB first. The first data bit of a data word is located at bit position 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SDIR_A::VALUE1) } #[doc = "Shift MSB first. The first data bit of a data word is located at the bit position given by bit field SCTR.WLE."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SDIR_A::VALUE2) } } @@ -103,39 +74,42 @@ impl From for bool { impl PDL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDL_A { + pub const fn variant(&self) -> PDL_A { match self.bits { false => PDL_A::VALUE1, true => PDL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The passive data level is 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The passive data level is 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDL_A::VALUE2 } } #[doc = "Field `PDL` writer - Passive Data Level"] -pub type PDL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SCTR_SPEC, PDL_A, O>; -impl<'a, const O: u8> PDL_W<'a, O> { +pub type PDL_W<'a, REG> = crate::BitWriter<'a, REG, PDL_A>; +impl<'a, REG> PDL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The passive data level is 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDL_A::VALUE1) } #[doc = "The passive data level is 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDL_A::VALUE2) } } #[doc = "Field `DSM` reader - Data Shift Mode"] -pub type DSM_R = crate::FieldReader; +pub type DSM_R = crate::FieldReader; #[doc = "Data Shift Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -155,10 +129,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DSM_A { + type Ux = u8; +} impl DSM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DSM_A::VALUE1), 2 => Some(DSM_A::VALUE3), @@ -166,40 +143,46 @@ impl DSM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Receive and transmit data is shifted in and out one bit at a time through DX0 and DOUT0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DSM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Receive and transmit data is shifted in and out two bits at a time through two input stages (DX0 and DX3) and DOUT\\[1:0\\] +respectively."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DSM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Receive and transmit data is shifted in and out four bits at a time through four input stages (DX0, DX\\[5:3\\]) and DOUT\\[3:0\\] +respectively."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DSM_A::VALUE4 } } #[doc = "Field `DSM` writer - Data Shift Mode"] -pub type DSM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCTR_SPEC, u8, DSM_A, 2, O>; -impl<'a, const O: u8> DSM_W<'a, O> { +pub type DSM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DSM_A>; +impl<'a, REG> DSM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Receive and transmit data is shifted in and out one bit at a time through DX0 and DOUT0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DSM_A::VALUE1) } #[doc = "Receive and transmit data is shifted in and out two bits at a time through two input stages (DX0 and DX3) and DOUT\\[1:0\\] respectively."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DSM_A::VALUE3) } #[doc = "Receive and transmit data is shifted in and out four bits at a time through four input stages (DX0, DX\\[5:3\\]) and DOUT\\[3:0\\] respectively."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DSM_A::VALUE4) } } @@ -222,39 +205,42 @@ impl From for bool { impl HPCDIR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HPCDIR_A { + pub const fn variant(&self) -> HPCDIR_A { match self.bits { false => HPCDIR_A::VALUE1, true => HPCDIR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The pin(s) with hardware pin control enabled are selected to be in input mode."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HPCDIR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The pin(s) with hardware pin control enabled are selected to be in output mode."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HPCDIR_A::VALUE2 } } #[doc = "Field `HPCDIR` writer - Port Control Direction"] -pub type HPCDIR_W<'a, const O: u8> = crate::BitWriter<'a, u32, SCTR_SPEC, HPCDIR_A, O>; -impl<'a, const O: u8> HPCDIR_W<'a, O> { +pub type HPCDIR_W<'a, REG> = crate::BitWriter<'a, REG, HPCDIR_A>; +impl<'a, REG> HPCDIR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The pin(s) with hardware pin control enabled are selected to be in input mode."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HPCDIR_A::VALUE1) } #[doc = "The pin(s) with hardware pin control enabled are selected to be in output mode."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HPCDIR_A::VALUE2) } } #[doc = "Field `DOCFG` reader - Data Output Configuration"] -pub type DOCFG_R = crate::FieldReader; +pub type DOCFG_R = crate::FieldReader; #[doc = "Data Output Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -270,43 +256,50 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DOCFG_A { + type Ux = u8; +} impl DOCFG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DOCFG_A::VALUE1), 1 => Some(DOCFG_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "DOUTx = shift data value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DOCFG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "DOUTx = inverted shift data value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DOCFG_A::VALUE2 } } #[doc = "Field `DOCFG` writer - Data Output Configuration"] -pub type DOCFG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCTR_SPEC, u8, DOCFG_A, 2, O>; -impl<'a, const O: u8> DOCFG_W<'a, O> { +pub type DOCFG_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DOCFG_A>; +impl<'a, REG> DOCFG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "DOUTx = shift data value"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DOCFG_A::VALUE1) } #[doc = "DOUTx = inverted shift data value"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DOCFG_A::VALUE2) } } #[doc = "Field `TRM` reader - Transmission Mode"] -pub type TRM_R = crate::FieldReader; +pub type TRM_R = crate::FieldReader; #[doc = "Transmission Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -326,10 +319,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TRM_A { + type Ux = u8; +} impl TRM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TRM_A { + pub const fn variant(&self) -> TRM_A { match self.bits { 0 => TRM_A::VALUE1, 1 => TRM_A::VALUE2, @@ -338,57 +334,61 @@ impl TRM_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The shift control signal is considered as inactive and data frame transfers are not possible."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TRM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The shift control signal is considered active if it is at 1-level. This is the setting to be programmed to allow data transfers."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TRM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The shift control signal is considered active if it is at 0-level. It is recommended to avoid this setting and to use the inversion in the DX2 stage in case of a low-active signal."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TRM_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The shift control signal is considered active without referring to the actual signal level. Data frame transfer is possible after each edge of the signal."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TRM_A::VALUE4 } } #[doc = "Field `TRM` writer - Transmission Mode"] -pub type TRM_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SCTR_SPEC, u8, TRM_A, 2, O>; -impl<'a, const O: u8> TRM_W<'a, O> { +pub type TRM_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, TRM_A>; +impl<'a, REG> TRM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The shift control signal is considered as inactive and data frame transfers are not possible."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TRM_A::VALUE1) } #[doc = "The shift control signal is considered active if it is at 1-level. This is the setting to be programmed to allow data transfers."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TRM_A::VALUE2) } #[doc = "The shift control signal is considered active if it is at 0-level. It is recommended to avoid this setting and to use the inversion in the DX2 stage in case of a low-active signal."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TRM_A::VALUE3) } #[doc = "The shift control signal is considered active without referring to the actual signal level. Data frame transfer is possible after each edge of the signal."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TRM_A::VALUE4) } } #[doc = "Field `FLE` reader - Frame Length"] -pub type FLE_R = crate::FieldReader; +pub type FLE_R = crate::FieldReader; #[doc = "Field `FLE` writer - Frame Length"] -pub type FLE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCTR_SPEC, u8, u8, 6, O>; +pub type FLE_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `WLE` reader - Word Length"] -pub type WLE_R = crate::FieldReader; +pub type WLE_R = crate::FieldReader; #[doc = "Word Length\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -408,10 +408,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for WLE_A { + type Ux = u8; +} impl WLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(WLE_A::VALUE1), 1 => Some(WLE_A::VALUE2), @@ -420,48 +423,52 @@ impl WLE_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data word contains 1 data bit located at bit position 0."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data word contains 2 data bits located at bit positions \\[1:0\\]."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WLE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The data word contains 15 data bits located at bit positions \\[14:0\\]."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == WLE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The data word contains 16 data bits located at bit positions \\[15:0\\]."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == WLE_A::VALUE4 } } #[doc = "Field `WLE` writer - Word Length"] -pub type WLE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SCTR_SPEC, u8, WLE_A, 4, O>; -impl<'a, const O: u8> WLE_W<'a, O> { +pub type WLE_W<'a, REG> = crate::FieldWriter<'a, REG, 4, WLE_A>; +impl<'a, REG> WLE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The data word contains 1 data bit located at bit position 0."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WLE_A::VALUE1) } #[doc = "The data word contains 2 data bits located at bit positions \\[1:0\\]."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WLE_A::VALUE2) } #[doc = "The data word contains 15 data bits located at bit positions \\[14:0\\]."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(WLE_A::VALUE3) } #[doc = "The data word contains 16 data bits located at bit positions \\[15:0\\]."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(WLE_A::VALUE4) } } @@ -511,70 +518,71 @@ impl W { #[doc = "Bit 0 - Shift Direction"] #[inline(always)] #[must_use] - pub fn sdir(&mut self) -> SDIR_W<0> { - SDIR_W::new(self) + pub fn sdir(&mut self) -> SDIR_W { + SDIR_W::new(self, 0) } #[doc = "Bit 1 - Passive Data Level"] #[inline(always)] #[must_use] - pub fn pdl(&mut self) -> PDL_W<1> { - PDL_W::new(self) + pub fn pdl(&mut self) -> PDL_W { + PDL_W::new(self, 1) } #[doc = "Bits 2:3 - Data Shift Mode"] #[inline(always)] #[must_use] - pub fn dsm(&mut self) -> DSM_W<2> { - DSM_W::new(self) + pub fn dsm(&mut self) -> DSM_W { + DSM_W::new(self, 2) } #[doc = "Bit 4 - Port Control Direction"] #[inline(always)] #[must_use] - pub fn hpcdir(&mut self) -> HPCDIR_W<4> { - HPCDIR_W::new(self) + pub fn hpcdir(&mut self) -> HPCDIR_W { + HPCDIR_W::new(self, 4) } #[doc = "Bits 6:7 - Data Output Configuration"] #[inline(always)] #[must_use] - pub fn docfg(&mut self) -> DOCFG_W<6> { - DOCFG_W::new(self) + pub fn docfg(&mut self) -> DOCFG_W { + DOCFG_W::new(self, 6) } #[doc = "Bits 8:9 - Transmission Mode"] #[inline(always)] #[must_use] - pub fn trm(&mut self) -> TRM_W<8> { - TRM_W::new(self) + pub fn trm(&mut self) -> TRM_W { + TRM_W::new(self, 8) } #[doc = "Bits 16:21 - Frame Length"] #[inline(always)] #[must_use] - pub fn fle(&mut self) -> FLE_W<16> { - FLE_W::new(self) + pub fn fle(&mut self) -> FLE_W { + FLE_W::new(self, 16) } #[doc = "Bits 24:27 - Word Length"] #[inline(always)] #[must_use] - pub fn wle(&mut self) -> WLE_W<24> { - WLE_W::new(self) + pub fn wle(&mut self) -> WLE_W { + WLE_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Shift Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sctr::R`](R) reader structure"] +impl crate::Readable for SCTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sctr::W`](W) writer structure"] impl crate::Writable for SCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/tbctr.rs b/src/usic0_ch0/tbctr.rs index 16054430..1d89dd4a 100644 --- a/src/usic0_ch0/tbctr.rs +++ b/src/usic0_ch0/tbctr.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DPTR` writer - Data Pointer"] -pub type DPTR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBCTR_SPEC, u8, u8, 6, O>; +pub type DPTR_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `LIMIT` reader - Limit For Interrupt Generation"] -pub type LIMIT_R = crate::FieldReader; +pub type LIMIT_R = crate::FieldReader; #[doc = "Field `LIMIT` writer - Limit For Interrupt Generation"] -pub type LIMIT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBCTR_SPEC, u8, u8, 6, O>; +pub type LIMIT_W<'a, REG> = crate::FieldWriter<'a, REG, 6>; #[doc = "Field `STBTM` reader - Standard Transmit Buffer Trigger Mode"] pub type STBTM_R = crate::BitReader; #[doc = "Standard Transmit Buffer Trigger Mode\n\nValue on reset: 0"] @@ -59,34 +27,37 @@ impl From for bool { impl STBTM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STBTM_A { + pub const fn variant(&self) -> STBTM_A { match self.bits { false => STBTM_A::VALUE1, true => STBTM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == STBTM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger mode 1: 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.SIZE."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STBTM_A::VALUE2 } } #[doc = "Field `STBTM` writer - Standard Transmit Buffer Trigger Mode"] -pub type STBTM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TBCTR_SPEC, STBTM_A, O>; -impl<'a, const O: u8> STBTM_W<'a, O> { +pub type STBTM_W<'a, REG> = crate::BitWriter<'a, REG, STBTM_A>; +impl<'a, REG> STBTM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STBTM_A::VALUE1) } #[doc = "Trigger mode 1: 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.SIZE."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STBTM_A::VALUE2) } } @@ -109,39 +80,42 @@ impl From for bool { impl STBTEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STBTEN_A { + pub const fn variant(&self) -> STBTEN_A { match self.bits { false => STBTEN_A::VALUE1, true => STBTEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STBTEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STBTEN_A::VALUE2 } } #[doc = "Field `STBTEN` writer - Standard Transmit Buffer Trigger Enable"] -pub type STBTEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, TBCTR_SPEC, STBTEN_A, O>; -impl<'a, const O: u8> STBTEN_W<'a, O> { +pub type STBTEN_W<'a, REG> = crate::BitWriter<'a, REG, STBTEN_A>; +impl<'a, REG> STBTEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STBTEN_A::VALUE1) } #[doc = "The standard transmit buffer event trigger through bit TRBSR.STBT is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STBTEN_A::VALUE2) } } #[doc = "Field `STBINP` reader - Standard Transmit Buffer Interrupt Node Pointer"] -pub type STBINP_R = crate::FieldReader; +pub type STBINP_R = crate::FieldReader; #[doc = "Standard Transmit Buffer Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -165,10 +139,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STBINP_A { + type Ux = u8; +} impl STBINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(STBINP_A::VALUE1), 1 => Some(STBINP_A::VALUE2), @@ -179,73 +156,77 @@ impl STBINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Output SR0 becomes activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STBINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Output SR1 becomes activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STBINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Output SR2 becomes activated."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STBINP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Output SR3 becomes activated."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STBINP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Output SR4 becomes activated."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == STBINP_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Output SR5 becomes activated."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == STBINP_A::VALUE6 } } #[doc = "Field `STBINP` writer - Standard Transmit Buffer Interrupt Node Pointer"] -pub type STBINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBCTR_SPEC, u8, STBINP_A, 3, O>; -impl<'a, const O: u8> STBINP_W<'a, O> { +pub type STBINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, STBINP_A>; +impl<'a, REG> STBINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Output SR0 becomes activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STBINP_A::VALUE1) } #[doc = "Output SR1 becomes activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STBINP_A::VALUE2) } #[doc = "Output SR2 becomes activated."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STBINP_A::VALUE3) } #[doc = "Output SR3 becomes activated."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STBINP_A::VALUE4) } #[doc = "Output SR4 becomes activated."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(STBINP_A::VALUE5) } #[doc = "Output SR5 becomes activated."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(STBINP_A::VALUE6) } } #[doc = "Field `ATBINP` reader - Alternative Transmit Buffer Interrupt Node Pointer"] -pub type ATBINP_R = crate::FieldReader; +pub type ATBINP_R = crate::FieldReader; #[doc = "Alternative Transmit Buffer Interrupt Node Pointer\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -269,10 +250,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ATBINP_A { + type Ux = u8; +} impl ATBINP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ATBINP_A::VALUE1), 1 => Some(ATBINP_A::VALUE2), @@ -283,73 +267,77 @@ impl ATBINP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Output SR0 becomes activated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ATBINP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Output SR1 becomes activated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ATBINP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Output SR2 becomes activated."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ATBINP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Output SR3 becomes activated."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ATBINP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Output SR4 becomes activated."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == ATBINP_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "Output SR5 becomes activated."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == ATBINP_A::VALUE6 } } #[doc = "Field `ATBINP` writer - Alternative Transmit Buffer Interrupt Node Pointer"] -pub type ATBINP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBCTR_SPEC, u8, ATBINP_A, 3, O>; -impl<'a, const O: u8> ATBINP_W<'a, O> { +pub type ATBINP_W<'a, REG> = crate::FieldWriter<'a, REG, 3, ATBINP_A>; +impl<'a, REG> ATBINP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Output SR0 becomes activated."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ATBINP_A::VALUE1) } #[doc = "Output SR1 becomes activated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ATBINP_A::VALUE2) } #[doc = "Output SR2 becomes activated."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ATBINP_A::VALUE3) } #[doc = "Output SR3 becomes activated."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ATBINP_A::VALUE4) } #[doc = "Output SR4 becomes activated."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(ATBINP_A::VALUE5) } #[doc = "Output SR5 becomes activated."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(ATBINP_A::VALUE6) } } #[doc = "Field `SIZE` reader - Buffer Size"] -pub type SIZE_R = crate::FieldReader; +pub type SIZE_R = crate::FieldReader; #[doc = "Buffer Size\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -375,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SIZE_A { + type Ux = u8; +} impl SIZE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SIZE_A::VALUE1), 1 => Some(SIZE_A::VALUE2), @@ -390,78 +381,82 @@ impl SIZE_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The FIFO mechanism is disabled. The buffer does not accept any request for data."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SIZE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The FIFO buffer contains 2 entries."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SIZE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "The FIFO buffer contains 4 entries."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SIZE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "The FIFO buffer contains 8 entries."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SIZE_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "The FIFO buffer contains 16 entries."] #[inline(always)] pub fn is_value5(&self) -> bool { *self == SIZE_A::VALUE5 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "The FIFO buffer contains 32 entries."] #[inline(always)] pub fn is_value6(&self) -> bool { *self == SIZE_A::VALUE6 } - #[doc = "Checks if the value of the field is `VALUE7`"] + #[doc = "The FIFO buffer contains 64 entries."] #[inline(always)] pub fn is_value7(&self) -> bool { *self == SIZE_A::VALUE7 } } #[doc = "Field `SIZE` writer - Buffer Size"] -pub type SIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBCTR_SPEC, u8, SIZE_A, 3, O>; -impl<'a, const O: u8> SIZE_W<'a, O> { +pub type SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 3, SIZE_A>; +impl<'a, REG> SIZE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "The FIFO mechanism is disabled. The buffer does not accept any request for data."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE1) } #[doc = "The FIFO buffer contains 2 entries."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE2) } #[doc = "The FIFO buffer contains 4 entries."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE3) } #[doc = "The FIFO buffer contains 8 entries."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE4) } #[doc = "The FIFO buffer contains 16 entries."] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE5) } #[doc = "The FIFO buffer contains 32 entries."] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE6) } #[doc = "The FIFO buffer contains 64 entries."] #[inline(always)] - pub fn value7(self) -> &'a mut W { + pub fn value7(self) -> &'a mut crate::W { self.variant(SIZE_A::VALUE7) } } @@ -484,34 +479,37 @@ impl From for bool { impl LOF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LOF_A { + pub const fn variant(&self) -> LOF_A { match self.bits { false => LOF_A::VALUE1, true => LOF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == LOF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A standard transmit buffer interrupt event occurs when the filling level equals the limit value and gets bigger due to a write access to a data input location INx."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LOF_A::VALUE2 } } #[doc = "Field `LOF` writer - Buffer Event on Limit Overflow"] -pub type LOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, TBCTR_SPEC, LOF_A, O>; -impl<'a, const O: u8> LOF_W<'a, O> { +pub type LOF_W<'a, REG> = crate::BitWriter<'a, REG, LOF_A>; +impl<'a, REG> LOF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LOF_A::VALUE1) } #[doc = "A standard transmit buffer interrupt event occurs when the filling level equals the limit value and gets bigger due to a write access to a data input location INx."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LOF_A::VALUE2) } } @@ -534,34 +532,37 @@ impl From for bool { impl STBIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STBIEN_A { + pub const fn variant(&self) -> STBIEN_A { match self.bits { false => STBIEN_A::VALUE1, true => STBIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The standard transmit buffer interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STBIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The standard transmit buffer interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STBIEN_A::VALUE2 } } #[doc = "Field `STBIEN` writer - Standard Transmit Buffer Interrupt Enable"] -pub type STBIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, TBCTR_SPEC, STBIEN_A, O>; -impl<'a, const O: u8> STBIEN_W<'a, O> { +pub type STBIEN_W<'a, REG> = crate::BitWriter<'a, REG, STBIEN_A>; +impl<'a, REG> STBIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The standard transmit buffer interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STBIEN_A::VALUE1) } #[doc = "The standard transmit buffer interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STBIEN_A::VALUE2) } } @@ -584,34 +585,37 @@ impl From for bool { impl TBERIEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBERIEN_A { + pub const fn variant(&self) -> TBERIEN_A { match self.bits { false => TBERIEN_A::VALUE1, true => TBERIEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmit buffer error interrupt generation is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBERIEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transmit buffer error interrupt generation is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBERIEN_A::VALUE2 } } #[doc = "Field `TBERIEN` writer - Transmit Buffer Error Interrupt Enable"] -pub type TBERIEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, TBCTR_SPEC, TBERIEN_A, O>; -impl<'a, const O: u8> TBERIEN_W<'a, O> { +pub type TBERIEN_W<'a, REG> = crate::BitWriter<'a, REG, TBERIEN_A>; +impl<'a, REG> TBERIEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The transmit buffer error interrupt generation is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TBERIEN_A::VALUE1) } #[doc = "The transmit buffer error interrupt generation is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TBERIEN_A::VALUE2) } } @@ -666,82 +670,83 @@ impl W { #[doc = "Bits 0:5 - Data Pointer"] #[inline(always)] #[must_use] - pub fn dptr(&mut self) -> DPTR_W<0> { - DPTR_W::new(self) + pub fn dptr(&mut self) -> DPTR_W { + DPTR_W::new(self, 0) } #[doc = "Bits 8:13 - Limit For Interrupt Generation"] #[inline(always)] #[must_use] - pub fn limit(&mut self) -> LIMIT_W<8> { - LIMIT_W::new(self) + pub fn limit(&mut self) -> LIMIT_W { + LIMIT_W::new(self, 8) } #[doc = "Bit 14 - Standard Transmit Buffer Trigger Mode"] #[inline(always)] #[must_use] - pub fn stbtm(&mut self) -> STBTM_W<14> { - STBTM_W::new(self) + pub fn stbtm(&mut self) -> STBTM_W { + STBTM_W::new(self, 14) } #[doc = "Bit 15 - Standard Transmit Buffer Trigger Enable"] #[inline(always)] #[must_use] - pub fn stbten(&mut self) -> STBTEN_W<15> { - STBTEN_W::new(self) + pub fn stbten(&mut self) -> STBTEN_W { + STBTEN_W::new(self, 15) } #[doc = "Bits 16:18 - Standard Transmit Buffer Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn stbinp(&mut self) -> STBINP_W<16> { - STBINP_W::new(self) + pub fn stbinp(&mut self) -> STBINP_W { + STBINP_W::new(self, 16) } #[doc = "Bits 19:21 - Alternative Transmit Buffer Interrupt Node Pointer"] #[inline(always)] #[must_use] - pub fn atbinp(&mut self) -> ATBINP_W<19> { - ATBINP_W::new(self) + pub fn atbinp(&mut self) -> ATBINP_W { + ATBINP_W::new(self, 19) } #[doc = "Bits 24:26 - Buffer Size"] #[inline(always)] #[must_use] - pub fn size(&mut self) -> SIZE_W<24> { - SIZE_W::new(self) + pub fn size(&mut self) -> SIZE_W { + SIZE_W::new(self, 24) } #[doc = "Bit 28 - Buffer Event on Limit Overflow"] #[inline(always)] #[must_use] - pub fn lof(&mut self) -> LOF_W<28> { - LOF_W::new(self) + pub fn lof(&mut self) -> LOF_W { + LOF_W::new(self, 28) } #[doc = "Bit 30 - Standard Transmit Buffer Interrupt Enable"] #[inline(always)] #[must_use] - pub fn stbien(&mut self) -> STBIEN_W<30> { - STBIEN_W::new(self) + pub fn stbien(&mut self) -> STBIEN_W { + STBIEN_W::new(self, 30) } #[doc = "Bit 31 - Transmit Buffer Error Interrupt Enable"] #[inline(always)] #[must_use] - pub fn tberien(&mut self) -> TBERIEN_W<31> { - TBERIEN_W::new(self) + pub fn tberien(&mut self) -> TBERIEN_W { + TBERIEN_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Transmitter Buffer Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tbctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tbctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tbctr::R`](R) reader structure"] +impl crate::Readable for TBCTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tbctr::W`](W) writer structure"] impl crate::Writable for TBCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/tbuf.rs b/src/usic0_ch0/tbuf.rs index 67da7e6c..71d85417 100644 --- a/src/usic0_ch0/tbuf.rs +++ b/src/usic0_ch0/tbuf.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TDATA` reader - Transmit Data"] -pub type TDATA_R = crate::FieldReader; +pub type TDATA_R = crate::FieldReader; #[doc = "Field `TDATA` writer - Transmit Data"] -pub type TDATA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TBUF_SPEC, u16, u16, 16, O>; +pub type TDATA_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; impl R { #[doc = "Bits 0:15 - Transmit Data"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:15 - Transmit Data"] #[inline(always)] #[must_use] - pub fn tdata(&mut self) -> TDATA_W<0> { - TDATA_W::new(self) + pub fn tdata(&mut self) -> TDATA_W { + TDATA_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Transmit Buffer\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tbuf::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tbuf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tbuf::R`](R) reader structure"] +impl crate::Readable for TBUF_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tbuf::W`](W) writer structure"] impl crate::Writable for TBUF_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/tcsr.rs b/src/usic0_ch0/tcsr.rs index 1b1705a8..b5fe7396 100644 --- a/src/usic0_ch0/tcsr.rs +++ b/src/usic0_ch0/tcsr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WLEMD` reader - WLE Mode"] pub type WLEMD_R = crate::BitReader; #[doc = "WLE Mode\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl WLEMD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WLEMD_A { + pub const fn variant(&self) -> WLEMD_A { match self.bits { false => WLEMD_A::VALUE1, true => WLEMD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The automatic update of SCTR.WLE and TCSR.EOF is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WLEMD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The automatic update of SCTR.WLE and TCSR.EOF is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WLEMD_A::VALUE2 } } #[doc = "Field `WLEMD` writer - WLE Mode"] -pub type WLEMD_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, WLEMD_A, O>; -impl<'a, const O: u8> WLEMD_W<'a, O> { +pub type WLEMD_W<'a, REG> = crate::BitWriter<'a, REG, WLEMD_A>; +impl<'a, REG> WLEMD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The automatic update of SCTR.WLE and TCSR.EOF is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WLEMD_A::VALUE1) } #[doc = "The automatic update of SCTR.WLE and TCSR.EOF is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WLEMD_A::VALUE2) } } @@ -105,36 +76,41 @@ impl From for bool { impl SELMD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SELMD_A { + pub const fn variant(&self) -> SELMD_A { match self.bits { false => SELMD_A::VALUE1, true => SELMD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The automatic update of PCR.CTR\\[23:16\\] +is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SELMD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The automatic update of PCR.CTR\\[23:16\\] +is disabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SELMD_A::VALUE2 } } #[doc = "Field `SELMD` writer - Select Mode"] -pub type SELMD_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, SELMD_A, O>; -impl<'a, const O: u8> SELMD_W<'a, O> { +pub type SELMD_W<'a, REG> = crate::BitWriter<'a, REG, SELMD_A>; +impl<'a, REG> SELMD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The automatic update of PCR.CTR\\[23:16\\] is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SELMD_A::VALUE1) } #[doc = "The automatic update of PCR.CTR\\[23:16\\] is disabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SELMD_A::VALUE2) } } @@ -157,34 +133,37 @@ impl From for bool { impl FLEMD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FLEMD_A { + pub const fn variant(&self) -> FLEMD_A { match self.bits { false => FLEMD_A::VALUE1, true => FLEMD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The automatic update of FLE is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FLEMD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The automatic update of FLE is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FLEMD_A::VALUE2 } } #[doc = "Field `FLEMD` writer - FLE Mode"] -pub type FLEMD_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, FLEMD_A, O>; -impl<'a, const O: u8> FLEMD_W<'a, O> { +pub type FLEMD_W<'a, REG> = crate::BitWriter<'a, REG, FLEMD_A>; +impl<'a, REG> FLEMD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The automatic update of FLE is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FLEMD_A::VALUE1) } #[doc = "The automatic update of FLE is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FLEMD_A::VALUE2) } } @@ -207,34 +186,37 @@ impl From for bool { impl WAMD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WAMD_A { + pub const fn variant(&self) -> WAMD_A { match self.bits { false => WAMD_A::VALUE1, true => WAMD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The automatic update of bit WA is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WAMD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The automatic update of bit WA is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WAMD_A::VALUE2 } } #[doc = "Field `WAMD` writer - WA Mode"] -pub type WAMD_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, WAMD_A, O>; -impl<'a, const O: u8> WAMD_W<'a, O> { +pub type WAMD_W<'a, REG> = crate::BitWriter<'a, REG, WAMD_A>; +impl<'a, REG> WAMD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The automatic update of bit WA is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WAMD_A::VALUE1) } #[doc = "The automatic update of bit WA is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WAMD_A::VALUE2) } } @@ -257,34 +239,37 @@ impl From for bool { impl HPCMD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> HPCMD_A { + pub const fn variant(&self) -> HPCMD_A { match self.bits { false => HPCMD_A::VALUE1, true => HPCMD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The automatic update of bits SCTR.DSM and SCTR.HPCDIR is disabled."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == HPCMD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The automatic update of bits SCTR.DSM and SCTR.HPCDIR is enabled."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == HPCMD_A::VALUE2 } } #[doc = "Field `HPCMD` writer - Hardware Port Control Mode"] -pub type HPCMD_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, HPCMD_A, O>; -impl<'a, const O: u8> HPCMD_W<'a, O> { +pub type HPCMD_W<'a, REG> = crate::BitWriter<'a, REG, HPCMD_A>; +impl<'a, REG> HPCMD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The automatic update of bits SCTR.DSM and SCTR.HPCDIR is disabled."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(HPCMD_A::VALUE1) } #[doc = "The automatic update of bits SCTR.DSM and SCTR.HPCDIR is enabled."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(HPCMD_A::VALUE2) } } @@ -307,34 +292,37 @@ impl From for bool { impl SOF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SOF_A { + pub const fn variant(&self) -> SOF_A { match self.bits { false => SOF_A::VALUE1, true => SOF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data word in TBUF is not considered as first word of a frame."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SOF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data word in TBUF is considered as first word of a frame. A currently running frame is finished and MSLS becomes deactivated (respecting the programmed delays)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SOF_A::VALUE2 } } #[doc = "Field `SOF` writer - Start Of Frame"] -pub type SOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, SOF_A, O>; -impl<'a, const O: u8> SOF_W<'a, O> { +pub type SOF_W<'a, REG> = crate::BitWriter<'a, REG, SOF_A>; +impl<'a, REG> SOF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The data word in TBUF is not considered as first word of a frame."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SOF_A::VALUE1) } #[doc = "The data word in TBUF is considered as first word of a frame. A currently running frame is finished and MSLS becomes deactivated (respecting the programmed delays)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SOF_A::VALUE2) } } @@ -357,34 +345,37 @@ impl From for bool { impl EOF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EOF_A { + pub const fn variant(&self) -> EOF_A { match self.bits { false => EOF_A::VALUE1, true => EOF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data word in TBUF is not considered as last word of an SSC frame."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EOF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data word in TBUF is considered as last word of an SSC frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EOF_A::VALUE2 } } #[doc = "Field `EOF` writer - End Of Frame"] -pub type EOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, EOF_A, O>; -impl<'a, const O: u8> EOF_W<'a, O> { +pub type EOF_W<'a, REG> = crate::BitWriter<'a, REG, EOF_A>; +impl<'a, REG> EOF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The data word in TBUF is not considered as last word of an SSC frame."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EOF_A::VALUE1) } #[doc = "The data word in TBUF is considered as last word of an SSC frame."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EOF_A::VALUE2) } } @@ -407,18 +398,18 @@ impl From for bool { impl TDV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TDV_A { + pub const fn variant(&self) -> TDV_A { match self.bits { false => TDV_A::VALUE1, true => TDV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data word in TBUF is not valid for transmission."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TDV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data word in TBUF is valid for transmission and a transmission start is possible. New data should not be written to a TBUFx input location while TDV = 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TDV_A::VALUE2 @@ -443,39 +434,42 @@ impl From for bool { impl TDSSM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TDSSM_A { + pub const fn variant(&self) -> TDSSM_A { match self.bits { false => TDSSM_A::VALUE1, true => TDSSM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == TDSSM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data word in TBUF is considered as invalid after it has been loaded into the shift register. In ASC and IIC mode, TDV is cleared with the TBI event, whereas in SSC and IIS mode, it is cleared with the RSI event. TDSSM = 1 has to be programmed if an optional data buffer is used."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TDSSM_A::VALUE2 } } #[doc = "Field `TDSSM` writer - TBUF Data Single Shot Mode"] -pub type TDSSM_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, TDSSM_A, O>; -impl<'a, const O: u8> TDSSM_W<'a, O> { +pub type TDSSM_W<'a, REG> = crate::BitWriter<'a, REG, TDSSM_A>; +impl<'a, REG> TDSSM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TDSSM_A::VALUE1) } #[doc = "The data word in TBUF is considered as invalid after it has been loaded into the shift register. In ASC and IIC mode, TDV is cleared with the TBI event, whereas in SSC and IIS mode, it is cleared with the RSI event. TDSSM = 1 has to be programmed if an optional data buffer is used."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TDSSM_A::VALUE2) } } #[doc = "Field `TDEN` reader - TBUF Data Enable"] -pub type TDEN_R = crate::FieldReader; +pub type TDEN_R = crate::FieldReader; #[doc = "TBUF Data Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -495,10 +489,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TDEN_A { + type Ux = u8; +} impl TDEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TDEN_A { + pub const fn variant(&self) -> TDEN_A { match self.bits { 0 => TDEN_A::VALUE1, 1 => TDEN_A::VALUE2, @@ -507,48 +504,52 @@ impl TDEN_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == TDEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmission of the data word in TBUF can be started if TDV = 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TDEN_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "A transmission of the data word in TBUF can be started if TDV = 1 while DX2S = 0."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == TDEN_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "A transmission of the data word in TBUF can be started if TDV = 1 while DX2S = 1."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == TDEN_A::VALUE4 } } #[doc = "Field `TDEN` writer - TBUF Data Enable"] -pub type TDEN_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, TCSR_SPEC, u8, TDEN_A, 2, O>; -impl<'a, const O: u8> TDEN_W<'a, O> { +pub type TDEN_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, TDEN_A>; +impl<'a, REG> TDEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TDEN_A::VALUE1) } #[doc = "A transmission of the data word in TBUF can be started if TDV = 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TDEN_A::VALUE2) } #[doc = "A transmission of the data word in TBUF can be started if TDV = 1 while DX2S = 0."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(TDEN_A::VALUE3) } #[doc = "A transmission of the data word in TBUF can be started if TDV = 1 while DX2S = 1."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(TDEN_A::VALUE4) } } @@ -571,34 +572,37 @@ impl From for bool { impl TDVTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TDVTR_A { + pub const fn variant(&self) -> TDVTR_A { match self.bits { false => TDVTR_A::VALUE1, true => TDVTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Bit TCSR.TE is permanently set."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TDVTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bit TCSR.TE is set if DX2T becomes active while TDV = 1."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TDVTR_A::VALUE2 } } #[doc = "Field `TDVTR` writer - TBUF Data Valid Trigger"] -pub type TDVTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, TDVTR_A, O>; -impl<'a, const O: u8> TDVTR_W<'a, O> { +pub type TDVTR_W<'a, REG> = crate::BitWriter<'a, REG, TDVTR_A>; +impl<'a, REG> TDVTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Bit TCSR.TE is permanently set."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TDVTR_A::VALUE1) } #[doc = "Bit TCSR.TE is set if DX2T becomes active while TDV = 1."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TDVTR_A::VALUE2) } } @@ -621,34 +625,37 @@ impl From for bool { impl WA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WA_A { + pub const fn variant(&self) -> WA_A { match self.bits { false => WA_A::VALUE1, true => WA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The data word in TBUF will be transmitted after a falling edge of WA has been detected (referring to PSR.WA)."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The data word in TBUF will be transmitted after a rising edge of WA has been detected (referring to PSR.WA)."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WA_A::VALUE2 } } #[doc = "Field `WA` writer - Word Address"] -pub type WA_W<'a, const O: u8> = crate::BitWriter<'a, u32, TCSR_SPEC, WA_A, O>; -impl<'a, const O: u8> WA_W<'a, O> { +pub type WA_W<'a, REG> = crate::BitWriter<'a, REG, WA_A>; +impl<'a, REG> WA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The data word in TBUF will be transmitted after a falling edge of WA has been detected (referring to PSR.WA)."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WA_A::VALUE1) } #[doc = "The data word in TBUF will be transmitted after a rising edge of WA has been detected (referring to PSR.WA)."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WA_A::VALUE2) } } @@ -671,18 +678,18 @@ impl From for bool { impl TSOF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TSOF_A { + pub const fn variant(&self) -> TSOF_A { match self.bits { false => TSOF_A::VALUE1, true => TSOF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The latest data word transmission has not been started for the first word of a data frame."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TSOF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The latest data word transmission has been started for the first word of a data frame."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TSOF_A::VALUE2 @@ -707,18 +714,18 @@ impl From for bool { impl TV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TV_A { + pub const fn variant(&self) -> TV_A { match self.bits { false => TV_A::VALUE1, true => TV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The latest start of a data word transmission has taken place while no valid data was available. As a result, the transmission of a data words with passive level (SCTR.PDL) has been started."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The latest start of a data word transmission has taken place with valid data from TBUF."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TV_A::VALUE2 @@ -743,18 +750,18 @@ impl From for bool { impl TVC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TVC_A { + pub const fn variant(&self) -> TVC_A { match self.bits { false => TVC_A::VALUE1, true => TVC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Since TVC has been set, at least one data buffer underflow condition has occurred."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TVC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Since TVC has been set, no data buffer underflow condition has occurred."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TVC_A::VALUE2 @@ -779,18 +786,18 @@ impl From for bool { impl TE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TE_A { + pub const fn variant(&self) -> TE_A { match self.bits { false => TE_A::VALUE1, true => TE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The trigger event has not yet been detected. A transmission of the data word in TBUF can not be started."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The trigger event has been detected (or the trigger mechanism is switched off) and a transmission of the data word in TBUF can not be started."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TE_A::VALUE2 @@ -882,88 +889,89 @@ impl W { #[doc = "Bit 0 - WLE Mode"] #[inline(always)] #[must_use] - pub fn wlemd(&mut self) -> WLEMD_W<0> { - WLEMD_W::new(self) + pub fn wlemd(&mut self) -> WLEMD_W { + WLEMD_W::new(self, 0) } #[doc = "Bit 1 - Select Mode"] #[inline(always)] #[must_use] - pub fn selmd(&mut self) -> SELMD_W<1> { - SELMD_W::new(self) + pub fn selmd(&mut self) -> SELMD_W { + SELMD_W::new(self, 1) } #[doc = "Bit 2 - FLE Mode"] #[inline(always)] #[must_use] - pub fn flemd(&mut self) -> FLEMD_W<2> { - FLEMD_W::new(self) + pub fn flemd(&mut self) -> FLEMD_W { + FLEMD_W::new(self, 2) } #[doc = "Bit 3 - WA Mode"] #[inline(always)] #[must_use] - pub fn wamd(&mut self) -> WAMD_W<3> { - WAMD_W::new(self) + pub fn wamd(&mut self) -> WAMD_W { + WAMD_W::new(self, 3) } #[doc = "Bit 4 - Hardware Port Control Mode"] #[inline(always)] #[must_use] - pub fn hpcmd(&mut self) -> HPCMD_W<4> { - HPCMD_W::new(self) + pub fn hpcmd(&mut self) -> HPCMD_W { + HPCMD_W::new(self, 4) } #[doc = "Bit 5 - Start Of Frame"] #[inline(always)] #[must_use] - pub fn sof(&mut self) -> SOF_W<5> { - SOF_W::new(self) + pub fn sof(&mut self) -> SOF_W { + SOF_W::new(self, 5) } #[doc = "Bit 6 - End Of Frame"] #[inline(always)] #[must_use] - pub fn eof(&mut self) -> EOF_W<6> { - EOF_W::new(self) + pub fn eof(&mut self) -> EOF_W { + EOF_W::new(self, 6) } #[doc = "Bit 8 - TBUF Data Single Shot Mode"] #[inline(always)] #[must_use] - pub fn tdssm(&mut self) -> TDSSM_W<8> { - TDSSM_W::new(self) + pub fn tdssm(&mut self) -> TDSSM_W { + TDSSM_W::new(self, 8) } #[doc = "Bits 10:11 - TBUF Data Enable"] #[inline(always)] #[must_use] - pub fn tden(&mut self) -> TDEN_W<10> { - TDEN_W::new(self) + pub fn tden(&mut self) -> TDEN_W { + TDEN_W::new(self, 10) } #[doc = "Bit 12 - TBUF Data Valid Trigger"] #[inline(always)] #[must_use] - pub fn tdvtr(&mut self) -> TDVTR_W<12> { - TDVTR_W::new(self) + pub fn tdvtr(&mut self) -> TDVTR_W { + TDVTR_W::new(self, 12) } #[doc = "Bit 13 - Word Address"] #[inline(always)] #[must_use] - pub fn wa(&mut self) -> WA_W<13> { - WA_W::new(self) + pub fn wa(&mut self) -> WA_W { + WA_W::new(self, 13) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Transmit Control/Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tcsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tcsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`tcsr::R`](R) reader structure"] +impl crate::Readable for TCSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`tcsr::W`](W) writer structure"] impl crate::Writable for TCSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/trbptr.rs b/src/usic0_ch0/trbptr.rs index f4048134..9cd56075 100644 --- a/src/usic0_ch0/trbptr.rs +++ b/src/usic0_ch0/trbptr.rs @@ -1,26 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `TDIPTR` reader - Transmitter Data Input Pointer"] -pub type TDIPTR_R = crate::FieldReader; +pub type TDIPTR_R = crate::FieldReader; #[doc = "Field `TDOPTR` reader - Transmitter Data Output Pointer"] -pub type TDOPTR_R = crate::FieldReader; +pub type TDOPTR_R = crate::FieldReader; #[doc = "Field `RDIPTR` reader - Receiver Data Input Pointer"] -pub type RDIPTR_R = crate::FieldReader; +pub type RDIPTR_R = crate::FieldReader; #[doc = "Field `RDOPTR` reader - Receiver Data Output Pointer"] -pub type RDOPTR_R = crate::FieldReader; +pub type RDOPTR_R = crate::FieldReader; impl R { #[doc = "Bits 0:5 - Transmitter Data Input Pointer"] #[inline(always)] @@ -43,15 +30,13 @@ 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"] +#[doc = "Transmit/Receive Buffer Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trbptr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`trbptr::R`](R) reader structure"] +impl crate::Readable for TRBPTR_SPEC {} #[doc = "`reset()` method sets TRBPTR to value 0"] impl crate::Resettable for TRBPTR_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/usic0_ch0/trbscr.rs b/src/usic0_ch0/trbscr.rs index 37315125..5014f439 100644 --- a/src/usic0_ch0/trbscr.rs +++ b/src/usic0_ch0/trbscr.rs @@ -1,24 +1,5 @@ #[doc = "Register `TRBSCR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Standard Receive Buffer Event\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CSRBI_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CSRBI` writer - Clear Standard Receive Buffer Event"] -pub type CSRBI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSCR_SPEC, CSRBI_AW, O>; -impl<'a, const O: u8> CSRBI_W<'a, O> { +pub type CSRBI_W<'a, REG> = crate::BitWriter<'a, REG, CSRBI_AW>; +impl<'a, REG> CSRBI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CSRBI_AW::VALUE1) } #[doc = "Clear TRBSR.SRBI."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CSRBI_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `CRBERI` writer - Clear Receive Buffer Error Event"] -pub type CRBERI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSCR_SPEC, CRBERI_AW, O>; -impl<'a, const O: u8> CRBERI_W<'a, O> { +pub type CRBERI_W<'a, REG> = crate::BitWriter<'a, REG, CRBERI_AW>; +impl<'a, REG> CRBERI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CRBERI_AW::VALUE1) } #[doc = "Clear TRBSR.RBERI."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CRBERI_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CARBI` writer - Clear Alternative Receive Buffer Event"] -pub type CARBI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSCR_SPEC, CARBI_AW, O>; -impl<'a, const O: u8> CARBI_W<'a, O> { +pub type CARBI_W<'a, REG> = crate::BitWriter<'a, REG, CARBI_AW>; +impl<'a, REG> CARBI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CARBI_AW::VALUE1) } #[doc = "Clear TRBSR.ARBI."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CARBI_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CSTBI` writer - Clear Standard Transmit Buffer Event"] -pub type CSTBI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSCR_SPEC, CSTBI_AW, O>; -impl<'a, const O: u8> CSTBI_W<'a, O> { +pub type CSTBI_W<'a, REG> = crate::BitWriter<'a, REG, CSTBI_AW>; +impl<'a, REG> CSTBI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CSTBI_AW::VALUE1) } #[doc = "Clear TRBSR.STBI."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CSTBI_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CTBERI` writer - Clear Transmit Buffer Error Event"] -pub type CTBERI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSCR_SPEC, CTBERI_AW, O>; -impl<'a, const O: u8> CTBERI_W<'a, O> { +pub type CTBERI_W<'a, REG> = crate::BitWriter<'a, REG, CTBERI_AW>; +impl<'a, REG> CTBERI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CTBERI_AW::VALUE1) } #[doc = "Clear TRBSR.TBERI."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CTBERI_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CBDV` writer - Clear Bypass Data Valid"] -pub type CBDV_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSCR_SPEC, CBDV_AW, O>; -impl<'a, const O: u8> CBDV_W<'a, O> { +pub type CBDV_W<'a, REG> = crate::BitWriter<'a, REG, CBDV_AW>; +impl<'a, REG> CBDV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CBDV_AW::VALUE1) } #[doc = "Clear BYPCR.BDV."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CBDV_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `FLUSHRB` writer - Flush Receive Buffer"] -pub type FLUSHRB_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSCR_SPEC, FLUSHRB_AW, O>; -impl<'a, const O: u8> FLUSHRB_W<'a, O> { +pub type FLUSHRB_W<'a, REG> = crate::BitWriter<'a, REG, FLUSHRB_AW>; +impl<'a, REG> FLUSHRB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FLUSHRB_AW::VALUE1) } #[doc = "The receive FIFO buffer is cleared (filling level is cleared and output pointer is set to input pointer value). Should only be used while the FIFO buffer is not taking part in data traffic."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FLUSHRB_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `FLUSHTB` writer - Flush Transmit Buffer"] -pub type FLUSHTB_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSCR_SPEC, FLUSHTB_AW, O>; -impl<'a, const O: u8> FLUSHTB_W<'a, O> { +pub type FLUSHTB_W<'a, REG> = crate::BitWriter<'a, REG, FLUSHTB_AW>; +impl<'a, REG> FLUSHTB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No effect."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FLUSHTB_AW::VALUE1) } #[doc = "The transmit FIFO buffer is cleared (filling level is cleared and output pointer is set to input pointer value). Should only be used while the FIFO buffer is not taking part in data traffic."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FLUSHTB_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Clear Standard Receive Buffer Event"] #[inline(always)] #[must_use] - pub fn csrbi(&mut self) -> CSRBI_W<0> { - CSRBI_W::new(self) + pub fn csrbi(&mut self) -> CSRBI_W { + CSRBI_W::new(self, 0) } #[doc = "Bit 1 - Clear Receive Buffer Error Event"] #[inline(always)] #[must_use] - pub fn crberi(&mut self) -> CRBERI_W<1> { - CRBERI_W::new(self) + pub fn crberi(&mut self) -> CRBERI_W { + CRBERI_W::new(self, 1) } #[doc = "Bit 2 - Clear Alternative Receive Buffer Event"] #[inline(always)] #[must_use] - pub fn carbi(&mut self) -> CARBI_W<2> { - CARBI_W::new(self) + pub fn carbi(&mut self) -> CARBI_W { + CARBI_W::new(self, 2) } #[doc = "Bit 8 - Clear Standard Transmit Buffer Event"] #[inline(always)] #[must_use] - pub fn cstbi(&mut self) -> CSTBI_W<8> { - CSTBI_W::new(self) + pub fn cstbi(&mut self) -> CSTBI_W { + CSTBI_W::new(self, 8) } #[doc = "Bit 9 - Clear Transmit Buffer Error Event"] #[inline(always)] #[must_use] - pub fn ctberi(&mut self) -> CTBERI_W<9> { - CTBERI_W::new(self) + pub fn ctberi(&mut self) -> CTBERI_W { + CTBERI_W::new(self, 9) } #[doc = "Bit 10 - Clear Bypass Data Valid"] #[inline(always)] #[must_use] - pub fn cbdv(&mut self) -> CBDV_W<10> { - CBDV_W::new(self) + pub fn cbdv(&mut self) -> CBDV_W { + CBDV_W::new(self, 10) } #[doc = "Bit 14 - Flush Receive Buffer"] #[inline(always)] #[must_use] - pub fn flushrb(&mut self) -> FLUSHRB_W<14> { - FLUSHRB_W::new(self) + pub fn flushrb(&mut self) -> FLUSHRB_W { + FLUSHRB_W::new(self, 14) } #[doc = "Bit 15 - Flush Transmit Buffer"] #[inline(always)] #[must_use] - pub fn flushtb(&mut self) -> FLUSHTB_W<15> { - FLUSHTB_W::new(self) + pub fn flushtb(&mut self) -> FLUSHTB_W { + FLUSHTB_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Transmit/Receive Buffer Status Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trbscr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct TRBSCR_SPEC; impl crate::RegisterSpec for TRBSCR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [trbscr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`trbscr::W`](W) writer structure"] impl crate::Writable for TRBSCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/usic0_ch0/trbsr.rs b/src/usic0_ch0/trbsr.rs index 773aaa38..43e9a1ec 100644 --- a/src/usic0_ch0/trbsr.rs +++ b/src/usic0_ch0/trbsr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SRBI` reader - Standard Receive Buffer Event"] pub type SRBI_R = crate::BitReader; #[doc = "Standard Receive Buffer Event\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SRBI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRBI_A { + pub const fn variant(&self) -> SRBI_A { match self.bits { false => SRBI_A::VALUE1, true => SRBI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A standard receive buffer event has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRBI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A standard receive buffer event has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRBI_A::VALUE2 } } #[doc = "Field `SRBI` writer - Standard Receive Buffer Event"] -pub type SRBI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSR_SPEC, SRBI_A, O>; -impl<'a, const O: u8> SRBI_W<'a, O> { +pub type SRBI_W<'a, REG> = crate::BitWriter<'a, REG, SRBI_A>; +impl<'a, REG> SRBI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A standard receive buffer event has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRBI_A::VALUE1) } #[doc = "A standard receive buffer event has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRBI_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl RBERI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RBERI_A { + pub const fn variant(&self) -> RBERI_A { match self.bits { false => RBERI_A::VALUE1, true => RBERI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A receive buffer error event has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RBERI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A receive buffer error event has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RBERI_A::VALUE2 } } #[doc = "Field `RBERI` writer - Receive Buffer Error Event"] -pub type RBERI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSR_SPEC, RBERI_A, O>; -impl<'a, const O: u8> RBERI_W<'a, O> { +pub type RBERI_W<'a, REG> = crate::BitWriter<'a, REG, RBERI_A>; +impl<'a, REG> RBERI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A receive buffer error event has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RBERI_A::VALUE1) } #[doc = "A receive buffer error event has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RBERI_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl ARBI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ARBI_A { + pub const fn variant(&self) -> ARBI_A { match self.bits { false => ARBI_A::VALUE1, true => ARBI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "An alternative receive buffer event has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ARBI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "An alternative receive buffer event has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ARBI_A::VALUE2 } } #[doc = "Field `ARBI` writer - Alternative Receive Buffer Event"] -pub type ARBI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSR_SPEC, ARBI_A, O>; -impl<'a, const O: u8> ARBI_W<'a, O> { +pub type ARBI_W<'a, REG> = crate::BitWriter<'a, REG, ARBI_A>; +impl<'a, REG> ARBI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "An alternative receive buffer event has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ARBI_A::VALUE1) } #[doc = "An alternative receive buffer event has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ARBI_A::VALUE2) } } @@ -203,18 +180,18 @@ impl From for bool { impl REMPTY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REMPTY_A { + pub const fn variant(&self) -> REMPTY_A { match self.bits { false => REMPTY_A::VALUE1, true => REMPTY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The receive buffer is not empty."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REMPTY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The receive buffer is empty."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REMPTY_A::VALUE2 @@ -239,18 +216,18 @@ impl From for bool { impl RFULL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RFULL_A { + pub const fn variant(&self) -> RFULL_A { match self.bits { false => RFULL_A::VALUE1, true => RFULL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The receive buffer is not full."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RFULL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The receive buffer is full."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RFULL_A::VALUE2 @@ -275,18 +252,18 @@ impl From for bool { impl RBUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RBUS_A { + pub const fn variant(&self) -> RBUS_A { match self.bits { false => RBUS_A::VALUE1, true => RBUS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The receive buffer information has been completely updated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RBUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The OUTR update from the FIFO memory is ongoing. A read from OUTR will be delayed. FIFO pointers from the previous read are not yet updated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RBUS_A::VALUE2 @@ -311,18 +288,18 @@ impl From for bool { impl SRBT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRBT_A { + pub const fn variant(&self) -> SRBT_A { match self.bits { false => SRBT_A::VALUE1, true => SRBT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A standard receive buffer event is not triggered using this bit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRBT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A standard receive buffer event is triggered using this bit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRBT_A::VALUE2 @@ -347,34 +324,37 @@ impl From for bool { impl STBI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STBI_A { + pub const fn variant(&self) -> STBI_A { match self.bits { false => STBI_A::VALUE1, true => STBI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A standard transmit buffer event has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STBI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A standard transmit buffer event has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STBI_A::VALUE2 } } #[doc = "Field `STBI` writer - Standard Transmit Buffer Event"] -pub type STBI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSR_SPEC, STBI_A, O>; -impl<'a, const O: u8> STBI_W<'a, O> { +pub type STBI_W<'a, REG> = crate::BitWriter<'a, REG, STBI_A>; +impl<'a, REG> STBI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A standard transmit buffer event has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STBI_A::VALUE1) } #[doc = "A standard transmit buffer event has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STBI_A::VALUE2) } } @@ -397,34 +377,37 @@ impl From for bool { impl TBERI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBERI_A { + pub const fn variant(&self) -> TBERI_A { match self.bits { false => TBERI_A::VALUE1, true => TBERI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A transmit buffer error event has not been detected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBERI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A transmit buffer error event has been detected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBERI_A::VALUE2 } } #[doc = "Field `TBERI` writer - Transmit Buffer Error Event"] -pub type TBERI_W<'a, const O: u8> = crate::BitWriter<'a, u32, TRBSR_SPEC, TBERI_A, O>; -impl<'a, const O: u8> TBERI_W<'a, O> { +pub type TBERI_W<'a, REG> = crate::BitWriter<'a, REG, TBERI_A>; +impl<'a, REG> TBERI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A transmit buffer error event has not been detected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TBERI_A::VALUE1) } #[doc = "A transmit buffer error event has been detected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TBERI_A::VALUE2) } } @@ -447,18 +430,18 @@ impl From for bool { impl TEMPTY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TEMPTY_A { + pub const fn variant(&self) -> TEMPTY_A { match self.bits { false => TEMPTY_A::VALUE1, true => TEMPTY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmit buffer is not empty."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TEMPTY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transmit buffer is empty."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TEMPTY_A::VALUE2 @@ -483,18 +466,18 @@ impl From for bool { impl TFULL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TFULL_A { + pub const fn variant(&self) -> TFULL_A { match self.bits { false => TFULL_A::VALUE1, true => TFULL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmit buffer is not full."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TFULL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The transmit buffer is full."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TFULL_A::VALUE2 @@ -519,18 +502,18 @@ impl From for bool { impl TBUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TBUS_A { + pub const fn variant(&self) -> TBUS_A { match self.bits { false => TBUS_A::VALUE1, true => TBUS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The transmit buffer information has been completely updated."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TBUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The FIFO memory update after write to INx is ongoing. A write to INx will be delayed. FIFO pointers from the previous INx write are not yet updated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TBUS_A::VALUE2 @@ -555,27 +538,27 @@ impl From for bool { impl STBT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STBT_A { + pub const fn variant(&self) -> STBT_A { match self.bits { false => STBT_A::VALUE1, true => STBT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A standard transmit buffer event is not triggered using this bit."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STBT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A standard transmit buffer event is triggered using this bit."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STBT_A::VALUE2 } } #[doc = "Field `RBFLVL` reader - Receive Buffer Filling Level"] -pub type RBFLVL_R = crate::FieldReader; +pub type RBFLVL_R = crate::FieldReader; #[doc = "Field `TBFLVL` reader - Transmit Buffer Filling Level"] -pub type TBFLVL_R = crate::FieldReader; +pub type TBFLVL_R = crate::FieldReader; impl R { #[doc = "Bit 0 - Standard Receive Buffer Event"] #[inline(always)] @@ -657,52 +640,53 @@ impl W { #[doc = "Bit 0 - Standard Receive Buffer Event"] #[inline(always)] #[must_use] - pub fn srbi(&mut self) -> SRBI_W<0> { - SRBI_W::new(self) + pub fn srbi(&mut self) -> SRBI_W { + SRBI_W::new(self, 0) } #[doc = "Bit 1 - Receive Buffer Error Event"] #[inline(always)] #[must_use] - pub fn rberi(&mut self) -> RBERI_W<1> { - RBERI_W::new(self) + pub fn rberi(&mut self) -> RBERI_W { + RBERI_W::new(self, 1) } #[doc = "Bit 2 - Alternative Receive Buffer Event"] #[inline(always)] #[must_use] - pub fn arbi(&mut self) -> ARBI_W<2> { - ARBI_W::new(self) + pub fn arbi(&mut self) -> ARBI_W { + ARBI_W::new(self, 2) } #[doc = "Bit 8 - Standard Transmit Buffer Event"] #[inline(always)] #[must_use] - pub fn stbi(&mut self) -> STBI_W<8> { - STBI_W::new(self) + pub fn stbi(&mut self) -> STBI_W { + STBI_W::new(self, 8) } #[doc = "Bit 9 - Transmit Buffer Error Event"] #[inline(always)] #[must_use] - pub fn tberi(&mut self) -> TBERI_W<9> { - TBERI_W::new(self) + pub fn tberi(&mut self) -> TBERI_W { + TBERI_W::new(self, 9) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Transmit/Receive Buffer Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trbsr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`trbsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`trbsr::R`](R) reader structure"] +impl crate::Readable for TRBSR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`trbsr::W`](W) writer structure"] impl crate::Writable for TRBSR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc.rs b/src/vadc.rs index c23863f1..48b9d90c 100644 --- a/src/vadc.rs +++ b/src/vadc.rs @@ -1,121 +1,208 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { - #[doc = "0x00 - Clock Control Register"] - pub clc: CLC, + clc: CLC, _reserved1: [u8; 0x04], - #[doc = "0x08 - Module Identification Register"] - pub id: ID, + id: ID, _reserved2: [u8; 0x1c], - #[doc = "0x28 - OCDS Control and Status Register"] - pub ocs: OCS, + ocs: OCS, _reserved3: [u8; 0x54], - #[doc = "0x80 - Global Configuration Register"] - pub globcfg: GLOBCFG, + globcfg: GLOBCFG, _reserved4: [u8; 0x1c], - #[doc = "0xa0..0xa8 - Input Class Register, Global"] - pub globiclass: [GLOBICLASS; 2], + globiclass: [GLOBICLASS; 2], _reserved5: [u8; 0x10], - #[doc = "0xb8 - Global Boundary Select Register"] - pub globbound: GLOBBOUND, + globbound: GLOBBOUND, _reserved6: [u8; 0x24], - #[doc = "0xe0 - Global Event Flag Register"] - pub globeflag: GLOBEFLAG, + globeflag: GLOBEFLAG, _reserved7: [u8; 0x5c], - #[doc = "0x140 - Global Event Node Pointer Register"] - pub globevnp: GLOBEVNP, + globevnp: GLOBEVNP, _reserved8: [u8; 0x1c], - #[doc = "0x160 - Global Test Functions Register"] - pub globtf: GLOBTF, + globtf: GLOBTF, _reserved9: [u8; 0x1c], - #[doc = "0x180..0x190 - Background Request Source Channel Select Register"] - pub brssel: [BRSSEL; 4], + brssel: [BRSSEL; 4], _reserved10: [u8; 0x30], - #[doc = "0x1c0..0x1d0 - Background Request Source Pending Register"] - pub brspnd: [BRSPND; 4], + brspnd: [BRSPND; 4], _reserved11: [u8; 0x30], + brsctrl: BRSCTRL, + brsmr: BRSMR, + _reserved13: [u8; 0x78], + globrcr: GLOBRCR, + _reserved14: [u8; 0x7c], + globres: GLOBRES, + _reserved15: [u8; 0x7c], + globresd: GLOBRESD, + _reserved16: [u8; 0x6c], + emuxsel: EMUXSEL, +} +impl RegisterBlock { + #[doc = "0x00 - Clock Control Register"] + #[inline(always)] + pub const fn clc(&self) -> &CLC { + &self.clc + } + #[doc = "0x08 - Module Identification Register"] + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } + #[doc = "0x28 - OCDS Control and Status Register"] + #[inline(always)] + pub const fn ocs(&self) -> &OCS { + &self.ocs + } + #[doc = "0x80 - Global Configuration Register"] + #[inline(always)] + pub const fn globcfg(&self) -> &GLOBCFG { + &self.globcfg + } + #[doc = "0xa0..0xa8 - Input Class Register, Global"] + #[inline(always)] + pub const fn globiclass(&self, n: usize) -> &GLOBICLASS { + &self.globiclass[n] + } + #[doc = "0xb8 - Global Boundary Select Register"] + #[inline(always)] + pub const fn globbound(&self) -> &GLOBBOUND { + &self.globbound + } + #[doc = "0xe0 - Global Event Flag Register"] + #[inline(always)] + pub const fn globeflag(&self) -> &GLOBEFLAG { + &self.globeflag + } + #[doc = "0x140 - Global Event Node Pointer Register"] + #[inline(always)] + pub const fn globevnp(&self) -> &GLOBEVNP { + &self.globevnp + } + #[doc = "0x160 - Global Test Functions Register"] + #[inline(always)] + pub const fn globtf(&self) -> &GLOBTF { + &self.globtf + } + #[doc = "0x180..0x190 - Background Request Source Channel Select Register"] + #[inline(always)] + pub const fn brssel(&self, n: usize) -> &BRSSEL { + &self.brssel[n] + } + #[doc = "0x1c0..0x1d0 - Background Request Source Pending Register"] + #[inline(always)] + pub const fn brspnd(&self, n: usize) -> &BRSPND { + &self.brspnd[n] + } #[doc = "0x200 - Background Request Source Control Register"] - pub brsctrl: BRSCTRL, + #[inline(always)] + pub const fn brsctrl(&self) -> &BRSCTRL { + &self.brsctrl + } #[doc = "0x204 - Background Request Source Mode Register"] - pub brsmr: BRSMR, - _reserved13: [u8; 0x78], + #[inline(always)] + pub const fn brsmr(&self) -> &BRSMR { + &self.brsmr + } #[doc = "0x280 - Global Result Control Register"] - pub globrcr: GLOBRCR, - _reserved14: [u8; 0x7c], + #[inline(always)] + pub const fn globrcr(&self) -> &GLOBRCR { + &self.globrcr + } #[doc = "0x300 - Global Result Register"] - pub globres: GLOBRES, - _reserved15: [u8; 0x7c], + #[inline(always)] + pub const fn globres(&self) -> &GLOBRES { + &self.globres + } #[doc = "0x380 - Global Result Register, Debug"] - pub globresd: GLOBRESD, - _reserved16: [u8; 0x6c], + #[inline(always)] + pub const fn globresd(&self) -> &GLOBRESD { + &self.globresd + } #[doc = "0x3f0 - External Multiplexer Select Register"] - pub emuxsel: EMUXSEL, + #[inline(always)] + pub const fn emuxsel(&self) -> &EMUXSEL { + &self.emuxsel + } } -#[doc = "CLC (rw) register accessor: an alias for `Reg`"] +#[doc = "CLC (rw) register accessor: Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clc`] +module"] pub type CLC = crate::Reg; #[doc = "Clock Control Register"] pub mod clc; -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "Module Identification Register"] pub mod id; -#[doc = "OCS (rw) register accessor: an alias for `Reg`"] +#[doc = "OCS (rw) register accessor: OCDS Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ocs::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ocs::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ocs`] +module"] pub type OCS = crate::Reg; #[doc = "OCDS Control and Status Register"] pub mod ocs; -#[doc = "GLOBCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBCFG (rw) register accessor: Global Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globcfg`] +module"] pub type GLOBCFG = crate::Reg; #[doc = "Global Configuration Register"] pub mod globcfg; -#[doc = "GLOBICLASS (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBICLASS (rw) register accessor: Input Class Register, Global\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globiclass::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globiclass::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globiclass`] +module"] pub type GLOBICLASS = crate::Reg; #[doc = "Input Class Register, Global"] pub mod globiclass; -#[doc = "GLOBBOUND (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBBOUND (rw) register accessor: Global Boundary Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globbound::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globbound::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globbound`] +module"] pub type GLOBBOUND = crate::Reg; #[doc = "Global Boundary Select Register"] pub mod globbound; -#[doc = "GLOBEFLAG (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBEFLAG (rw) register accessor: Global Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globeflag::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globeflag::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globeflag`] +module"] pub type GLOBEFLAG = crate::Reg; #[doc = "Global Event Flag Register"] pub mod globeflag; -#[doc = "GLOBEVNP (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBEVNP (rw) register accessor: Global Event Node Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globevnp::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globevnp::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globevnp`] +module"] pub type GLOBEVNP = crate::Reg; #[doc = "Global Event Node Pointer Register"] pub mod globevnp; -#[doc = "GLOBTF (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBTF (rw) register accessor: Global Test Functions Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globtf::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globtf::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globtf`] +module"] pub type GLOBTF = crate::Reg; #[doc = "Global Test Functions Register"] pub mod globtf; -#[doc = "BRSSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "BRSSEL (rw) register accessor: Background Request Source Channel Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brssel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brssel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@brssel`] +module"] pub type BRSSEL = crate::Reg; #[doc = "Background Request Source Channel Select Register"] pub mod brssel; -#[doc = "BRSPND (rw) register accessor: an alias for `Reg`"] +#[doc = "BRSPND (rw) register accessor: Background Request Source Pending Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brspnd::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brspnd::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@brspnd`] +module"] pub type BRSPND = crate::Reg; #[doc = "Background Request Source Pending Register"] pub mod brspnd; -#[doc = "BRSCTRL (rw) register accessor: an alias for `Reg`"] +#[doc = "BRSCTRL (rw) register accessor: Background Request Source Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brsctrl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brsctrl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@brsctrl`] +module"] pub type BRSCTRL = crate::Reg; #[doc = "Background Request Source Control Register"] pub mod brsctrl; -#[doc = "BRSMR (rw) register accessor: an alias for `Reg`"] +#[doc = "BRSMR (rw) register accessor: Background Request Source Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brsmr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brsmr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@brsmr`] +module"] pub type BRSMR = crate::Reg; #[doc = "Background Request Source Mode Register"] pub mod brsmr; -#[doc = "GLOBRCR (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBRCR (rw) register accessor: Global Result Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globrcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globrcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globrcr`] +module"] pub type GLOBRCR = crate::Reg; #[doc = "Global Result Control Register"] pub mod globrcr; -#[doc = "GLOBRES (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBRES (rw) register accessor: Global Result Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globres::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globres::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globres`] +module"] pub type GLOBRES = crate::Reg; #[doc = "Global Result Register"] pub mod globres; -#[doc = "GLOBRESD (rw) register accessor: an alias for `Reg`"] +#[doc = "GLOBRESD (rw) register accessor: Global Result Register, Debug\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globresd::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globresd::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@globresd`] +module"] pub type GLOBRESD = crate::Reg; #[doc = "Global Result Register, Debug"] pub mod globresd; -#[doc = "EMUXSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "EMUXSEL (rw) register accessor: External Multiplexer Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`emuxsel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`emuxsel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@emuxsel`] +module"] 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 1e21e960..9b1b7ce1 100644 --- a/src/vadc/brsctrl.rs +++ b/src/vadc/brsctrl.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SRCRESREG` reader - Source-specific Result Register"] -pub type SRCRESREG_R = crate::FieldReader; +pub type SRCRESREG_R = crate::FieldReader; #[doc = "Source-specific Result Register\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRCRESREG_A { + type Ux = u8; +} impl SRCRESREG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRCRESREG_A::VALUE1), 1 => Some(SRCRESREG_A::VALUE2), @@ -64,49 +35,53 @@ impl SRCRESREG_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use GxCHCTRy.RESREG to select a group result register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRCRESREG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Store result in group result register GxRES1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRCRESREG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Store result in group result register GxRES15"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SRCRESREG_A::VALUE3 } } #[doc = "Field `SRCRESREG` writer - Source-specific Result Register"] -pub type SRCRESREG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BRSCTRL_SPEC, u8, SRCRESREG_A, 4, O>; -impl<'a, const O: u8> SRCRESREG_W<'a, O> { +pub type SRCRESREG_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SRCRESREG_A>; +impl<'a, REG> SRCRESREG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Use GxCHCTRy.RESREG to select a group result register"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE1) } #[doc = "Store result in group result register GxRES1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE2) } #[doc = "Store result in group result register GxRES15"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE3) } } #[doc = "Field `XTSEL` reader - External Trigger Input Selection"] -pub type XTSEL_R = crate::FieldReader; +pub type XTSEL_R = crate::FieldReader; #[doc = "Field `XTSEL` writer - External Trigger Input Selection"] -pub type XTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BRSCTRL_SPEC, u8, u8, 4, O>; +pub type XTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `XTLVL` reader - External Trigger Level"] -pub type XTLVL_R = crate::BitReader; +pub type XTLVL_R = crate::BitReader; #[doc = "Field `XTMODE` reader - Trigger Operating Mode"] -pub type XTMODE_R = crate::FieldReader; +pub type XTMODE_R = crate::FieldReader; #[doc = "Trigger Operating Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -126,10 +101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for XTMODE_A { + type Ux = u8; +} impl XTMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XTMODE_A { + pub const fn variant(&self) -> XTMODE_A { match self.bits { 0 => XTMODE_A::VALUE1, 1 => XTMODE_A::VALUE2, @@ -138,48 +116,52 @@ impl XTMODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No external trigger"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XTMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger event upon a falling edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XTMODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Trigger event upon a rising edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == XTMODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Trigger event upon any edge"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == XTMODE_A::VALUE4 } } #[doc = "Field `XTMODE` writer - Trigger Operating Mode"] -pub type XTMODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, BRSCTRL_SPEC, u8, XTMODE_A, 2, O>; -impl<'a, const O: u8> XTMODE_W<'a, O> { +pub type XTMODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, XTMODE_A>; +impl<'a, REG> XTMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No external trigger"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE1) } #[doc = "Trigger event upon a falling edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE2) } #[doc = "Trigger event upon a rising edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE3) } #[doc = "Trigger event upon any edge"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE4) } } @@ -198,25 +180,28 @@ impl From for bool { } } #[doc = "Field `XTWC` writer - Write Control for Trigger Configuration"] -pub type XTWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSCTRL_SPEC, XTWC_AW, O>; -impl<'a, const O: u8> XTWC_W<'a, O> { +pub type XTWC_W<'a, REG> = crate::BitWriter<'a, REG, XTWC_AW>; +impl<'a, REG> XTWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to trigger configuration"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XTWC_AW::VALUE1) } #[doc = "Bitfields XTMODE and XTSEL can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XTWC_AW::VALUE2) } } #[doc = "Field `GTSEL` reader - Gate Input Selection"] -pub type GTSEL_R = crate::FieldReader; +pub type GTSEL_R = crate::FieldReader; #[doc = "Field `GTSEL` writer - Gate Input Selection"] -pub type GTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BRSCTRL_SPEC, u8, u8, 4, O>; +pub type GTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `GTLVL` reader - Gate Input Level"] -pub type GTLVL_R = crate::BitReader; +pub type GTLVL_R = crate::BitReader; #[doc = "Write Control for Gate Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum GTWC_AW { @@ -232,16 +217,19 @@ impl From for bool { } } #[doc = "Field `GTWC` writer - Write Control for Gate Configuration"] -pub type GTWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSCTRL_SPEC, GTWC_AW, O>; -impl<'a, const O: u8> GTWC_W<'a, O> { +pub type GTWC_W<'a, REG> = crate::BitWriter<'a, REG, GTWC_AW>; +impl<'a, REG> GTWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to gate configuration"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GTWC_AW::VALUE1) } #[doc = "Bitfield GTSEL can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GTWC_AW::VALUE2) } } @@ -281,58 +269,59 @@ impl W { #[doc = "Bits 0:3 - Source-specific Result Register"] #[inline(always)] #[must_use] - pub fn srcresreg(&mut self) -> SRCRESREG_W<0> { - SRCRESREG_W::new(self) + pub fn srcresreg(&mut self) -> SRCRESREG_W { + SRCRESREG_W::new(self, 0) } #[doc = "Bits 8:11 - External Trigger Input Selection"] #[inline(always)] #[must_use] - pub fn xtsel(&mut self) -> XTSEL_W<8> { - XTSEL_W::new(self) + pub fn xtsel(&mut self) -> XTSEL_W { + XTSEL_W::new(self, 8) } #[doc = "Bits 13:14 - Trigger Operating Mode"] #[inline(always)] #[must_use] - pub fn xtmode(&mut self) -> XTMODE_W<13> { - XTMODE_W::new(self) + pub fn xtmode(&mut self) -> XTMODE_W { + XTMODE_W::new(self, 13) } #[doc = "Bit 15 - Write Control for Trigger Configuration"] #[inline(always)] #[must_use] - pub fn xtwc(&mut self) -> XTWC_W<15> { - XTWC_W::new(self) + pub fn xtwc(&mut self) -> XTWC_W { + XTWC_W::new(self, 15) } #[doc = "Bits 16:19 - Gate Input Selection"] #[inline(always)] #[must_use] - pub fn gtsel(&mut self) -> GTSEL_W<16> { - GTSEL_W::new(self) + pub fn gtsel(&mut self) -> GTSEL_W { + GTSEL_W::new(self, 16) } #[doc = "Bit 23 - Write Control for Gate Configuration"] #[inline(always)] #[must_use] - pub fn gtwc(&mut self) -> GTWC_W<23> { - GTWC_W::new(self) + pub fn gtwc(&mut self) -> GTWC_W { + GTWC_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Background Request Source Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brsctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brsctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`brsctrl::R`](R) reader structure"] +impl crate::Readable for BRSCTRL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`brsctrl::W`](W) writer structure"] impl crate::Writable for BRSCTRL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/brsmr.rs b/src/vadc/brsmr.rs index f7f12499..6e54b184 100644 --- a/src/vadc/brsmr.rs +++ b/src/vadc/brsmr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENGT` reader - Enable Gate"] -pub type ENGT_R = crate::FieldReader; +pub type ENGT_R = crate::FieldReader; #[doc = "Enable Gate\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ENGT_A { + type Ux = u8; +} impl ENGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENGT_A { + pub const fn variant(&self) -> ENGT_A { match self.bits { 0 => ENGT_A::VALUE1, 1 => ENGT_A::VALUE2, @@ -67,48 +38,52 @@ impl ENGT_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No conversion requests are issued"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Conversion requests are issued if at least one pending bit is set"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENGT_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Conversion requests are issued if at least one pending bit is set and REQGTx = 1."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ENGT_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Conversion requests are issued if at least one pending bit is set and REQGTx = 0."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ENGT_A::VALUE4 } } #[doc = "Field `ENGT` writer - Enable Gate"] -pub type ENGT_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, BRSMR_SPEC, u8, ENGT_A, 2, O>; -impl<'a, const O: u8> ENGT_W<'a, O> { +pub type ENGT_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ENGT_A>; +impl<'a, REG> ENGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No conversion requests are issued"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE1) } #[doc = "Conversion requests are issued if at least one pending bit is set"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE2) } #[doc = "Conversion requests are issued if at least one pending bit is set and REQGTx = 1."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE3) } #[doc = "Conversion requests are issued if at least one pending bit is set and REQGTx = 0."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE4) } } @@ -131,34 +106,37 @@ impl From for bool { impl ENTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENTR_A { + pub const fn variant(&self) -> ENTR_A { match self.bits { false => ENTR_A::VALUE1, true => ENTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External trigger disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The selected edge at the selected trigger input signal REQTR generates the load event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENTR_A::VALUE2 } } #[doc = "Field `ENTR` writer - Enable External Trigger"] -pub type ENTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSMR_SPEC, ENTR_A, O>; -impl<'a, const O: u8> ENTR_W<'a, O> { +pub type ENTR_W<'a, REG> = crate::BitWriter<'a, REG, ENTR_A>; +impl<'a, REG> ENTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External trigger disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENTR_A::VALUE1) } #[doc = "The selected edge at the selected trigger input signal REQTR generates the load event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENTR_A::VALUE2) } } @@ -181,34 +159,37 @@ impl From for bool { impl ENSI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENSI_A { + pub const fn variant(&self) -> ENSI_A { match self.bits { false => ENSI_A::VALUE1, true => ENSI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No request source interrupt"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENSI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A request source interrupt is generated upon a request source event (last pending conversion is finished)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENSI_A::VALUE2 } } #[doc = "Field `ENSI` writer - Enable Source Interrupt"] -pub type ENSI_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSMR_SPEC, ENSI_A, O>; -impl<'a, const O: u8> ENSI_W<'a, O> { +pub type ENSI_W<'a, REG> = crate::BitWriter<'a, REG, ENSI_A>; +impl<'a, REG> ENSI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No request source interrupt"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENSI_A::VALUE1) } #[doc = "A request source interrupt is generated upon a request source event (last pending conversion is finished)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENSI_A::VALUE2) } } @@ -231,34 +212,37 @@ impl From for bool { impl SCAN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCAN_A { + pub const fn variant(&self) -> SCAN_A { match self.bits { false => SCAN_A::VALUE1, true => SCAN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No autoscan"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCAN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Autoscan functionality enabled: a request source event automatically generates a load event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCAN_A::VALUE2 } } #[doc = "Field `SCAN` writer - Autoscan Enable"] -pub type SCAN_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSMR_SPEC, SCAN_A, O>; -impl<'a, const O: u8> SCAN_W<'a, O> { +pub type SCAN_W<'a, REG> = crate::BitWriter<'a, REG, SCAN_A>; +impl<'a, REG> SCAN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No autoscan"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCAN_A::VALUE1) } #[doc = "Autoscan functionality enabled: a request source event automatically generates a load event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCAN_A::VALUE2) } } @@ -281,34 +265,37 @@ impl From for bool { impl LDM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LDM_A { + pub const fn variant(&self) -> LDM_A { match self.bits { false => LDM_A::VALUE1, true => LDM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Overwrite mode: Copy all bits from the select registers to the pending registers upon a load event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LDM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Combine mode: Set all pending bits that are set in the select registers upon a load event (logic OR)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LDM_A::VALUE2 } } #[doc = "Field `LDM` writer - Autoscan Source Load Event Mode"] -pub type LDM_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSMR_SPEC, LDM_A, O>; -impl<'a, const O: u8> LDM_W<'a, O> { +pub type LDM_W<'a, REG> = crate::BitWriter<'a, REG, LDM_A>; +impl<'a, REG> LDM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Overwrite mode: Copy all bits from the select registers to the pending registers upon a load event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LDM_A::VALUE1) } #[doc = "Combine mode: Set all pending bits that are set in the select registers upon a load event (logic OR)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LDM_A::VALUE2) } } @@ -331,18 +318,18 @@ impl From for bool { impl REQGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REQGT_A { + pub const fn variant(&self) -> REQGT_A { match self.bits { false => REQGT_A::VALUE1, true => REQGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The gate input is low"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REQGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The gate input is high"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REQGT_A::VALUE2 @@ -363,16 +350,19 @@ impl From for bool { } } #[doc = "Field `CLRPND` writer - Clear Pending Bits"] -pub type CLRPND_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSMR_SPEC, CLRPND_AW, O>; -impl<'a, const O: u8> CLRPND_W<'a, O> { +pub type CLRPND_W<'a, REG> = crate::BitWriter<'a, REG, CLRPND_AW>; +impl<'a, REG> CLRPND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CLRPND_AW::VALUE1) } #[doc = "The bits in registers BRSPNDx are cleared"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CLRPND_AW::VALUE2) } } @@ -391,16 +381,19 @@ impl From for bool { } } #[doc = "Field `LDEV` writer - Generate Load Event"] -pub type LDEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSMR_SPEC, LDEV_AW, O>; -impl<'a, const O: u8> LDEV_W<'a, O> { +pub type LDEV_W<'a, REG> = crate::BitWriter<'a, REG, LDEV_AW>; +impl<'a, REG> LDEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LDEV_AW::VALUE1) } #[doc = "A load event is generated"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LDEV_AW::VALUE2) } } @@ -423,34 +416,37 @@ impl From for bool { impl RPTDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RPTDIS_A { + pub const fn variant(&self) -> RPTDIS_A { match self.bits { false => RPTDIS_A::VALUE1, true => RPTDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A cancelled conversion is repeated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RPTDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A cancelled conversion is discarded"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RPTDIS_A::VALUE2 } } #[doc = "Field `RPTDIS` writer - Repeat Disable"] -pub type RPTDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSMR_SPEC, RPTDIS_A, O>; -impl<'a, const O: u8> RPTDIS_W<'a, O> { +pub type RPTDIS_W<'a, REG> = crate::BitWriter<'a, REG, RPTDIS_A>; +impl<'a, REG> RPTDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A cancelled conversion is repeated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RPTDIS_A::VALUE1) } #[doc = "A cancelled conversion is discarded"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RPTDIS_A::VALUE2) } } @@ -495,70 +491,71 @@ impl W { #[doc = "Bits 0:1 - Enable Gate"] #[inline(always)] #[must_use] - pub fn engt(&mut self) -> ENGT_W<0> { - ENGT_W::new(self) + pub fn engt(&mut self) -> ENGT_W { + ENGT_W::new(self, 0) } #[doc = "Bit 2 - Enable External Trigger"] #[inline(always)] #[must_use] - pub fn entr(&mut self) -> ENTR_W<2> { - ENTR_W::new(self) + pub fn entr(&mut self) -> ENTR_W { + ENTR_W::new(self, 2) } #[doc = "Bit 3 - Enable Source Interrupt"] #[inline(always)] #[must_use] - pub fn ensi(&mut self) -> ENSI_W<3> { - ENSI_W::new(self) + pub fn ensi(&mut self) -> ENSI_W { + ENSI_W::new(self, 3) } #[doc = "Bit 4 - Autoscan Enable"] #[inline(always)] #[must_use] - pub fn scan(&mut self) -> SCAN_W<4> { - SCAN_W::new(self) + pub fn scan(&mut self) -> SCAN_W { + SCAN_W::new(self, 4) } #[doc = "Bit 5 - Autoscan Source Load Event Mode"] #[inline(always)] #[must_use] - pub fn ldm(&mut self) -> LDM_W<5> { - LDM_W::new(self) + pub fn ldm(&mut self) -> LDM_W { + LDM_W::new(self, 5) } #[doc = "Bit 8 - Clear Pending Bits"] #[inline(always)] #[must_use] - pub fn clrpnd(&mut self) -> CLRPND_W<8> { - CLRPND_W::new(self) + pub fn clrpnd(&mut self) -> CLRPND_W { + CLRPND_W::new(self, 8) } #[doc = "Bit 9 - Generate Load Event"] #[inline(always)] #[must_use] - pub fn ldev(&mut self) -> LDEV_W<9> { - LDEV_W::new(self) + pub fn ldev(&mut self) -> LDEV_W { + LDEV_W::new(self, 9) } #[doc = "Bit 16 - Repeat Disable"] #[inline(always)] #[must_use] - pub fn rptdis(&mut self) -> RPTDIS_W<16> { - RPTDIS_W::new(self) + pub fn rptdis(&mut self) -> RPTDIS_W { + RPTDIS_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Background Request Source Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brsmr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brsmr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`brsmr::R`](R) reader structure"] +impl crate::Readable for BRSMR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`brsmr::W`](W) writer structure"] impl crate::Writable for BRSMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/brspnd.rs b/src/vadc/brspnd.rs index e617679f..0964eb0d 100644 --- a/src/vadc/brspnd.rs +++ b/src/vadc/brspnd.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CHPNDG0` reader - Channels Pending Group x"] pub type CHPNDG0_R = crate::BitReader; #[doc = "Channels Pending Group x\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CHPNDG0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPNDG0_A { + pub const fn variant(&self) -> CHPNDG0_A { match self.bits { false => CHPNDG0_A::VALUE1, true => CHPNDG0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPNDG0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPNDG0_A::VALUE2 } } #[doc = "Field `CHPNDG0` writer - Channels Pending Group x"] -pub type CHPNDG0_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSPND_SPEC, CHPNDG0_A, O>; -impl<'a, const O: u8> CHPNDG0_W<'a, O> { +pub type CHPNDG0_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG0_A>; +impl<'a, REG> CHPNDG0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPNDG0_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPNDG0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CHPNDG1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPNDG1_A { + pub const fn variant(&self) -> CHPNDG1_A { match self.bits { false => CHPNDG1_A::VALUE1, true => CHPNDG1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPNDG1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPNDG1_A::VALUE2 } } #[doc = "Field `CHPNDG1` writer - Channels Pending Group x"] -pub type CHPNDG1_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSPND_SPEC, CHPNDG1_A, O>; -impl<'a, const O: u8> CHPNDG1_W<'a, O> { +pub type CHPNDG1_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG1_A>; +impl<'a, REG> CHPNDG1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPNDG1_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPNDG1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CHPNDG2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPNDG2_A { + pub const fn variant(&self) -> CHPNDG2_A { match self.bits { false => CHPNDG2_A::VALUE1, true => CHPNDG2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPNDG2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPNDG2_A::VALUE2 } } #[doc = "Field `CHPNDG2` writer - Channels Pending Group x"] -pub type CHPNDG2_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSPND_SPEC, CHPNDG2_A, O>; -impl<'a, const O: u8> CHPNDG2_W<'a, O> { +pub type CHPNDG2_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG2_A>; +impl<'a, REG> CHPNDG2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPNDG2_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPNDG2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CHPNDG3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPNDG3_A { + pub const fn variant(&self) -> CHPNDG3_A { match self.bits { false => CHPNDG3_A::VALUE1, true => CHPNDG3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPNDG3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPNDG3_A::VALUE2 } } #[doc = "Field `CHPNDG3` writer - Channels Pending Group x"] -pub type CHPNDG3_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSPND_SPEC, CHPNDG3_A, O>; -impl<'a, const O: u8> CHPNDG3_W<'a, O> { +pub type CHPNDG3_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG3_A>; +impl<'a, REG> CHPNDG3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPNDG3_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPNDG3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CHPNDG4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPNDG4_A { + pub const fn variant(&self) -> CHPNDG4_A { match self.bits { false => CHPNDG4_A::VALUE1, true => CHPNDG4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPNDG4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPNDG4_A::VALUE2 } } #[doc = "Field `CHPNDG4` writer - Channels Pending Group x"] -pub type CHPNDG4_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSPND_SPEC, CHPNDG4_A, O>; -impl<'a, const O: u8> CHPNDG4_W<'a, O> { +pub type CHPNDG4_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG4_A>; +impl<'a, REG> CHPNDG4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPNDG4_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPNDG4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CHPNDG5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPNDG5_A { + pub const fn variant(&self) -> CHPNDG5_A { match self.bits { false => CHPNDG5_A::VALUE1, true => CHPNDG5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPNDG5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPNDG5_A::VALUE2 } } #[doc = "Field `CHPNDG5` writer - Channels Pending Group x"] -pub type CHPNDG5_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSPND_SPEC, CHPNDG5_A, O>; -impl<'a, const O: u8> CHPNDG5_W<'a, O> { +pub type CHPNDG5_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG5_A>; +impl<'a, REG> CHPNDG5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPNDG5_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPNDG5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CHPNDG6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPNDG6_A { + pub const fn variant(&self) -> CHPNDG6_A { match self.bits { false => CHPNDG6_A::VALUE1, true => CHPNDG6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPNDG6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPNDG6_A::VALUE2 } } #[doc = "Field `CHPNDG6` writer - Channels Pending Group x"] -pub type CHPNDG6_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSPND_SPEC, CHPNDG6_A, O>; -impl<'a, const O: u8> CHPNDG6_W<'a, O> { +pub type CHPNDG6_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG6_A>; +impl<'a, REG> CHPNDG6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPNDG6_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPNDG6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CHPNDG7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPNDG7_A { + pub const fn variant(&self) -> CHPNDG7_A { match self.bits { false => CHPNDG7_A::VALUE1, true => CHPNDG7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPNDG7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPNDG7_A::VALUE2 } } #[doc = "Field `CHPNDG7` writer - Channels Pending Group x"] -pub type CHPNDG7_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSPND_SPEC, CHPNDG7_A, O>; -impl<'a, const O: u8> CHPNDG7_W<'a, O> { +pub type CHPNDG7_W<'a, REG> = crate::BitWriter<'a, REG, CHPNDG7_A>; +impl<'a, REG> CHPNDG7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPNDG7_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPNDG7_A::VALUE2) } } @@ -480,70 +472,71 @@ impl W { #[doc = "Bit 0 - Channels Pending Group x"] #[inline(always)] #[must_use] - pub fn chpndg0(&mut self) -> CHPNDG0_W<0> { - CHPNDG0_W::new(self) + pub fn chpndg0(&mut self) -> CHPNDG0_W { + CHPNDG0_W::new(self, 0) } #[doc = "Bit 1 - Channels Pending Group x"] #[inline(always)] #[must_use] - pub fn chpndg1(&mut self) -> CHPNDG1_W<1> { - CHPNDG1_W::new(self) + pub fn chpndg1(&mut self) -> CHPNDG1_W { + CHPNDG1_W::new(self, 1) } #[doc = "Bit 2 - Channels Pending Group x"] #[inline(always)] #[must_use] - pub fn chpndg2(&mut self) -> CHPNDG2_W<2> { - CHPNDG2_W::new(self) + pub fn chpndg2(&mut self) -> CHPNDG2_W { + CHPNDG2_W::new(self, 2) } #[doc = "Bit 3 - Channels Pending Group x"] #[inline(always)] #[must_use] - pub fn chpndg3(&mut self) -> CHPNDG3_W<3> { - CHPNDG3_W::new(self) + pub fn chpndg3(&mut self) -> CHPNDG3_W { + CHPNDG3_W::new(self, 3) } #[doc = "Bit 4 - Channels Pending Group x"] #[inline(always)] #[must_use] - pub fn chpndg4(&mut self) -> CHPNDG4_W<4> { - CHPNDG4_W::new(self) + pub fn chpndg4(&mut self) -> CHPNDG4_W { + CHPNDG4_W::new(self, 4) } #[doc = "Bit 5 - Channels Pending Group x"] #[inline(always)] #[must_use] - pub fn chpndg5(&mut self) -> CHPNDG5_W<5> { - CHPNDG5_W::new(self) + pub fn chpndg5(&mut self) -> CHPNDG5_W { + CHPNDG5_W::new(self, 5) } #[doc = "Bit 6 - Channels Pending Group x"] #[inline(always)] #[must_use] - pub fn chpndg6(&mut self) -> CHPNDG6_W<6> { - CHPNDG6_W::new(self) + pub fn chpndg6(&mut self) -> CHPNDG6_W { + CHPNDG6_W::new(self, 6) } #[doc = "Bit 7 - Channels Pending Group x"] #[inline(always)] #[must_use] - pub fn chpndg7(&mut self) -> CHPNDG7_W<7> { - CHPNDG7_W::new(self) + pub fn chpndg7(&mut self) -> CHPNDG7_W { + CHPNDG7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Background Request Source Pending Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brspnd::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brspnd::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`brspnd::R`](R) reader structure"] +impl crate::Readable for BRSPND_SPEC {} +#[doc = "`write(|w| ..)` method takes [`brspnd::W`](W) writer structure"] impl crate::Writable for BRSPND_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/brssel.rs b/src/vadc/brssel.rs index 89f9e7cb..d90b4998 100644 --- a/src/vadc/brssel.rs +++ b/src/vadc/brssel.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CHSELG0` reader - Channel Selection Group x"] pub type CHSELG0_R = crate::BitReader; #[doc = "Channel Selection Group x\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CHSELG0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSELG0_A { + pub const fn variant(&self) -> CHSELG0_A { match self.bits { false => CHSELG0_A::VALUE1, true => CHSELG0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSELG0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSELG0_A::VALUE2 } } #[doc = "Field `CHSELG0` writer - Channel Selection Group x"] -pub type CHSELG0_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSSEL_SPEC, CHSELG0_A, O>; -impl<'a, const O: u8> CHSELG0_W<'a, O> { +pub type CHSELG0_W<'a, REG> = crate::BitWriter<'a, REG, CHSELG0_A>; +impl<'a, REG> CHSELG0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSELG0_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSELG0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CHSELG1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSELG1_A { + pub const fn variant(&self) -> CHSELG1_A { match self.bits { false => CHSELG1_A::VALUE1, true => CHSELG1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSELG1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSELG1_A::VALUE2 } } #[doc = "Field `CHSELG1` writer - Channel Selection Group x"] -pub type CHSELG1_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSSEL_SPEC, CHSELG1_A, O>; -impl<'a, const O: u8> CHSELG1_W<'a, O> { +pub type CHSELG1_W<'a, REG> = crate::BitWriter<'a, REG, CHSELG1_A>; +impl<'a, REG> CHSELG1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSELG1_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSELG1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CHSELG2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSELG2_A { + pub const fn variant(&self) -> CHSELG2_A { match self.bits { false => CHSELG2_A::VALUE1, true => CHSELG2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSELG2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSELG2_A::VALUE2 } } #[doc = "Field `CHSELG2` writer - Channel Selection Group x"] -pub type CHSELG2_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSSEL_SPEC, CHSELG2_A, O>; -impl<'a, const O: u8> CHSELG2_W<'a, O> { +pub type CHSELG2_W<'a, REG> = crate::BitWriter<'a, REG, CHSELG2_A>; +impl<'a, REG> CHSELG2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSELG2_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSELG2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CHSELG3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSELG3_A { + pub const fn variant(&self) -> CHSELG3_A { match self.bits { false => CHSELG3_A::VALUE1, true => CHSELG3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSELG3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSELG3_A::VALUE2 } } #[doc = "Field `CHSELG3` writer - Channel Selection Group x"] -pub type CHSELG3_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSSEL_SPEC, CHSELG3_A, O>; -impl<'a, const O: u8> CHSELG3_W<'a, O> { +pub type CHSELG3_W<'a, REG> = crate::BitWriter<'a, REG, CHSELG3_A>; +impl<'a, REG> CHSELG3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSELG3_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSELG3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CHSELG4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSELG4_A { + pub const fn variant(&self) -> CHSELG4_A { match self.bits { false => CHSELG4_A::VALUE1, true => CHSELG4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSELG4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSELG4_A::VALUE2 } } #[doc = "Field `CHSELG4` writer - Channel Selection Group x"] -pub type CHSELG4_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSSEL_SPEC, CHSELG4_A, O>; -impl<'a, const O: u8> CHSELG4_W<'a, O> { +pub type CHSELG4_W<'a, REG> = crate::BitWriter<'a, REG, CHSELG4_A>; +impl<'a, REG> CHSELG4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSELG4_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSELG4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CHSELG5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSELG5_A { + pub const fn variant(&self) -> CHSELG5_A { match self.bits { false => CHSELG5_A::VALUE1, true => CHSELG5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSELG5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSELG5_A::VALUE2 } } #[doc = "Field `CHSELG5` writer - Channel Selection Group x"] -pub type CHSELG5_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSSEL_SPEC, CHSELG5_A, O>; -impl<'a, const O: u8> CHSELG5_W<'a, O> { +pub type CHSELG5_W<'a, REG> = crate::BitWriter<'a, REG, CHSELG5_A>; +impl<'a, REG> CHSELG5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSELG5_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSELG5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CHSELG6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSELG6_A { + pub const fn variant(&self) -> CHSELG6_A { match self.bits { false => CHSELG6_A::VALUE1, true => CHSELG6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSELG6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSELG6_A::VALUE2 } } #[doc = "Field `CHSELG6` writer - Channel Selection Group x"] -pub type CHSELG6_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSSEL_SPEC, CHSELG6_A, O>; -impl<'a, const O: u8> CHSELG6_W<'a, O> { +pub type CHSELG6_W<'a, REG> = crate::BitWriter<'a, REG, CHSELG6_A>; +impl<'a, REG> CHSELG6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSELG6_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSELG6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CHSELG7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSELG7_A { + pub const fn variant(&self) -> CHSELG7_A { match self.bits { false => CHSELG7_A::VALUE1, true => CHSELG7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSELG7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSELG7_A::VALUE2 } } #[doc = "Field `CHSELG7` writer - Channel Selection Group x"] -pub type CHSELG7_W<'a, const O: u8> = crate::BitWriter<'a, u32, BRSSEL_SPEC, CHSELG7_A, O>; -impl<'a, const O: u8> CHSELG7_W<'a, O> { +pub type CHSELG7_W<'a, REG> = crate::BitWriter<'a, REG, CHSELG7_A>; +impl<'a, REG> CHSELG7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSELG7_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSELG7_A::VALUE2) } } @@ -480,70 +472,71 @@ impl W { #[doc = "Bit 0 - Channel Selection Group x"] #[inline(always)] #[must_use] - pub fn chselg0(&mut self) -> CHSELG0_W<0> { - CHSELG0_W::new(self) + pub fn chselg0(&mut self) -> CHSELG0_W { + CHSELG0_W::new(self, 0) } #[doc = "Bit 1 - Channel Selection Group x"] #[inline(always)] #[must_use] - pub fn chselg1(&mut self) -> CHSELG1_W<1> { - CHSELG1_W::new(self) + pub fn chselg1(&mut self) -> CHSELG1_W { + CHSELG1_W::new(self, 1) } #[doc = "Bit 2 - Channel Selection Group x"] #[inline(always)] #[must_use] - pub fn chselg2(&mut self) -> CHSELG2_W<2> { - CHSELG2_W::new(self) + pub fn chselg2(&mut self) -> CHSELG2_W { + CHSELG2_W::new(self, 2) } #[doc = "Bit 3 - Channel Selection Group x"] #[inline(always)] #[must_use] - pub fn chselg3(&mut self) -> CHSELG3_W<3> { - CHSELG3_W::new(self) + pub fn chselg3(&mut self) -> CHSELG3_W { + CHSELG3_W::new(self, 3) } #[doc = "Bit 4 - Channel Selection Group x"] #[inline(always)] #[must_use] - pub fn chselg4(&mut self) -> CHSELG4_W<4> { - CHSELG4_W::new(self) + pub fn chselg4(&mut self) -> CHSELG4_W { + CHSELG4_W::new(self, 4) } #[doc = "Bit 5 - Channel Selection Group x"] #[inline(always)] #[must_use] - pub fn chselg5(&mut self) -> CHSELG5_W<5> { - CHSELG5_W::new(self) + pub fn chselg5(&mut self) -> CHSELG5_W { + CHSELG5_W::new(self, 5) } #[doc = "Bit 6 - Channel Selection Group x"] #[inline(always)] #[must_use] - pub fn chselg6(&mut self) -> CHSELG6_W<6> { - CHSELG6_W::new(self) + pub fn chselg6(&mut self) -> CHSELG6_W { + CHSELG6_W::new(self, 6) } #[doc = "Bit 7 - Channel Selection Group x"] #[inline(always)] #[must_use] - pub fn chselg7(&mut self) -> CHSELG7_W<7> { - CHSELG7_W::new(self) + pub fn chselg7(&mut self) -> CHSELG7_W { + CHSELG7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Background Request Source Channel Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`brssel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`brssel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`brssel::R`](R) reader structure"] +impl crate::Readable for BRSSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`brssel::W`](W) writer structure"] impl crate::Writable for BRSSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/clc.rs b/src/vadc/clc.rs index 7bbd3188..7a7c39c0 100644 --- a/src/vadc/clc.rs +++ b/src/vadc/clc.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DISR` reader - Module Disable Request Bit"] pub type DISR_R = crate::BitReader; #[doc = "Module Disable Request Bit\n\nValue on reset: 1"] @@ -53,34 +21,37 @@ impl From for bool { impl DISR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DISR_A { + pub const fn variant(&self) -> DISR_A { match self.bits { false => DISR_A::VALUE1, true => DISR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "On request: enable the module clock"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DISR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Off request: stop the module clock"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DISR_A::VALUE2 } } #[doc = "Field `DISR` writer - Module Disable Request Bit"] -pub type DISR_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLC_SPEC, DISR_A, O>; -impl<'a, const O: u8> DISR_W<'a, O> { +pub type DISR_W<'a, REG> = crate::BitWriter<'a, REG, DISR_A>; +impl<'a, REG> DISR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "On request: enable the module clock"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DISR_A::VALUE1) } #[doc = "Off request: stop the module clock"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DISR_A::VALUE2) } } @@ -103,18 +74,18 @@ impl From for bool { impl DISS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DISS_A { + pub const fn variant(&self) -> DISS_A { match self.bits { false => DISS_A::VALUE1, true => DISS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Module clock is enabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DISS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Off: module is not clocked"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DISS_A::VALUE2 @@ -139,34 +110,37 @@ impl From for bool { impl EDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EDIS_A { + pub const fn variant(&self) -> EDIS_A { match self.bits { false => EDIS_A::VALUE1, true => EDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Sleep mode request is enabled and functional"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Module disregards the sleep mode control signal"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EDIS_A::VALUE2 } } #[doc = "Field `EDIS` writer - Sleep Mode Enable Control"] -pub type EDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CLC_SPEC, EDIS_A, O>; -impl<'a, const O: u8> EDIS_W<'a, O> { +pub type EDIS_W<'a, REG> = crate::BitWriter<'a, REG, EDIS_A>; +impl<'a, REG> EDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Sleep mode request is enabled and functional"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EDIS_A::VALUE1) } #[doc = "Module disregards the sleep mode control signal"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EDIS_A::VALUE2) } } @@ -191,34 +165,35 @@ impl W { #[doc = "Bit 0 - Module Disable Request Bit"] #[inline(always)] #[must_use] - pub fn disr(&mut self) -> DISR_W<0> { - DISR_W::new(self) + pub fn disr(&mut self) -> DISR_W { + DISR_W::new(self, 0) } #[doc = "Bit 3 - Sleep Mode Enable Control"] #[inline(always)] #[must_use] - pub fn edis(&mut self) -> EDIS_W<3> { - EDIS_W::new(self) + pub fn edis(&mut self) -> EDIS_W { + EDIS_W::new(self, 3) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Clock Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`clc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`clc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`clc::R`](R) reader structure"] +impl crate::Readable for CLC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`clc::W`](W) writer structure"] impl crate::Writable for CLC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/emuxsel.rs b/src/vadc/emuxsel.rs index 778852c0..795a07b4 100644 --- a/src/vadc/emuxsel.rs +++ b/src/vadc/emuxsel.rs @@ -1,47 +1,15 @@ #[doc = "Register `EMUXSEL` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `EMUXGRP0` reader - External Multiplexer Group for Interface x"] -pub type EMUXGRP0_R = crate::FieldReader; +pub type EMUXGRP0_R = crate::FieldReader; #[doc = "Field `EMUXGRP0` writer - External Multiplexer Group for Interface x"] -pub type EMUXGRP0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, EMUXSEL_SPEC, u8, u8, 4, O>; +pub type EMUXGRP0_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `EMUXGRP1` reader - External Multiplexer Group for Interface x"] -pub type EMUXGRP1_R = crate::FieldReader; +pub type EMUXGRP1_R = crate::FieldReader; #[doc = "Field `EMUXGRP1` writer - External Multiplexer Group for Interface x"] -pub type EMUXGRP1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, EMUXSEL_SPEC, u8, u8, 4, O>; +pub type EMUXGRP1_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; impl R { #[doc = "Bits 0:3 - External Multiplexer Group for Interface x"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:3 - External Multiplexer Group for Interface x"] #[inline(always)] #[must_use] - pub fn emuxgrp0(&mut self) -> EMUXGRP0_W<0> { - EMUXGRP0_W::new(self) + pub fn emuxgrp0(&mut self) -> EMUXGRP0_W { + EMUXGRP0_W::new(self, 0) } #[doc = "Bits 4:7 - External Multiplexer Group for Interface x"] #[inline(always)] #[must_use] - pub fn emuxgrp1(&mut self) -> EMUXGRP1_W<4> { - EMUXGRP1_W::new(self) + pub fn emuxgrp1(&mut self) -> EMUXGRP1_W { + EMUXGRP1_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "External Multiplexer Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`emuxsel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`emuxsel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`emuxsel::R`](R) reader structure"] +impl crate::Readable for EMUXSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`emuxsel::W`](W) writer structure"] impl crate::Writable for EMUXSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globbound.rs b/src/vadc/globbound.rs index fef70366..adb7f20f 100644 --- a/src/vadc/globbound.rs +++ b/src/vadc/globbound.rs @@ -1,47 +1,15 @@ #[doc = "Register `GLOBBOUND` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BOUNDARY0` reader - Boundary Value 0 for Limit Checking"] -pub type BOUNDARY0_R = crate::FieldReader; +pub type BOUNDARY0_R = crate::FieldReader; #[doc = "Field `BOUNDARY0` writer - Boundary Value 0 for Limit Checking"] -pub type BOUNDARY0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBBOUND_SPEC, u16, u16, 12, O>; +pub type BOUNDARY0_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; #[doc = "Field `BOUNDARY1` reader - Boundary Value 1 for Limit Checking"] -pub type BOUNDARY1_R = crate::FieldReader; +pub type BOUNDARY1_R = crate::FieldReader; #[doc = "Field `BOUNDARY1` writer - Boundary Value 1 for Limit Checking"] -pub type BOUNDARY1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBBOUND_SPEC, u16, u16, 12, O>; +pub type BOUNDARY1_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:11 - Boundary Value 0 for Limit Checking"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:11 - Boundary Value 0 for Limit Checking"] #[inline(always)] #[must_use] - pub fn boundary0(&mut self) -> BOUNDARY0_W<0> { - BOUNDARY0_W::new(self) + pub fn boundary0(&mut self) -> BOUNDARY0_W { + BOUNDARY0_W::new(self, 0) } #[doc = "Bits 16:27 - Boundary Value 1 for Limit Checking"] #[inline(always)] #[must_use] - pub fn boundary1(&mut self) -> BOUNDARY1_W<16> { - BOUNDARY1_W::new(self) + pub fn boundary1(&mut self) -> BOUNDARY1_W { + BOUNDARY1_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Boundary Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globbound::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globbound::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globbound::R`](R) reader structure"] +impl crate::Readable for GLOBBOUND_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globbound::W`](W) writer structure"] impl crate::Writable for GLOBBOUND_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globcfg.rs b/src/vadc/globcfg.rs index 9d8b09d6..597ae7f1 100644 --- a/src/vadc/globcfg.rs +++ b/src/vadc/globcfg.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DIVA` reader - Divider Factor for the Analog Internal Clock"] -pub type DIVA_R = crate::FieldReader; +pub type DIVA_R = crate::FieldReader; #[doc = "Divider Factor for the Analog Internal Clock\n\nValue on reset: 15"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DIVA_A { + type Ux = u8; +} impl DIVA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DIVA_A::VALUE1), 1 => Some(DIVA_A::VALUE2), @@ -67,48 +38,52 @@ impl DIVA_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fADCI = fADC / 2"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIVA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fADCI = fADC / 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIVA_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fADCI = fADC / 3"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DIVA_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "fADCI = fADC / 32"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DIVA_A::VALUE4 } } #[doc = "Field `DIVA` writer - Divider Factor for the Analog Internal Clock"] -pub type DIVA_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBCFG_SPEC, u8, DIVA_A, 5, O>; -impl<'a, const O: u8> DIVA_W<'a, O> { +pub type DIVA_W<'a, REG> = crate::FieldWriter<'a, REG, 5, DIVA_A>; +impl<'a, REG> DIVA_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fADCI = fADC / 2"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIVA_A::VALUE1) } #[doc = "fADCI = fADC / 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIVA_A::VALUE2) } #[doc = "fADCI = fADC / 3"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DIVA_A::VALUE3) } #[doc = "fADCI = fADC / 32"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DIVA_A::VALUE4) } } @@ -131,39 +106,42 @@ impl From for bool { impl DCMSB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DCMSB_A { + pub const fn variant(&self) -> DCMSB_A { match self.bits { false => DCMSB_A::VALUE1, true => DCMSB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "1 clock cycles for the MSB (standard)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DCMSB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "2 clock cycles for the MSB (fADCI > 20 MHz)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DCMSB_A::VALUE2 } } #[doc = "Field `DCMSB` writer - Double Clock for the MSB Conversion"] -pub type DCMSB_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCFG_SPEC, DCMSB_A, O>; -impl<'a, const O: u8> DCMSB_W<'a, O> { +pub type DCMSB_W<'a, REG> = crate::BitWriter<'a, REG, DCMSB_A>; +impl<'a, REG> DCMSB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "1 clock cycles for the MSB (standard)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DCMSB_A::VALUE1) } #[doc = "2 clock cycles for the MSB (fADCI > 20 MHz)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DCMSB_A::VALUE2) } } #[doc = "Field `DIVD` reader - Divider Factor for the Arbiter Clock"] -pub type DIVD_R = crate::FieldReader; +pub type DIVD_R = crate::FieldReader; #[doc = "Divider Factor for the Arbiter Clock\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,10 +161,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DIVD_A { + type Ux = u8; +} impl DIVD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DIVD_A { + pub const fn variant(&self) -> DIVD_A { match self.bits { 0 => DIVD_A::VALUE1, 1 => DIVD_A::VALUE2, @@ -195,48 +176,52 @@ impl DIVD_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "fADCD = fADC"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DIVD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "fADCD = fADC / 2"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DIVD_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "fADCD = fADC / 3"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DIVD_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "fADCD = fADC / 4"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == DIVD_A::VALUE4 } } #[doc = "Field `DIVD` writer - Divider Factor for the Arbiter Clock"] -pub type DIVD_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GLOBCFG_SPEC, u8, DIVD_A, 2, O>; -impl<'a, const O: u8> DIVD_W<'a, O> { +pub type DIVD_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, DIVD_A>; +impl<'a, REG> DIVD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "fADCD = fADC"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIVD_A::VALUE1) } #[doc = "fADCD = fADC / 2"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIVD_A::VALUE2) } #[doc = "fADCD = fADC / 3"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DIVD_A::VALUE3) } #[doc = "fADCD = fADC / 4"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(DIVD_A::VALUE4) } } @@ -255,16 +240,19 @@ impl From for bool { } } #[doc = "Field `DIVWC` writer - Write Control for Divider Parameters"] -pub type DIVWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCFG_SPEC, DIVWC_AW, O>; -impl<'a, const O: u8> DIVWC_W<'a, O> { +pub type DIVWC_W<'a, REG> = crate::BitWriter<'a, REG, DIVWC_AW>; +impl<'a, REG> DIVWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to divider parameters"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DIVWC_AW::VALUE1) } #[doc = "Bitfields DIVA, DCMSB, DIVD can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DIVWC_AW::VALUE2) } } @@ -287,34 +275,37 @@ impl From for bool { impl DPCAL0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPCAL0_A { + pub const fn variant(&self) -> DPCAL0_A { match self.bits { false => DPCAL0_A::VALUE1, true => DPCAL0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPCAL0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No post-calibration"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPCAL0_A::VALUE2 } } #[doc = "Field `DPCAL0` writer - Disable Post-Calibration"] -pub type DPCAL0_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCFG_SPEC, DPCAL0_A, O>; -impl<'a, const O: u8> DPCAL0_W<'a, O> { +pub type DPCAL0_W<'a, REG> = crate::BitWriter<'a, REG, DPCAL0_A>; +impl<'a, REG> DPCAL0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPCAL0_A::VALUE1) } #[doc = "No post-calibration"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPCAL0_A::VALUE2) } } @@ -337,34 +328,37 @@ impl From for bool { impl DPCAL1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPCAL1_A { + pub const fn variant(&self) -> DPCAL1_A { match self.bits { false => DPCAL1_A::VALUE1, true => DPCAL1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPCAL1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No post-calibration"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPCAL1_A::VALUE2 } } #[doc = "Field `DPCAL1` writer - Disable Post-Calibration"] -pub type DPCAL1_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCFG_SPEC, DPCAL1_A, O>; -impl<'a, const O: u8> DPCAL1_W<'a, O> { +pub type DPCAL1_W<'a, REG> = crate::BitWriter<'a, REG, DPCAL1_A>; +impl<'a, REG> DPCAL1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPCAL1_A::VALUE1) } #[doc = "No post-calibration"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPCAL1_A::VALUE2) } } @@ -387,34 +381,37 @@ impl From for bool { impl DPCAL2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPCAL2_A { + pub const fn variant(&self) -> DPCAL2_A { match self.bits { false => DPCAL2_A::VALUE1, true => DPCAL2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPCAL2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No post-calibration"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPCAL2_A::VALUE2 } } #[doc = "Field `DPCAL2` writer - Disable Post-Calibration"] -pub type DPCAL2_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCFG_SPEC, DPCAL2_A, O>; -impl<'a, const O: u8> DPCAL2_W<'a, O> { +pub type DPCAL2_W<'a, REG> = crate::BitWriter<'a, REG, DPCAL2_A>; +impl<'a, REG> DPCAL2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPCAL2_A::VALUE1) } #[doc = "No post-calibration"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPCAL2_A::VALUE2) } } @@ -437,34 +434,37 @@ impl From for bool { impl DPCAL3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> DPCAL3_A { + pub const fn variant(&self) -> DPCAL3_A { match self.bits { false => DPCAL3_A::VALUE1, true => DPCAL3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DPCAL3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No post-calibration"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DPCAL3_A::VALUE2 } } #[doc = "Field `DPCAL3` writer - Disable Post-Calibration"] -pub type DPCAL3_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCFG_SPEC, DPCAL3_A, O>; -impl<'a, const O: u8> DPCAL3_W<'a, O> { +pub type DPCAL3_W<'a, REG> = crate::BitWriter<'a, REG, DPCAL3_A>; +impl<'a, REG> DPCAL3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Automatic post-calibration after each conversion of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DPCAL3_A::VALUE1) } #[doc = "No post-calibration"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DPCAL3_A::VALUE2) } } @@ -483,16 +483,19 @@ impl From for bool { } } #[doc = "Field `SUCAL` writer - Start-Up Calibration"] -pub type SUCAL_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBCFG_SPEC, SUCAL_AW, O>; -impl<'a, const O: u8> SUCAL_W<'a, O> { +pub type SUCAL_W<'a, REG> = crate::BitWriter<'a, REG, SUCAL_AW>; +impl<'a, REG> SUCAL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUCAL_AW::VALUE1) } #[doc = "Initiate the start-up calibration phase (indication in bit GxARBCFG.CAL)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUCAL_AW::VALUE2) } } @@ -537,76 +540,77 @@ impl W { #[doc = "Bits 0:4 - Divider Factor for the Analog Internal Clock"] #[inline(always)] #[must_use] - pub fn diva(&mut self) -> DIVA_W<0> { - DIVA_W::new(self) + pub fn diva(&mut self) -> DIVA_W { + DIVA_W::new(self, 0) } #[doc = "Bit 7 - Double Clock for the MSB Conversion"] #[inline(always)] #[must_use] - pub fn dcmsb(&mut self) -> DCMSB_W<7> { - DCMSB_W::new(self) + pub fn dcmsb(&mut self) -> DCMSB_W { + DCMSB_W::new(self, 7) } #[doc = "Bits 8:9 - Divider Factor for the Arbiter Clock"] #[inline(always)] #[must_use] - pub fn divd(&mut self) -> DIVD_W<8> { - DIVD_W::new(self) + pub fn divd(&mut self) -> DIVD_W { + DIVD_W::new(self, 8) } #[doc = "Bit 15 - Write Control for Divider Parameters"] #[inline(always)] #[must_use] - pub fn divwc(&mut self) -> DIVWC_W<15> { - DIVWC_W::new(self) + pub fn divwc(&mut self) -> DIVWC_W { + DIVWC_W::new(self, 15) } #[doc = "Bit 16 - Disable Post-Calibration"] #[inline(always)] #[must_use] - pub fn dpcal0(&mut self) -> DPCAL0_W<16> { - DPCAL0_W::new(self) + pub fn dpcal0(&mut self) -> DPCAL0_W { + DPCAL0_W::new(self, 16) } #[doc = "Bit 17 - Disable Post-Calibration"] #[inline(always)] #[must_use] - pub fn dpcal1(&mut self) -> DPCAL1_W<17> { - DPCAL1_W::new(self) + pub fn dpcal1(&mut self) -> DPCAL1_W { + DPCAL1_W::new(self, 17) } #[doc = "Bit 18 - Disable Post-Calibration"] #[inline(always)] #[must_use] - pub fn dpcal2(&mut self) -> DPCAL2_W<18> { - DPCAL2_W::new(self) + pub fn dpcal2(&mut self) -> DPCAL2_W { + DPCAL2_W::new(self, 18) } #[doc = "Bit 19 - Disable Post-Calibration"] #[inline(always)] #[must_use] - pub fn dpcal3(&mut self) -> DPCAL3_W<19> { - DPCAL3_W::new(self) + pub fn dpcal3(&mut self) -> DPCAL3_W { + DPCAL3_W::new(self, 19) } #[doc = "Bit 31 - Start-Up Calibration"] #[inline(always)] #[must_use] - pub fn sucal(&mut self) -> SUCAL_W<31> { - SUCAL_W::new(self) + pub fn sucal(&mut self) -> SUCAL_W { + SUCAL_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globcfg::R`](R) reader structure"] +impl crate::Readable for GLOBCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globcfg::W`](W) writer structure"] impl crate::Writable for GLOBCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globeflag.rs b/src/vadc/globeflag.rs index 55baab0c..7e7291c7 100644 --- a/src/vadc/globeflag.rs +++ b/src/vadc/globeflag.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SEVGLB` reader - Source Event (Background)"] pub type SEVGLB_R = crate::BitReader; #[doc = "Source Event (Background)\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SEVGLB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SEVGLB_A { + pub const fn variant(&self) -> SEVGLB_A { match self.bits { false => SEVGLB_A::VALUE1, true => SEVGLB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No source event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SEVGLB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A source event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SEVGLB_A::VALUE2 } } #[doc = "Field `SEVGLB` writer - Source Event (Background)"] -pub type SEVGLB_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBEFLAG_SPEC, SEVGLB_A, O>; -impl<'a, const O: u8> SEVGLB_W<'a, O> { +pub type SEVGLB_W<'a, REG> = crate::BitWriter<'a, REG, SEVGLB_A>; +impl<'a, REG> SEVGLB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No source event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEVGLB_A::VALUE1) } #[doc = "A source event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEVGLB_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl REVGLB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REVGLB_A { + pub const fn variant(&self) -> REVGLB_A { match self.bits { false => REVGLB_A::VALUE1, true => REVGLB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REVGLB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GLOBRES"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REVGLB_A::VALUE2 } } #[doc = "Field `REVGLB` writer - Global Result Event"] -pub type REVGLB_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBEFLAG_SPEC, REVGLB_A, O>; -impl<'a, const O: u8> REVGLB_W<'a, O> { +pub type REVGLB_W<'a, REG> = crate::BitWriter<'a, REG, REVGLB_A>; +impl<'a, REG> REVGLB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REVGLB_A::VALUE1) } #[doc = "New result was stored in register GLOBRES"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REVGLB_A::VALUE2) } } @@ -149,16 +123,19 @@ impl From for bool { } } #[doc = "Field `SEVGLBCLR` writer - Clear Source Event (Background)"] -pub type SEVGLBCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBEFLAG_SPEC, SEVGLBCLR_AW, O>; -impl<'a, const O: u8> SEVGLBCLR_W<'a, O> { +pub type SEVGLBCLR_W<'a, REG> = crate::BitWriter<'a, REG, SEVGLBCLR_AW>; +impl<'a, REG> SEVGLBCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEVGLBCLR_AW::VALUE1) } #[doc = "Clear the source event flag SEVGLB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEVGLBCLR_AW::VALUE2) } } @@ -177,16 +154,19 @@ impl From for bool { } } #[doc = "Field `REVGLBCLR` writer - Clear Global Result Event"] -pub type REVGLBCLR_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBEFLAG_SPEC, REVGLBCLR_AW, O>; -impl<'a, const O: u8> REVGLBCLR_W<'a, O> { +pub type REVGLBCLR_W<'a, REG> = crate::BitWriter<'a, REG, REVGLBCLR_AW>; +impl<'a, REG> REVGLBCLR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REVGLBCLR_AW::VALUE1) } #[doc = "Clear the result event flag REVGLB"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REVGLBCLR_AW::VALUE2) } } @@ -206,46 +186,47 @@ impl W { #[doc = "Bit 0 - Source Event (Background)"] #[inline(always)] #[must_use] - pub fn sevglb(&mut self) -> SEVGLB_W<0> { - SEVGLB_W::new(self) + pub fn sevglb(&mut self) -> SEVGLB_W { + SEVGLB_W::new(self, 0) } #[doc = "Bit 8 - Global Result Event"] #[inline(always)] #[must_use] - pub fn revglb(&mut self) -> REVGLB_W<8> { - REVGLB_W::new(self) + pub fn revglb(&mut self) -> REVGLB_W { + REVGLB_W::new(self, 8) } #[doc = "Bit 16 - Clear Source Event (Background)"] #[inline(always)] #[must_use] - pub fn sevglbclr(&mut self) -> SEVGLBCLR_W<16> { - SEVGLBCLR_W::new(self) + pub fn sevglbclr(&mut self) -> SEVGLBCLR_W { + SEVGLBCLR_W::new(self, 16) } #[doc = "Bit 24 - Clear Global Result Event"] #[inline(always)] #[must_use] - pub fn revglbclr(&mut self) -> REVGLBCLR_W<24> { - REVGLBCLR_W::new(self) + pub fn revglbclr(&mut self) -> REVGLBCLR_W { + REVGLBCLR_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globeflag::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globeflag::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globeflag::R`](R) reader structure"] +impl crate::Readable for GLOBEFLAG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globeflag::W`](W) writer structure"] impl crate::Writable for GLOBEFLAG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globevnp.rs b/src/vadc/globevnp.rs index 7d017558..9edca062 100644 --- a/src/vadc/globevnp.rs +++ b/src/vadc/globevnp.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SEV0NP` reader - Service Request Node Pointer Backgr. Source"] -pub type SEV0NP_R = crate::FieldReader; +pub type SEV0NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Backgr. Source\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SEV0NP_A { + type Ux = u8; +} impl SEV0NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SEV0NP_A::VALUE1), 3 => Some(SEV0NP_A::VALUE2), @@ -67,53 +38,57 @@ impl SEV0NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select shared service request line 0 of common service request group 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SEV0NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select shared service request line 3 of common service request group 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SEV0NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0 of common service request group 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SEV0NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3 of common service request group 1"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SEV0NP_A::VALUE4 } } #[doc = "Field `SEV0NP` writer - Service Request Node Pointer Backgr. Source"] -pub type SEV0NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBEVNP_SPEC, u8, SEV0NP_A, 4, O>; -impl<'a, const O: u8> SEV0NP_W<'a, O> { +pub type SEV0NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SEV0NP_A>; +impl<'a, REG> SEV0NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select shared service request line 0 of common service request group 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEV0NP_A::VALUE1) } #[doc = "Select shared service request line 3 of common service request group 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEV0NP_A::VALUE2) } #[doc = "Select shared service request line 0 of common service request group 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SEV0NP_A::VALUE3) } #[doc = "Select shared service request line 3 of common service request group 1"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SEV0NP_A::VALUE4) } } #[doc = "Field `REV0NP` reader - Service Request Node Pointer Backgr. Result"] -pub type REV0NP_R = crate::FieldReader; +pub type REV0NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Backgr. Result\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV0NP_A { + type Ux = u8; +} impl REV0NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV0NP_A::VALUE1), 3 => Some(REV0NP_A::VALUE2), @@ -145,48 +123,52 @@ impl REV0NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select shared service request line 0 of common service request group 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV0NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select shared service request line 3 of common service request group 0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV0NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0 of common service request group 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV0NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3 of common service request group 1"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV0NP_A::VALUE4 } } #[doc = "Field `REV0NP` writer - Service Request Node Pointer Backgr. Result"] -pub type REV0NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBEVNP_SPEC, u8, REV0NP_A, 4, O>; -impl<'a, const O: u8> REV0NP_W<'a, O> { +pub type REV0NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV0NP_A>; +impl<'a, REG> REV0NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select shared service request line 0 of common service request group 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV0NP_A::VALUE1) } #[doc = "Select shared service request line 3 of common service request group 0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV0NP_A::VALUE2) } #[doc = "Select shared service request line 0 of common service request group 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV0NP_A::VALUE3) } #[doc = "Select shared service request line 3 of common service request group 1"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV0NP_A::VALUE4) } } @@ -206,34 +188,35 @@ impl W { #[doc = "Bits 0:3 - Service Request Node Pointer Backgr. Source"] #[inline(always)] #[must_use] - pub fn sev0np(&mut self) -> SEV0NP_W<0> { - SEV0NP_W::new(self) + pub fn sev0np(&mut self) -> SEV0NP_W { + SEV0NP_W::new(self, 0) } #[doc = "Bits 16:19 - Service Request Node Pointer Backgr. Result"] #[inline(always)] #[must_use] - pub fn rev0np(&mut self) -> REV0NP_W<16> { - REV0NP_W::new(self) + pub fn rev0np(&mut self) -> REV0NP_W { + REV0NP_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Event Node Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globevnp::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globevnp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globevnp::R`](R) reader structure"] +impl crate::Readable for GLOBEVNP_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globevnp::W`](W) writer structure"] impl crate::Writable for GLOBEVNP_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globiclass.rs b/src/vadc/globiclass.rs index 579b55e7..e4a6b8bc 100644 --- a/src/vadc/globiclass.rs +++ b/src/vadc/globiclass.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `STCS` reader - Sample Time Control for Standard Conversions"] -pub type STCS_R = crate::FieldReader; +pub type STCS_R = crate::FieldReader; #[doc = "Field `STCS` writer - Sample Time Control for Standard Conversions"] -pub type STCS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBICLASS_SPEC, u8, u8, 5, O>; +pub type STCS_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `CMS` reader - Conversion Mode for Standard Conversions"] -pub type CMS_R = crate::FieldReader; +pub type CMS_R = crate::FieldReader; #[doc = "Conversion Mode for Standard Conversions\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CMS_A { + type Ux = u8; +} impl CMS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CMS_A::VALUE1), 1 => Some(CMS_A::VALUE2), @@ -71,57 +42,61 @@ impl CMS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "12-bit conversion"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "10-bit conversion"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "8-bit conversion"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CMS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "10-bit fast compare mode"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == CMS_A::VALUE6 } } #[doc = "Field `CMS` writer - Conversion Mode for Standard Conversions"] -pub type CMS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBICLASS_SPEC, u8, CMS_A, 3, O>; -impl<'a, const O: u8> CMS_W<'a, O> { +pub type CMS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CMS_A>; +impl<'a, REG> CMS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "12-bit conversion"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMS_A::VALUE1) } #[doc = "10-bit conversion"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMS_A::VALUE2) } #[doc = "8-bit conversion"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CMS_A::VALUE3) } #[doc = "10-bit fast compare mode"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(CMS_A::VALUE6) } } #[doc = "Field `STCE` reader - Sample Time Control for EMUX Conversions"] -pub type STCE_R = crate::FieldReader; +pub type STCE_R = crate::FieldReader; #[doc = "Field `STCE` writer - Sample Time Control for EMUX Conversions"] -pub type STCE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBICLASS_SPEC, u8, u8, 5, O>; +pub type STCE_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `CME` reader - Conversion Mode for EMUX Conversions"] -pub type CME_R = crate::FieldReader; +pub type CME_R = crate::FieldReader; #[doc = "Conversion Mode for EMUX Conversions\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -141,10 +116,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CME_A { + type Ux = u8; +} impl CME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CME_A::VALUE1), 1 => Some(CME_A::VALUE2), @@ -153,48 +131,52 @@ impl CME_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "12-bit conversion"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "10-bit conversion"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CME_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "8-bit conversion"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CME_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "10-bit fast compare mode"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == CME_A::VALUE6 } } #[doc = "Field `CME` writer - Conversion Mode for EMUX Conversions"] -pub type CME_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBICLASS_SPEC, u8, CME_A, 3, O>; -impl<'a, const O: u8> CME_W<'a, O> { +pub type CME_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CME_A>; +impl<'a, REG> CME_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "12-bit conversion"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CME_A::VALUE1) } #[doc = "10-bit conversion"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CME_A::VALUE2) } #[doc = "8-bit conversion"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CME_A::VALUE3) } #[doc = "10-bit fast compare mode"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(CME_A::VALUE6) } } @@ -224,46 +206,47 @@ impl W { #[doc = "Bits 0:4 - Sample Time Control for Standard Conversions"] #[inline(always)] #[must_use] - pub fn stcs(&mut self) -> STCS_W<0> { - STCS_W::new(self) + pub fn stcs(&mut self) -> STCS_W { + STCS_W::new(self, 0) } #[doc = "Bits 8:10 - Conversion Mode for Standard Conversions"] #[inline(always)] #[must_use] - pub fn cms(&mut self) -> CMS_W<8> { - CMS_W::new(self) + pub fn cms(&mut self) -> CMS_W { + CMS_W::new(self, 8) } #[doc = "Bits 16:20 - Sample Time Control for EMUX Conversions"] #[inline(always)] #[must_use] - pub fn stce(&mut self) -> STCE_W<16> { - STCE_W::new(self) + pub fn stce(&mut self) -> STCE_W { + STCE_W::new(self, 16) } #[doc = "Bits 24:26 - Conversion Mode for EMUX Conversions"] #[inline(always)] #[must_use] - pub fn cme(&mut self) -> CME_W<24> { - CME_W::new(self) + pub fn cme(&mut self) -> CME_W { + CME_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Class Register, Global\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globiclass::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globiclass::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globiclass::R`](R) reader structure"] +impl crate::Readable for GLOBICLASS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globiclass::W`](W) writer structure"] impl crate::Writable for GLOBICLASS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globrcr.rs b/src/vadc/globrcr.rs index 9c12253b..3232d560 100644 --- a/src/vadc/globrcr.rs +++ b/src/vadc/globrcr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `DRCTR` reader - Data Reduction Control"] -pub type DRCTR_R = crate::FieldReader; +pub type DRCTR_R = crate::FieldReader; #[doc = "Data Reduction Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -49,27 +17,34 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DRCTR_A { + type Ux = u8; +} impl DRCTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DRCTR_A::VALUE1), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Data reduction disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DRCTR_A::VALUE1 } } #[doc = "Field `DRCTR` writer - Data Reduction Control"] -pub type DRCTR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBRCR_SPEC, u8, DRCTR_A, 4, O>; -impl<'a, const O: u8> DRCTR_W<'a, O> { +pub type DRCTR_W<'a, REG> = crate::FieldWriter<'a, REG, 4, DRCTR_A>; +impl<'a, REG> DRCTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Data reduction disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DRCTR_A::VALUE1) } } @@ -92,34 +67,37 @@ impl From for bool { impl WFR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WFR_A { + pub const fn variant(&self) -> WFR_A { match self.bits { false => WFR_A::VALUE1, true => WFR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Overwrite mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WFR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wait-for-read mode enabled for this register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WFR_A::VALUE2 } } #[doc = "Field `WFR` writer - Wait-for-Read Mode Enable"] -pub type WFR_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBRCR_SPEC, WFR_A, O>; -impl<'a, const O: u8> WFR_W<'a, O> { +pub type WFR_W<'a, REG> = crate::BitWriter<'a, REG, WFR_A>; +impl<'a, REG> WFR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Overwrite mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WFR_A::VALUE1) } #[doc = "Wait-for-read mode enabled for this register"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WFR_A::VALUE2) } } @@ -142,34 +120,37 @@ impl From for bool { impl SRGEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRGEN_A { + pub const fn variant(&self) -> SRGEN_A { match self.bits { false => SRGEN_A::VALUE1, true => SRGEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No service request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRGEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Service request after a result event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRGEN_A::VALUE2 } } #[doc = "Field `SRGEN` writer - Service Request Generation Enable"] -pub type SRGEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBRCR_SPEC, SRGEN_A, O>; -impl<'a, const O: u8> SRGEN_W<'a, O> { +pub type SRGEN_W<'a, REG> = crate::BitWriter<'a, REG, SRGEN_A>; +impl<'a, REG> SRGEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No service request"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRGEN_A::VALUE1) } #[doc = "Service request after a result event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRGEN_A::VALUE2) } } @@ -194,40 +175,41 @@ impl W { #[doc = "Bits 16:19 - Data Reduction Control"] #[inline(always)] #[must_use] - pub fn drctr(&mut self) -> DRCTR_W<16> { - DRCTR_W::new(self) + pub fn drctr(&mut self) -> DRCTR_W { + DRCTR_W::new(self, 16) } #[doc = "Bit 24 - Wait-for-Read Mode Enable"] #[inline(always)] #[must_use] - pub fn wfr(&mut self) -> WFR_W<24> { - WFR_W::new(self) + pub fn wfr(&mut self) -> WFR_W { + WFR_W::new(self, 24) } #[doc = "Bit 31 - Service Request Generation Enable"] #[inline(always)] #[must_use] - pub fn srgen(&mut self) -> SRGEN_W<31> { - SRGEN_W::new(self) + pub fn srgen(&mut self) -> SRGEN_W { + SRGEN_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Result Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globrcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globrcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globrcr::R`](R) reader structure"] +impl crate::Readable for GLOBRCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globrcr::W`](W) writer structure"] impl crate::Writable for GLOBRCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globres.rs b/src/vadc/globres.rs index b6f6a485..f55580a2 100644 --- a/src/vadc/globres.rs +++ b/src/vadc/globres.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RESULT` reader - Result of most recent conversion"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; #[doc = "Field `RESULT` writer - Result of most recent conversion"] -pub type RESULT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBRES_SPEC, u16, u16, 16, O>; +pub type RESULT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `GNR` reader - Group Number"] -pub type GNR_R = crate::FieldReader; +pub type GNR_R = crate::FieldReader; #[doc = "Field `CHNR` reader - Channel Number"] -pub type CHNR_R = crate::FieldReader; +pub type CHNR_R = crate::FieldReader; #[doc = "Field `EMUX` reader - External Multiplexer Setting"] -pub type EMUX_R = crate::FieldReader; +pub type EMUX_R = crate::FieldReader; #[doc = "Field `CRS` reader - Converted Request Source"] -pub type CRS_R = crate::FieldReader; +pub type CRS_R = crate::FieldReader; #[doc = "Field `FCR` reader - Fast Compare Result"] pub type FCR_R = crate::BitReader; #[doc = "Fast Compare Result\n\nValue on reset: 0"] @@ -65,18 +33,18 @@ impl From for bool { impl FCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FCR_A { + pub const fn variant(&self) -> FCR_A { match self.bits { false => FCR_A::VALUE1, true => FCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Signal level was below compare value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal level was above compare value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FCR_A::VALUE2 @@ -101,34 +69,37 @@ impl From for bool { impl VF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF_A { + pub const fn variant(&self) -> VF_A { match self.bits { false => VF_A::VALUE1, true => VF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Bitfield RESULT contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and the data reduction counter (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF_A::VALUE2 } } #[doc = "Field `VF` writer - Valid Flag"] -pub type VF_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBRES_SPEC, VF_A, O>; -impl<'a, const O: u8> VF_W<'a, O> { +pub type VF_W<'a, REG> = crate::BitWriter<'a, REG, VF_A>; +impl<'a, REG> VF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF_A::VALUE1) } #[doc = "Read access: Bitfield RESULT contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and the data reduction counter (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF_A::VALUE2) } } @@ -173,34 +144,35 @@ impl W { #[doc = "Bits 0:15 - Result of most recent conversion"] #[inline(always)] #[must_use] - pub fn result(&mut self) -> RESULT_W<0> { - RESULT_W::new(self) + pub fn result(&mut self) -> RESULT_W { + RESULT_W::new(self, 0) } #[doc = "Bit 31 - Valid Flag"] #[inline(always)] #[must_use] - pub fn vf(&mut self) -> VF_W<31> { - VF_W::new(self) + pub fn vf(&mut self) -> VF_W { + VF_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Global Result Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globres::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globres::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globres::R`](R) reader structure"] +impl crate::Readable for GLOBRES_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globres::W`](W) writer structure"] impl crate::Writable for GLOBRES_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globresd.rs b/src/vadc/globresd.rs index af1c5551..8d7c8699 100644 --- a/src/vadc/globresd.rs +++ b/src/vadc/globresd.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `RESULT` reader - Result of most recent conversion"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; #[doc = "Field `RESULT` writer - Result of most recent conversion"] -pub type RESULT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBRESD_SPEC, u16, u16, 16, O>; +pub type RESULT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `GNR` reader - Group Number"] -pub type GNR_R = crate::FieldReader; +pub type GNR_R = crate::FieldReader; #[doc = "Field `CHNR` reader - Channel Number"] -pub type CHNR_R = crate::FieldReader; +pub type CHNR_R = crate::FieldReader; #[doc = "Field `EMUX` reader - External Multiplexer Setting"] -pub type EMUX_R = crate::FieldReader; +pub type EMUX_R = crate::FieldReader; #[doc = "Field `CRS` reader - Converted Request Source"] -pub type CRS_R = crate::FieldReader; +pub type CRS_R = crate::FieldReader; #[doc = "Field `FCR` reader - Fast Compare Result"] pub type FCR_R = crate::BitReader; #[doc = "Fast Compare Result\n\nValue on reset: 0"] @@ -65,18 +33,18 @@ impl From for bool { impl FCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FCR_A { + pub const fn variant(&self) -> FCR_A { match self.bits { false => FCR_A::VALUE1, true => FCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Signal level was below compare value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal level was above compare value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FCR_A::VALUE2 @@ -101,34 +69,37 @@ impl From for bool { impl VF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF_A { + pub const fn variant(&self) -> VF_A { match self.bits { false => VF_A::VALUE1, true => VF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Bitfield RESULT contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and the data reduction counter (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF_A::VALUE2 } } #[doc = "Field `VF` writer - Valid Flag"] -pub type VF_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBRESD_SPEC, VF_A, O>; -impl<'a, const O: u8> VF_W<'a, O> { +pub type VF_W<'a, REG> = crate::BitWriter<'a, REG, VF_A>; +impl<'a, REG> VF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF_A::VALUE1) } #[doc = "Read access: Bitfield RESULT contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and the data reduction counter (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF_A::VALUE2) } } @@ -173,34 +144,35 @@ impl W { #[doc = "Bits 0:15 - Result of most recent conversion"] #[inline(always)] #[must_use] - pub fn result(&mut self) -> RESULT_W<0> { - RESULT_W::new(self) + pub fn result(&mut self) -> RESULT_W { + RESULT_W::new(self, 0) } #[doc = "Bit 31 - Valid Flag"] #[inline(always)] #[must_use] - pub fn vf(&mut self) -> VF_W<31> { - VF_W::new(self) + pub fn vf(&mut self) -> VF_W { + VF_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Result Register, Debug\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globresd::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globresd::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globresd::R`](R) reader structure"] +impl crate::Readable for GLOBRESD_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globresd::W`](W) writer structure"] impl crate::Writable for GLOBRESD_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/globtf.rs b/src/vadc/globtf.rs index 25518528..b358599e 100644 --- a/src/vadc/globtf.rs +++ b/src/vadc/globtf.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `CDGR` reader - Converter Diagnostics Group"] -pub type CDGR_R = crate::FieldReader; +pub type CDGR_R = crate::FieldReader; #[doc = "Field `CDGR` writer - Converter Diagnostics Group"] -pub type CDGR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GLOBTF_SPEC, u8, u8, 4, O>; +pub type CDGR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `CDEN` reader - Converter Diagnostics Enable"] pub type CDEN_R = crate::BitReader; #[doc = "Converter Diagnostics Enable\n\nValue on reset: 0"] @@ -57,39 +25,42 @@ impl From for bool { impl CDEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CDEN_A { + pub const fn variant(&self) -> CDEN_A { match self.bits { false => CDEN_A::VALUE1, true => CDEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "All diagnostic pull devices are disconnected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CDEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Diagnostic pull devices connected as selected by bitfield CDSEL"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CDEN_A::VALUE2 } } #[doc = "Field `CDEN` writer - Converter Diagnostics Enable"] -pub type CDEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBTF_SPEC, CDEN_A, O>; -impl<'a, const O: u8> CDEN_W<'a, O> { +pub type CDEN_W<'a, REG> = crate::BitWriter<'a, REG, CDEN_A>; +impl<'a, REG> CDEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "All diagnostic pull devices are disconnected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CDEN_A::VALUE1) } #[doc = "Diagnostic pull devices connected as selected by bitfield CDSEL"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CDEN_A::VALUE2) } } #[doc = "Field `CDSEL` reader - Converter Diagnostics Pull-Devices Select"] -pub type CDSEL_R = crate::FieldReader; +pub type CDSEL_R = crate::FieldReader; #[doc = "Converter Diagnostics Pull-Devices Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -109,10 +80,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CDSEL_A { + type Ux = u8; +} impl CDSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CDSEL_A { + pub const fn variant(&self) -> CDSEL_A { match self.bits { 0 => CDSEL_A::VALUE1, 1 => CDSEL_A::VALUE2, @@ -121,48 +95,52 @@ impl CDSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Connected to VAREF"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CDSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Connected to VAGND"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CDSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Connected to 1/3rd VAREF"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CDSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Connected to 2/3rd VAREF"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CDSEL_A::VALUE4 } } #[doc = "Field `CDSEL` writer - Converter Diagnostics Pull-Devices Select"] -pub type CDSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, GLOBTF_SPEC, u8, CDSEL_A, 2, O>; -impl<'a, const O: u8> CDSEL_W<'a, O> { +pub type CDSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CDSEL_A>; +impl<'a, REG> CDSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Connected to VAREF"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CDSEL_A::VALUE1) } #[doc = "Connected to VAGND"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CDSEL_A::VALUE2) } #[doc = "Connected to 1/3rd VAREF"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CDSEL_A::VALUE3) } #[doc = "Connected to 2/3rd VAREF"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CDSEL_A::VALUE4) } } @@ -181,16 +159,19 @@ impl From for bool { } } #[doc = "Field `CDWC` writer - Write Control for Conversion Diagnostics"] -pub type CDWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBTF_SPEC, CDWC_AW, O>; -impl<'a, const O: u8> CDWC_W<'a, O> { +pub type CDWC_W<'a, REG> = crate::BitWriter<'a, REG, CDWC_AW>; +impl<'a, REG> CDWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to parameters"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CDWC_AW::VALUE1) } #[doc = "Bitfields CDSEL, CDEN, CDGR can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CDWC_AW::VALUE2) } } @@ -213,34 +194,37 @@ impl From for bool { impl PDD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> PDD_A { + pub const fn variant(&self) -> PDD_A { match self.bits { false => PDD_A::VALUE1, true => PDD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disconnected"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PDD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The pull-down diagnostics device is active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PDD_A::VALUE2 } } #[doc = "Field `PDD` writer - Pull-Down Diagnostics Enable"] -pub type PDD_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBTF_SPEC, PDD_A, O>; -impl<'a, const O: u8> PDD_W<'a, O> { +pub type PDD_W<'a, REG> = crate::BitWriter<'a, REG, PDD_A>; +impl<'a, REG> PDD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Disconnected"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PDD_A::VALUE1) } #[doc = "The pull-down diagnostics device is active"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PDD_A::VALUE2) } } @@ -259,16 +243,19 @@ impl From for bool { } } #[doc = "Field `MDWC` writer - Write Control for Multiplexer Diagnostics"] -pub type MDWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, GLOBTF_SPEC, MDWC_AW, O>; -impl<'a, const O: u8> MDWC_W<'a, O> { +pub type MDWC_W<'a, REG> = crate::BitWriter<'a, REG, MDWC_AW>; +impl<'a, REG> MDWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to parameters"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(MDWC_AW::VALUE1) } #[doc = "Bitfield PDD can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(MDWC_AW::VALUE2) } } @@ -298,58 +285,59 @@ impl W { #[doc = "Bits 4:7 - Converter Diagnostics Group"] #[inline(always)] #[must_use] - pub fn cdgr(&mut self) -> CDGR_W<4> { - CDGR_W::new(self) + pub fn cdgr(&mut self) -> CDGR_W { + CDGR_W::new(self, 4) } #[doc = "Bit 8 - Converter Diagnostics Enable"] #[inline(always)] #[must_use] - pub fn cden(&mut self) -> CDEN_W<8> { - CDEN_W::new(self) + pub fn cden(&mut self) -> CDEN_W { + CDEN_W::new(self, 8) } #[doc = "Bits 9:10 - Converter Diagnostics Pull-Devices Select"] #[inline(always)] #[must_use] - pub fn cdsel(&mut self) -> CDSEL_W<9> { - CDSEL_W::new(self) + pub fn cdsel(&mut self) -> CDSEL_W { + CDSEL_W::new(self, 9) } #[doc = "Bit 15 - Write Control for Conversion Diagnostics"] #[inline(always)] #[must_use] - pub fn cdwc(&mut self) -> CDWC_W<15> { - CDWC_W::new(self) + pub fn cdwc(&mut self) -> CDWC_W { + CDWC_W::new(self, 15) } #[doc = "Bit 16 - Pull-Down Diagnostics Enable"] #[inline(always)] #[must_use] - pub fn pdd(&mut self) -> PDD_W<16> { - PDD_W::new(self) + pub fn pdd(&mut self) -> PDD_W { + PDD_W::new(self, 16) } #[doc = "Bit 23 - Write Control for Multiplexer Diagnostics"] #[inline(always)] #[must_use] - pub fn mdwc(&mut self) -> MDWC_W<23> { - MDWC_W::new(self) + pub fn mdwc(&mut self) -> MDWC_W { + MDWC_W::new(self, 23) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Global Test Functions Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`globtf::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`globtf::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`globtf::R`](R) reader structure"] +impl crate::Readable for GLOBTF_SPEC {} +#[doc = "`write(|w| ..)` method takes [`globtf::W`](W) writer structure"] impl crate::Writable for GLOBTF_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc/id.rs b/src/vadc/id.rs index 97eb934e..39ad19e3 100644 --- a/src/vadc/id.rs +++ b/src/vadc/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "Module Identification Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00c5_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00c5_c000; diff --git a/src/vadc/ocs.rs b/src/vadc/ocs.rs index 81daaa03..68f44569 100644 --- a/src/vadc/ocs.rs +++ b/src/vadc/ocs.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `TGS` reader - Trigger Set for OTGB0/1"] -pub type TGS_R = crate::FieldReader; +pub type TGS_R = crate::FieldReader; #[doc = "Trigger Set for OTGB0/1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -51,38 +19,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for TGS_A { + type Ux = u8; +} impl TGS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(TGS_A::VALUE1), 1 => Some(TGS_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No Trigger Set output"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TGS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger Set 1: TS16_SSIG, input sample signals"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TGS_A::VALUE2 } } #[doc = "Field `TGS` writer - Trigger Set for OTGB0/1"] -pub type TGS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OCS_SPEC, u8, TGS_A, 2, O>; -impl<'a, const O: u8> TGS_W<'a, O> { +pub type TGS_W<'a, REG> = crate::FieldWriter<'a, REG, 2, TGS_A>; +impl<'a, REG> TGS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No Trigger Set output"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TGS_A::VALUE1) } #[doc = "Trigger Set 1: TS16_SSIG, input sample signals"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TGS_A::VALUE2) } } @@ -105,41 +80,44 @@ impl From for bool { impl TGB_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TGB_A { + pub const fn variant(&self) -> TGB_A { match self.bits { false => TGB_A::VALUE1, true => TGB_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Trigger Set is output on OTGB0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TGB_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger Set is output on OTGB1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TGB_A::VALUE2 } } #[doc = "Field `TGB` writer - OTGB0/1 Bus Select"] -pub type TGB_W<'a, const O: u8> = crate::BitWriter<'a, u32, OCS_SPEC, TGB_A, O>; -impl<'a, const O: u8> TGB_W<'a, O> { +pub type TGB_W<'a, REG> = crate::BitWriter<'a, REG, TGB_A>; +impl<'a, REG> TGB_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Trigger Set is output on OTGB0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TGB_A::VALUE1) } #[doc = "Trigger Set is output on OTGB1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TGB_A::VALUE2) } } #[doc = "Field `TG_P` writer - TGS, TGB Write Protection"] -pub type TG_P_W<'a, const O: u8> = crate::BitWriter<'a, u32, OCS_SPEC, bool, O>; +pub type TG_P_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SUS` reader - OCDS Suspend Control"] -pub type SUS_R = crate::FieldReader; +pub type SUS_R = crate::FieldReader; #[doc = "OCDS Suspend Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -159,10 +137,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SUS_A { + type Ux = u8; +} impl SUS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SUS_A::VALUE1), 1 => Some(SUS_A::VALUE2), @@ -171,53 +152,57 @@ impl SUS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Will not suspend"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Hard suspend: Clock is switched off immediately."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Soft suspend mode 0: Stop conversions after the currently running one is completed and its result has been stored. No change for the arbiter."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SUS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Soft suspend mode 1: Stop conversions after the currently running one is completed and its result has been stored. Stop arbiter after the current arbitration round."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SUS_A::VALUE4 } } #[doc = "Field `SUS` writer - OCDS Suspend Control"] -pub type SUS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, OCS_SPEC, u8, SUS_A, 4, O>; -impl<'a, const O: u8> SUS_W<'a, O> { +pub type SUS_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SUS_A>; +impl<'a, REG> SUS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Will not suspend"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE1) } #[doc = "Hard suspend: Clock is switched off immediately."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE2) } #[doc = "Soft suspend mode 0: Stop conversions after the currently running one is completed and its result has been stored. No change for the arbiter."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE3) } #[doc = "Soft suspend mode 1: Stop conversions after the currently running one is completed and its result has been stored. Stop arbiter after the current arbitration round."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SUS_A::VALUE4) } } #[doc = "Field `SUS_P` writer - SUS Write Protection"] -pub type SUS_P_W<'a, const O: u8> = crate::BitWriter<'a, u32, OCS_SPEC, bool, O>; +pub type SUS_P_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SUSSTA` reader - Suspend State"] pub type SUSSTA_R = crate::BitReader; #[doc = "Suspend State\n\nValue on reset: 0"] @@ -237,18 +222,18 @@ impl From for bool { impl SUSSTA_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SUSSTA_A { + pub const fn variant(&self) -> SUSSTA_A { match self.bits { false => SUSSTA_A::VALUE1, true => SUSSTA_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Module is not (yet) suspended"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SUSSTA_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Module is suspended"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SUSSTA_A::VALUE2 @@ -280,52 +265,53 @@ impl W { #[doc = "Bits 0:1 - Trigger Set for OTGB0/1"] #[inline(always)] #[must_use] - pub fn tgs(&mut self) -> TGS_W<0> { - TGS_W::new(self) + pub fn tgs(&mut self) -> TGS_W { + TGS_W::new(self, 0) } #[doc = "Bit 2 - OTGB0/1 Bus Select"] #[inline(always)] #[must_use] - pub fn tgb(&mut self) -> TGB_W<2> { - TGB_W::new(self) + pub fn tgb(&mut self) -> TGB_W { + TGB_W::new(self, 2) } #[doc = "Bit 3 - TGS, TGB Write Protection"] #[inline(always)] #[must_use] - pub fn tg_p(&mut self) -> TG_P_W<3> { - TG_P_W::new(self) + pub fn tg_p(&mut self) -> TG_P_W { + TG_P_W::new(self, 3) } #[doc = "Bits 24:27 - OCDS Suspend Control"] #[inline(always)] #[must_use] - pub fn sus(&mut self) -> SUS_W<24> { - SUS_W::new(self) + pub fn sus(&mut self) -> SUS_W { + SUS_W::new(self, 24) } #[doc = "Bit 28 - SUS Write Protection"] #[inline(always)] #[must_use] - pub fn sus_p(&mut self) -> SUS_P_W<28> { - SUS_P_W::new(self) + pub fn sus_p(&mut self) -> SUS_P_W { + SUS_P_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "OCDS Control and Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ocs::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ocs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ocs::R`](R) reader structure"] +impl crate::Readable for OCS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ocs::W`](W) writer structure"] impl crate::Writable for OCS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0.rs b/src/vadc_g0.rs index f37c4bae..bd0a82b8 100644 --- a/src/vadc_g0.rs +++ b/src/vadc_g0.rs @@ -2,260 +2,442 @@ #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 0x80], + arbcfg: ARBCFG, + arbpr: ARBPR, + chass: CHASS, + _reserved3: [u8; 0x14], + iclass: [ICLASS; 2], + _reserved4: [u8; 0x08], + alias: ALIAS, + _reserved5: [u8; 0x04], + bound: BOUND, + _reserved6: [u8; 0x04], + synctr: SYNCTR, + _reserved7: [u8; 0x04], + bfl: BFL, + bfls: BFLS, + bflc: BFLC, + bflnp: BFLNP, + _reserved11: [u8; 0x28], + qctrl0: QCTRL0, + qmr0: QMR0, + qsr0: QSR0, + q0r0: Q0R0, + _reserved_15_qbur0: [u8; 0x04], + _reserved16: [u8; 0x0c], + asctrl: ASCTRL, + asmr: ASMR, + assel: ASSEL, + aspnd: ASPND, + _reserved20: [u8; 0x50], + ceflag: CEFLAG, + reflag: REFLAG, + seflag: SEFLAG, + _reserved23: [u8; 0x04], + cefclr: CEFCLR, + refclr: REFCLR, + sefclr: SEFCLR, + _reserved26: [u8; 0x04], + cevnp0: CEVNP0, + _reserved27: [u8; 0x0c], + revnp0: REVNP0, + revnp1: REVNP1, + _reserved29: [u8; 0x08], + sevnp: SEVNP, + _reserved30: [u8; 0x04], + sract: SRACT, + _reserved31: [u8; 0x24], + emuxctr: EMUXCTR, + _reserved32: [u8; 0x04], + vfr: VFR, + _reserved33: [u8; 0x04], + chctr: [CHCTR; 8], + _reserved34: [u8; 0x60], + rcr: [RCR; 16], + _reserved35: [u8; 0x40], + res: [RES; 16], + _reserved36: [u8; 0x40], + resd: [RESD; 16], +} +impl RegisterBlock { #[doc = "0x80 - Arbitration Configuration Register"] - pub arbcfg: ARBCFG, + #[inline(always)] + pub const fn arbcfg(&self) -> &ARBCFG { + &self.arbcfg + } #[doc = "0x84 - Arbitration Priority Register"] - pub arbpr: ARBPR, + #[inline(always)] + pub const fn arbpr(&self) -> &ARBPR { + &self.arbpr + } #[doc = "0x88 - Channel Assignment Register"] - pub chass: CHASS, - _reserved3: [u8; 0x14], + #[inline(always)] + pub const fn chass(&self) -> &CHASS { + &self.chass + } #[doc = "0xa0..0xa8 - Input Class Register"] - pub iclass: [ICLASS; 2], - _reserved4: [u8; 0x08], + #[inline(always)] + pub const fn iclass(&self, n: usize) -> &ICLASS { + &self.iclass[n] + } #[doc = "0xb0 - Alias Register"] - pub alias: ALIAS, - _reserved5: [u8; 0x04], + #[inline(always)] + pub const fn alias(&self) -> &ALIAS { + &self.alias + } #[doc = "0xb8 - Boundary Select Register"] - pub bound: BOUND, - _reserved6: [u8; 0x04], + #[inline(always)] + pub const fn bound(&self) -> &BOUND { + &self.bound + } #[doc = "0xc0 - Synchronization Control Register"] - pub synctr: SYNCTR, - _reserved7: [u8; 0x04], + #[inline(always)] + pub const fn synctr(&self) -> &SYNCTR { + &self.synctr + } #[doc = "0xc8 - Boundary Flag Register"] - pub bfl: BFL, + #[inline(always)] + pub const fn bfl(&self) -> &BFL { + &self.bfl + } #[doc = "0xcc - Boundary Flag Software Register"] - pub bfls: BFLS, + #[inline(always)] + pub const fn bfls(&self) -> &BFLS { + &self.bfls + } #[doc = "0xd0 - Boundary Flag Control Register"] - pub bflc: BFLC, + #[inline(always)] + pub const fn bflc(&self) -> &BFLC { + &self.bflc + } #[doc = "0xd4 - Boundary Flag Node Pointer Register"] - pub bflnp: BFLNP, - _reserved11: [u8; 0x28], + #[inline(always)] + pub const fn bflnp(&self) -> &BFLNP { + &self.bflnp + } #[doc = "0x100 - Queue 0 Source Control Register"] - pub qctrl0: QCTRL0, + #[inline(always)] + pub const fn qctrl0(&self) -> &QCTRL0 { + &self.qctrl0 + } #[doc = "0x104 - Queue 0 Mode Register"] - pub qmr0: QMR0, + #[inline(always)] + pub const fn qmr0(&self) -> &QMR0 { + &self.qmr0 + } #[doc = "0x108 - Queue 0 Status Register"] - pub qsr0: QSR0, + #[inline(always)] + pub const fn qsr0(&self) -> &QSR0 { + &self.qsr0 + } #[doc = "0x10c - Queue 0 Register 0"] - pub q0r0: Q0R0, - _reserved_15_qbur0: [u8; 0x04], - _reserved16: [u8; 0x0c], + #[inline(always)] + pub const fn q0r0(&self) -> &Q0R0 { + &self.q0r0 + } + #[doc = "0x110 - Queue 0 Backup Register"] + #[inline(always)] + pub const fn qbur0(&self) -> &QBUR0 { + unsafe { &*(self as *const Self).cast::().add(272).cast() } + } + #[doc = "0x110 - Queue 0 Input Register"] + #[inline(always)] + pub const fn qinr0(&self) -> &QINR0 { + unsafe { &*(self as *const Self).cast::().add(272).cast() } + } #[doc = "0x120 - Autoscan Source Control Register"] - pub asctrl: ASCTRL, + #[inline(always)] + pub const fn asctrl(&self) -> &ASCTRL { + &self.asctrl + } #[doc = "0x124 - Autoscan Source Mode Register"] - pub asmr: ASMR, + #[inline(always)] + pub const fn asmr(&self) -> &ASMR { + &self.asmr + } #[doc = "0x128 - Autoscan Source Channel Select Register"] - pub assel: ASSEL, + #[inline(always)] + pub const fn assel(&self) -> &ASSEL { + &self.assel + } #[doc = "0x12c - Autoscan Source Pending Register"] - pub aspnd: ASPND, - _reserved20: [u8; 0x50], + #[inline(always)] + pub const fn aspnd(&self) -> &ASPND { + &self.aspnd + } #[doc = "0x180 - Channel Event Flag Register"] - pub ceflag: CEFLAG, + #[inline(always)] + pub const fn ceflag(&self) -> &CEFLAG { + &self.ceflag + } #[doc = "0x184 - Result Event Flag Register"] - pub reflag: REFLAG, + #[inline(always)] + pub const fn reflag(&self) -> &REFLAG { + &self.reflag + } #[doc = "0x188 - Source Event Flag Register"] - pub seflag: SEFLAG, - _reserved23: [u8; 0x04], + #[inline(always)] + pub const fn seflag(&self) -> &SEFLAG { + &self.seflag + } #[doc = "0x190 - Channel Event Flag Clear Register"] - pub cefclr: CEFCLR, + #[inline(always)] + pub const fn cefclr(&self) -> &CEFCLR { + &self.cefclr + } #[doc = "0x194 - Result Event Flag Clear Register"] - pub refclr: REFCLR, + #[inline(always)] + pub const fn refclr(&self) -> &REFCLR { + &self.refclr + } #[doc = "0x198 - Source Event Flag Clear Register"] - pub sefclr: SEFCLR, - _reserved26: [u8; 0x04], + #[inline(always)] + pub const fn sefclr(&self) -> &SEFCLR { + &self.sefclr + } #[doc = "0x1a0 - Channel Event Node Pointer Register 0"] - pub cevnp0: CEVNP0, - _reserved27: [u8; 0x0c], + #[inline(always)] + pub const fn cevnp0(&self) -> &CEVNP0 { + &self.cevnp0 + } #[doc = "0x1b0 - Result Event Node Pointer Register 0"] - pub revnp0: REVNP0, + #[inline(always)] + pub const fn revnp0(&self) -> &REVNP0 { + &self.revnp0 + } #[doc = "0x1b4 - Result Event Node Pointer Register 1"] - pub revnp1: REVNP1, - _reserved29: [u8; 0x08], + #[inline(always)] + pub const fn revnp1(&self) -> &REVNP1 { + &self.revnp1 + } #[doc = "0x1c0 - Source Event Node Pointer Register"] - pub sevnp: SEVNP, - _reserved30: [u8; 0x04], + #[inline(always)] + pub const fn sevnp(&self) -> &SEVNP { + &self.sevnp + } #[doc = "0x1c8 - Service Request Software Activation Trigger"] - pub sract: SRACT, - _reserved31: [u8; 0x24], + #[inline(always)] + pub const fn sract(&self) -> &SRACT { + &self.sract + } #[doc = "0x1f0 - E0ternal Multiplexer Control Register"] - pub emuxctr: EMUXCTR, - _reserved32: [u8; 0x04], + #[inline(always)] + pub const fn emuxctr(&self) -> &EMUXCTR { + &self.emuxctr + } #[doc = "0x1f8 - Valid Flag Register"] - pub vfr: VFR, - _reserved33: [u8; 0x04], + #[inline(always)] + pub const fn vfr(&self) -> &VFR { + &self.vfr + } #[doc = "0x200..0x220 - Channel Ctrl. Reg."] - pub chctr: [CHCTR; 8], - _reserved34: [u8; 0x60], + #[inline(always)] + pub const fn chctr(&self, n: usize) -> &CHCTR { + &self.chctr[n] + } #[doc = "0x280..0x2c0 - Result Control Register"] - pub rcr: [RCR; 16], - _reserved35: [u8; 0x40], + #[inline(always)] + pub const fn rcr(&self, n: usize) -> &RCR { + &self.rcr[n] + } #[doc = "0x300..0x340 - Result Register"] - pub res: [RES; 16], - _reserved36: [u8; 0x40], - #[doc = "0x380..0x3c0 - Result Register, Debug"] - pub resd: [RESD; 16], -} -impl RegisterBlock { - #[doc = "0x110 - Queue 0 Backup Register"] #[inline(always)] - pub const fn qbur0(&self) -> &QBUR0 { - unsafe { &*(self as *const Self).cast::().add(272usize).cast() } + pub const fn res(&self, n: usize) -> &RES { + &self.res[n] } - #[doc = "0x110 - Queue 0 Input Register"] + #[doc = "0x380..0x3c0 - Result Register, Debug"] #[inline(always)] - pub const fn qinr0(&self) -> &QINR0 { - unsafe { &*(self as *const Self).cast::().add(272usize).cast() } + pub const fn resd(&self, n: usize) -> &RESD { + &self.resd[n] } } -#[doc = "ARBCFG (rw) register accessor: an alias for `Reg`"] +#[doc = "ARBCFG (rw) register accessor: Arbitration Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`arbcfg::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`arbcfg::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@arbcfg`] +module"] pub type ARBCFG = crate::Reg; #[doc = "Arbitration Configuration Register"] pub mod arbcfg; -#[doc = "ARBPR (rw) register accessor: an alias for `Reg`"] +#[doc = "ARBPR (rw) register accessor: Arbitration Priority Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`arbpr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`arbpr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@arbpr`] +module"] pub type ARBPR = crate::Reg; #[doc = "Arbitration Priority Register"] pub mod arbpr; -#[doc = "CHASS (rw) register accessor: an alias for `Reg`"] +#[doc = "CHASS (rw) register accessor: Channel Assignment Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chass::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chass::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@chass`] +module"] pub type CHASS = crate::Reg; #[doc = "Channel Assignment Register"] pub mod chass; -#[doc = "ICLASS (rw) register accessor: an alias for `Reg`"] +#[doc = "ICLASS (rw) register accessor: Input Class Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iclass::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iclass::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@iclass`] +module"] pub type ICLASS = crate::Reg; #[doc = "Input Class Register"] pub mod iclass; -#[doc = "ALIAS (rw) register accessor: an alias for `Reg`"] +#[doc = "ALIAS (rw) register accessor: Alias Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`alias::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`alias::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@alias`] +module"] pub type ALIAS = crate::Reg; #[doc = "Alias Register"] pub mod alias; -#[doc = "BOUND (rw) register accessor: an alias for `Reg`"] +#[doc = "BOUND (rw) register accessor: Boundary Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bound::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bound::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bound`] +module"] pub type BOUND = crate::Reg; #[doc = "Boundary Select Register"] pub mod bound; -#[doc = "SYNCTR (rw) register accessor: an alias for `Reg`"] +#[doc = "SYNCTR (rw) register accessor: Synchronization Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`synctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`synctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@synctr`] +module"] pub type SYNCTR = crate::Reg; #[doc = "Synchronization Control Register"] pub mod synctr; -#[doc = "BFL (rw) register accessor: an alias for `Reg`"] +#[doc = "BFL (rw) register accessor: Boundary Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bfl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bfl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bfl`] +module"] pub type BFL = crate::Reg; #[doc = "Boundary Flag Register"] pub mod bfl; -#[doc = "BFLS (w) register accessor: an alias for `Reg`"] +#[doc = "BFLS (w) register accessor: Boundary Flag Software Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bfls::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bfls`] +module"] pub type BFLS = crate::Reg; #[doc = "Boundary Flag Software Register"] pub mod bfls; -#[doc = "BFLC (rw) register accessor: an alias for `Reg`"] +#[doc = "BFLC (rw) register accessor: Boundary Flag Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bflc::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bflc::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bflc`] +module"] pub type BFLC = crate::Reg; #[doc = "Boundary Flag Control Register"] pub mod bflc; -#[doc = "BFLNP (rw) register accessor: an alias for `Reg`"] +#[doc = "BFLNP (rw) register accessor: Boundary Flag Node Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bflnp::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bflnp::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bflnp`] +module"] pub type BFLNP = crate::Reg; #[doc = "Boundary Flag Node Pointer Register"] pub mod bflnp; -#[doc = "QCTRL0 (rw) register accessor: an alias for `Reg`"] +#[doc = "QCTRL0 (rw) register accessor: Queue 0 Source Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qctrl0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`qctrl0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@qctrl0`] +module"] pub type QCTRL0 = crate::Reg; #[doc = "Queue 0 Source Control Register"] pub mod qctrl0; -#[doc = "QMR0 (rw) register accessor: an alias for `Reg`"] +#[doc = "QMR0 (rw) register accessor: Queue 0 Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qmr0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`qmr0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@qmr0`] +module"] pub type QMR0 = crate::Reg; #[doc = "Queue 0 Mode Register"] pub mod qmr0; -#[doc = "QSR0 (r) register accessor: an alias for `Reg`"] +#[doc = "QSR0 (r) register accessor: Queue 0 Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qsr0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@qsr0`] +module"] pub type QSR0 = crate::Reg; #[doc = "Queue 0 Status Register"] pub mod qsr0; -#[doc = "Q0R0 (r) register accessor: an alias for `Reg`"] +#[doc = "Q0R0 (r) register accessor: Queue 0 Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`q0r0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@q0r0`] +module"] pub type Q0R0 = crate::Reg; #[doc = "Queue 0 Register 0"] pub mod q0r0; -#[doc = "QINR0 (w) register accessor: an alias for `Reg`"] +#[doc = "QINR0 (w) register accessor: Queue 0 Input Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`qinr0::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@qinr0`] +module"] pub type QINR0 = crate::Reg; #[doc = "Queue 0 Input Register"] pub mod qinr0; -#[doc = "QBUR0 (r) register accessor: an alias for `Reg`"] +#[doc = "QBUR0 (r) register accessor: Queue 0 Backup Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qbur0::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@qbur0`] +module"] pub type QBUR0 = crate::Reg; #[doc = "Queue 0 Backup Register"] pub mod qbur0; -#[doc = "ASCTRL (rw) register accessor: an alias for `Reg`"] +#[doc = "ASCTRL (rw) register accessor: Autoscan Source Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`asctrl::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`asctrl::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@asctrl`] +module"] pub type ASCTRL = crate::Reg; #[doc = "Autoscan Source Control Register"] pub mod asctrl; -#[doc = "ASMR (rw) register accessor: an alias for `Reg`"] +#[doc = "ASMR (rw) register accessor: Autoscan Source Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`asmr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`asmr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@asmr`] +module"] pub type ASMR = crate::Reg; #[doc = "Autoscan Source Mode Register"] pub mod asmr; -#[doc = "ASSEL (rw) register accessor: an alias for `Reg`"] +#[doc = "ASSEL (rw) register accessor: Autoscan Source Channel Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`assel::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`assel::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@assel`] +module"] pub type ASSEL = crate::Reg; #[doc = "Autoscan Source Channel Select Register"] pub mod assel; -#[doc = "ASPND (rw) register accessor: an alias for `Reg`"] +#[doc = "ASPND (rw) register accessor: Autoscan Source Pending Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`aspnd::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`aspnd::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@aspnd`] +module"] pub type ASPND = crate::Reg; #[doc = "Autoscan Source Pending Register"] pub mod aspnd; -#[doc = "CEFLAG (rw) register accessor: an alias for `Reg`"] +#[doc = "CEFLAG (rw) register accessor: Channel Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ceflag::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ceflag::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ceflag`] +module"] pub type CEFLAG = crate::Reg; #[doc = "Channel Event Flag Register"] pub mod ceflag; -#[doc = "REFLAG (rw) register accessor: an alias for `Reg`"] +#[doc = "REFLAG (rw) register accessor: Result Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`reflag::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`reflag::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@reflag`] +module"] pub type REFLAG = crate::Reg; #[doc = "Result Event Flag Register"] pub mod reflag; -#[doc = "SEFLAG (rw) register accessor: an alias for `Reg`"] +#[doc = "SEFLAG (rw) register accessor: Source Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`seflag::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`seflag::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@seflag`] +module"] pub type SEFLAG = crate::Reg; #[doc = "Source Event Flag Register"] pub mod seflag; -#[doc = "CEFCLR (w) register accessor: an alias for `Reg`"] +#[doc = "CEFCLR (w) register accessor: Channel Event Flag Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cefclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cefclr`] +module"] pub type CEFCLR = crate::Reg; #[doc = "Channel Event Flag Clear Register"] pub mod cefclr; -#[doc = "REFCLR (w) register accessor: an alias for `Reg`"] +#[doc = "REFCLR (w) register accessor: Result Event Flag Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`refclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@refclr`] +module"] pub type REFCLR = crate::Reg; #[doc = "Result Event Flag Clear Register"] pub mod refclr; -#[doc = "SEFCLR (w) register accessor: an alias for `Reg`"] +#[doc = "SEFCLR (w) register accessor: Source Event Flag Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sefclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sefclr`] +module"] pub type SEFCLR = crate::Reg; #[doc = "Source Event Flag Clear Register"] pub mod sefclr; -#[doc = "CEVNP0 (rw) register accessor: an alias for `Reg`"] +#[doc = "CEVNP0 (rw) register accessor: Channel Event Node Pointer Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cevnp0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cevnp0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cevnp0`] +module"] pub type CEVNP0 = crate::Reg; #[doc = "Channel Event Node Pointer Register 0"] pub mod cevnp0; -#[doc = "REVNP0 (rw) register accessor: an alias for `Reg`"] +#[doc = "REVNP0 (rw) register accessor: Result Event Node Pointer Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`revnp0::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`revnp0::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@revnp0`] +module"] pub type REVNP0 = crate::Reg; #[doc = "Result Event Node Pointer Register 0"] pub mod revnp0; -#[doc = "REVNP1 (rw) register accessor: an alias for `Reg`"] +#[doc = "REVNP1 (rw) register accessor: Result Event Node Pointer Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`revnp1::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`revnp1::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@revnp1`] +module"] pub type REVNP1 = crate::Reg; #[doc = "Result Event Node Pointer Register 1"] pub mod revnp1; -#[doc = "SEVNP (rw) register accessor: an alias for `Reg`"] +#[doc = "SEVNP (rw) register accessor: Source Event Node Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sevnp::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sevnp::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sevnp`] +module"] pub type SEVNP = crate::Reg; #[doc = "Source Event Node Pointer Register"] pub mod sevnp; -#[doc = "SRACT (w) register accessor: an alias for `Reg`"] +#[doc = "SRACT (w) register accessor: Service Request Software Activation Trigger\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sract::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@sract`] +module"] pub type SRACT = crate::Reg; #[doc = "Service Request Software Activation Trigger"] pub mod sract; -#[doc = "EMUXCTR (rw) register accessor: an alias for `Reg`"] +#[doc = "EMUXCTR (rw) register accessor: E0ternal Multiplexer Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`emuxctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`emuxctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@emuxctr`] +module"] pub type EMUXCTR = crate::Reg; #[doc = "E0ternal Multiplexer Control Register"] pub mod emuxctr; -#[doc = "VFR (rw) register accessor: an alias for `Reg`"] +#[doc = "VFR (rw) register accessor: Valid Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`vfr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`vfr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@vfr`] +module"] pub type VFR = crate::Reg; #[doc = "Valid Flag Register"] pub mod vfr; -#[doc = "CHCTR (rw) register accessor: an alias for `Reg`"] +#[doc = "CHCTR (rw) register accessor: Channel Ctrl. Reg.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@chctr`] +module"] pub type CHCTR = crate::Reg; #[doc = "Channel Ctrl. Reg."] pub mod chctr; -#[doc = "RCR (rw) register accessor: an alias for `Reg`"] +#[doc = "RCR (rw) register accessor: Result Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rcr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rcr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@rcr`] +module"] pub type RCR = crate::Reg; #[doc = "Result Control Register"] pub mod rcr; -#[doc = "RES (rw) register accessor: an alias for `Reg`"] +#[doc = "RES (rw) register accessor: Result Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`res::R`]. WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`res::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@res`] +module"] pub type RES = crate::Reg; #[doc = "Result Register"] pub mod res; -#[doc = "RESD (r) register accessor: an alias for `Reg`"] +#[doc = "RESD (r) register accessor: Result Register, Debug\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`resd::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@resd`] +module"] 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 806a334c..07fdc450 100644 --- a/src/vadc_g0/alias.rs +++ b/src/vadc_g0/alias.rs @@ -1,47 +1,15 @@ #[doc = "Register `ALIAS` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ALIAS0` reader - Alias Value for CH0 Conversion Requests"] -pub type ALIAS0_R = crate::FieldReader; +pub type ALIAS0_R = crate::FieldReader; #[doc = "Field `ALIAS0` writer - Alias Value for CH0 Conversion Requests"] -pub type ALIAS0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ALIAS_SPEC, u8, u8, 5, O>; +pub type ALIAS0_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `ALIAS1` reader - Alias Value for CH1 Conversion Requests"] -pub type ALIAS1_R = crate::FieldReader; +pub type ALIAS1_R = crate::FieldReader; #[doc = "Field `ALIAS1` writer - Alias Value for CH1 Conversion Requests"] -pub type ALIAS1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ALIAS_SPEC, u8, u8, 5, O>; +pub type ALIAS1_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; impl R { #[doc = "Bits 0:4 - Alias Value for CH0 Conversion Requests"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:4 - Alias Value for CH0 Conversion Requests"] #[inline(always)] #[must_use] - pub fn alias0(&mut self) -> ALIAS0_W<0> { - ALIAS0_W::new(self) + pub fn alias0(&mut self) -> ALIAS0_W { + ALIAS0_W::new(self, 0) } #[doc = "Bits 8:12 - Alias Value for CH1 Conversion Requests"] #[inline(always)] #[must_use] - pub fn alias1(&mut self) -> ALIAS1_W<8> { - ALIAS1_W::new(self) + pub fn alias1(&mut self) -> ALIAS1_W { + ALIAS1_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Alias Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`alias::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`alias::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`alias::R`](R) reader structure"] +impl crate::Readable for ALIAS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`alias::W`](W) writer structure"] impl crate::Writable for ALIAS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/arbcfg.rs b/src/vadc_g0/arbcfg.rs index b0a0aed0..d8840d8b 100644 --- a/src/vadc_g0/arbcfg.rs +++ b/src/vadc_g0/arbcfg.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ANONC` reader - Analog Converter Control"] -pub type ANONC_R = crate::FieldReader; +pub type ANONC_R = crate::FieldReader; #[doc = "Field `ANONC` writer - Analog Converter Control"] -pub type ANONC_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ARBCFG_SPEC, u8, u8, 2, O>; +pub type ANONC_W<'a, REG> = crate::FieldWriter<'a, REG, 2>; #[doc = "Field `ARBRND` reader - Arbitration Round Length"] -pub type ARBRND_R = crate::FieldReader; +pub type ARBRND_R = crate::FieldReader; #[doc = "Arbitration Round Length\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ARBRND_A { + type Ux = u8; +} impl ARBRND_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ARBRND_A { + pub const fn variant(&self) -> ARBRND_A { match self.bits { 0 => ARBRND_A::VALUE1, 1 => ARBRND_A::VALUE2, @@ -71,48 +42,52 @@ impl ARBRND_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "4 arbitration slots per round (tARB = 4 / fADCD)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ARBRND_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "8 arbitration slots per round (tARB = 8 / fADCD)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ARBRND_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "16 arbitration slots per round (tARB = 16 / fADCD)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ARBRND_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "20 arbitration slots per round (tARB = 20 / fADCD)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ARBRND_A::VALUE4 } } #[doc = "Field `ARBRND` writer - Arbitration Round Length"] -pub type ARBRND_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ARBCFG_SPEC, u8, ARBRND_A, 2, O>; -impl<'a, const O: u8> ARBRND_W<'a, O> { +pub type ARBRND_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ARBRND_A>; +impl<'a, REG> ARBRND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "4 arbitration slots per round (tARB = 4 / fADCD)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ARBRND_A::VALUE1) } #[doc = "8 arbitration slots per round (tARB = 8 / fADCD)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ARBRND_A::VALUE2) } #[doc = "16 arbitration slots per round (tARB = 16 / fADCD)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ARBRND_A::VALUE3) } #[doc = "20 arbitration slots per round (tARB = 20 / fADCD)"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ARBRND_A::VALUE4) } } @@ -135,39 +110,42 @@ impl From for bool { impl ARBM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ARBM_A { + pub const fn variant(&self) -> ARBM_A { match self.bits { false => ARBM_A::VALUE1, true => ARBM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[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)] pub fn is_value1(&self) -> bool { *self == ARBM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The arbiter only runs if at least one conversion request of an enabled request source is pending. This setting ensures a reproducible latency from an incoming request to the conversion start, if the converter is idle. Synchronized conversions are not supported."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ARBM_A::VALUE2 } } #[doc = "Field `ARBM` writer - Arbitration Mode"] -pub type ARBM_W<'a, const O: u8> = crate::BitWriter<'a, u32, ARBCFG_SPEC, ARBM_A, O>; -impl<'a, const O: u8> ARBM_W<'a, O> { +pub type ARBM_W<'a, REG> = crate::BitWriter<'a, REG, ARBM_A>; +impl<'a, REG> ARBM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[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)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ARBM_A::VALUE1) } #[doc = "The arbiter only runs if at least one conversion request of an enabled request source is pending. This setting ensures a reproducible latency from an incoming request to the conversion start, if the converter is idle. Synchronized conversions are not supported."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ARBM_A::VALUE2) } } #[doc = "Field `ANONS` reader - Analog Converter Control Status"] -pub type ANONS_R = crate::FieldReader; +pub type ANONS_R = crate::FieldReader; #[doc = "Analog Converter Control Status\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -183,22 +161,25 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ANONS_A { + type Ux = u8; +} impl ANONS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(ANONS_A::VALUE1), 3 => Some(ANONS_A::VALUE4), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Analog converter off"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ANONS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Normal operation (permanently on)"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ANONS_A::VALUE4 @@ -223,18 +204,18 @@ impl From for bool { impl CAL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CAL_A { + pub const fn variant(&self) -> CAL_A { match self.bits { false => CAL_A::VALUE1, true => CAL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Completed or not yet started"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CAL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Start-up calibration phase is active"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CAL_A::VALUE2 @@ -259,18 +240,18 @@ impl From for bool { impl BUSY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BUSY_A { + pub const fn variant(&self) -> BUSY_A { match self.bits { false => BUSY_A::VALUE1, true => BUSY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Not busy"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BUSY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Converter is busy with a conversion"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BUSY_A::VALUE2 @@ -295,18 +276,18 @@ impl From for bool { impl SAMPLE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SAMPLE_A { + pub const fn variant(&self) -> SAMPLE_A { match self.bits { false => SAMPLE_A::VALUE1, true => SAMPLE_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Converting or idle"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SAMPLE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Input signal is currently sampled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SAMPLE_A::VALUE2 @@ -353,40 +334,41 @@ impl W { #[doc = "Bits 0:1 - Analog Converter Control"] #[inline(always)] #[must_use] - pub fn anonc(&mut self) -> ANONC_W<0> { - ANONC_W::new(self) + pub fn anonc(&mut self) -> ANONC_W { + ANONC_W::new(self, 0) } #[doc = "Bits 4:5 - Arbitration Round Length"] #[inline(always)] #[must_use] - pub fn arbrnd(&mut self) -> ARBRND_W<4> { - ARBRND_W::new(self) + pub fn arbrnd(&mut self) -> ARBRND_W { + ARBRND_W::new(self, 4) } #[doc = "Bit 7 - Arbitration Mode"] #[inline(always)] #[must_use] - pub fn arbm(&mut self) -> ARBM_W<7> { - ARBM_W::new(self) + pub fn arbm(&mut self) -> ARBM_W { + ARBM_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Arbitration Configuration Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`arbcfg::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`arbcfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`arbcfg::R`](R) reader structure"] +impl crate::Readable for ARBCFG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`arbcfg::W`](W) writer structure"] impl crate::Writable for ARBCFG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/arbpr.rs b/src/vadc_g0/arbpr.rs index cd886627..1dd4d457 100644 --- a/src/vadc_g0/arbpr.rs +++ b/src/vadc_g0/arbpr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `PRIO0` reader - Priority of Request Source x"] -pub type PRIO0_R = crate::FieldReader; +pub type PRIO0_R = crate::FieldReader; #[doc = "Priority of Request Source x\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -51,38 +19,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PRIO0_A { + type Ux = u8; +} impl PRIO0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PRIO0_A::VALUE1), 3 => Some(PRIO0_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Lowest priority is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRIO0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Highest priority is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRIO0_A::VALUE2 } } #[doc = "Field `PRIO0` writer - Priority of Request Source x"] -pub type PRIO0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ARBPR_SPEC, u8, PRIO0_A, 2, O>; -impl<'a, const O: u8> PRIO0_W<'a, O> { +pub type PRIO0_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PRIO0_A>; +impl<'a, REG> PRIO0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Lowest priority is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRIO0_A::VALUE1) } #[doc = "Highest priority is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRIO0_A::VALUE2) } } @@ -105,39 +80,42 @@ impl From for bool { impl CSM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CSM0_A { + pub const fn variant(&self) -> CSM0_A { match self.bits { false => CSM0_A::VALUE1, true => CSM0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wait-for-start mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CSM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Cancel-inject-repeat mode, i.e. this source can cancel conversion of other sources."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CSM0_A::VALUE2 } } #[doc = "Field `CSM0` writer - Conversion Start Mode of Request Source x"] -pub type CSM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, ARBPR_SPEC, CSM0_A, O>; -impl<'a, const O: u8> CSM0_W<'a, O> { +pub type CSM0_W<'a, REG> = crate::BitWriter<'a, REG, CSM0_A>; +impl<'a, REG> CSM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wait-for-start mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CSM0_A::VALUE1) } #[doc = "Cancel-inject-repeat mode, i.e. this source can cancel conversion of other sources."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CSM0_A::VALUE2) } } #[doc = "Field `PRIO1` reader - Priority of Request Source x"] -pub type PRIO1_R = crate::FieldReader; +pub type PRIO1_R = crate::FieldReader; #[doc = "Priority of Request Source x\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -153,38 +131,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PRIO1_A { + type Ux = u8; +} impl PRIO1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PRIO1_A::VALUE1), 3 => Some(PRIO1_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Lowest priority is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRIO1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Highest priority is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRIO1_A::VALUE2 } } #[doc = "Field `PRIO1` writer - Priority of Request Source x"] -pub type PRIO1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ARBPR_SPEC, u8, PRIO1_A, 2, O>; -impl<'a, const O: u8> PRIO1_W<'a, O> { +pub type PRIO1_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PRIO1_A>; +impl<'a, REG> PRIO1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Lowest priority is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRIO1_A::VALUE1) } #[doc = "Highest priority is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRIO1_A::VALUE2) } } @@ -207,39 +192,42 @@ impl From for bool { impl CSM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CSM1_A { + pub const fn variant(&self) -> CSM1_A { match self.bits { false => CSM1_A::VALUE1, true => CSM1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wait-for-start mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CSM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Cancel-inject-repeat mode, i.e. this source can cancel conversion of other sources."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CSM1_A::VALUE2 } } #[doc = "Field `CSM1` writer - Conversion Start Mode of Request Source x"] -pub type CSM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, ARBPR_SPEC, CSM1_A, O>; -impl<'a, const O: u8> CSM1_W<'a, O> { +pub type CSM1_W<'a, REG> = crate::BitWriter<'a, REG, CSM1_A>; +impl<'a, REG> CSM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wait-for-start mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CSM1_A::VALUE1) } #[doc = "Cancel-inject-repeat mode, i.e. this source can cancel conversion of other sources."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CSM1_A::VALUE2) } } #[doc = "Field `PRIO2` reader - Priority of Request Source x"] -pub type PRIO2_R = crate::FieldReader; +pub type PRIO2_R = crate::FieldReader; #[doc = "Priority of Request Source x\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -255,38 +243,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for PRIO2_A { + type Ux = u8; +} impl PRIO2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(PRIO2_A::VALUE1), 3 => Some(PRIO2_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Lowest priority is selected."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == PRIO2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Highest priority is selected."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == PRIO2_A::VALUE2 } } #[doc = "Field `PRIO2` writer - Priority of Request Source x"] -pub type PRIO2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ARBPR_SPEC, u8, PRIO2_A, 2, O>; -impl<'a, const O: u8> PRIO2_W<'a, O> { +pub type PRIO2_W<'a, REG> = crate::FieldWriter<'a, REG, 2, PRIO2_A>; +impl<'a, REG> PRIO2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Lowest priority is selected."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(PRIO2_A::VALUE1) } #[doc = "Highest priority is selected."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(PRIO2_A::VALUE2) } } @@ -309,34 +304,37 @@ impl From for bool { impl CSM2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CSM2_A { + pub const fn variant(&self) -> CSM2_A { match self.bits { false => CSM2_A::VALUE1, true => CSM2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Wait-for-start mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CSM2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Cancel-inject-repeat mode, i.e. this source can cancel conversion of other sources."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CSM2_A::VALUE2 } } #[doc = "Field `CSM2` writer - Conversion Start Mode of Request Source x"] -pub type CSM2_W<'a, const O: u8> = crate::BitWriter<'a, u32, ARBPR_SPEC, CSM2_A, O>; -impl<'a, const O: u8> CSM2_W<'a, O> { +pub type CSM2_W<'a, REG> = crate::BitWriter<'a, REG, CSM2_A>; +impl<'a, REG> CSM2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Wait-for-start mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CSM2_A::VALUE1) } #[doc = "Cancel-inject-repeat mode, i.e. this source can cancel conversion of other sources."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CSM2_A::VALUE2) } } @@ -359,34 +357,37 @@ impl From for bool { impl ASEN0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASEN0_A { + pub const fn variant(&self) -> ASEN0_A { match self.bits { false => ASEN0_A::VALUE1, true => ASEN0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASEN0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The corresponding arbitration slot is enabled. Pending conversion requests from the associated request source are arbitrated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASEN0_A::VALUE2 } } #[doc = "Field `ASEN0` writer - Arbitration Slot 0 Enable"] -pub type ASEN0_W<'a, const O: u8> = crate::BitWriter<'a, u32, ARBPR_SPEC, ASEN0_A, O>; -impl<'a, const O: u8> ASEN0_W<'a, O> { +pub type ASEN0_W<'a, REG> = crate::BitWriter<'a, REG, ASEN0_A>; +impl<'a, REG> ASEN0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASEN0_A::VALUE1) } #[doc = "The corresponding arbitration slot is enabled. Pending conversion requests from the associated request source are arbitrated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASEN0_A::VALUE2) } } @@ -409,34 +410,37 @@ impl From for bool { impl ASEN1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASEN1_A { + pub const fn variant(&self) -> ASEN1_A { match self.bits { false => ASEN1_A::VALUE1, true => ASEN1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASEN1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The corresponding arbitration slot is enabled. Pending conversion requests from the associated request source are arbitrated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASEN1_A::VALUE2 } } #[doc = "Field `ASEN1` writer - Arbitration Slot 1 Enable"] -pub type ASEN1_W<'a, const O: u8> = crate::BitWriter<'a, u32, ARBPR_SPEC, ASEN1_A, O>; -impl<'a, const O: u8> ASEN1_W<'a, O> { +pub type ASEN1_W<'a, REG> = crate::BitWriter<'a, REG, ASEN1_A>; +impl<'a, REG> ASEN1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASEN1_A::VALUE1) } #[doc = "The corresponding arbitration slot is enabled. Pending conversion requests from the associated request source are arbitrated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASEN1_A::VALUE2) } } @@ -459,34 +463,37 @@ impl From for bool { impl ASEN2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASEN2_A { + pub const fn variant(&self) -> ASEN2_A { match self.bits { false => ASEN2_A::VALUE1, true => ASEN2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASEN2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The corresponding arbitration slot is enabled. Pending conversion requests from the associated request source are arbitrated."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASEN2_A::VALUE2 } } #[doc = "Field `ASEN2` writer - Arbitration Slot 2 Enable"] -pub type ASEN2_W<'a, const O: u8> = crate::BitWriter<'a, u32, ARBPR_SPEC, ASEN2_A, O>; -impl<'a, const O: u8> ASEN2_W<'a, O> { +pub type ASEN2_W<'a, REG> = crate::BitWriter<'a, REG, ASEN2_A>; +impl<'a, REG> ASEN2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "The corresponding arbitration slot is disabled and considered as empty. Pending conversion requests from the associated request source are disregarded."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASEN2_A::VALUE1) } #[doc = "The corresponding arbitration slot is enabled. Pending conversion requests from the associated request source are arbitrated."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASEN2_A::VALUE2) } } @@ -541,76 +548,77 @@ impl W { #[doc = "Bits 0:1 - Priority of Request Source x"] #[inline(always)] #[must_use] - pub fn prio0(&mut self) -> PRIO0_W<0> { - PRIO0_W::new(self) + pub fn prio0(&mut self) -> PRIO0_W { + PRIO0_W::new(self, 0) } #[doc = "Bit 3 - Conversion Start Mode of Request Source x"] #[inline(always)] #[must_use] - pub fn csm0(&mut self) -> CSM0_W<3> { - CSM0_W::new(self) + pub fn csm0(&mut self) -> CSM0_W { + CSM0_W::new(self, 3) } #[doc = "Bits 4:5 - Priority of Request Source x"] #[inline(always)] #[must_use] - pub fn prio1(&mut self) -> PRIO1_W<4> { - PRIO1_W::new(self) + pub fn prio1(&mut self) -> PRIO1_W { + PRIO1_W::new(self, 4) } #[doc = "Bit 7 - Conversion Start Mode of Request Source x"] #[inline(always)] #[must_use] - pub fn csm1(&mut self) -> CSM1_W<7> { - CSM1_W::new(self) + pub fn csm1(&mut self) -> CSM1_W { + CSM1_W::new(self, 7) } #[doc = "Bits 8:9 - Priority of Request Source x"] #[inline(always)] #[must_use] - pub fn prio2(&mut self) -> PRIO2_W<8> { - PRIO2_W::new(self) + pub fn prio2(&mut self) -> PRIO2_W { + PRIO2_W::new(self, 8) } #[doc = "Bit 11 - Conversion Start Mode of Request Source x"] #[inline(always)] #[must_use] - pub fn csm2(&mut self) -> CSM2_W<11> { - CSM2_W::new(self) + pub fn csm2(&mut self) -> CSM2_W { + CSM2_W::new(self, 11) } #[doc = "Bit 24 - Arbitration Slot 0 Enable"] #[inline(always)] #[must_use] - pub fn asen0(&mut self) -> ASEN0_W<24> { - ASEN0_W::new(self) + pub fn asen0(&mut self) -> ASEN0_W { + ASEN0_W::new(self, 24) } #[doc = "Bit 25 - Arbitration Slot 1 Enable"] #[inline(always)] #[must_use] - pub fn asen1(&mut self) -> ASEN1_W<25> { - ASEN1_W::new(self) + pub fn asen1(&mut self) -> ASEN1_W { + ASEN1_W::new(self, 25) } #[doc = "Bit 26 - Arbitration Slot 2 Enable"] #[inline(always)] #[must_use] - pub fn asen2(&mut self) -> ASEN2_W<26> { - ASEN2_W::new(self) + pub fn asen2(&mut self) -> ASEN2_W { + ASEN2_W::new(self, 26) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Arbitration Priority Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`arbpr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`arbpr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`arbpr::R`](R) reader structure"] +impl crate::Readable for ARBPR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`arbpr::W`](W) writer structure"] impl crate::Writable for ARBPR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/asctrl.rs b/src/vadc_g0/asctrl.rs index cd539fd0..63827991 100644 --- a/src/vadc_g0/asctrl.rs +++ b/src/vadc_g0/asctrl.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SRCRESREG` reader - Source-specific Result Register"] -pub type SRCRESREG_R = crate::FieldReader; +pub type SRCRESREG_R = crate::FieldReader; #[doc = "Source-specific Result Register\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRCRESREG_A { + type Ux = u8; +} impl SRCRESREG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRCRESREG_A::VALUE1), 1 => Some(SRCRESREG_A::VALUE2), @@ -64,49 +35,53 @@ impl SRCRESREG_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use GxCHCTRy.RESREG to select a group result register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRCRESREG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Store result in group result register GxRES1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRCRESREG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Store result in group result register GxRES15"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SRCRESREG_A::VALUE3 } } #[doc = "Field `SRCRESREG` writer - Source-specific Result Register"] -pub type SRCRESREG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ASCTRL_SPEC, u8, SRCRESREG_A, 4, O>; -impl<'a, const O: u8> SRCRESREG_W<'a, O> { +pub type SRCRESREG_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SRCRESREG_A>; +impl<'a, REG> SRCRESREG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Use GxCHCTRy.RESREG to select a group result register"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE1) } #[doc = "Store result in group result register GxRES1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE2) } #[doc = "Store result in group result register GxRES15"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE3) } } #[doc = "Field `XTSEL` reader - External Trigger Input Selection"] -pub type XTSEL_R = crate::FieldReader; +pub type XTSEL_R = crate::FieldReader; #[doc = "Field `XTSEL` writer - External Trigger Input Selection"] -pub type XTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ASCTRL_SPEC, u8, u8, 4, O>; +pub type XTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `XTLVL` reader - External Trigger Level"] -pub type XTLVL_R = crate::BitReader; +pub type XTLVL_R = crate::BitReader; #[doc = "Field `XTMODE` reader - Trigger Operating Mode"] -pub type XTMODE_R = crate::FieldReader; +pub type XTMODE_R = crate::FieldReader; #[doc = "Trigger Operating Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -126,10 +101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for XTMODE_A { + type Ux = u8; +} impl XTMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XTMODE_A { + pub const fn variant(&self) -> XTMODE_A { match self.bits { 0 => XTMODE_A::VALUE1, 1 => XTMODE_A::VALUE2, @@ -138,48 +116,52 @@ impl XTMODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No external trigger"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XTMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger event upon a falling edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XTMODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Trigger event upon a rising edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == XTMODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Trigger event upon any edge"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == XTMODE_A::VALUE4 } } #[doc = "Field `XTMODE` writer - Trigger Operating Mode"] -pub type XTMODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ASCTRL_SPEC, u8, XTMODE_A, 2, O>; -impl<'a, const O: u8> XTMODE_W<'a, O> { +pub type XTMODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, XTMODE_A>; +impl<'a, REG> XTMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No external trigger"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE1) } #[doc = "Trigger event upon a falling edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE2) } #[doc = "Trigger event upon a rising edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE3) } #[doc = "Trigger event upon any edge"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE4) } } @@ -198,25 +180,28 @@ impl From for bool { } } #[doc = "Field `XTWC` writer - Write Control for Trigger Configuration"] -pub type XTWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASCTRL_SPEC, XTWC_AW, O>; -impl<'a, const O: u8> XTWC_W<'a, O> { +pub type XTWC_W<'a, REG> = crate::BitWriter<'a, REG, XTWC_AW>; +impl<'a, REG> XTWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to trigger configuration"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XTWC_AW::VALUE1) } #[doc = "Bitfields XTMODE and XTSEL can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XTWC_AW::VALUE2) } } #[doc = "Field `GTSEL` reader - Gate Input Selection"] -pub type GTSEL_R = crate::FieldReader; +pub type GTSEL_R = crate::FieldReader; #[doc = "Field `GTSEL` writer - Gate Input Selection"] -pub type GTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ASCTRL_SPEC, u8, u8, 4, O>; +pub type GTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `GTLVL` reader - Gate Input Level"] -pub type GTLVL_R = crate::BitReader; +pub type GTLVL_R = crate::BitReader; #[doc = "Write Control for Gate Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum GTWC_AW { @@ -232,16 +217,19 @@ impl From for bool { } } #[doc = "Field `GTWC` writer - Write Control for Gate Configuration"] -pub type GTWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASCTRL_SPEC, GTWC_AW, O>; -impl<'a, const O: u8> GTWC_W<'a, O> { +pub type GTWC_W<'a, REG> = crate::BitWriter<'a, REG, GTWC_AW>; +impl<'a, REG> GTWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to gate configuration"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GTWC_AW::VALUE1) } #[doc = "Bitfield GTSEL can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GTWC_AW::VALUE2) } } @@ -264,34 +252,37 @@ impl From for bool { impl TMEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TMEN_A { + pub const fn variant(&self) -> TMEN_A { match self.bits { false => TMEN_A::VALUE1, true => TMEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No timer mode: standard gating mechanism can be used"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TMEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer mode for equidistant sampling enabled: standard gating mechanism must be disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TMEN_A::VALUE2 } } #[doc = "Field `TMEN` writer - Timer Mode Enable"] -pub type TMEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASCTRL_SPEC, TMEN_A, O>; -impl<'a, const O: u8> TMEN_W<'a, O> { +pub type TMEN_W<'a, REG> = crate::BitWriter<'a, REG, TMEN_A>; +impl<'a, REG> TMEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No timer mode: standard gating mechanism can be used"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TMEN_A::VALUE1) } #[doc = "Timer mode for equidistant sampling enabled: standard gating mechanism must be disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TMEN_A::VALUE2) } } @@ -310,16 +301,19 @@ impl From for bool { } } #[doc = "Field `TMWC` writer - Write Control for Timer Mode"] -pub type TMWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASCTRL_SPEC, TMWC_AW, O>; -impl<'a, const O: u8> TMWC_W<'a, O> { +pub type TMWC_W<'a, REG> = crate::BitWriter<'a, REG, TMWC_AW>; +impl<'a, REG> TMWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to timer mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TMWC_AW::VALUE1) } #[doc = "Bitfield TMEN can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TMWC_AW::VALUE2) } } @@ -364,70 +358,71 @@ impl W { #[doc = "Bits 0:3 - Source-specific Result Register"] #[inline(always)] #[must_use] - pub fn srcresreg(&mut self) -> SRCRESREG_W<0> { - SRCRESREG_W::new(self) + pub fn srcresreg(&mut self) -> SRCRESREG_W { + SRCRESREG_W::new(self, 0) } #[doc = "Bits 8:11 - External Trigger Input Selection"] #[inline(always)] #[must_use] - pub fn xtsel(&mut self) -> XTSEL_W<8> { - XTSEL_W::new(self) + pub fn xtsel(&mut self) -> XTSEL_W { + XTSEL_W::new(self, 8) } #[doc = "Bits 13:14 - Trigger Operating Mode"] #[inline(always)] #[must_use] - pub fn xtmode(&mut self) -> XTMODE_W<13> { - XTMODE_W::new(self) + pub fn xtmode(&mut self) -> XTMODE_W { + XTMODE_W::new(self, 13) } #[doc = "Bit 15 - Write Control for Trigger Configuration"] #[inline(always)] #[must_use] - pub fn xtwc(&mut self) -> XTWC_W<15> { - XTWC_W::new(self) + pub fn xtwc(&mut self) -> XTWC_W { + XTWC_W::new(self, 15) } #[doc = "Bits 16:19 - Gate Input Selection"] #[inline(always)] #[must_use] - pub fn gtsel(&mut self) -> GTSEL_W<16> { - GTSEL_W::new(self) + pub fn gtsel(&mut self) -> GTSEL_W { + GTSEL_W::new(self, 16) } #[doc = "Bit 23 - Write Control for Gate Configuration"] #[inline(always)] #[must_use] - pub fn gtwc(&mut self) -> GTWC_W<23> { - GTWC_W::new(self) + pub fn gtwc(&mut self) -> GTWC_W { + GTWC_W::new(self, 23) } #[doc = "Bit 28 - Timer Mode Enable"] #[inline(always)] #[must_use] - pub fn tmen(&mut self) -> TMEN_W<28> { - TMEN_W::new(self) + pub fn tmen(&mut self) -> TMEN_W { + TMEN_W::new(self, 28) } #[doc = "Bit 31 - Write Control for Timer Mode"] #[inline(always)] #[must_use] - pub fn tmwc(&mut self) -> TMWC_W<31> { - TMWC_W::new(self) + pub fn tmwc(&mut self) -> TMWC_W { + TMWC_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Autoscan Source Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`asctrl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`asctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`asctrl::R`](R) reader structure"] +impl crate::Readable for ASCTRL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`asctrl::W`](W) writer structure"] impl crate::Writable for ASCTRL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/asmr.rs b/src/vadc_g0/asmr.rs index 162a2bf3..1025cef0 100644 --- a/src/vadc_g0/asmr.rs +++ b/src/vadc_g0/asmr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENGT` reader - Enable Gate"] -pub type ENGT_R = crate::FieldReader; +pub type ENGT_R = crate::FieldReader; #[doc = "Enable Gate\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ENGT_A { + type Ux = u8; +} impl ENGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENGT_A { + pub const fn variant(&self) -> ENGT_A { match self.bits { 0 => ENGT_A::VALUE1, 1 => ENGT_A::VALUE2, @@ -67,48 +38,52 @@ impl ENGT_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No conversion requests are issued"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Conversion requests are issued if at least one pending bit is set"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENGT_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Conversion requests are issued if at least one pending bit is set and REQGTx = 1."] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ENGT_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Conversion requests are issued if at least one pending bit is set and REQGTx = 0."] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ENGT_A::VALUE4 } } #[doc = "Field `ENGT` writer - Enable Gate"] -pub type ENGT_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, ASMR_SPEC, u8, ENGT_A, 2, O>; -impl<'a, const O: u8> ENGT_W<'a, O> { +pub type ENGT_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ENGT_A>; +impl<'a, REG> ENGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No conversion requests are issued"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE1) } #[doc = "Conversion requests are issued if at least one pending bit is set"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE2) } #[doc = "Conversion requests are issued if at least one pending bit is set and REQGTx = 1."] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE3) } #[doc = "Conversion requests are issued if at least one pending bit is set and REQGTx = 0."] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE4) } } @@ -131,34 +106,37 @@ impl From for bool { impl ENTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENTR_A { + pub const fn variant(&self) -> ENTR_A { match self.bits { false => ENTR_A::VALUE1, true => ENTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External trigger disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The selected edge at the selected trigger input signal REQTR generates the load event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENTR_A::VALUE2 } } #[doc = "Field `ENTR` writer - Enable External Trigger"] -pub type ENTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASMR_SPEC, ENTR_A, O>; -impl<'a, const O: u8> ENTR_W<'a, O> { +pub type ENTR_W<'a, REG> = crate::BitWriter<'a, REG, ENTR_A>; +impl<'a, REG> ENTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External trigger disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENTR_A::VALUE1) } #[doc = "The selected edge at the selected trigger input signal REQTR generates the load event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENTR_A::VALUE2) } } @@ -181,34 +159,37 @@ impl From for bool { impl ENSI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENSI_A { + pub const fn variant(&self) -> ENSI_A { match self.bits { false => ENSI_A::VALUE1, true => ENSI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No request source interrupt"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENSI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A request source interrupt is generated upon a request source event (last pending conversion is finished)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENSI_A::VALUE2 } } #[doc = "Field `ENSI` writer - Enable Source Interrupt"] -pub type ENSI_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASMR_SPEC, ENSI_A, O>; -impl<'a, const O: u8> ENSI_W<'a, O> { +pub type ENSI_W<'a, REG> = crate::BitWriter<'a, REG, ENSI_A>; +impl<'a, REG> ENSI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No request source interrupt"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENSI_A::VALUE1) } #[doc = "A request source interrupt is generated upon a request source event (last pending conversion is finished)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENSI_A::VALUE2) } } @@ -231,34 +212,37 @@ impl From for bool { impl SCAN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SCAN_A { + pub const fn variant(&self) -> SCAN_A { match self.bits { false => SCAN_A::VALUE1, true => SCAN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No autoscan"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SCAN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Autoscan functionality enabled: a request source event automatically generates a load event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SCAN_A::VALUE2 } } #[doc = "Field `SCAN` writer - Autoscan Enable"] -pub type SCAN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASMR_SPEC, SCAN_A, O>; -impl<'a, const O: u8> SCAN_W<'a, O> { +pub type SCAN_W<'a, REG> = crate::BitWriter<'a, REG, SCAN_A>; +impl<'a, REG> SCAN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No autoscan"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SCAN_A::VALUE1) } #[doc = "Autoscan functionality enabled: a request source event automatically generates a load event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SCAN_A::VALUE2) } } @@ -281,34 +265,37 @@ impl From for bool { impl LDM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> LDM_A { + pub const fn variant(&self) -> LDM_A { match self.bits { false => LDM_A::VALUE1, true => LDM_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Overwrite mode: Copy all bits from the select registers to the pending registers upon a load event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == LDM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Combine mode: Set all pending bits that are set in the select registers upon a load event (logic OR)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == LDM_A::VALUE2 } } #[doc = "Field `LDM` writer - Autoscan Source Load Event Mode"] -pub type LDM_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASMR_SPEC, LDM_A, O>; -impl<'a, const O: u8> LDM_W<'a, O> { +pub type LDM_W<'a, REG> = crate::BitWriter<'a, REG, LDM_A>; +impl<'a, REG> LDM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Overwrite mode: Copy all bits from the select registers to the pending registers upon a load event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LDM_A::VALUE1) } #[doc = "Combine mode: Set all pending bits that are set in the select registers upon a load event (logic OR)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LDM_A::VALUE2) } } @@ -331,18 +318,18 @@ impl From for bool { impl REQGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REQGT_A { + pub const fn variant(&self) -> REQGT_A { match self.bits { false => REQGT_A::VALUE1, true => REQGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The gate input is low"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REQGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The gate input is high"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REQGT_A::VALUE2 @@ -363,16 +350,19 @@ impl From for bool { } } #[doc = "Field `CLRPND` writer - Clear Pending Bits"] -pub type CLRPND_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASMR_SPEC, CLRPND_AW, O>; -impl<'a, const O: u8> CLRPND_W<'a, O> { +pub type CLRPND_W<'a, REG> = crate::BitWriter<'a, REG, CLRPND_AW>; +impl<'a, REG> CLRPND_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CLRPND_AW::VALUE1) } #[doc = "The bits in register GxASPNDx are cleared"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CLRPND_AW::VALUE2) } } @@ -391,16 +381,19 @@ impl From for bool { } } #[doc = "Field `LDEV` writer - Generate Load Event"] -pub type LDEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASMR_SPEC, LDEV_AW, O>; -impl<'a, const O: u8> LDEV_W<'a, O> { +pub type LDEV_W<'a, REG> = crate::BitWriter<'a, REG, LDEV_AW>; +impl<'a, REG> LDEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(LDEV_AW::VALUE1) } #[doc = "A load event is generated"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(LDEV_AW::VALUE2) } } @@ -423,34 +416,37 @@ impl From for bool { impl RPTDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RPTDIS_A { + pub const fn variant(&self) -> RPTDIS_A { match self.bits { false => RPTDIS_A::VALUE1, true => RPTDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A cancelled conversion is repeated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RPTDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A cancelled conversion is discarded"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RPTDIS_A::VALUE2 } } #[doc = "Field `RPTDIS` writer - Repeat Disable"] -pub type RPTDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASMR_SPEC, RPTDIS_A, O>; -impl<'a, const O: u8> RPTDIS_W<'a, O> { +pub type RPTDIS_W<'a, REG> = crate::BitWriter<'a, REG, RPTDIS_A>; +impl<'a, REG> RPTDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A cancelled conversion is repeated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RPTDIS_A::VALUE1) } #[doc = "A cancelled conversion is discarded"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RPTDIS_A::VALUE2) } } @@ -495,70 +491,71 @@ impl W { #[doc = "Bits 0:1 - Enable Gate"] #[inline(always)] #[must_use] - pub fn engt(&mut self) -> ENGT_W<0> { - ENGT_W::new(self) + pub fn engt(&mut self) -> ENGT_W { + ENGT_W::new(self, 0) } #[doc = "Bit 2 - Enable External Trigger"] #[inline(always)] #[must_use] - pub fn entr(&mut self) -> ENTR_W<2> { - ENTR_W::new(self) + pub fn entr(&mut self) -> ENTR_W { + ENTR_W::new(self, 2) } #[doc = "Bit 3 - Enable Source Interrupt"] #[inline(always)] #[must_use] - pub fn ensi(&mut self) -> ENSI_W<3> { - ENSI_W::new(self) + pub fn ensi(&mut self) -> ENSI_W { + ENSI_W::new(self, 3) } #[doc = "Bit 4 - Autoscan Enable"] #[inline(always)] #[must_use] - pub fn scan(&mut self) -> SCAN_W<4> { - SCAN_W::new(self) + pub fn scan(&mut self) -> SCAN_W { + SCAN_W::new(self, 4) } #[doc = "Bit 5 - Autoscan Source Load Event Mode"] #[inline(always)] #[must_use] - pub fn ldm(&mut self) -> LDM_W<5> { - LDM_W::new(self) + pub fn ldm(&mut self) -> LDM_W { + LDM_W::new(self, 5) } #[doc = "Bit 8 - Clear Pending Bits"] #[inline(always)] #[must_use] - pub fn clrpnd(&mut self) -> CLRPND_W<8> { - CLRPND_W::new(self) + pub fn clrpnd(&mut self) -> CLRPND_W { + CLRPND_W::new(self, 8) } #[doc = "Bit 9 - Generate Load Event"] #[inline(always)] #[must_use] - pub fn ldev(&mut self) -> LDEV_W<9> { - LDEV_W::new(self) + pub fn ldev(&mut self) -> LDEV_W { + LDEV_W::new(self, 9) } #[doc = "Bit 16 - Repeat Disable"] #[inline(always)] #[must_use] - pub fn rptdis(&mut self) -> RPTDIS_W<16> { - RPTDIS_W::new(self) + pub fn rptdis(&mut self) -> RPTDIS_W { + RPTDIS_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Autoscan Source Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`asmr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`asmr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`asmr::R`](R) reader structure"] +impl crate::Readable for ASMR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`asmr::W`](W) writer structure"] impl crate::Writable for ASMR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/aspnd.rs b/src/vadc_g0/aspnd.rs index feaaa7d1..c0b5a90e 100644 --- a/src/vadc_g0/aspnd.rs +++ b/src/vadc_g0/aspnd.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CHPND0` reader - Channels Pending"] pub type CHPND0_R = crate::BitReader; #[doc = "Channels Pending\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CHPND0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPND0_A { + pub const fn variant(&self) -> CHPND0_A { match self.bits { false => CHPND0_A::VALUE1, true => CHPND0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPND0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPND0_A::VALUE2 } } #[doc = "Field `CHPND0` writer - Channels Pending"] -pub type CHPND0_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASPND_SPEC, CHPND0_A, O>; -impl<'a, const O: u8> CHPND0_W<'a, O> { +pub type CHPND0_W<'a, REG> = crate::BitWriter<'a, REG, CHPND0_A>; +impl<'a, REG> CHPND0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPND0_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPND0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CHPND1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPND1_A { + pub const fn variant(&self) -> CHPND1_A { match self.bits { false => CHPND1_A::VALUE1, true => CHPND1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPND1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPND1_A::VALUE2 } } #[doc = "Field `CHPND1` writer - Channels Pending"] -pub type CHPND1_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASPND_SPEC, CHPND1_A, O>; -impl<'a, const O: u8> CHPND1_W<'a, O> { +pub type CHPND1_W<'a, REG> = crate::BitWriter<'a, REG, CHPND1_A>; +impl<'a, REG> CHPND1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPND1_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPND1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CHPND2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPND2_A { + pub const fn variant(&self) -> CHPND2_A { match self.bits { false => CHPND2_A::VALUE1, true => CHPND2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPND2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPND2_A::VALUE2 } } #[doc = "Field `CHPND2` writer - Channels Pending"] -pub type CHPND2_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASPND_SPEC, CHPND2_A, O>; -impl<'a, const O: u8> CHPND2_W<'a, O> { +pub type CHPND2_W<'a, REG> = crate::BitWriter<'a, REG, CHPND2_A>; +impl<'a, REG> CHPND2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPND2_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPND2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CHPND3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPND3_A { + pub const fn variant(&self) -> CHPND3_A { match self.bits { false => CHPND3_A::VALUE1, true => CHPND3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPND3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPND3_A::VALUE2 } } #[doc = "Field `CHPND3` writer - Channels Pending"] -pub type CHPND3_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASPND_SPEC, CHPND3_A, O>; -impl<'a, const O: u8> CHPND3_W<'a, O> { +pub type CHPND3_W<'a, REG> = crate::BitWriter<'a, REG, CHPND3_A>; +impl<'a, REG> CHPND3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPND3_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPND3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CHPND4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPND4_A { + pub const fn variant(&self) -> CHPND4_A { match self.bits { false => CHPND4_A::VALUE1, true => CHPND4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPND4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPND4_A::VALUE2 } } #[doc = "Field `CHPND4` writer - Channels Pending"] -pub type CHPND4_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASPND_SPEC, CHPND4_A, O>; -impl<'a, const O: u8> CHPND4_W<'a, O> { +pub type CHPND4_W<'a, REG> = crate::BitWriter<'a, REG, CHPND4_A>; +impl<'a, REG> CHPND4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPND4_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPND4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CHPND5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPND5_A { + pub const fn variant(&self) -> CHPND5_A { match self.bits { false => CHPND5_A::VALUE1, true => CHPND5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPND5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPND5_A::VALUE2 } } #[doc = "Field `CHPND5` writer - Channels Pending"] -pub type CHPND5_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASPND_SPEC, CHPND5_A, O>; -impl<'a, const O: u8> CHPND5_W<'a, O> { +pub type CHPND5_W<'a, REG> = crate::BitWriter<'a, REG, CHPND5_A>; +impl<'a, REG> CHPND5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPND5_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPND5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CHPND6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPND6_A { + pub const fn variant(&self) -> CHPND6_A { match self.bits { false => CHPND6_A::VALUE1, true => CHPND6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPND6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPND6_A::VALUE2 } } #[doc = "Field `CHPND6` writer - Channels Pending"] -pub type CHPND6_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASPND_SPEC, CHPND6_A, O>; -impl<'a, const O: u8> CHPND6_W<'a, O> { +pub type CHPND6_W<'a, REG> = crate::BitWriter<'a, REG, CHPND6_A>; +impl<'a, REG> CHPND6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPND6_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPND6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CHPND7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHPND7_A { + pub const fn variant(&self) -> CHPND7_A { match self.bits { false => CHPND7_A::VALUE1, true => CHPND7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHPND7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request conversion of this channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHPND7_A::VALUE2 } } #[doc = "Field `CHPND7` writer - Channels Pending"] -pub type CHPND7_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASPND_SPEC, CHPND7_A, O>; -impl<'a, const O: u8> CHPND7_W<'a, O> { +pub type CHPND7_W<'a, REG> = crate::BitWriter<'a, REG, CHPND7_A>; +impl<'a, REG> CHPND7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHPND7_A::VALUE1) } #[doc = "Request conversion of this channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHPND7_A::VALUE2) } } @@ -480,70 +472,71 @@ impl W { #[doc = "Bit 0 - Channels Pending"] #[inline(always)] #[must_use] - pub fn chpnd0(&mut self) -> CHPND0_W<0> { - CHPND0_W::new(self) + pub fn chpnd0(&mut self) -> CHPND0_W { + CHPND0_W::new(self, 0) } #[doc = "Bit 1 - Channels Pending"] #[inline(always)] #[must_use] - pub fn chpnd1(&mut self) -> CHPND1_W<1> { - CHPND1_W::new(self) + pub fn chpnd1(&mut self) -> CHPND1_W { + CHPND1_W::new(self, 1) } #[doc = "Bit 2 - Channels Pending"] #[inline(always)] #[must_use] - pub fn chpnd2(&mut self) -> CHPND2_W<2> { - CHPND2_W::new(self) + pub fn chpnd2(&mut self) -> CHPND2_W { + CHPND2_W::new(self, 2) } #[doc = "Bit 3 - Channels Pending"] #[inline(always)] #[must_use] - pub fn chpnd3(&mut self) -> CHPND3_W<3> { - CHPND3_W::new(self) + pub fn chpnd3(&mut self) -> CHPND3_W { + CHPND3_W::new(self, 3) } #[doc = "Bit 4 - Channels Pending"] #[inline(always)] #[must_use] - pub fn chpnd4(&mut self) -> CHPND4_W<4> { - CHPND4_W::new(self) + pub fn chpnd4(&mut self) -> CHPND4_W { + CHPND4_W::new(self, 4) } #[doc = "Bit 5 - Channels Pending"] #[inline(always)] #[must_use] - pub fn chpnd5(&mut self) -> CHPND5_W<5> { - CHPND5_W::new(self) + pub fn chpnd5(&mut self) -> CHPND5_W { + CHPND5_W::new(self, 5) } #[doc = "Bit 6 - Channels Pending"] #[inline(always)] #[must_use] - pub fn chpnd6(&mut self) -> CHPND6_W<6> { - CHPND6_W::new(self) + pub fn chpnd6(&mut self) -> CHPND6_W { + CHPND6_W::new(self, 6) } #[doc = "Bit 7 - Channels Pending"] #[inline(always)] #[must_use] - pub fn chpnd7(&mut self) -> CHPND7_W<7> { - CHPND7_W::new(self) + pub fn chpnd7(&mut self) -> CHPND7_W { + CHPND7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Autoscan Source Pending Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`aspnd::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`aspnd::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`aspnd::R`](R) reader structure"] +impl crate::Readable for ASPND_SPEC {} +#[doc = "`write(|w| ..)` method takes [`aspnd::W`](W) writer structure"] impl crate::Writable for ASPND_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/assel.rs b/src/vadc_g0/assel.rs index 22757429..d4e6b163 100644 --- a/src/vadc_g0/assel.rs +++ b/src/vadc_g0/assel.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CHSEL0` reader - Channel Selection"] pub type CHSEL0_R = crate::BitReader; #[doc = "Channel Selection\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CHSEL0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSEL0_A { + pub const fn variant(&self) -> CHSEL0_A { match self.bits { false => CHSEL0_A::VALUE1, true => CHSEL0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSEL0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSEL0_A::VALUE2 } } #[doc = "Field `CHSEL0` writer - Channel Selection"] -pub type CHSEL0_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASSEL_SPEC, CHSEL0_A, O>; -impl<'a, const O: u8> CHSEL0_W<'a, O> { +pub type CHSEL0_W<'a, REG> = crate::BitWriter<'a, REG, CHSEL0_A>; +impl<'a, REG> CHSEL0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSEL0_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSEL0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CHSEL1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSEL1_A { + pub const fn variant(&self) -> CHSEL1_A { match self.bits { false => CHSEL1_A::VALUE1, true => CHSEL1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSEL1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSEL1_A::VALUE2 } } #[doc = "Field `CHSEL1` writer - Channel Selection"] -pub type CHSEL1_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASSEL_SPEC, CHSEL1_A, O>; -impl<'a, const O: u8> CHSEL1_W<'a, O> { +pub type CHSEL1_W<'a, REG> = crate::BitWriter<'a, REG, CHSEL1_A>; +impl<'a, REG> CHSEL1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSEL1_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSEL1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CHSEL2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSEL2_A { + pub const fn variant(&self) -> CHSEL2_A { match self.bits { false => CHSEL2_A::VALUE1, true => CHSEL2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSEL2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSEL2_A::VALUE2 } } #[doc = "Field `CHSEL2` writer - Channel Selection"] -pub type CHSEL2_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASSEL_SPEC, CHSEL2_A, O>; -impl<'a, const O: u8> CHSEL2_W<'a, O> { +pub type CHSEL2_W<'a, REG> = crate::BitWriter<'a, REG, CHSEL2_A>; +impl<'a, REG> CHSEL2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSEL2_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSEL2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CHSEL3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSEL3_A { + pub const fn variant(&self) -> CHSEL3_A { match self.bits { false => CHSEL3_A::VALUE1, true => CHSEL3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSEL3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSEL3_A::VALUE2 } } #[doc = "Field `CHSEL3` writer - Channel Selection"] -pub type CHSEL3_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASSEL_SPEC, CHSEL3_A, O>; -impl<'a, const O: u8> CHSEL3_W<'a, O> { +pub type CHSEL3_W<'a, REG> = crate::BitWriter<'a, REG, CHSEL3_A>; +impl<'a, REG> CHSEL3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSEL3_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSEL3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CHSEL4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSEL4_A { + pub const fn variant(&self) -> CHSEL4_A { match self.bits { false => CHSEL4_A::VALUE1, true => CHSEL4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSEL4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSEL4_A::VALUE2 } } #[doc = "Field `CHSEL4` writer - Channel Selection"] -pub type CHSEL4_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASSEL_SPEC, CHSEL4_A, O>; -impl<'a, const O: u8> CHSEL4_W<'a, O> { +pub type CHSEL4_W<'a, REG> = crate::BitWriter<'a, REG, CHSEL4_A>; +impl<'a, REG> CHSEL4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSEL4_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSEL4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CHSEL5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSEL5_A { + pub const fn variant(&self) -> CHSEL5_A { match self.bits { false => CHSEL5_A::VALUE1, true => CHSEL5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSEL5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSEL5_A::VALUE2 } } #[doc = "Field `CHSEL5` writer - Channel Selection"] -pub type CHSEL5_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASSEL_SPEC, CHSEL5_A, O>; -impl<'a, const O: u8> CHSEL5_W<'a, O> { +pub type CHSEL5_W<'a, REG> = crate::BitWriter<'a, REG, CHSEL5_A>; +impl<'a, REG> CHSEL5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSEL5_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSEL5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CHSEL6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSEL6_A { + pub const fn variant(&self) -> CHSEL6_A { match self.bits { false => CHSEL6_A::VALUE1, true => CHSEL6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSEL6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSEL6_A::VALUE2 } } #[doc = "Field `CHSEL6` writer - Channel Selection"] -pub type CHSEL6_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASSEL_SPEC, CHSEL6_A, O>; -impl<'a, const O: u8> CHSEL6_W<'a, O> { +pub type CHSEL6_W<'a, REG> = crate::BitWriter<'a, REG, CHSEL6_A>; +impl<'a, REG> CHSEL6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSEL6_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSEL6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CHSEL7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHSEL7_A { + pub const fn variant(&self) -> CHSEL7_A { match self.bits { false => CHSEL7_A::VALUE1, true => CHSEL7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Ignore this channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHSEL7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "This channel is part of the scan sequence"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHSEL7_A::VALUE2 } } #[doc = "Field `CHSEL7` writer - Channel Selection"] -pub type CHSEL7_W<'a, const O: u8> = crate::BitWriter<'a, u32, ASSEL_SPEC, CHSEL7_A, O>; -impl<'a, const O: u8> CHSEL7_W<'a, O> { +pub type CHSEL7_W<'a, REG> = crate::BitWriter<'a, REG, CHSEL7_A>; +impl<'a, REG> CHSEL7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Ignore this channel"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHSEL7_A::VALUE1) } #[doc = "This channel is part of the scan sequence"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHSEL7_A::VALUE2) } } @@ -480,70 +472,71 @@ impl W { #[doc = "Bit 0 - Channel Selection"] #[inline(always)] #[must_use] - pub fn chsel0(&mut self) -> CHSEL0_W<0> { - CHSEL0_W::new(self) + pub fn chsel0(&mut self) -> CHSEL0_W { + CHSEL0_W::new(self, 0) } #[doc = "Bit 1 - Channel Selection"] #[inline(always)] #[must_use] - pub fn chsel1(&mut self) -> CHSEL1_W<1> { - CHSEL1_W::new(self) + pub fn chsel1(&mut self) -> CHSEL1_W { + CHSEL1_W::new(self, 1) } #[doc = "Bit 2 - Channel Selection"] #[inline(always)] #[must_use] - pub fn chsel2(&mut self) -> CHSEL2_W<2> { - CHSEL2_W::new(self) + pub fn chsel2(&mut self) -> CHSEL2_W { + CHSEL2_W::new(self, 2) } #[doc = "Bit 3 - Channel Selection"] #[inline(always)] #[must_use] - pub fn chsel3(&mut self) -> CHSEL3_W<3> { - CHSEL3_W::new(self) + pub fn chsel3(&mut self) -> CHSEL3_W { + CHSEL3_W::new(self, 3) } #[doc = "Bit 4 - Channel Selection"] #[inline(always)] #[must_use] - pub fn chsel4(&mut self) -> CHSEL4_W<4> { - CHSEL4_W::new(self) + pub fn chsel4(&mut self) -> CHSEL4_W { + CHSEL4_W::new(self, 4) } #[doc = "Bit 5 - Channel Selection"] #[inline(always)] #[must_use] - pub fn chsel5(&mut self) -> CHSEL5_W<5> { - CHSEL5_W::new(self) + pub fn chsel5(&mut self) -> CHSEL5_W { + CHSEL5_W::new(self, 5) } #[doc = "Bit 6 - Channel Selection"] #[inline(always)] #[must_use] - pub fn chsel6(&mut self) -> CHSEL6_W<6> { - CHSEL6_W::new(self) + pub fn chsel6(&mut self) -> CHSEL6_W { + CHSEL6_W::new(self, 6) } #[doc = "Bit 7 - Channel Selection"] #[inline(always)] #[must_use] - pub fn chsel7(&mut self) -> CHSEL7_W<7> { - CHSEL7_W::new(self) + pub fn chsel7(&mut self) -> CHSEL7_W { + CHSEL7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Autoscan Source Channel Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`assel::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`assel::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`assel::R`](R) reader structure"] +impl crate::Readable for ASSEL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`assel::W`](W) writer structure"] impl crate::Writable for ASSEL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/bfl.rs b/src/vadc_g0/bfl.rs index 46751a8b..95625139 100644 --- a/src/vadc_g0/bfl.rs +++ b/src/vadc_g0/bfl.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BFL0` reader - Boundary Flag 0"] pub type BFL0_R = crate::BitReader; #[doc = "Boundary Flag 0\n\nValue on reset: 0"] @@ -53,18 +21,18 @@ impl From for bool { impl BFL0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFL0_A { + pub const fn variant(&self) -> BFL0_A { match self.bits { false => BFL0_A::VALUE1, true => BFL0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive state: result has not yet crossed the activation boundary (see bitfield BFAy), or selected gate signal is inactive, or this boundary flag is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFL0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active state: result has crossed the activation boundary"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFL0_A::VALUE2 @@ -89,18 +57,18 @@ impl From for bool { impl BFL1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFL1_A { + pub const fn variant(&self) -> BFL1_A { match self.bits { false => BFL1_A::VALUE1, true => BFL1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive state: result has not yet crossed the activation boundary (see bitfield BFAy), or selected gate signal is inactive, or this boundary flag is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFL1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active state: result has crossed the activation boundary"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFL1_A::VALUE2 @@ -125,18 +93,18 @@ impl From for bool { impl BFL2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFL2_A { + pub const fn variant(&self) -> BFL2_A { match self.bits { false => BFL2_A::VALUE1, true => BFL2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive state: result has not yet crossed the activation boundary (see bitfield BFAy), or selected gate signal is inactive, or this boundary flag is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFL2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active state: result has crossed the activation boundary"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFL2_A::VALUE2 @@ -161,18 +129,18 @@ impl From for bool { impl BFL3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFL3_A { + pub const fn variant(&self) -> BFL3_A { match self.bits { false => BFL3_A::VALUE1, true => BFL3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Passive state: result has not yet crossed the activation boundary (see bitfield BFAy), or selected gate signal is inactive, or this boundary flag is disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFL3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Active state: result has crossed the activation boundary"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFL3_A::VALUE2 @@ -197,34 +165,37 @@ impl From for bool { impl BFA0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFA0_A { + pub const fn variant(&self) -> BFA0_A { match self.bits { false => BFA0_A::VALUE1, true => BFA0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFA0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Set boundary flag BFLy if result is below the defined band or compare value, clear if above"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFA0_A::VALUE2 } } #[doc = "Field `BFA0` writer - Boundary Flag 0 Activation Select"] -pub type BFA0_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFL_SPEC, BFA0_A, O>; -impl<'a, const O: u8> BFA0_W<'a, O> { +pub type BFA0_W<'a, REG> = crate::BitWriter<'a, REG, BFA0_A>; +impl<'a, REG> BFA0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFA0_A::VALUE1) } #[doc = "Set boundary flag BFLy if result is below the defined band or compare value, clear if above"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFA0_A::VALUE2) } } @@ -247,34 +218,37 @@ impl From for bool { impl BFA1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFA1_A { + pub const fn variant(&self) -> BFA1_A { match self.bits { false => BFA1_A::VALUE1, true => BFA1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFA1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Set boundary flag BFLy if result is below the defined band or compare value, clear if above"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFA1_A::VALUE2 } } #[doc = "Field `BFA1` writer - Boundary Flag 1 Activation Select"] -pub type BFA1_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFL_SPEC, BFA1_A, O>; -impl<'a, const O: u8> BFA1_W<'a, O> { +pub type BFA1_W<'a, REG> = crate::BitWriter<'a, REG, BFA1_A>; +impl<'a, REG> BFA1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFA1_A::VALUE1) } #[doc = "Set boundary flag BFLy if result is below the defined band or compare value, clear if above"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFA1_A::VALUE2) } } @@ -297,34 +271,37 @@ impl From for bool { impl BFA2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFA2_A { + pub const fn variant(&self) -> BFA2_A { match self.bits { false => BFA2_A::VALUE1, true => BFA2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFA2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Set boundary flag BFLy if result is below the defined band or compare value, clear if above"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFA2_A::VALUE2 } } #[doc = "Field `BFA2` writer - Boundary Flag 2 Activation Select"] -pub type BFA2_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFL_SPEC, BFA2_A, O>; -impl<'a, const O: u8> BFA2_W<'a, O> { +pub type BFA2_W<'a, REG> = crate::BitWriter<'a, REG, BFA2_A>; +impl<'a, REG> BFA2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFA2_A::VALUE1) } #[doc = "Set boundary flag BFLy if result is below the defined band or compare value, clear if above"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFA2_A::VALUE2) } } @@ -347,34 +324,37 @@ impl From for bool { impl BFA3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFA3_A { + pub const fn variant(&self) -> BFA3_A { match self.bits { false => BFA3_A::VALUE1, true => BFA3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFA3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Set boundary flag BFLy if result is below the defined band or compare value, clear if above"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFA3_A::VALUE2 } } #[doc = "Field `BFA3` writer - Boundary Flag 3 Activation Select"] -pub type BFA3_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFL_SPEC, BFA3_A, O>; -impl<'a, const O: u8> BFA3_W<'a, O> { +pub type BFA3_W<'a, REG> = crate::BitWriter<'a, REG, BFA3_A>; +impl<'a, REG> BFA3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Set boundary flag BFLy if result is above the defined band or compare value, clear if below"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFA3_A::VALUE1) } #[doc = "Set boundary flag BFLy if result is below the defined band or compare value, clear if above"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFA3_A::VALUE2) } } @@ -397,34 +377,37 @@ impl From for bool { impl BFI0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFI0_A { + pub const fn variant(&self) -> BFI0_A { match self.bits { false => BFI0_A::VALUE1, true => BFI0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use BFLy directly"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFI0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Invert value and use BFLy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFI0_A::VALUE2 } } #[doc = "Field `BFI0` writer - Boundary Flag 0 Inversion Control"] -pub type BFI0_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFL_SPEC, BFI0_A, O>; -impl<'a, const O: u8> BFI0_W<'a, O> { +pub type BFI0_W<'a, REG> = crate::BitWriter<'a, REG, BFI0_A>; +impl<'a, REG> BFI0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Use BFLy directly"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFI0_A::VALUE1) } #[doc = "Invert value and use BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFI0_A::VALUE2) } } @@ -447,34 +430,37 @@ impl From for bool { impl BFI1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFI1_A { + pub const fn variant(&self) -> BFI1_A { match self.bits { false => BFI1_A::VALUE1, true => BFI1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use BFLy directly"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFI1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Invert value and use BFLy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFI1_A::VALUE2 } } #[doc = "Field `BFI1` writer - Boundary Flag 1 Inversion Control"] -pub type BFI1_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFL_SPEC, BFI1_A, O>; -impl<'a, const O: u8> BFI1_W<'a, O> { +pub type BFI1_W<'a, REG> = crate::BitWriter<'a, REG, BFI1_A>; +impl<'a, REG> BFI1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Use BFLy directly"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFI1_A::VALUE1) } #[doc = "Invert value and use BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFI1_A::VALUE2) } } @@ -497,34 +483,37 @@ impl From for bool { impl BFI2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFI2_A { + pub const fn variant(&self) -> BFI2_A { match self.bits { false => BFI2_A::VALUE1, true => BFI2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use BFLy directly"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFI2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Invert value and use BFLy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFI2_A::VALUE2 } } #[doc = "Field `BFI2` writer - Boundary Flag 2 Inversion Control"] -pub type BFI2_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFL_SPEC, BFI2_A, O>; -impl<'a, const O: u8> BFI2_W<'a, O> { +pub type BFI2_W<'a, REG> = crate::BitWriter<'a, REG, BFI2_A>; +impl<'a, REG> BFI2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Use BFLy directly"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFI2_A::VALUE1) } #[doc = "Invert value and use BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFI2_A::VALUE2) } } @@ -547,34 +536,37 @@ impl From for bool { impl BFI3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BFI3_A { + pub const fn variant(&self) -> BFI3_A { match self.bits { false => BFI3_A::VALUE1, true => BFI3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use BFLy directly"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFI3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Invert value and use BFLy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFI3_A::VALUE2 } } #[doc = "Field `BFI3` writer - Boundary Flag 3 Inversion Control"] -pub type BFI3_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFL_SPEC, BFI3_A, O>; -impl<'a, const O: u8> BFI3_W<'a, O> { +pub type BFI3_W<'a, REG> = crate::BitWriter<'a, REG, BFI3_A>; +impl<'a, REG> BFI3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Use BFLy directly"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFI3_A::VALUE1) } #[doc = "Invert value and use BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFI3_A::VALUE2) } } @@ -644,70 +636,71 @@ impl W { #[doc = "Bit 8 - Boundary Flag 0 Activation Select"] #[inline(always)] #[must_use] - pub fn bfa0(&mut self) -> BFA0_W<8> { - BFA0_W::new(self) + pub fn bfa0(&mut self) -> BFA0_W { + BFA0_W::new(self, 8) } #[doc = "Bit 9 - Boundary Flag 1 Activation Select"] #[inline(always)] #[must_use] - pub fn bfa1(&mut self) -> BFA1_W<9> { - BFA1_W::new(self) + pub fn bfa1(&mut self) -> BFA1_W { + BFA1_W::new(self, 9) } #[doc = "Bit 10 - Boundary Flag 2 Activation Select"] #[inline(always)] #[must_use] - pub fn bfa2(&mut self) -> BFA2_W<10> { - BFA2_W::new(self) + pub fn bfa2(&mut self) -> BFA2_W { + BFA2_W::new(self, 10) } #[doc = "Bit 11 - Boundary Flag 3 Activation Select"] #[inline(always)] #[must_use] - pub fn bfa3(&mut self) -> BFA3_W<11> { - BFA3_W::new(self) + pub fn bfa3(&mut self) -> BFA3_W { + BFA3_W::new(self, 11) } #[doc = "Bit 16 - Boundary Flag 0 Inversion Control"] #[inline(always)] #[must_use] - pub fn bfi0(&mut self) -> BFI0_W<16> { - BFI0_W::new(self) + pub fn bfi0(&mut self) -> BFI0_W { + BFI0_W::new(self, 16) } #[doc = "Bit 17 - Boundary Flag 1 Inversion Control"] #[inline(always)] #[must_use] - pub fn bfi1(&mut self) -> BFI1_W<17> { - BFI1_W::new(self) + pub fn bfi1(&mut self) -> BFI1_W { + BFI1_W::new(self, 17) } #[doc = "Bit 18 - Boundary Flag 2 Inversion Control"] #[inline(always)] #[must_use] - pub fn bfi2(&mut self) -> BFI2_W<18> { - BFI2_W::new(self) + pub fn bfi2(&mut self) -> BFI2_W { + BFI2_W::new(self, 18) } #[doc = "Bit 19 - Boundary Flag 3 Inversion Control"] #[inline(always)] #[must_use] - pub fn bfi3(&mut self) -> BFI3_W<19> { - BFI3_W::new(self) + pub fn bfi3(&mut self) -> BFI3_W { + BFI3_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Boundary Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bfl::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bfl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`bfl::R`](R) reader structure"] +impl crate::Readable for BFL_SPEC {} +#[doc = "`write(|w| ..)` method takes [`bfl::W`](W) writer structure"] impl crate::Writable for BFL_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/bflc.rs b/src/vadc_g0/bflc.rs index 46a2122a..ab669a76 100644 --- a/src/vadc_g0/bflc.rs +++ b/src/vadc_g0/bflc.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BFM0` reader - Boundary Flag y Mode Control"] -pub type BFM0_R = crate::FieldReader; +pub type BFM0_R = crate::FieldReader; #[doc = "Boundary Flag y Mode Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BFM0_A { + type Ux = u8; +} impl BFM0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BFM0_A::VALUE1), 1 => Some(BFM0_A::VALUE2), @@ -67,53 +38,57 @@ impl BFM0_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable boundary flag, BFLy is not changed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFM0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Always enable boundary flag (follow compare results)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFM0_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Enable boundary flag while gate of source 0 is active, clear BFLy while gate is inactive"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BFM0_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Enable boundary flag while gate of source 1 is active, clear BFLy while gate is inactive"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BFM0_A::VALUE4 } } #[doc = "Field `BFM0` writer - Boundary Flag y Mode Control"] -pub type BFM0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFLC_SPEC, u8, BFM0_A, 4, O>; -impl<'a, const O: u8> BFM0_W<'a, O> { +pub type BFM0_W<'a, REG> = crate::FieldWriter<'a, REG, 4, BFM0_A>; +impl<'a, REG> BFM0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Disable boundary flag, BFLy is not changed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFM0_A::VALUE1) } #[doc = "Always enable boundary flag (follow compare results)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFM0_A::VALUE2) } #[doc = "Enable boundary flag while gate of source 0 is active, clear BFLy while gate is inactive"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BFM0_A::VALUE3) } #[doc = "Enable boundary flag while gate of source 1 is active, clear BFLy while gate is inactive"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BFM0_A::VALUE4) } } #[doc = "Field `BFM1` reader - Boundary Flag y Mode Control"] -pub type BFM1_R = crate::FieldReader; +pub type BFM1_R = crate::FieldReader; #[doc = "Boundary Flag y Mode Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BFM1_A { + type Ux = u8; +} impl BFM1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BFM1_A::VALUE1), 1 => Some(BFM1_A::VALUE2), @@ -145,53 +123,57 @@ impl BFM1_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable boundary flag, BFLy is not changed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFM1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Always enable boundary flag (follow compare results)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFM1_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Enable boundary flag while gate of source 0 is active, clear BFLy while gate is inactive"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BFM1_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Enable boundary flag while gate of source 1 is active, clear BFLy while gate is inactive"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BFM1_A::VALUE4 } } #[doc = "Field `BFM1` writer - Boundary Flag y Mode Control"] -pub type BFM1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFLC_SPEC, u8, BFM1_A, 4, O>; -impl<'a, const O: u8> BFM1_W<'a, O> { +pub type BFM1_W<'a, REG> = crate::FieldWriter<'a, REG, 4, BFM1_A>; +impl<'a, REG> BFM1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Disable boundary flag, BFLy is not changed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFM1_A::VALUE1) } #[doc = "Always enable boundary flag (follow compare results)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFM1_A::VALUE2) } #[doc = "Enable boundary flag while gate of source 0 is active, clear BFLy while gate is inactive"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BFM1_A::VALUE3) } #[doc = "Enable boundary flag while gate of source 1 is active, clear BFLy while gate is inactive"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BFM1_A::VALUE4) } } #[doc = "Field `BFM2` reader - Boundary Flag y Mode Control"] -pub type BFM2_R = crate::FieldReader; +pub type BFM2_R = crate::FieldReader; #[doc = "Boundary Flag y Mode Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BFM2_A { + type Ux = u8; +} impl BFM2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BFM2_A::VALUE1), 1 => Some(BFM2_A::VALUE2), @@ -223,53 +208,57 @@ impl BFM2_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable boundary flag, BFLy is not changed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFM2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Always enable boundary flag (follow compare results)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFM2_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Enable boundary flag while gate of source 0 is active, clear BFLy while gate is inactive"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BFM2_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Enable boundary flag while gate of source 1 is active, clear BFLy while gate is inactive"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BFM2_A::VALUE4 } } #[doc = "Field `BFM2` writer - Boundary Flag y Mode Control"] -pub type BFM2_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFLC_SPEC, u8, BFM2_A, 4, O>; -impl<'a, const O: u8> BFM2_W<'a, O> { +pub type BFM2_W<'a, REG> = crate::FieldWriter<'a, REG, 4, BFM2_A>; +impl<'a, REG> BFM2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Disable boundary flag, BFLy is not changed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFM2_A::VALUE1) } #[doc = "Always enable boundary flag (follow compare results)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFM2_A::VALUE2) } #[doc = "Enable boundary flag while gate of source 0 is active, clear BFLy while gate is inactive"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BFM2_A::VALUE3) } #[doc = "Enable boundary flag while gate of source 1 is active, clear BFLy while gate is inactive"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BFM2_A::VALUE4) } } #[doc = "Field `BFM3` reader - Boundary Flag y Mode Control"] -pub type BFM3_R = crate::FieldReader; +pub type BFM3_R = crate::FieldReader; #[doc = "Boundary Flag y Mode Control\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BFM3_A { + type Ux = u8; +} impl BFM3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BFM3_A::VALUE1), 1 => Some(BFM3_A::VALUE2), @@ -301,48 +293,52 @@ impl BFM3_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Disable boundary flag, BFLy is not changed"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFM3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Always enable boundary flag (follow compare results)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFM3_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Enable boundary flag while gate of source 0 is active, clear BFLy while gate is inactive"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BFM3_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Enable boundary flag while gate of source 1 is active, clear BFLy while gate is inactive"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BFM3_A::VALUE4 } } #[doc = "Field `BFM3` writer - Boundary Flag y Mode Control"] -pub type BFM3_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFLC_SPEC, u8, BFM3_A, 4, O>; -impl<'a, const O: u8> BFM3_W<'a, O> { +pub type BFM3_W<'a, REG> = crate::FieldWriter<'a, REG, 4, BFM3_A>; +impl<'a, REG> BFM3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Disable boundary flag, BFLy is not changed"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFM3_A::VALUE1) } #[doc = "Always enable boundary flag (follow compare results)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFM3_A::VALUE2) } #[doc = "Enable boundary flag while gate of source 0 is active, clear BFLy while gate is inactive"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BFM3_A::VALUE3) } #[doc = "Enable boundary flag while gate of source 1 is active, clear BFLy while gate is inactive"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BFM3_A::VALUE4) } } @@ -372,46 +368,47 @@ impl W { #[doc = "Bits 0:3 - Boundary Flag y Mode Control"] #[inline(always)] #[must_use] - pub fn bfm0(&mut self) -> BFM0_W<0> { - BFM0_W::new(self) + pub fn bfm0(&mut self) -> BFM0_W { + BFM0_W::new(self, 0) } #[doc = "Bits 4:7 - Boundary Flag y Mode Control"] #[inline(always)] #[must_use] - pub fn bfm1(&mut self) -> BFM1_W<4> { - BFM1_W::new(self) + pub fn bfm1(&mut self) -> BFM1_W { + BFM1_W::new(self, 4) } #[doc = "Bits 8:11 - Boundary Flag y Mode Control"] #[inline(always)] #[must_use] - pub fn bfm2(&mut self) -> BFM2_W<8> { - BFM2_W::new(self) + pub fn bfm2(&mut self) -> BFM2_W { + BFM2_W::new(self, 8) } #[doc = "Bits 12:15 - Boundary Flag y Mode Control"] #[inline(always)] #[must_use] - pub fn bfm3(&mut self) -> BFM3_W<12> { - BFM3_W::new(self) + pub fn bfm3(&mut self) -> BFM3_W { + BFM3_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Boundary Flag Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bflc::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bflc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`bflc::R`](R) reader structure"] +impl crate::Readable for BFLC_SPEC {} +#[doc = "`write(|w| ..)` method takes [`bflc::W`](W) writer structure"] impl crate::Writable for BFLC_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/bflnp.rs b/src/vadc_g0/bflnp.rs index f7f0fbcc..2ad2807e 100644 --- a/src/vadc_g0/bflnp.rs +++ b/src/vadc_g0/bflnp.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BFL0NP` reader - Boundary Flag y Node Pointer"] -pub type BFL0NP_R = crate::FieldReader; +pub type BFL0NP_R = crate::FieldReader; #[doc = "Boundary Flag y Node Pointer\n\nValue on reset: 15"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BFL0NP_A { + type Ux = u8; +} impl BFL0NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BFL0NP_A::VALUE1), 3 => Some(BFL0NP_A::VALUE2), @@ -70,63 +41,67 @@ impl BFL0NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select common bondary flag output 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFL0NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select common bondary flag output 3"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFL0NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BFL0NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BFL0NP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Disabled, no common output signal"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == BFL0NP_A::VALUE5 } } #[doc = "Field `BFL0NP` writer - Boundary Flag y Node Pointer"] -pub type BFL0NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFLNP_SPEC, u8, BFL0NP_A, 4, O>; -impl<'a, const O: u8> BFL0NP_W<'a, O> { +pub type BFL0NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, BFL0NP_A>; +impl<'a, REG> BFL0NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select common bondary flag output 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFL0NP_A::VALUE1) } #[doc = "Select common bondary flag output 3"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFL0NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BFL0NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BFL0NP_A::VALUE4) } #[doc = "Disabled, no common output signal"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(BFL0NP_A::VALUE5) } } #[doc = "Field `BFL1NP` reader - Boundary Flag y Node Pointer"] -pub type BFL1NP_R = crate::FieldReader; +pub type BFL1NP_R = crate::FieldReader; #[doc = "Boundary Flag y Node Pointer\n\nValue on reset: 15"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -148,10 +123,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BFL1NP_A { + type Ux = u8; +} impl BFL1NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BFL1NP_A::VALUE1), 3 => Some(BFL1NP_A::VALUE2), @@ -161,63 +139,67 @@ impl BFL1NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select common bondary flag output 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFL1NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select common bondary flag output 3"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFL1NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BFL1NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BFL1NP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Disabled, no common output signal"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == BFL1NP_A::VALUE5 } } #[doc = "Field `BFL1NP` writer - Boundary Flag y Node Pointer"] -pub type BFL1NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFLNP_SPEC, u8, BFL1NP_A, 4, O>; -impl<'a, const O: u8> BFL1NP_W<'a, O> { +pub type BFL1NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, BFL1NP_A>; +impl<'a, REG> BFL1NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select common bondary flag output 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFL1NP_A::VALUE1) } #[doc = "Select common bondary flag output 3"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFL1NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BFL1NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BFL1NP_A::VALUE4) } #[doc = "Disabled, no common output signal"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(BFL1NP_A::VALUE5) } } #[doc = "Field `BFL2NP` reader - Boundary Flag y Node Pointer"] -pub type BFL2NP_R = crate::FieldReader; +pub type BFL2NP_R = crate::FieldReader; #[doc = "Boundary Flag y Node Pointer\n\nValue on reset: 15"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -239,10 +221,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BFL2NP_A { + type Ux = u8; +} impl BFL2NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BFL2NP_A::VALUE1), 3 => Some(BFL2NP_A::VALUE2), @@ -252,63 +237,67 @@ impl BFL2NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select common bondary flag output 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFL2NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select common bondary flag output 3"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFL2NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BFL2NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BFL2NP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Disabled, no common output signal"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == BFL2NP_A::VALUE5 } } #[doc = "Field `BFL2NP` writer - Boundary Flag y Node Pointer"] -pub type BFL2NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFLNP_SPEC, u8, BFL2NP_A, 4, O>; -impl<'a, const O: u8> BFL2NP_W<'a, O> { +pub type BFL2NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, BFL2NP_A>; +impl<'a, REG> BFL2NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select common bondary flag output 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFL2NP_A::VALUE1) } #[doc = "Select common bondary flag output 3"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFL2NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BFL2NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BFL2NP_A::VALUE4) } #[doc = "Disabled, no common output signal"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(BFL2NP_A::VALUE5) } } #[doc = "Field `BFL3NP` reader - Boundary Flag y Node Pointer"] -pub type BFL3NP_R = crate::FieldReader; +pub type BFL3NP_R = crate::FieldReader; #[doc = "Boundary Flag y Node Pointer\n\nValue on reset: 15"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -330,10 +319,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BFL3NP_A { + type Ux = u8; +} impl BFL3NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BFL3NP_A::VALUE1), 3 => Some(BFL3NP_A::VALUE2), @@ -343,58 +335,62 @@ impl BFL3NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select common bondary flag output 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BFL3NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select common bondary flag output 3"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BFL3NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BFL3NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BFL3NP_A::VALUE4 } - #[doc = "Checks if the value of the field is `VALUE5`"] + #[doc = "Disabled, no common output signal"] #[inline(always)] pub fn is_value5(&self) -> bool { *self == BFL3NP_A::VALUE5 } } #[doc = "Field `BFL3NP` writer - Boundary Flag y Node Pointer"] -pub type BFL3NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BFLNP_SPEC, u8, BFL3NP_A, 4, O>; -impl<'a, const O: u8> BFL3NP_W<'a, O> { +pub type BFL3NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, BFL3NP_A>; +impl<'a, REG> BFL3NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select common bondary flag output 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFL3NP_A::VALUE1) } #[doc = "Select common bondary flag output 3"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFL3NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BFL3NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BFL3NP_A::VALUE4) } #[doc = "Disabled, no common output signal"] #[inline(always)] - pub fn value5(self) -> &'a mut W { + pub fn value5(self) -> &'a mut crate::W { self.variant(BFL3NP_A::VALUE5) } } @@ -424,46 +420,47 @@ impl W { #[doc = "Bits 0:3 - Boundary Flag y Node Pointer"] #[inline(always)] #[must_use] - pub fn bfl0np(&mut self) -> BFL0NP_W<0> { - BFL0NP_W::new(self) + pub fn bfl0np(&mut self) -> BFL0NP_W { + BFL0NP_W::new(self, 0) } #[doc = "Bits 4:7 - Boundary Flag y Node Pointer"] #[inline(always)] #[must_use] - pub fn bfl1np(&mut self) -> BFL1NP_W<4> { - BFL1NP_W::new(self) + pub fn bfl1np(&mut self) -> BFL1NP_W { + BFL1NP_W::new(self, 4) } #[doc = "Bits 8:11 - Boundary Flag y Node Pointer"] #[inline(always)] #[must_use] - pub fn bfl2np(&mut self) -> BFL2NP_W<8> { - BFL2NP_W::new(self) + pub fn bfl2np(&mut self) -> BFL2NP_W { + BFL2NP_W::new(self, 8) } #[doc = "Bits 12:15 - Boundary Flag y Node Pointer"] #[inline(always)] #[must_use] - pub fn bfl3np(&mut self) -> BFL3NP_W<12> { - BFL3NP_W::new(self) + pub fn bfl3np(&mut self) -> BFL3NP_W { + BFL3NP_W::new(self, 12) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Boundary Flag Node Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bflnp::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bflnp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`bflnp::R`](R) reader structure"] +impl crate::Readable for BFLNP_SPEC {} +#[doc = "`write(|w| ..)` method takes [`bflnp::W`](W) writer structure"] impl crate::Writable for BFLNP_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/bfls.rs b/src/vadc_g0/bfls.rs index c504befb..6e1dc3a2 100644 --- a/src/vadc_g0/bfls.rs +++ b/src/vadc_g0/bfls.rs @@ -1,24 +1,5 @@ #[doc = "Register `BFLS` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Boundary Flag 0 Clear\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum BFC0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `BFC0` writer - Boundary Flag 0 Clear"] -pub type BFC0_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFLS_SPEC, BFC0_AW, O>; -impl<'a, const O: u8> BFC0_W<'a, O> { +pub type BFC0_W<'a, REG> = crate::BitWriter<'a, REG, BFC0_AW>; +impl<'a, REG> BFC0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFC0_AW::VALUE1) } #[doc = "Clear bit BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFC0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `BFC1` writer - Boundary Flag 1 Clear"] -pub type BFC1_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFLS_SPEC, BFC1_AW, O>; -impl<'a, const O: u8> BFC1_W<'a, O> { +pub type BFC1_W<'a, REG> = crate::BitWriter<'a, REG, BFC1_AW>; +impl<'a, REG> BFC1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFC1_AW::VALUE1) } #[doc = "Clear bit BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFC1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `BFC2` writer - Boundary Flag 2 Clear"] -pub type BFC2_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFLS_SPEC, BFC2_AW, O>; -impl<'a, const O: u8> BFC2_W<'a, O> { +pub type BFC2_W<'a, REG> = crate::BitWriter<'a, REG, BFC2_AW>; +impl<'a, REG> BFC2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFC2_AW::VALUE1) } #[doc = "Clear bit BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFC2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `BFC3` writer - Boundary Flag 3 Clear"] -pub type BFC3_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFLS_SPEC, BFC3_AW, O>; -impl<'a, const O: u8> BFC3_W<'a, O> { +pub type BFC3_W<'a, REG> = crate::BitWriter<'a, REG, BFC3_AW>; +impl<'a, REG> BFC3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFC3_AW::VALUE1) } #[doc = "Clear bit BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFC3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `BFS0` writer - Boundary Flag 0 Set"] -pub type BFS0_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFLS_SPEC, BFS0_AW, O>; -impl<'a, const O: u8> BFS0_W<'a, O> { +pub type BFS0_W<'a, REG> = crate::BitWriter<'a, REG, BFS0_AW>; +impl<'a, REG> BFS0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFS0_AW::VALUE1) } #[doc = "Set bit BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFS0_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `BFS1` writer - Boundary Flag 1 Set"] -pub type BFS1_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFLS_SPEC, BFS1_AW, O>; -impl<'a, const O: u8> BFS1_W<'a, O> { +pub type BFS1_W<'a, REG> = crate::BitWriter<'a, REG, BFS1_AW>; +impl<'a, REG> BFS1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFS1_AW::VALUE1) } #[doc = "Set bit BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFS1_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `BFS2` writer - Boundary Flag 2 Set"] -pub type BFS2_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFLS_SPEC, BFS2_AW, O>; -impl<'a, const O: u8> BFS2_W<'a, O> { +pub type BFS2_W<'a, REG> = crate::BitWriter<'a, REG, BFS2_AW>; +impl<'a, REG> BFS2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFS2_AW::VALUE1) } #[doc = "Set bit BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFS2_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `BFS3` writer - Boundary Flag 3 Set"] -pub type BFS3_W<'a, const O: u8> = crate::BitWriter<'a, u32, BFLS_SPEC, BFS3_AW, O>; -impl<'a, const O: u8> BFS3_W<'a, O> { +pub type BFS3_W<'a, REG> = crate::BitWriter<'a, REG, BFS3_AW>; +impl<'a, REG> BFS3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BFS3_AW::VALUE1) } #[doc = "Set bit BFLy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BFS3_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Boundary Flag 0 Clear"] #[inline(always)] #[must_use] - pub fn bfc0(&mut self) -> BFC0_W<0> { - BFC0_W::new(self) + pub fn bfc0(&mut self) -> BFC0_W { + BFC0_W::new(self, 0) } #[doc = "Bit 1 - Boundary Flag 1 Clear"] #[inline(always)] #[must_use] - pub fn bfc1(&mut self) -> BFC1_W<1> { - BFC1_W::new(self) + pub fn bfc1(&mut self) -> BFC1_W { + BFC1_W::new(self, 1) } #[doc = "Bit 2 - Boundary Flag 2 Clear"] #[inline(always)] #[must_use] - pub fn bfc2(&mut self) -> BFC2_W<2> { - BFC2_W::new(self) + pub fn bfc2(&mut self) -> BFC2_W { + BFC2_W::new(self, 2) } #[doc = "Bit 3 - Boundary Flag 3 Clear"] #[inline(always)] #[must_use] - pub fn bfc3(&mut self) -> BFC3_W<3> { - BFC3_W::new(self) + pub fn bfc3(&mut self) -> BFC3_W { + BFC3_W::new(self, 3) } #[doc = "Bit 16 - Boundary Flag 0 Set"] #[inline(always)] #[must_use] - pub fn bfs0(&mut self) -> BFS0_W<16> { - BFS0_W::new(self) + pub fn bfs0(&mut self) -> BFS0_W { + BFS0_W::new(self, 16) } #[doc = "Bit 17 - Boundary Flag 1 Set"] #[inline(always)] #[must_use] - pub fn bfs1(&mut self) -> BFS1_W<17> { - BFS1_W::new(self) + pub fn bfs1(&mut self) -> BFS1_W { + BFS1_W::new(self, 17) } #[doc = "Bit 18 - Boundary Flag 2 Set"] #[inline(always)] #[must_use] - pub fn bfs2(&mut self) -> BFS2_W<18> { - BFS2_W::new(self) + pub fn bfs2(&mut self) -> BFS2_W { + BFS2_W::new(self, 18) } #[doc = "Bit 19 - Boundary Flag 3 Set"] #[inline(always)] #[must_use] - pub fn bfs3(&mut self) -> BFS3_W<19> { - BFS3_W::new(self) + pub fn bfs3(&mut self) -> BFS3_W { + BFS3_W::new(self, 19) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Boundary Flag Software Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bfls::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct BFLS_SPEC; impl crate::RegisterSpec for BFLS_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [bfls::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`bfls::W`](W) writer structure"] impl crate::Writable for BFLS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/bound.rs b/src/vadc_g0/bound.rs index fa9409b9..523bef5d 100644 --- a/src/vadc_g0/bound.rs +++ b/src/vadc_g0/bound.rs @@ -1,47 +1,15 @@ #[doc = "Register `BOUND` reader"] -pub struct R(crate::R); -impl core::ops::Deref for R { - type Target = crate::R; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl From> for R { - #[inline(always)] - fn from(reader: crate::R) -> Self { - R(reader) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `BOUNDARY0` reader - Boundary Value 0 for Limit Checking"] -pub type BOUNDARY0_R = crate::FieldReader; +pub type BOUNDARY0_R = crate::FieldReader; #[doc = "Field `BOUNDARY0` writer - Boundary Value 0 for Limit Checking"] -pub type BOUNDARY0_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BOUND_SPEC, u16, u16, 12, O>; +pub type BOUNDARY0_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; #[doc = "Field `BOUNDARY1` reader - Boundary Value 1 for Limit Checking"] -pub type BOUNDARY1_R = crate::FieldReader; +pub type BOUNDARY1_R = crate::FieldReader; #[doc = "Field `BOUNDARY1` writer - Boundary Value 1 for Limit Checking"] -pub type BOUNDARY1_W<'a, const O: u8> = crate::FieldWriter<'a, u32, BOUND_SPEC, u16, u16, 12, O>; +pub type BOUNDARY1_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>; impl R { #[doc = "Bits 0:11 - Boundary Value 0 for Limit Checking"] #[inline(always)] @@ -58,34 +26,35 @@ impl W { #[doc = "Bits 0:11 - Boundary Value 0 for Limit Checking"] #[inline(always)] #[must_use] - pub fn boundary0(&mut self) -> BOUNDARY0_W<0> { - BOUNDARY0_W::new(self) + pub fn boundary0(&mut self) -> BOUNDARY0_W { + BOUNDARY0_W::new(self, 0) } #[doc = "Bits 16:27 - Boundary Value 1 for Limit Checking"] #[inline(always)] #[must_use] - pub fn boundary1(&mut self) -> BOUNDARY1_W<16> { - BOUNDARY1_W::new(self) + pub fn boundary1(&mut self) -> BOUNDARY1_W { + BOUNDARY1_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Boundary Select Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`bound::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`bound::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`bound::R`](R) reader structure"] +impl crate::Readable for BOUND_SPEC {} +#[doc = "`write(|w| ..)` method takes [`bound::W`](W) writer structure"] impl crate::Writable for BOUND_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/cefclr.rs b/src/vadc_g0/cefclr.rs index 8aa35c8e..534fc137 100644 --- a/src/vadc_g0/cefclr.rs +++ b/src/vadc_g0/cefclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `CEFCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Channel Event for Channel 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CEV0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `CEV0` writer - Clear Channel Event for Channel 0"] -pub type CEV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFCLR_SPEC, CEV0_AW, O>; -impl<'a, const O: u8> CEV0_W<'a, O> { +pub type CEV0_W<'a, REG> = crate::BitWriter<'a, REG, CEV0_AW>; +impl<'a, REG> CEV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV0_AW::VALUE1) } #[doc = "Clear the channel event flag in GxCEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `CEV1` writer - Clear Channel Event for Channel 1"] -pub type CEV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFCLR_SPEC, CEV1_AW, O>; -impl<'a, const O: u8> CEV1_W<'a, O> { +pub type CEV1_W<'a, REG> = crate::BitWriter<'a, REG, CEV1_AW>; +impl<'a, REG> CEV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV1_AW::VALUE1) } #[doc = "Clear the channel event flag in GxCEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `CEV2` writer - Clear Channel Event for Channel 2"] -pub type CEV2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFCLR_SPEC, CEV2_AW, O>; -impl<'a, const O: u8> CEV2_W<'a, O> { +pub type CEV2_W<'a, REG> = crate::BitWriter<'a, REG, CEV2_AW>; +impl<'a, REG> CEV2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV2_AW::VALUE1) } #[doc = "Clear the channel event flag in GxCEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `CEV3` writer - Clear Channel Event for Channel 3"] -pub type CEV3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFCLR_SPEC, CEV3_AW, O>; -impl<'a, const O: u8> CEV3_W<'a, O> { +pub type CEV3_W<'a, REG> = crate::BitWriter<'a, REG, CEV3_AW>; +impl<'a, REG> CEV3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV3_AW::VALUE1) } #[doc = "Clear the channel event flag in GxCEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `CEV4` writer - Clear Channel Event for Channel 4"] -pub type CEV4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFCLR_SPEC, CEV4_AW, O>; -impl<'a, const O: u8> CEV4_W<'a, O> { +pub type CEV4_W<'a, REG> = crate::BitWriter<'a, REG, CEV4_AW>; +impl<'a, REG> CEV4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV4_AW::VALUE1) } #[doc = "Clear the channel event flag in GxCEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV4_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `CEV5` writer - Clear Channel Event for Channel 5"] -pub type CEV5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFCLR_SPEC, CEV5_AW, O>; -impl<'a, const O: u8> CEV5_W<'a, O> { +pub type CEV5_W<'a, REG> = crate::BitWriter<'a, REG, CEV5_AW>; +impl<'a, REG> CEV5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV5_AW::VALUE1) } #[doc = "Clear the channel event flag in GxCEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV5_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `CEV6` writer - Clear Channel Event for Channel 6"] -pub type CEV6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFCLR_SPEC, CEV6_AW, O>; -impl<'a, const O: u8> CEV6_W<'a, O> { +pub type CEV6_W<'a, REG> = crate::BitWriter<'a, REG, CEV6_AW>; +impl<'a, REG> CEV6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV6_AW::VALUE1) } #[doc = "Clear the channel event flag in GxCEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV6_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `CEV7` writer - Clear Channel Event for Channel 7"] -pub type CEV7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFCLR_SPEC, CEV7_AW, O>; -impl<'a, const O: u8> CEV7_W<'a, O> { +pub type CEV7_W<'a, REG> = crate::BitWriter<'a, REG, CEV7_AW>; +impl<'a, REG> CEV7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV7_AW::VALUE1) } #[doc = "Clear the channel event flag in GxCEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV7_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Clear Channel Event for Channel 0"] #[inline(always)] #[must_use] - pub fn cev0(&mut self) -> CEV0_W<0> { - CEV0_W::new(self) + pub fn cev0(&mut self) -> CEV0_W { + CEV0_W::new(self, 0) } #[doc = "Bit 1 - Clear Channel Event for Channel 1"] #[inline(always)] #[must_use] - pub fn cev1(&mut self) -> CEV1_W<1> { - CEV1_W::new(self) + pub fn cev1(&mut self) -> CEV1_W { + CEV1_W::new(self, 1) } #[doc = "Bit 2 - Clear Channel Event for Channel 2"] #[inline(always)] #[must_use] - pub fn cev2(&mut self) -> CEV2_W<2> { - CEV2_W::new(self) + pub fn cev2(&mut self) -> CEV2_W { + CEV2_W::new(self, 2) } #[doc = "Bit 3 - Clear Channel Event for Channel 3"] #[inline(always)] #[must_use] - pub fn cev3(&mut self) -> CEV3_W<3> { - CEV3_W::new(self) + pub fn cev3(&mut self) -> CEV3_W { + CEV3_W::new(self, 3) } #[doc = "Bit 4 - Clear Channel Event for Channel 4"] #[inline(always)] #[must_use] - pub fn cev4(&mut self) -> CEV4_W<4> { - CEV4_W::new(self) + pub fn cev4(&mut self) -> CEV4_W { + CEV4_W::new(self, 4) } #[doc = "Bit 5 - Clear Channel Event for Channel 5"] #[inline(always)] #[must_use] - pub fn cev5(&mut self) -> CEV5_W<5> { - CEV5_W::new(self) + pub fn cev5(&mut self) -> CEV5_W { + CEV5_W::new(self, 5) } #[doc = "Bit 6 - Clear Channel Event for Channel 6"] #[inline(always)] #[must_use] - pub fn cev6(&mut self) -> CEV6_W<6> { - CEV6_W::new(self) + pub fn cev6(&mut self) -> CEV6_W { + CEV6_W::new(self, 6) } #[doc = "Bit 7 - Clear Channel Event for Channel 7"] #[inline(always)] #[must_use] - pub fn cev7(&mut self) -> CEV7_W<7> { - CEV7_W::new(self) + pub fn cev7(&mut self) -> CEV7_W { + CEV7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel Event Flag Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cefclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct CEFCLR_SPEC; impl crate::RegisterSpec for CEFCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [cefclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`cefclr::W`](W) writer structure"] impl crate::Writable for CEFCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/ceflag.rs b/src/vadc_g0/ceflag.rs index 7acb996c..00fde71b 100644 --- a/src/vadc_g0/ceflag.rs +++ b/src/vadc_g0/ceflag.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CEV0` reader - Channel Event for Channel 0"] pub type CEV0_R = crate::BitReader; #[doc = "Channel Event for Channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl CEV0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEV0_A { + pub const fn variant(&self) -> CEV0_A { match self.bits { false => CEV0_A::VALUE1, true => CEV0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No channel event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A channel event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV0_A::VALUE2 } } #[doc = "Field `CEV0` writer - Channel Event for Channel 0"] -pub type CEV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFLAG_SPEC, CEV0_A, O>; -impl<'a, const O: u8> CEV0_W<'a, O> { +pub type CEV0_W<'a, REG> = crate::BitWriter<'a, REG, CEV0_A>; +impl<'a, REG> CEV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No channel event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV0_A::VALUE1) } #[doc = "A channel event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl CEV1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEV1_A { + pub const fn variant(&self) -> CEV1_A { match self.bits { false => CEV1_A::VALUE1, true => CEV1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No channel event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A channel event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV1_A::VALUE2 } } #[doc = "Field `CEV1` writer - Channel Event for Channel 1"] -pub type CEV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFLAG_SPEC, CEV1_A, O>; -impl<'a, const O: u8> CEV1_W<'a, O> { +pub type CEV1_W<'a, REG> = crate::BitWriter<'a, REG, CEV1_A>; +impl<'a, REG> CEV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No channel event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV1_A::VALUE1) } #[doc = "A channel event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl CEV2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEV2_A { + pub const fn variant(&self) -> CEV2_A { match self.bits { false => CEV2_A::VALUE1, true => CEV2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No channel event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A channel event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV2_A::VALUE2 } } #[doc = "Field `CEV2` writer - Channel Event for Channel 2"] -pub type CEV2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFLAG_SPEC, CEV2_A, O>; -impl<'a, const O: u8> CEV2_W<'a, O> { +pub type CEV2_W<'a, REG> = crate::BitWriter<'a, REG, CEV2_A>; +impl<'a, REG> CEV2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No channel event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV2_A::VALUE1) } #[doc = "A channel event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl CEV3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEV3_A { + pub const fn variant(&self) -> CEV3_A { match self.bits { false => CEV3_A::VALUE1, true => CEV3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No channel event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A channel event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV3_A::VALUE2 } } #[doc = "Field `CEV3` writer - Channel Event for Channel 3"] -pub type CEV3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFLAG_SPEC, CEV3_A, O>; -impl<'a, const O: u8> CEV3_W<'a, O> { +pub type CEV3_W<'a, REG> = crate::BitWriter<'a, REG, CEV3_A>; +impl<'a, REG> CEV3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No channel event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV3_A::VALUE1) } #[doc = "A channel event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl CEV4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEV4_A { + pub const fn variant(&self) -> CEV4_A { match self.bits { false => CEV4_A::VALUE1, true => CEV4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No channel event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A channel event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV4_A::VALUE2 } } #[doc = "Field `CEV4` writer - Channel Event for Channel 4"] -pub type CEV4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFLAG_SPEC, CEV4_A, O>; -impl<'a, const O: u8> CEV4_W<'a, O> { +pub type CEV4_W<'a, REG> = crate::BitWriter<'a, REG, CEV4_A>; +impl<'a, REG> CEV4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No channel event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV4_A::VALUE1) } #[doc = "A channel event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl CEV5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEV5_A { + pub const fn variant(&self) -> CEV5_A { match self.bits { false => CEV5_A::VALUE1, true => CEV5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No channel event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A channel event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV5_A::VALUE2 } } #[doc = "Field `CEV5` writer - Channel Event for Channel 5"] -pub type CEV5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFLAG_SPEC, CEV5_A, O>; -impl<'a, const O: u8> CEV5_W<'a, O> { +pub type CEV5_W<'a, REG> = crate::BitWriter<'a, REG, CEV5_A>; +impl<'a, REG> CEV5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No channel event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV5_A::VALUE1) } #[doc = "A channel event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl CEV6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEV6_A { + pub const fn variant(&self) -> CEV6_A { match self.bits { false => CEV6_A::VALUE1, true => CEV6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No channel event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A channel event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV6_A::VALUE2 } } #[doc = "Field `CEV6` writer - Channel Event for Channel 6"] -pub type CEV6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFLAG_SPEC, CEV6_A, O>; -impl<'a, const O: u8> CEV6_W<'a, O> { +pub type CEV6_W<'a, REG> = crate::BitWriter<'a, REG, CEV6_A>; +impl<'a, REG> CEV6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No channel event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV6_A::VALUE1) } #[doc = "A channel event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl CEV7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CEV7_A { + pub const fn variant(&self) -> CEV7_A { match self.bits { false => CEV7_A::VALUE1, true => CEV7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No channel event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A channel event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV7_A::VALUE2 } } #[doc = "Field `CEV7` writer - Channel Event for Channel 7"] -pub type CEV7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CEFLAG_SPEC, CEV7_A, O>; -impl<'a, const O: u8> CEV7_W<'a, O> { +pub type CEV7_W<'a, REG> = crate::BitWriter<'a, REG, CEV7_A>; +impl<'a, REG> CEV7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No channel event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV7_A::VALUE1) } #[doc = "A channel event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV7_A::VALUE2) } } @@ -480,70 +472,71 @@ impl W { #[doc = "Bit 0 - Channel Event for Channel 0"] #[inline(always)] #[must_use] - pub fn cev0(&mut self) -> CEV0_W<0> { - CEV0_W::new(self) + pub fn cev0(&mut self) -> CEV0_W { + CEV0_W::new(self, 0) } #[doc = "Bit 1 - Channel Event for Channel 1"] #[inline(always)] #[must_use] - pub fn cev1(&mut self) -> CEV1_W<1> { - CEV1_W::new(self) + pub fn cev1(&mut self) -> CEV1_W { + CEV1_W::new(self, 1) } #[doc = "Bit 2 - Channel Event for Channel 2"] #[inline(always)] #[must_use] - pub fn cev2(&mut self) -> CEV2_W<2> { - CEV2_W::new(self) + pub fn cev2(&mut self) -> CEV2_W { + CEV2_W::new(self, 2) } #[doc = "Bit 3 - Channel Event for Channel 3"] #[inline(always)] #[must_use] - pub fn cev3(&mut self) -> CEV3_W<3> { - CEV3_W::new(self) + pub fn cev3(&mut self) -> CEV3_W { + CEV3_W::new(self, 3) } #[doc = "Bit 4 - Channel Event for Channel 4"] #[inline(always)] #[must_use] - pub fn cev4(&mut self) -> CEV4_W<4> { - CEV4_W::new(self) + pub fn cev4(&mut self) -> CEV4_W { + CEV4_W::new(self, 4) } #[doc = "Bit 5 - Channel Event for Channel 5"] #[inline(always)] #[must_use] - pub fn cev5(&mut self) -> CEV5_W<5> { - CEV5_W::new(self) + pub fn cev5(&mut self) -> CEV5_W { + CEV5_W::new(self, 5) } #[doc = "Bit 6 - Channel Event for Channel 6"] #[inline(always)] #[must_use] - pub fn cev6(&mut self) -> CEV6_W<6> { - CEV6_W::new(self) + pub fn cev6(&mut self) -> CEV6_W { + CEV6_W::new(self, 6) } #[doc = "Bit 7 - Channel Event for Channel 7"] #[inline(always)] #[must_use] - pub fn cev7(&mut self) -> CEV7_W<7> { - CEV7_W::new(self) + pub fn cev7(&mut self) -> CEV7_W { + CEV7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ceflag::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ceflag::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ceflag::R`](R) reader structure"] +impl crate::Readable for CEFLAG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ceflag::W`](W) writer structure"] impl crate::Writable for CEFLAG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/cevnp0.rs b/src/vadc_g0/cevnp0.rs index 6a1893e3..5d0e5ea9 100644 --- a/src/vadc_g0/cevnp0.rs +++ b/src/vadc_g0/cevnp0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `CEV0NP` reader - Service Request Node Pointer Channel Event i"] -pub type CEV0NP_R = crate::FieldReader; +pub type CEV0NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CEV0NP_A { + type Ux = u8; +} impl CEV0NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CEV0NP_A::VALUE1), 3 => Some(CEV0NP_A::VALUE2), @@ -67,53 +38,57 @@ impl CEV0NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV0NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV0NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CEV0NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CEV0NP_A::VALUE4 } } #[doc = "Field `CEV0NP` writer - Service Request Node Pointer Channel Event i"] -pub type CEV0NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CEVNP0_SPEC, u8, CEV0NP_A, 4, O>; -impl<'a, const O: u8> CEV0NP_W<'a, O> { +pub type CEV0NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CEV0NP_A>; +impl<'a, REG> CEV0NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV0NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV0NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CEV0NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CEV0NP_A::VALUE4) } } #[doc = "Field `CEV1NP` reader - Service Request Node Pointer Channel Event i"] -pub type CEV1NP_R = crate::FieldReader; +pub type CEV1NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CEV1NP_A { + type Ux = u8; +} impl CEV1NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CEV1NP_A::VALUE1), 3 => Some(CEV1NP_A::VALUE2), @@ -145,53 +123,57 @@ impl CEV1NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV1NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV1NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CEV1NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CEV1NP_A::VALUE4 } } #[doc = "Field `CEV1NP` writer - Service Request Node Pointer Channel Event i"] -pub type CEV1NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CEVNP0_SPEC, u8, CEV1NP_A, 4, O>; -impl<'a, const O: u8> CEV1NP_W<'a, O> { +pub type CEV1NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CEV1NP_A>; +impl<'a, REG> CEV1NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV1NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV1NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CEV1NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CEV1NP_A::VALUE4) } } #[doc = "Field `CEV2NP` reader - Service Request Node Pointer Channel Event i"] -pub type CEV2NP_R = crate::FieldReader; +pub type CEV2NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CEV2NP_A { + type Ux = u8; +} impl CEV2NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CEV2NP_A::VALUE1), 3 => Some(CEV2NP_A::VALUE2), @@ -223,53 +208,57 @@ impl CEV2NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV2NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV2NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CEV2NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CEV2NP_A::VALUE4 } } #[doc = "Field `CEV2NP` writer - Service Request Node Pointer Channel Event i"] -pub type CEV2NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CEVNP0_SPEC, u8, CEV2NP_A, 4, O>; -impl<'a, const O: u8> CEV2NP_W<'a, O> { +pub type CEV2NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CEV2NP_A>; +impl<'a, REG> CEV2NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV2NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV2NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CEV2NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CEV2NP_A::VALUE4) } } #[doc = "Field `CEV3NP` reader - Service Request Node Pointer Channel Event i"] -pub type CEV3NP_R = crate::FieldReader; +pub type CEV3NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CEV3NP_A { + type Ux = u8; +} impl CEV3NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CEV3NP_A::VALUE1), 3 => Some(CEV3NP_A::VALUE2), @@ -301,53 +293,57 @@ impl CEV3NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV3NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV3NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CEV3NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CEV3NP_A::VALUE4 } } #[doc = "Field `CEV3NP` writer - Service Request Node Pointer Channel Event i"] -pub type CEV3NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CEVNP0_SPEC, u8, CEV3NP_A, 4, O>; -impl<'a, const O: u8> CEV3NP_W<'a, O> { +pub type CEV3NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CEV3NP_A>; +impl<'a, REG> CEV3NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV3NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV3NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CEV3NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CEV3NP_A::VALUE4) } } #[doc = "Field `CEV4NP` reader - Service Request Node Pointer Channel Event i"] -pub type CEV4NP_R = crate::FieldReader; +pub type CEV4NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CEV4NP_A { + type Ux = u8; +} impl CEV4NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CEV4NP_A::VALUE1), 3 => Some(CEV4NP_A::VALUE2), @@ -379,53 +378,57 @@ impl CEV4NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV4NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV4NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CEV4NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CEV4NP_A::VALUE4 } } #[doc = "Field `CEV4NP` writer - Service Request Node Pointer Channel Event i"] -pub type CEV4NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CEVNP0_SPEC, u8, CEV4NP_A, 4, O>; -impl<'a, const O: u8> CEV4NP_W<'a, O> { +pub type CEV4NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CEV4NP_A>; +impl<'a, REG> CEV4NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV4NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV4NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CEV4NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CEV4NP_A::VALUE4) } } #[doc = "Field `CEV5NP` reader - Service Request Node Pointer Channel Event i"] -pub type CEV5NP_R = crate::FieldReader; +pub type CEV5NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CEV5NP_A { + type Ux = u8; +} impl CEV5NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CEV5NP_A::VALUE1), 3 => Some(CEV5NP_A::VALUE2), @@ -457,53 +463,57 @@ impl CEV5NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV5NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV5NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CEV5NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CEV5NP_A::VALUE4 } } #[doc = "Field `CEV5NP` writer - Service Request Node Pointer Channel Event i"] -pub type CEV5NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CEVNP0_SPEC, u8, CEV5NP_A, 4, O>; -impl<'a, const O: u8> CEV5NP_W<'a, O> { +pub type CEV5NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CEV5NP_A>; +impl<'a, REG> CEV5NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV5NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV5NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CEV5NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CEV5NP_A::VALUE4) } } #[doc = "Field `CEV6NP` reader - Service Request Node Pointer Channel Event i"] -pub type CEV6NP_R = crate::FieldReader; +pub type CEV6NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -523,10 +533,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CEV6NP_A { + type Ux = u8; +} impl CEV6NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CEV6NP_A::VALUE1), 3 => Some(CEV6NP_A::VALUE2), @@ -535,53 +548,57 @@ impl CEV6NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV6NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV6NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CEV6NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CEV6NP_A::VALUE4 } } #[doc = "Field `CEV6NP` writer - Service Request Node Pointer Channel Event i"] -pub type CEV6NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CEVNP0_SPEC, u8, CEV6NP_A, 4, O>; -impl<'a, const O: u8> CEV6NP_W<'a, O> { +pub type CEV6NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CEV6NP_A>; +impl<'a, REG> CEV6NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV6NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV6NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CEV6NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CEV6NP_A::VALUE4) } } #[doc = "Field `CEV7NP` reader - Service Request Node Pointer Channel Event i"] -pub type CEV7NP_R = crate::FieldReader; +pub type CEV7NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Channel Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -601,10 +618,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CEV7NP_A { + type Ux = u8; +} impl CEV7NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CEV7NP_A::VALUE1), 3 => Some(CEV7NP_A::VALUE2), @@ -613,48 +633,52 @@ impl CEV7NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CEV7NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CEV7NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CEV7NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CEV7NP_A::VALUE4 } } #[doc = "Field `CEV7NP` writer - Service Request Node Pointer Channel Event i"] -pub type CEV7NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CEVNP0_SPEC, u8, CEV7NP_A, 4, O>; -impl<'a, const O: u8> CEV7NP_W<'a, O> { +pub type CEV7NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, CEV7NP_A>; +impl<'a, REG> CEV7NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV7NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV7NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CEV7NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CEV7NP_A::VALUE4) } } @@ -704,70 +728,71 @@ impl W { #[doc = "Bits 0:3 - Service Request Node Pointer Channel Event i"] #[inline(always)] #[must_use] - pub fn cev0np(&mut self) -> CEV0NP_W<0> { - CEV0NP_W::new(self) + pub fn cev0np(&mut self) -> CEV0NP_W { + CEV0NP_W::new(self, 0) } #[doc = "Bits 4:7 - Service Request Node Pointer Channel Event i"] #[inline(always)] #[must_use] - pub fn cev1np(&mut self) -> CEV1NP_W<4> { - CEV1NP_W::new(self) + pub fn cev1np(&mut self) -> CEV1NP_W { + CEV1NP_W::new(self, 4) } #[doc = "Bits 8:11 - Service Request Node Pointer Channel Event i"] #[inline(always)] #[must_use] - pub fn cev2np(&mut self) -> CEV2NP_W<8> { - CEV2NP_W::new(self) + pub fn cev2np(&mut self) -> CEV2NP_W { + CEV2NP_W::new(self, 8) } #[doc = "Bits 12:15 - Service Request Node Pointer Channel Event i"] #[inline(always)] #[must_use] - pub fn cev3np(&mut self) -> CEV3NP_W<12> { - CEV3NP_W::new(self) + pub fn cev3np(&mut self) -> CEV3NP_W { + CEV3NP_W::new(self, 12) } #[doc = "Bits 16:19 - Service Request Node Pointer Channel Event i"] #[inline(always)] #[must_use] - pub fn cev4np(&mut self) -> CEV4NP_W<16> { - CEV4NP_W::new(self) + pub fn cev4np(&mut self) -> CEV4NP_W { + CEV4NP_W::new(self, 16) } #[doc = "Bits 20:23 - Service Request Node Pointer Channel Event i"] #[inline(always)] #[must_use] - pub fn cev5np(&mut self) -> CEV5NP_W<20> { - CEV5NP_W::new(self) + pub fn cev5np(&mut self) -> CEV5NP_W { + CEV5NP_W::new(self, 20) } #[doc = "Bits 24:27 - Service Request Node Pointer Channel Event i"] #[inline(always)] #[must_use] - pub fn cev6np(&mut self) -> CEV6NP_W<24> { - CEV6NP_W::new(self) + pub fn cev6np(&mut self) -> CEV6NP_W { + CEV6NP_W::new(self, 24) } #[doc = "Bits 28:31 - Service Request Node Pointer Channel Event i"] #[inline(always)] #[must_use] - pub fn cev7np(&mut self) -> CEV7NP_W<28> { - CEV7NP_W::new(self) + pub fn cev7np(&mut self) -> CEV7NP_W { + CEV7NP_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel Event Node Pointer Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cevnp0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`cevnp0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`cevnp0::R`](R) reader structure"] +impl crate::Readable for CEVNP0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`cevnp0::W`](W) writer structure"] impl crate::Writable for CEVNP0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/chass.rs b/src/vadc_g0/chass.rs index f3cf1bbf..0b134638 100644 --- a/src/vadc_g0/chass.rs +++ b/src/vadc_g0/chass.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ASSCH0` reader - Assignment for Channel 0"] pub type ASSCH0_R = crate::BitReader; #[doc = "Assignment for Channel 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl ASSCH0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASSCH0_A { + pub const fn variant(&self) -> ASSCH0_A { match self.bits { false => ASSCH0_A::VALUE1, true => ASSCH0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASSCH0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel y is a priority channel within group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASSCH0_A::VALUE2 } } #[doc = "Field `ASSCH0` writer - Assignment for Channel 0"] -pub type ASSCH0_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHASS_SPEC, ASSCH0_A, O>; -impl<'a, const O: u8> ASSCH0_W<'a, O> { +pub type ASSCH0_W<'a, REG> = crate::BitWriter<'a, REG, ASSCH0_A>; +impl<'a, REG> ASSCH0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSCH0_A::VALUE1) } #[doc = "Channel y is a priority channel within group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSCH0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl ASSCH1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASSCH1_A { + pub const fn variant(&self) -> ASSCH1_A { match self.bits { false => ASSCH1_A::VALUE1, true => ASSCH1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASSCH1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel y is a priority channel within group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASSCH1_A::VALUE2 } } #[doc = "Field `ASSCH1` writer - Assignment for Channel 1"] -pub type ASSCH1_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHASS_SPEC, ASSCH1_A, O>; -impl<'a, const O: u8> ASSCH1_W<'a, O> { +pub type ASSCH1_W<'a, REG> = crate::BitWriter<'a, REG, ASSCH1_A>; +impl<'a, REG> ASSCH1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSCH1_A::VALUE1) } #[doc = "Channel y is a priority channel within group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSCH1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl ASSCH2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASSCH2_A { + pub const fn variant(&self) -> ASSCH2_A { match self.bits { false => ASSCH2_A::VALUE1, true => ASSCH2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASSCH2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel y is a priority channel within group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASSCH2_A::VALUE2 } } #[doc = "Field `ASSCH2` writer - Assignment for Channel 2"] -pub type ASSCH2_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHASS_SPEC, ASSCH2_A, O>; -impl<'a, const O: u8> ASSCH2_W<'a, O> { +pub type ASSCH2_W<'a, REG> = crate::BitWriter<'a, REG, ASSCH2_A>; +impl<'a, REG> ASSCH2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSCH2_A::VALUE1) } #[doc = "Channel y is a priority channel within group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSCH2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl ASSCH3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASSCH3_A { + pub const fn variant(&self) -> ASSCH3_A { match self.bits { false => ASSCH3_A::VALUE1, true => ASSCH3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASSCH3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel y is a priority channel within group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASSCH3_A::VALUE2 } } #[doc = "Field `ASSCH3` writer - Assignment for Channel 3"] -pub type ASSCH3_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHASS_SPEC, ASSCH3_A, O>; -impl<'a, const O: u8> ASSCH3_W<'a, O> { +pub type ASSCH3_W<'a, REG> = crate::BitWriter<'a, REG, ASSCH3_A>; +impl<'a, REG> ASSCH3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSCH3_A::VALUE1) } #[doc = "Channel y is a priority channel within group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSCH3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl ASSCH4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASSCH4_A { + pub const fn variant(&self) -> ASSCH4_A { match self.bits { false => ASSCH4_A::VALUE1, true => ASSCH4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASSCH4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel y is a priority channel within group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASSCH4_A::VALUE2 } } #[doc = "Field `ASSCH4` writer - Assignment for Channel 4"] -pub type ASSCH4_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHASS_SPEC, ASSCH4_A, O>; -impl<'a, const O: u8> ASSCH4_W<'a, O> { +pub type ASSCH4_W<'a, REG> = crate::BitWriter<'a, REG, ASSCH4_A>; +impl<'a, REG> ASSCH4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSCH4_A::VALUE1) } #[doc = "Channel y is a priority channel within group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSCH4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl ASSCH5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASSCH5_A { + pub const fn variant(&self) -> ASSCH5_A { match self.bits { false => ASSCH5_A::VALUE1, true => ASSCH5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASSCH5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel y is a priority channel within group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASSCH5_A::VALUE2 } } #[doc = "Field `ASSCH5` writer - Assignment for Channel 5"] -pub type ASSCH5_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHASS_SPEC, ASSCH5_A, O>; -impl<'a, const O: u8> ASSCH5_W<'a, O> { +pub type ASSCH5_W<'a, REG> = crate::BitWriter<'a, REG, ASSCH5_A>; +impl<'a, REG> ASSCH5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSCH5_A::VALUE1) } #[doc = "Channel y is a priority channel within group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSCH5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl ASSCH6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASSCH6_A { + pub const fn variant(&self) -> ASSCH6_A { match self.bits { false => ASSCH6_A::VALUE1, true => ASSCH6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASSCH6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel y is a priority channel within group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASSCH6_A::VALUE2 } } #[doc = "Field `ASSCH6` writer - Assignment for Channel 6"] -pub type ASSCH6_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHASS_SPEC, ASSCH6_A, O>; -impl<'a, const O: u8> ASSCH6_W<'a, O> { +pub type ASSCH6_W<'a, REG> = crate::BitWriter<'a, REG, ASSCH6_A>; +impl<'a, REG> ASSCH6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSCH6_A::VALUE1) } #[doc = "Channel y is a priority channel within group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSCH6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl ASSCH7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ASSCH7_A { + pub const fn variant(&self) -> ASSCH7_A { match self.bits { false => ASSCH7_A::VALUE1, true => ASSCH7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ASSCH7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel y is a priority channel within group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ASSCH7_A::VALUE2 } } #[doc = "Field `ASSCH7` writer - Assignment for Channel 7"] -pub type ASSCH7_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHASS_SPEC, ASSCH7_A, O>; -impl<'a, const O: u8> ASSCH7_W<'a, O> { +pub type ASSCH7_W<'a, REG> = crate::BitWriter<'a, REG, ASSCH7_A>; +impl<'a, REG> ASSCH7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Channel y can be a background channel converted with lowest priority"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSCH7_A::VALUE1) } #[doc = "Channel y is a priority channel within group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSCH7_A::VALUE2) } } @@ -480,70 +472,71 @@ impl W { #[doc = "Bit 0 - Assignment for Channel 0"] #[inline(always)] #[must_use] - pub fn assch0(&mut self) -> ASSCH0_W<0> { - ASSCH0_W::new(self) + pub fn assch0(&mut self) -> ASSCH0_W { + ASSCH0_W::new(self, 0) } #[doc = "Bit 1 - Assignment for Channel 1"] #[inline(always)] #[must_use] - pub fn assch1(&mut self) -> ASSCH1_W<1> { - ASSCH1_W::new(self) + pub fn assch1(&mut self) -> ASSCH1_W { + ASSCH1_W::new(self, 1) } #[doc = "Bit 2 - Assignment for Channel 2"] #[inline(always)] #[must_use] - pub fn assch2(&mut self) -> ASSCH2_W<2> { - ASSCH2_W::new(self) + pub fn assch2(&mut self) -> ASSCH2_W { + ASSCH2_W::new(self, 2) } #[doc = "Bit 3 - Assignment for Channel 3"] #[inline(always)] #[must_use] - pub fn assch3(&mut self) -> ASSCH3_W<3> { - ASSCH3_W::new(self) + pub fn assch3(&mut self) -> ASSCH3_W { + ASSCH3_W::new(self, 3) } #[doc = "Bit 4 - Assignment for Channel 4"] #[inline(always)] #[must_use] - pub fn assch4(&mut self) -> ASSCH4_W<4> { - ASSCH4_W::new(self) + pub fn assch4(&mut self) -> ASSCH4_W { + ASSCH4_W::new(self, 4) } #[doc = "Bit 5 - Assignment for Channel 5"] #[inline(always)] #[must_use] - pub fn assch5(&mut self) -> ASSCH5_W<5> { - ASSCH5_W::new(self) + pub fn assch5(&mut self) -> ASSCH5_W { + ASSCH5_W::new(self, 5) } #[doc = "Bit 6 - Assignment for Channel 6"] #[inline(always)] #[must_use] - pub fn assch6(&mut self) -> ASSCH6_W<6> { - ASSCH6_W::new(self) + pub fn assch6(&mut self) -> ASSCH6_W { + ASSCH6_W::new(self, 6) } #[doc = "Bit 7 - Assignment for Channel 7"] #[inline(always)] #[must_use] - pub fn assch7(&mut self) -> ASSCH7_W<7> { - ASSCH7_W::new(self) + pub fn assch7(&mut self) -> ASSCH7_W { + ASSCH7_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel Assignment Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chass::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chass::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`chass::R`](R) reader structure"] +impl crate::Readable for CHASS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`chass::W`](W) writer structure"] impl crate::Writable for CHASS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/chctr.rs b/src/vadc_g0/chctr.rs index f45e411e..c4e669ed 100644 --- a/src/vadc_g0/chctr.rs +++ b/src/vadc_g0/chctr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ICLSEL` reader - Input Class Select"] -pub type ICLSEL_R = crate::FieldReader; +pub type ICLSEL_R = crate::FieldReader; #[doc = "Input Class Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ICLSEL_A { + type Ux = u8; +} impl ICLSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ICLSEL_A { + pub const fn variant(&self) -> ICLSEL_A { match self.bits { 0 => ICLSEL_A::VALUE1, 1 => ICLSEL_A::VALUE2, @@ -67,53 +38,57 @@ impl ICLSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use group-specific class 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ICLSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Use group-specific class 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ICLSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Use global class 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ICLSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Use global class 1"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ICLSEL_A::VALUE4 } } #[doc = "Field `ICLSEL` writer - Input Class Select"] -pub type ICLSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CHCTR_SPEC, u8, ICLSEL_A, 2, O>; -impl<'a, const O: u8> ICLSEL_W<'a, O> { +pub type ICLSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ICLSEL_A>; +impl<'a, REG> ICLSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Use group-specific class 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ICLSEL_A::VALUE1) } #[doc = "Use group-specific class 1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ICLSEL_A::VALUE2) } #[doc = "Use global class 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ICLSEL_A::VALUE3) } #[doc = "Use global class 1"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ICLSEL_A::VALUE4) } } #[doc = "Field `BNDSELL` reader - Lower Boundary Select"] -pub type BNDSELL_R = crate::FieldReader; +pub type BNDSELL_R = crate::FieldReader; #[doc = "Lower Boundary Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BNDSELL_A { + type Ux = u8; +} impl BNDSELL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BNDSELL_A { + pub const fn variant(&self) -> BNDSELL_A { match self.bits { 0 => BNDSELL_A::VALUE1, 1 => BNDSELL_A::VALUE2, @@ -145,53 +123,57 @@ impl BNDSELL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use group-specific boundary 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BNDSELL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Use group-specific boundary 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BNDSELL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Use global boundary 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BNDSELL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Use global boundary 1"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BNDSELL_A::VALUE4 } } #[doc = "Field `BNDSELL` writer - Lower Boundary Select"] -pub type BNDSELL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CHCTR_SPEC, u8, BNDSELL_A, 2, O>; -impl<'a, const O: u8> BNDSELL_W<'a, O> { +pub type BNDSELL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, BNDSELL_A>; +impl<'a, REG> BNDSELL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Use group-specific boundary 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BNDSELL_A::VALUE1) } #[doc = "Use group-specific boundary 1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BNDSELL_A::VALUE2) } #[doc = "Use global boundary 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BNDSELL_A::VALUE3) } #[doc = "Use global boundary 1"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BNDSELL_A::VALUE4) } } #[doc = "Field `BNDSELU` reader - Upper Boundary Select"] -pub type BNDSELU_R = crate::FieldReader; +pub type BNDSELU_R = crate::FieldReader; #[doc = "Upper Boundary Select\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BNDSELU_A { + type Ux = u8; +} impl BNDSELU_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BNDSELU_A { + pub const fn variant(&self) -> BNDSELU_A { match self.bits { 0 => BNDSELU_A::VALUE1, 1 => BNDSELU_A::VALUE2, @@ -223,53 +208,57 @@ impl BNDSELU_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use group-specific boundary 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BNDSELU_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Use group-specific boundary 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BNDSELU_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Use global boundary 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == BNDSELU_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Use global boundary 1"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == BNDSELU_A::VALUE4 } } #[doc = "Field `BNDSELU` writer - Upper Boundary Select"] -pub type BNDSELU_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CHCTR_SPEC, u8, BNDSELU_A, 2, O>; -impl<'a, const O: u8> BNDSELU_W<'a, O> { +pub type BNDSELU_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, BNDSELU_A>; +impl<'a, REG> BNDSELU_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Use group-specific boundary 0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BNDSELU_A::VALUE1) } #[doc = "Use group-specific boundary 1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BNDSELU_A::VALUE2) } #[doc = "Use global boundary 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(BNDSELU_A::VALUE3) } #[doc = "Use global boundary 1"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(BNDSELU_A::VALUE4) } } #[doc = "Field `CHEVMODE` reader - Channel Event Mode"] -pub type CHEVMODE_R = crate::FieldReader; +pub type CHEVMODE_R = crate::FieldReader; #[doc = "Channel Event Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CHEVMODE_A { + type Ux = u8; +} impl CHEVMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> CHEVMODE_A { + pub const fn variant(&self) -> CHEVMODE_A { match self.bits { 0 => CHEVMODE_A::VALUE1, 1 => CHEVMODE_A::VALUE2, @@ -301,48 +293,52 @@ impl CHEVMODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Never"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CHEVMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "NCM: If result is inside the boundary band FCM: If result becomes high (above cmp. val.)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CHEVMODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "NCM: If result is outside the boundary band FCM: If result becomes low (below cmp. val.)"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CHEVMODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "NCM: Always (ignore band) FCM: If result switches to either level"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == CHEVMODE_A::VALUE4 } } #[doc = "Field `CHEVMODE` writer - Channel Event Mode"] -pub type CHEVMODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, CHCTR_SPEC, u8, CHEVMODE_A, 2, O>; -impl<'a, const O: u8> CHEVMODE_W<'a, O> { +pub type CHEVMODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, CHEVMODE_A>; +impl<'a, REG> CHEVMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Never"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CHEVMODE_A::VALUE1) } #[doc = "NCM: If result is inside the boundary band FCM: If result becomes high (above cmp. val.)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CHEVMODE_A::VALUE2) } #[doc = "NCM: If result is outside the boundary band FCM: If result becomes low (below cmp. val.)"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CHEVMODE_A::VALUE3) } #[doc = "NCM: Always (ignore band) FCM: If result switches to either level"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(CHEVMODE_A::VALUE4) } } @@ -365,34 +361,37 @@ impl From for bool { impl SYNC_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SYNC_A { + pub const fn variant(&self) -> SYNC_A { match self.bits { false => SYNC_A::VALUE1, true => SYNC_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No synchroniz. request, standalone operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SYNC_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request a synchronized conversion of this channel (only taken into account for a master)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SYNC_A::VALUE2 } } #[doc = "Field `SYNC` writer - Synchronization Request"] -pub type SYNC_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHCTR_SPEC, SYNC_A, O>; -impl<'a, const O: u8> SYNC_W<'a, O> { +pub type SYNC_W<'a, REG> = crate::BitWriter<'a, REG, SYNC_A>; +impl<'a, REG> SYNC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No synchroniz. request, standalone operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SYNC_A::VALUE1) } #[doc = "Request a synchronized conversion of this channel (only taken into account for a master)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SYNC_A::VALUE2) } } @@ -415,39 +414,42 @@ impl From for bool { impl REFSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REFSEL_A { + pub const fn variant(&self) -> REFSEL_A { match self.bits { false => REFSEL_A::VALUE1, true => REFSEL_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard reference input VAREF"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REFSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Alternate reference input from CH0"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REFSEL_A::VALUE2 } } #[doc = "Field `REFSEL` writer - Reference Input Selection"] -pub type REFSEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHCTR_SPEC, REFSEL_A, O>; -impl<'a, const O: u8> REFSEL_W<'a, O> { +pub type REFSEL_W<'a, REG> = crate::BitWriter<'a, REG, REFSEL_A>; +impl<'a, REG> REFSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Standard reference input VAREF"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REFSEL_A::VALUE1) } #[doc = "Alternate reference input from CH0"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REFSEL_A::VALUE2) } } #[doc = "Field `RESREG` reader - Result Register"] -pub type RESREG_R = crate::FieldReader; +pub type RESREG_R = crate::FieldReader; #[doc = "Result Register\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -463,38 +465,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for RESREG_A { + type Ux = u8; +} impl RESREG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(RESREG_A::VALUE1), 15 => Some(RESREG_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Store result in group result register GxRES0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RESREG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Store result in group result register GxRES15"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RESREG_A::VALUE2 } } #[doc = "Field `RESREG` writer - Result Register"] -pub type RESREG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CHCTR_SPEC, u8, RESREG_A, 4, O>; -impl<'a, const O: u8> RESREG_W<'a, O> { +pub type RESREG_W<'a, REG> = crate::FieldWriter<'a, REG, 4, RESREG_A>; +impl<'a, REG> RESREG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Store result in group result register GxRES0"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESREG_A::VALUE1) } #[doc = "Store result in group result register GxRES15"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESREG_A::VALUE2) } } @@ -517,34 +526,37 @@ impl From for bool { impl RESTBS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RESTBS_A { + pub const fn variant(&self) -> RESTBS_A { match self.bits { false => RESTBS_A::VALUE1, true => RESTBS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Store results in the selected group result register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RESTBS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Store results in the global result register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RESTBS_A::VALUE2 } } #[doc = "Field `RESTBS` writer - Result Target for Background Source"] -pub type RESTBS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHCTR_SPEC, RESTBS_A, O>; -impl<'a, const O: u8> RESTBS_W<'a, O> { +pub type RESTBS_W<'a, REG> = crate::BitWriter<'a, REG, RESTBS_A>; +impl<'a, REG> RESTBS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Store results in the selected group result register"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESTBS_A::VALUE1) } #[doc = "Store results in the global result register"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESTBS_A::VALUE2) } } @@ -567,39 +579,42 @@ impl From for bool { impl RESPOS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RESPOS_A { + pub const fn variant(&self) -> RESPOS_A { match self.bits { false => RESPOS_A::VALUE1, true => RESPOS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Store results left-aligned"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RESPOS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Store results right-aligned"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RESPOS_A::VALUE2 } } #[doc = "Field `RESPOS` writer - Result Position"] -pub type RESPOS_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHCTR_SPEC, RESPOS_A, O>; -impl<'a, const O: u8> RESPOS_W<'a, O> { +pub type RESPOS_W<'a, REG> = crate::BitWriter<'a, REG, RESPOS_A>; +impl<'a, REG> RESPOS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Store results left-aligned"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RESPOS_A::VALUE1) } #[doc = "Store results right-aligned"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RESPOS_A::VALUE2) } } #[doc = "Field `BWDCH` reader - Broken Wire Detection Channel"] -pub type BWDCH_R = crate::FieldReader; +pub type BWDCH_R = crate::FieldReader; #[doc = "Broken Wire Detection Channel\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -615,38 +630,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for BWDCH_A { + type Ux = u8; +} impl BWDCH_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(BWDCH_A::VALUE1), 1 => Some(BWDCH_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select VAGND"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BWDCH_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select VAREF"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BWDCH_A::VALUE2 } } #[doc = "Field `BWDCH` writer - Broken Wire Detection Channel"] -pub type BWDCH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CHCTR_SPEC, u8, BWDCH_A, 2, O>; -impl<'a, const O: u8> BWDCH_W<'a, O> { +pub type BWDCH_W<'a, REG> = crate::FieldWriter<'a, REG, 2, BWDCH_A>; +impl<'a, REG> BWDCH_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select VAGND"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BWDCH_A::VALUE1) } #[doc = "Select VAREF"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BWDCH_A::VALUE2) } } @@ -669,34 +691,37 @@ impl From for bool { impl BWDEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> BWDEN_A { + pub const fn variant(&self) -> BWDEN_A { match self.bits { false => BWDEN_A::VALUE1, true => BWDEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Normal operation"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == BWDEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Additional preparation phase is enabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == BWDEN_A::VALUE2 } } #[doc = "Field `BWDEN` writer - Broken Wire Detection Enable"] -pub type BWDEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CHCTR_SPEC, BWDEN_A, O>; -impl<'a, const O: u8> BWDEN_W<'a, O> { +pub type BWDEN_W<'a, REG> = crate::BitWriter<'a, REG, BWDEN_A>; +impl<'a, REG> BWDEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Normal operation"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(BWDEN_A::VALUE1) } #[doc = "Additional preparation phase is enabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(BWDEN_A::VALUE2) } } @@ -761,88 +786,89 @@ impl W { #[doc = "Bits 0:1 - Input Class Select"] #[inline(always)] #[must_use] - pub fn iclsel(&mut self) -> ICLSEL_W<0> { - ICLSEL_W::new(self) + pub fn iclsel(&mut self) -> ICLSEL_W { + ICLSEL_W::new(self, 0) } #[doc = "Bits 4:5 - Lower Boundary Select"] #[inline(always)] #[must_use] - pub fn bndsell(&mut self) -> BNDSELL_W<4> { - BNDSELL_W::new(self) + pub fn bndsell(&mut self) -> BNDSELL_W { + BNDSELL_W::new(self, 4) } #[doc = "Bits 6:7 - Upper Boundary Select"] #[inline(always)] #[must_use] - pub fn bndselu(&mut self) -> BNDSELU_W<6> { - BNDSELU_W::new(self) + pub fn bndselu(&mut self) -> BNDSELU_W { + BNDSELU_W::new(self, 6) } #[doc = "Bits 8:9 - Channel Event Mode"] #[inline(always)] #[must_use] - pub fn chevmode(&mut self) -> CHEVMODE_W<8> { - CHEVMODE_W::new(self) + pub fn chevmode(&mut self) -> CHEVMODE_W { + CHEVMODE_W::new(self, 8) } #[doc = "Bit 10 - Synchronization Request"] #[inline(always)] #[must_use] - pub fn sync(&mut self) -> SYNC_W<10> { - SYNC_W::new(self) + pub fn sync(&mut self) -> SYNC_W { + SYNC_W::new(self, 10) } #[doc = "Bit 11 - Reference Input Selection"] #[inline(always)] #[must_use] - pub fn refsel(&mut self) -> REFSEL_W<11> { - REFSEL_W::new(self) + pub fn refsel(&mut self) -> REFSEL_W { + REFSEL_W::new(self, 11) } #[doc = "Bits 16:19 - Result Register"] #[inline(always)] #[must_use] - pub fn resreg(&mut self) -> RESREG_W<16> { - RESREG_W::new(self) + pub fn resreg(&mut self) -> RESREG_W { + RESREG_W::new(self, 16) } #[doc = "Bit 20 - Result Target for Background Source"] #[inline(always)] #[must_use] - pub fn restbs(&mut self) -> RESTBS_W<20> { - RESTBS_W::new(self) + pub fn restbs(&mut self) -> RESTBS_W { + RESTBS_W::new(self, 20) } #[doc = "Bit 21 - Result Position"] #[inline(always)] #[must_use] - pub fn respos(&mut self) -> RESPOS_W<21> { - RESPOS_W::new(self) + pub fn respos(&mut self) -> RESPOS_W { + RESPOS_W::new(self, 21) } #[doc = "Bits 28:29 - Broken Wire Detection Channel"] #[inline(always)] #[must_use] - pub fn bwdch(&mut self) -> BWDCH_W<28> { - BWDCH_W::new(self) + pub fn bwdch(&mut self) -> BWDCH_W { + BWDCH_W::new(self, 28) } #[doc = "Bit 30 - Broken Wire Detection Enable"] #[inline(always)] #[must_use] - pub fn bwden(&mut self) -> BWDEN_W<30> { - BWDEN_W::new(self) + pub fn bwden(&mut self) -> BWDEN_W { + BWDEN_W::new(self, 30) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Channel Ctrl. Reg.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`chctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`chctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`chctr::R`](R) reader structure"] +impl crate::Readable for CHCTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`chctr::W`](W) writer structure"] impl crate::Writable for CHCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/emuxctr.rs b/src/vadc_g0/emuxctr.rs index c84bdf2f..b0d9827a 100644 --- a/src/vadc_g0/emuxctr.rs +++ b/src/vadc_g0/emuxctr.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `EMUXSET` reader - External Multiplexer Start Selection"] -pub type EMUXSET_R = crate::FieldReader; +pub type EMUXSET_R = crate::FieldReader; #[doc = "Field `EMUXSET` writer - External Multiplexer Start Selection"] -pub type EMUXSET_W<'a, const O: u8> = crate::FieldWriter<'a, u32, EMUXCTR_SPEC, u8, u8, 3, O>; +pub type EMUXSET_W<'a, REG> = crate::FieldWriter<'a, REG, 3>; #[doc = "Field `EMUXACT` reader - External Multiplexer Actual Selection"] -pub type EMUXACT_R = crate::FieldReader; +pub type EMUXACT_R = crate::FieldReader; #[doc = "Field `EMUXCH` reader - External Multiplexer Channel Select"] -pub type EMUXCH_R = crate::FieldReader; +pub type EMUXCH_R = crate::FieldReader; #[doc = "Field `EMUXCH` writer - External Multiplexer Channel Select"] -pub type EMUXCH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, EMUXCTR_SPEC, u16, u16, 10, O>; +pub type EMUXCH_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>; #[doc = "Field `EMUXMODE` reader - External Multiplexer Mode"] -pub type EMUXMODE_R = crate::FieldReader; +pub type EMUXMODE_R = crate::FieldReader; #[doc = "External Multiplexer Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -65,10 +33,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for EMUXMODE_A { + type Ux = u8; +} impl EMUXMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMUXMODE_A { + pub const fn variant(&self) -> EMUXMODE_A { match self.bits { 0 => EMUXMODE_A::VALUE1, 1 => EMUXMODE_A::VALUE2, @@ -77,48 +48,52 @@ impl EMUXMODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Software control (no hardware action)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMUXMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Steady mode (use EMUXSET value)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMUXMODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Single-step mode"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == EMUXMODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Sequence mode"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == EMUXMODE_A::VALUE4 } } #[doc = "Field `EMUXMODE` writer - External Multiplexer Mode"] -pub type EMUXMODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, EMUXCTR_SPEC, u8, EMUXMODE_A, 2, O>; -impl<'a, const O: u8> EMUXMODE_W<'a, O> { +pub type EMUXMODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, EMUXMODE_A>; +impl<'a, REG> EMUXMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Software control (no hardware action)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMUXMODE_A::VALUE1) } #[doc = "Steady mode (use EMUXSET value)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMUXMODE_A::VALUE2) } #[doc = "Single-step mode"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(EMUXMODE_A::VALUE3) } #[doc = "Sequence mode"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(EMUXMODE_A::VALUE4) } } @@ -141,34 +116,37 @@ impl From for bool { impl EMXCOD_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMXCOD_A { + pub const fn variant(&self) -> EMXCOD_A { match self.bits { false => EMXCOD_A::VALUE1, true => EMXCOD_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Output the channel number in binary code"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMXCOD_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Output the channel number in Gray code"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMXCOD_A::VALUE2 } } #[doc = "Field `EMXCOD` writer - External Multiplexer Coding Scheme"] -pub type EMXCOD_W<'a, const O: u8> = crate::BitWriter<'a, u32, EMUXCTR_SPEC, EMXCOD_A, O>; -impl<'a, const O: u8> EMXCOD_W<'a, O> { +pub type EMXCOD_W<'a, REG> = crate::BitWriter<'a, REG, EMXCOD_A>; +impl<'a, REG> EMXCOD_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Output the channel number in binary code"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMXCOD_A::VALUE1) } #[doc = "Output the channel number in Gray code"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMXCOD_A::VALUE2) } } @@ -191,34 +169,37 @@ impl From for bool { impl EMXST_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMXST_A { + pub const fn variant(&self) -> EMXST_A { match self.bits { false => EMXST_A::VALUE1, true => EMXST_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use STCE whenever the setting changes"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMXST_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Use STCE for each conversion of an external channel"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMXST_A::VALUE2 } } #[doc = "Field `EMXST` writer - External Multiplexer Sample Time Control"] -pub type EMXST_W<'a, const O: u8> = crate::BitWriter<'a, u32, EMUXCTR_SPEC, EMXST_A, O>; -impl<'a, const O: u8> EMXST_W<'a, O> { +pub type EMXST_W<'a, REG> = crate::BitWriter<'a, REG, EMXST_A>; +impl<'a, REG> EMXST_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Use STCE whenever the setting changes"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMXST_A::VALUE1) } #[doc = "Use STCE for each conversion of an external channel"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMXST_A::VALUE2) } } @@ -241,18 +222,18 @@ impl From for bool { impl EMXCSS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMXCSS_A { + pub const fn variant(&self) -> EMXCSS_A { match self.bits { false => EMXCSS_A::VALUE1, true => EMXCSS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Channel number: Bitfield EMUXCH selects an arbitrary channel"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMXCSS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Channel enable: Each bit of bitfield EMUXCH selects the associated channel for EMUX control"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMXCSS_A::VALUE2 @@ -273,16 +254,19 @@ impl From for bool { } } #[doc = "Field `EMXWC` writer - Write Control for EMUX Configuration"] -pub type EMXWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, EMUXCTR_SPEC, EMXWC_AW, O>; -impl<'a, const O: u8> EMXWC_W<'a, O> { +pub type EMXWC_W<'a, REG> = crate::BitWriter<'a, REG, EMXWC_AW>; +impl<'a, REG> EMXWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to EMUX cfg."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EMXWC_AW::VALUE1) } #[doc = "Bitfields EMXMODE, EMXCOD, EMXST, EMXCSS can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EMXWC_AW::VALUE2) } } @@ -327,58 +311,59 @@ impl W { #[doc = "Bits 0:2 - External Multiplexer Start Selection"] #[inline(always)] #[must_use] - pub fn emuxset(&mut self) -> EMUXSET_W<0> { - EMUXSET_W::new(self) + pub fn emuxset(&mut self) -> EMUXSET_W { + EMUXSET_W::new(self, 0) } #[doc = "Bits 16:25 - External Multiplexer Channel Select"] #[inline(always)] #[must_use] - pub fn emuxch(&mut self) -> EMUXCH_W<16> { - EMUXCH_W::new(self) + pub fn emuxch(&mut self) -> EMUXCH_W { + EMUXCH_W::new(self, 16) } #[doc = "Bits 26:27 - External Multiplexer Mode"] #[inline(always)] #[must_use] - pub fn emuxmode(&mut self) -> EMUXMODE_W<26> { - EMUXMODE_W::new(self) + pub fn emuxmode(&mut self) -> EMUXMODE_W { + EMUXMODE_W::new(self, 26) } #[doc = "Bit 28 - External Multiplexer Coding Scheme"] #[inline(always)] #[must_use] - pub fn emxcod(&mut self) -> EMXCOD_W<28> { - EMXCOD_W::new(self) + pub fn emxcod(&mut self) -> EMXCOD_W { + EMXCOD_W::new(self, 28) } #[doc = "Bit 29 - External Multiplexer Sample Time Control"] #[inline(always)] #[must_use] - pub fn emxst(&mut self) -> EMXST_W<29> { - EMXST_W::new(self) + pub fn emxst(&mut self) -> EMXST_W { + EMXST_W::new(self, 29) } #[doc = "Bit 31 - Write Control for EMUX Configuration"] #[inline(always)] #[must_use] - pub fn emxwc(&mut self) -> EMXWC_W<31> { - EMXWC_W::new(self) + pub fn emxwc(&mut self) -> EMXWC_W { + EMXWC_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.bits = bits; self } } -#[doc = "E0ternal 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"] +#[doc = "E0ternal Multiplexer Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`emuxctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`emuxctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`emuxctr::R`](R) reader structure"] +impl crate::Readable for EMUXCTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`emuxctr::W`](W) writer structure"] impl crate::Writable for EMUXCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/iclass.rs b/src/vadc_g0/iclass.rs index 4b25a056..8b2652b2 100644 --- a/src/vadc_g0/iclass.rs +++ b/src/vadc_g0/iclass.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `STCS` reader - Sample Time Control for Standard Conversions"] -pub type STCS_R = crate::FieldReader; +pub type STCS_R = crate::FieldReader; #[doc = "Field `STCS` writer - Sample Time Control for Standard Conversions"] -pub type STCS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ICLASS_SPEC, u8, u8, 5, O>; +pub type STCS_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `CMS` reader - Conversion Mode for Standard Conversions"] -pub type CMS_R = crate::FieldReader; +pub type CMS_R = crate::FieldReader; #[doc = "Conversion Mode for Standard Conversions\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -59,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CMS_A { + type Ux = u8; +} impl CMS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CMS_A::VALUE1), 1 => Some(CMS_A::VALUE2), @@ -71,57 +42,61 @@ impl CMS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "12-bit conversion"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CMS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "10-bit conversion"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CMS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "8-bit conversion"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CMS_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "10-bit fast compare mode"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == CMS_A::VALUE6 } } #[doc = "Field `CMS` writer - Conversion Mode for Standard Conversions"] -pub type CMS_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ICLASS_SPEC, u8, CMS_A, 3, O>; -impl<'a, const O: u8> CMS_W<'a, O> { +pub type CMS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CMS_A>; +impl<'a, REG> CMS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "12-bit conversion"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CMS_A::VALUE1) } #[doc = "10-bit conversion"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CMS_A::VALUE2) } #[doc = "8-bit conversion"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CMS_A::VALUE3) } #[doc = "10-bit fast compare mode"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(CMS_A::VALUE6) } } #[doc = "Field `STCE` reader - Sample Time Control for EMUX Conversions"] -pub type STCE_R = crate::FieldReader; +pub type STCE_R = crate::FieldReader; #[doc = "Field `STCE` writer - Sample Time Control for EMUX Conversions"] -pub type STCE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ICLASS_SPEC, u8, u8, 5, O>; +pub type STCE_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Field `CME` reader - Conversion Mode for EMUX Conversions"] -pub type CME_R = crate::FieldReader; +pub type CME_R = crate::FieldReader; #[doc = "Conversion Mode for EMUX Conversions\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -141,10 +116,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CME_A { + type Ux = u8; +} impl CME_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CME_A::VALUE1), 1 => Some(CME_A::VALUE2), @@ -153,48 +131,52 @@ impl CME_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "12-bit conversion"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CME_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "10-bit conversion"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CME_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "8-bit conversion"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CME_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE6`"] + #[doc = "10-bit fast compare mode"] #[inline(always)] pub fn is_value6(&self) -> bool { *self == CME_A::VALUE6 } } #[doc = "Field `CME` writer - Conversion Mode for EMUX Conversions"] -pub type CME_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ICLASS_SPEC, u8, CME_A, 3, O>; -impl<'a, const O: u8> CME_W<'a, O> { +pub type CME_W<'a, REG> = crate::FieldWriter<'a, REG, 3, CME_A>; +impl<'a, REG> CME_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "12-bit conversion"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CME_A::VALUE1) } #[doc = "10-bit conversion"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CME_A::VALUE2) } #[doc = "8-bit conversion"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(CME_A::VALUE3) } #[doc = "10-bit fast compare mode"] #[inline(always)] - pub fn value6(self) -> &'a mut W { + pub fn value6(self) -> &'a mut crate::W { self.variant(CME_A::VALUE6) } } @@ -224,46 +206,47 @@ impl W { #[doc = "Bits 0:4 - Sample Time Control for Standard Conversions"] #[inline(always)] #[must_use] - pub fn stcs(&mut self) -> STCS_W<0> { - STCS_W::new(self) + pub fn stcs(&mut self) -> STCS_W { + STCS_W::new(self, 0) } #[doc = "Bits 8:10 - Conversion Mode for Standard Conversions"] #[inline(always)] #[must_use] - pub fn cms(&mut self) -> CMS_W<8> { - CMS_W::new(self) + pub fn cms(&mut self) -> CMS_W { + CMS_W::new(self, 8) } #[doc = "Bits 16:20 - Sample Time Control for EMUX Conversions"] #[inline(always)] #[must_use] - pub fn stce(&mut self) -> STCE_W<16> { - STCE_W::new(self) + pub fn stce(&mut self) -> STCE_W { + STCE_W::new(self, 16) } #[doc = "Bits 24:26 - Conversion Mode for EMUX Conversions"] #[inline(always)] #[must_use] - pub fn cme(&mut self) -> CME_W<24> { - CME_W::new(self) + pub fn cme(&mut self) -> CME_W { + CME_W::new(self, 24) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Input Class Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iclass::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`iclass::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`iclass::R`](R) reader structure"] +impl crate::Readable for ICLASS_SPEC {} +#[doc = "`write(|w| ..)` method takes [`iclass::W`](W) writer structure"] impl crate::Writable for ICLASS_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/q0r0.rs b/src/vadc_g0/q0r0.rs index 681e286a..32e69a06 100644 --- a/src/vadc_g0/q0r0.rs +++ b/src/vadc_g0/q0r0.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `REQCHNR` reader - Request Channel Number"] -pub type REQCHNR_R = crate::FieldReader; +pub type REQCHNR_R = crate::FieldReader; #[doc = "Field `RF` reader - Refill"] pub type RF_R = crate::BitReader; #[doc = "Refill\n\nValue on reset: 0"] @@ -34,18 +21,18 @@ impl From for bool { impl RF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RF_A { + pub const fn variant(&self) -> RF_A { match self.bits { false => RF_A::VALUE1, true => RF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The request is discarded after the conversion start."] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The request is automatically refilled into the queue after the conversion start."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RF_A::VALUE2 @@ -70,18 +57,18 @@ impl From for bool { impl ENSI_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENSI_A { + pub const fn variant(&self) -> ENSI_A { match self.bits { false => ENSI_A::VALUE1, true => ENSI_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No request source interrupt"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENSI_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A request source event interrupt is generated upon a request source event (related conversion is finished)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENSI_A::VALUE2 @@ -106,18 +93,18 @@ impl From for bool { impl EXTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EXTR_A { + pub const fn variant(&self) -> EXTR_A { match self.bits { false => EXTR_A::VALUE1, true => EXTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A valid queue entry immediately leads to a conversion request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EXTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The request handler waits for a trigger event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EXTR_A::VALUE2 @@ -142,18 +129,18 @@ impl From for bool { impl V_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> V_A { + pub const fn variant(&self) -> V_A { match self.bits { false => V_A::VALUE1, true => V_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No valid queue entry"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == V_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The queue entry is valid and leads to a conversion request"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == V_A::VALUE2 @@ -186,15 +173,13 @@ impl R { V_R::new(((self.bits >> 8) & 1) != 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"] +#[doc = "Queue 0 Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`q0r0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`q0r0::R`](R) reader structure"] +impl crate::Readable for Q0R0_SPEC {} #[doc = "`reset()` method sets Q0R0 to value 0"] impl crate::Resettable for Q0R0_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/vadc_g0/qbur0.rs b/src/vadc_g0/qbur0.rs index 96897ed9..be90ae45 100644 --- a/src/vadc_g0/qbur0.rs +++ b/src/vadc_g0/qbur0.rs @@ -1,26 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `REQCHNR` reader - Request Channel Number"] -pub type REQCHNR_R = crate::FieldReader; +pub type REQCHNR_R = crate::FieldReader; #[doc = "Field `RF` reader - Refill"] -pub type RF_R = crate::BitReader; +pub type RF_R = crate::BitReader; #[doc = "Field `ENSI` reader - Enable Source Interrupt"] -pub type ENSI_R = crate::BitReader; +pub type ENSI_R = crate::BitReader; #[doc = "Field `EXTR` reader - External Trigger"] -pub type EXTR_R = crate::BitReader; +pub type EXTR_R = crate::BitReader; #[doc = "Field `V` reader - Request Channel Number Valid"] pub type V_R = crate::BitReader; #[doc = "Request Channel Number Valid\n\nValue on reset: 0"] @@ -40,18 +27,18 @@ impl From for bool { impl V_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> V_A { + pub const fn variant(&self) -> V_A { match self.bits { false => V_A::VALUE1, true => V_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Backup register not valid"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == V_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Backup register contains a valid entry. This will be requested before a valid entry in queue register 0 (stage 0) will be requested."] #[inline(always)] pub fn is_value2(&self) -> bool { *self == V_A::VALUE2 @@ -84,15 +71,13 @@ impl R { V_R::new(((self.bits >> 8) & 1) != 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"] +#[doc = "Queue 0 Backup Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qbur0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`qbur0::R`](R) reader structure"] +impl crate::Readable for QBUR0_SPEC {} #[doc = "`reset()` method sets QBUR0 to value 0"] impl crate::Resettable for QBUR0_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/vadc_g0/qctrl0.rs b/src/vadc_g0/qctrl0.rs index dc821965..04207720 100644 --- a/src/vadc_g0/qctrl0.rs +++ b/src/vadc_g0/qctrl0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SRCRESREG` reader - Source-specific Result Register"] -pub type SRCRESREG_R = crate::FieldReader; +pub type SRCRESREG_R = crate::FieldReader; #[doc = "Source-specific Result Register\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -53,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SRCRESREG_A { + type Ux = u8; +} impl SRCRESREG_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SRCRESREG_A::VALUE1), 1 => Some(SRCRESREG_A::VALUE2), @@ -64,49 +35,53 @@ impl SRCRESREG_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Use GxCHCTRy.RESREG to select a group result register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRCRESREG_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Store result in group result register GxRES1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRCRESREG_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Store result in group result register GxRES15"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SRCRESREG_A::VALUE3 } } #[doc = "Field `SRCRESREG` writer - Source-specific Result Register"] -pub type SRCRESREG_W<'a, const O: u8> = crate::FieldWriter<'a, u32, QCTRL0_SPEC, u8, SRCRESREG_A, 4, O>; -impl<'a, const O: u8> SRCRESREG_W<'a, O> { +pub type SRCRESREG_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SRCRESREG_A>; +impl<'a, REG> SRCRESREG_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Use GxCHCTRy.RESREG to select a group result register"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE1) } #[doc = "Store result in group result register GxRES1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE2) } #[doc = "Store result in group result register GxRES15"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SRCRESREG_A::VALUE3) } } #[doc = "Field `XTSEL` reader - External Trigger Input Selection"] -pub type XTSEL_R = crate::FieldReader; +pub type XTSEL_R = crate::FieldReader; #[doc = "Field `XTSEL` writer - External Trigger Input Selection"] -pub type XTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, QCTRL0_SPEC, u8, u8, 4, O>; +pub type XTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `XTLVL` reader - External Trigger Level"] -pub type XTLVL_R = crate::BitReader; +pub type XTLVL_R = crate::BitReader; #[doc = "Field `XTMODE` reader - Trigger Operating Mode"] -pub type XTMODE_R = crate::FieldReader; +pub type XTMODE_R = crate::FieldReader; #[doc = "Trigger Operating Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -126,10 +101,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for XTMODE_A { + type Ux = u8; +} impl XTMODE_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> XTMODE_A { + pub const fn variant(&self) -> XTMODE_A { match self.bits { 0 => XTMODE_A::VALUE1, 1 => XTMODE_A::VALUE2, @@ -138,48 +116,52 @@ impl XTMODE_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No external trigger"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == XTMODE_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Trigger event upon a falling edge"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == XTMODE_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Trigger event upon a rising edge"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == XTMODE_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Trigger event upon any edge"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == XTMODE_A::VALUE4 } } #[doc = "Field `XTMODE` writer - Trigger Operating Mode"] -pub type XTMODE_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, QCTRL0_SPEC, u8, XTMODE_A, 2, O>; -impl<'a, const O: u8> XTMODE_W<'a, O> { +pub type XTMODE_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, XTMODE_A>; +impl<'a, REG> XTMODE_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No external trigger"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE1) } #[doc = "Trigger event upon a falling edge"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE2) } #[doc = "Trigger event upon a rising edge"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE3) } #[doc = "Trigger event upon any edge"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(XTMODE_A::VALUE4) } } @@ -198,25 +180,28 @@ impl From for bool { } } #[doc = "Field `XTWC` writer - Write Control for Trigger Configuration"] -pub type XTWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, QCTRL0_SPEC, XTWC_AW, O>; -impl<'a, const O: u8> XTWC_W<'a, O> { +pub type XTWC_W<'a, REG> = crate::BitWriter<'a, REG, XTWC_AW>; +impl<'a, REG> XTWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to trigger configuration"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(XTWC_AW::VALUE1) } #[doc = "Bitfields XTMODE and XTSEL can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(XTWC_AW::VALUE2) } } #[doc = "Field `GTSEL` reader - Gate Input Selection"] -pub type GTSEL_R = crate::FieldReader; +pub type GTSEL_R = crate::FieldReader; #[doc = "Field `GTSEL` writer - Gate Input Selection"] -pub type GTSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, QCTRL0_SPEC, u8, u8, 4, O>; +pub type GTSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `GTLVL` reader - Gate Input Level"] -pub type GTLVL_R = crate::BitReader; +pub type GTLVL_R = crate::BitReader; #[doc = "Write Control for Gate Configuration\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum GTWC_AW { @@ -232,16 +217,19 @@ impl From for bool { } } #[doc = "Field `GTWC` writer - Write Control for Gate Configuration"] -pub type GTWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, QCTRL0_SPEC, GTWC_AW, O>; -impl<'a, const O: u8> GTWC_W<'a, O> { +pub type GTWC_W<'a, REG> = crate::BitWriter<'a, REG, GTWC_AW>; +impl<'a, REG> GTWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to gate configuration"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(GTWC_AW::VALUE1) } #[doc = "Bitfield GTSEL can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(GTWC_AW::VALUE2) } } @@ -264,34 +252,37 @@ impl From for bool { impl TMEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> TMEN_A { + pub const fn variant(&self) -> TMEN_A { match self.bits { false => TMEN_A::VALUE1, true => TMEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No timer mode: standard gating mechanism can be used"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == TMEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Timer mode for equidistant sampling enabled: standard gating mechanism must be disabled"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == TMEN_A::VALUE2 } } #[doc = "Field `TMEN` writer - Timer Mode Enable"] -pub type TMEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, QCTRL0_SPEC, TMEN_A, O>; -impl<'a, const O: u8> TMEN_W<'a, O> { +pub type TMEN_W<'a, REG> = crate::BitWriter<'a, REG, TMEN_A>; +impl<'a, REG> TMEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No timer mode: standard gating mechanism can be used"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TMEN_A::VALUE1) } #[doc = "Timer mode for equidistant sampling enabled: standard gating mechanism must be disabled"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TMEN_A::VALUE2) } } @@ -310,16 +301,19 @@ impl From for bool { } } #[doc = "Field `TMWC` writer - Write Control for Timer Mode"] -pub type TMWC_W<'a, const O: u8> = crate::BitWriter<'a, u32, QCTRL0_SPEC, TMWC_AW, O>; -impl<'a, const O: u8> TMWC_W<'a, O> { +pub type TMWC_W<'a, REG> = crate::BitWriter<'a, REG, TMWC_AW>; +impl<'a, REG> TMWC_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No write access to timer mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TMWC_AW::VALUE1) } #[doc = "Bitfield TMEN can be written"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TMWC_AW::VALUE2) } } @@ -364,70 +358,71 @@ impl W { #[doc = "Bits 0:3 - Source-specific Result Register"] #[inline(always)] #[must_use] - pub fn srcresreg(&mut self) -> SRCRESREG_W<0> { - SRCRESREG_W::new(self) + pub fn srcresreg(&mut self) -> SRCRESREG_W { + SRCRESREG_W::new(self, 0) } #[doc = "Bits 8:11 - External Trigger Input Selection"] #[inline(always)] #[must_use] - pub fn xtsel(&mut self) -> XTSEL_W<8> { - XTSEL_W::new(self) + pub fn xtsel(&mut self) -> XTSEL_W { + XTSEL_W::new(self, 8) } #[doc = "Bits 13:14 - Trigger Operating Mode"] #[inline(always)] #[must_use] - pub fn xtmode(&mut self) -> XTMODE_W<13> { - XTMODE_W::new(self) + pub fn xtmode(&mut self) -> XTMODE_W { + XTMODE_W::new(self, 13) } #[doc = "Bit 15 - Write Control for Trigger Configuration"] #[inline(always)] #[must_use] - pub fn xtwc(&mut self) -> XTWC_W<15> { - XTWC_W::new(self) + pub fn xtwc(&mut self) -> XTWC_W { + XTWC_W::new(self, 15) } #[doc = "Bits 16:19 - Gate Input Selection"] #[inline(always)] #[must_use] - pub fn gtsel(&mut self) -> GTSEL_W<16> { - GTSEL_W::new(self) + pub fn gtsel(&mut self) -> GTSEL_W { + GTSEL_W::new(self, 16) } #[doc = "Bit 23 - Write Control for Gate Configuration"] #[inline(always)] #[must_use] - pub fn gtwc(&mut self) -> GTWC_W<23> { - GTWC_W::new(self) + pub fn gtwc(&mut self) -> GTWC_W { + GTWC_W::new(self, 23) } #[doc = "Bit 28 - Timer Mode Enable"] #[inline(always)] #[must_use] - pub fn tmen(&mut self) -> TMEN_W<28> { - TMEN_W::new(self) + pub fn tmen(&mut self) -> TMEN_W { + TMEN_W::new(self, 28) } #[doc = "Bit 31 - Write Control for Timer Mode"] #[inline(always)] #[must_use] - pub fn tmwc(&mut self) -> TMWC_W<31> { - TMWC_W::new(self) + pub fn tmwc(&mut self) -> TMWC_W { + TMWC_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Queue 0 Source Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qctrl0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`qctrl0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`qctrl0::R`](R) reader structure"] +impl crate::Readable for QCTRL0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`qctrl0::W`](W) writer structure"] impl crate::Writable for QCTRL0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/qinr0.rs b/src/vadc_g0/qinr0.rs index 00d365c1..59e95a9c 100644 --- a/src/vadc_g0/qinr0.rs +++ b/src/vadc_g0/qinr0.rs @@ -1,26 +1,7 @@ #[doc = "Register `QINR0` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `REQCHNR` writer - Request Channel Number"] -pub type REQCHNR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, QINR0_SPEC, u8, u8, 5, O>; +pub type REQCHNR_W<'a, REG> = crate::FieldWriter<'a, REG, 5>; #[doc = "Refill\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum RF_AW { @@ -36,16 +17,19 @@ impl From for bool { } } #[doc = "Field `RF` writer - Refill"] -pub type RF_W<'a, const O: u8> = crate::BitWriter<'a, u32, QINR0_SPEC, RF_AW, O>; -impl<'a, const O: u8> RF_W<'a, O> { +pub type RF_W<'a, REG> = crate::BitWriter<'a, REG, RF_AW>; +impl<'a, REG> RF_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No refill: this queue entry is converted once and then invalidated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RF_AW::VALUE1) } #[doc = "Automatic refill: this queue entry is automatically reloaded into QINRx when the related conversion is started"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RF_AW::VALUE2) } } @@ -64,16 +48,19 @@ impl From for bool { } } #[doc = "Field `ENSI` writer - Enable Source Interrupt"] -pub type ENSI_W<'a, const O: u8> = crate::BitWriter<'a, u32, QINR0_SPEC, ENSI_AW, O>; -impl<'a, const O: u8> ENSI_W<'a, O> { +pub type ENSI_W<'a, REG> = crate::BitWriter<'a, REG, ENSI_AW>; +impl<'a, REG> ENSI_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No request source interrupt"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENSI_AW::VALUE1) } #[doc = "A request source event interrupt is generated upon a request source event (related conversion is finished)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENSI_AW::VALUE2) } } @@ -92,16 +79,19 @@ impl From for bool { } } #[doc = "Field `EXTR` writer - External Trigger"] -pub type EXTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, QINR0_SPEC, EXTR_AW, O>; -impl<'a, const O: u8> EXTR_W<'a, O> { +pub type EXTR_W<'a, REG> = crate::BitWriter<'a, REG, EXTR_AW>; +impl<'a, REG> EXTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A valid queue entry immediately leads to a conversion request."] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EXTR_AW::VALUE1) } #[doc = "A valid queue entry waits for a trigger event to occur before issuing a conversion request."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EXTR_AW::VALUE2) } } @@ -109,42 +99,45 @@ impl W { #[doc = "Bits 0:4 - Request Channel Number"] #[inline(always)] #[must_use] - pub fn reqchnr(&mut self) -> REQCHNR_W<0> { - REQCHNR_W::new(self) + pub fn reqchnr(&mut self) -> REQCHNR_W { + REQCHNR_W::new(self, 0) } #[doc = "Bit 5 - Refill"] #[inline(always)] #[must_use] - pub fn rf(&mut self) -> RF_W<5> { - RF_W::new(self) + pub fn rf(&mut self) -> RF_W { + RF_W::new(self, 5) } #[doc = "Bit 6 - Enable Source Interrupt"] #[inline(always)] #[must_use] - pub fn ensi(&mut self) -> ENSI_W<6> { - ENSI_W::new(self) + pub fn ensi(&mut self) -> ENSI_W { + ENSI_W::new(self, 6) } #[doc = "Bit 7 - External Trigger"] #[inline(always)] #[must_use] - pub fn extr(&mut self) -> EXTR_W<7> { - EXTR_W::new(self) + pub fn extr(&mut self) -> EXTR_W { + EXTR_W::new(self, 7) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Queue 0 Input Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`qinr0::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct QINR0_SPEC; impl crate::RegisterSpec for QINR0_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [qinr0::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`qinr0::W`](W) writer structure"] impl crate::Writable for QINR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/qmr0.rs b/src/vadc_g0/qmr0.rs index 275ac689..6909b2cb 100644 --- a/src/vadc_g0/qmr0.rs +++ b/src/vadc_g0/qmr0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENGT` reader - Enable Gate"] -pub type ENGT_R = crate::FieldReader; +pub type ENGT_R = crate::FieldReader; #[doc = "Enable Gate\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for ENGT_A { + type Ux = u8; +} impl ENGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENGT_A { + pub const fn variant(&self) -> ENGT_A { match self.bits { 0 => ENGT_A::VALUE1, 1 => ENGT_A::VALUE2, @@ -67,48 +38,52 @@ impl ENGT_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No conversion requests are issued"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Conversion requests are issued if a valid conversion request is pending in the queue 0 register or in the backup register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENGT_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Conversion requests are issued if a valid conversion request is pending in the queue 0 register or in the backup register and REQGTx = 1"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == ENGT_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Conversion requests are issued if a valid conversion request is pending in the queue 0 register or in the backup register and REQGTx = 0"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == ENGT_A::VALUE4 } } #[doc = "Field `ENGT` writer - Enable Gate"] -pub type ENGT_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, QMR0_SPEC, u8, ENGT_A, 2, O>; -impl<'a, const O: u8> ENGT_W<'a, O> { +pub type ENGT_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, ENGT_A>; +impl<'a, REG> ENGT_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "No conversion requests are issued"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE1) } #[doc = "Conversion requests are issued if a valid conversion request is pending in the queue 0 register or in the backup register"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE2) } #[doc = "Conversion requests are issued if a valid conversion request is pending in the queue 0 register or in the backup register and REQGTx = 1"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE3) } #[doc = "Conversion requests are issued if a valid conversion request is pending in the queue 0 register or in the backup register and REQGTx = 0"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(ENGT_A::VALUE4) } } @@ -131,34 +106,37 @@ impl From for bool { impl ENTR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> ENTR_A { + pub const fn variant(&self) -> ENTR_A { match self.bits { false => ENTR_A::VALUE1, true => ENTR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "External trigger disabled"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == ENTR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The selected edge at the selected trigger input signal REQTR generates the trigger event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == ENTR_A::VALUE2 } } #[doc = "Field `ENTR` writer - Enable External Trigger"] -pub type ENTR_W<'a, const O: u8> = crate::BitWriter<'a, u32, QMR0_SPEC, ENTR_A, O>; -impl<'a, const O: u8> ENTR_W<'a, O> { +pub type ENTR_W<'a, REG> = crate::BitWriter<'a, REG, ENTR_A>; +impl<'a, REG> ENTR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "External trigger disabled"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ENTR_A::VALUE1) } #[doc = "The selected edge at the selected trigger input signal REQTR generates the trigger event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ENTR_A::VALUE2) } } @@ -177,16 +155,19 @@ impl From for bool { } } #[doc = "Field `CLRV` writer - Clear Valid Bit"] -pub type CLRV_W<'a, const O: u8> = crate::BitWriter<'a, u32, QMR0_SPEC, CLRV_AW, O>; -impl<'a, const O: u8> CLRV_W<'a, O> { +pub type CLRV_W<'a, REG> = crate::BitWriter<'a, REG, CLRV_AW>; +impl<'a, REG> CLRV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CLRV_AW::VALUE1) } #[doc = "The next pending valid queue entry in the sequence and the event flag EV are cleared. If there is a valid entry in the queue backup register (QBUR.V = 1), this entry is cleared, otherwise the entry in queue register 0 is cleared."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CLRV_AW::VALUE2) } } @@ -205,16 +186,19 @@ impl From for bool { } } #[doc = "Field `TREV` writer - Trigger Event"] -pub type TREV_W<'a, const O: u8> = crate::BitWriter<'a, u32, QMR0_SPEC, TREV_AW, O>; -impl<'a, const O: u8> TREV_W<'a, O> { +pub type TREV_W<'a, REG> = crate::BitWriter<'a, REG, TREV_AW>; +impl<'a, REG> TREV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(TREV_AW::VALUE1) } #[doc = "Generate a trigger event by software"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(TREV_AW::VALUE2) } } @@ -233,16 +217,19 @@ impl From for bool { } } #[doc = "Field `FLUSH` writer - Flush Queue"] -pub type FLUSH_W<'a, const O: u8> = crate::BitWriter<'a, u32, QMR0_SPEC, FLUSH_AW, O>; -impl<'a, const O: u8> FLUSH_W<'a, O> { +pub type FLUSH_W<'a, REG> = crate::BitWriter<'a, REG, FLUSH_AW>; +impl<'a, REG> FLUSH_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FLUSH_AW::VALUE1) } #[doc = "Clear all queue entries (including backup stage) and the event flag EV. The queue contains no more valid entry."] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FLUSH_AW::VALUE2) } } @@ -261,16 +248,19 @@ impl From for bool { } } #[doc = "Field `CEV` writer - Clear Event Flag"] -pub type CEV_W<'a, const O: u8> = crate::BitWriter<'a, u32, QMR0_SPEC, CEV_AW, O>; -impl<'a, const O: u8> CEV_W<'a, O> { +pub type CEV_W<'a, REG> = crate::BitWriter<'a, REG, CEV_AW>; +impl<'a, REG> CEV_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(CEV_AW::VALUE1) } #[doc = "Clear bit EV"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(CEV_AW::VALUE2) } } @@ -293,34 +283,37 @@ impl From for bool { impl RPTDIS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> RPTDIS_A { + pub const fn variant(&self) -> RPTDIS_A { match self.bits { false => RPTDIS_A::VALUE1, true => RPTDIS_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "A cancelled conversion is repeated"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == RPTDIS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A cancelled conversion is discarded"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == RPTDIS_A::VALUE2 } } #[doc = "Field `RPTDIS` writer - Repeat Disable"] -pub type RPTDIS_W<'a, const O: u8> = crate::BitWriter<'a, u32, QMR0_SPEC, RPTDIS_A, O>; -impl<'a, const O: u8> RPTDIS_W<'a, O> { +pub type RPTDIS_W<'a, REG> = crate::BitWriter<'a, REG, RPTDIS_A>; +impl<'a, REG> RPTDIS_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "A cancelled conversion is repeated"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(RPTDIS_A::VALUE1) } #[doc = "A cancelled conversion is discarded"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(RPTDIS_A::VALUE2) } } @@ -345,64 +338,65 @@ impl W { #[doc = "Bits 0:1 - Enable Gate"] #[inline(always)] #[must_use] - pub fn engt(&mut self) -> ENGT_W<0> { - ENGT_W::new(self) + pub fn engt(&mut self) -> ENGT_W { + ENGT_W::new(self, 0) } #[doc = "Bit 2 - Enable External Trigger"] #[inline(always)] #[must_use] - pub fn entr(&mut self) -> ENTR_W<2> { - ENTR_W::new(self) + pub fn entr(&mut self) -> ENTR_W { + ENTR_W::new(self, 2) } #[doc = "Bit 8 - Clear Valid Bit"] #[inline(always)] #[must_use] - pub fn clrv(&mut self) -> CLRV_W<8> { - CLRV_W::new(self) + pub fn clrv(&mut self) -> CLRV_W { + CLRV_W::new(self, 8) } #[doc = "Bit 9 - Trigger Event"] #[inline(always)] #[must_use] - pub fn trev(&mut self) -> TREV_W<9> { - TREV_W::new(self) + pub fn trev(&mut self) -> TREV_W { + TREV_W::new(self, 9) } #[doc = "Bit 10 - Flush Queue"] #[inline(always)] #[must_use] - pub fn flush(&mut self) -> FLUSH_W<10> { - FLUSH_W::new(self) + pub fn flush(&mut self) -> FLUSH_W { + FLUSH_W::new(self, 10) } #[doc = "Bit 11 - Clear Event Flag"] #[inline(always)] #[must_use] - pub fn cev(&mut self) -> CEV_W<11> { - CEV_W::new(self) + pub fn cev(&mut self) -> CEV_W { + CEV_W::new(self, 11) } #[doc = "Bit 16 - Repeat Disable"] #[inline(always)] #[must_use] - pub fn rptdis(&mut self) -> RPTDIS_W<16> { - RPTDIS_W::new(self) + pub fn rptdis(&mut self) -> RPTDIS_W { + RPTDIS_W::new(self, 16) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Queue 0 Mode Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qmr0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`qmr0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`qmr0::R`](R) reader structure"] +impl crate::Readable for QMR0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`qmr0::W`](W) writer structure"] impl crate::Writable for QMR0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/qsr0.rs b/src/vadc_g0/qsr0.rs index 54aaf65d..3113eb26 100644 --- a/src/vadc_g0/qsr0.rs +++ b/src/vadc_g0/qsr0.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `FILL` reader - Filling Level for Queue 2"] -pub type FILL_R = crate::FieldReader; +pub type FILL_R = crate::FieldReader; #[doc = "Filling Level for Queue 2\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -34,10 +21,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for FILL_A { + type Ux = u8; +} impl FILL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(FILL_A::VALUE1), 1 => Some(FILL_A::VALUE2), @@ -46,22 +36,22 @@ impl FILL_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "There is 1 ( if EMPTY = 0) or no (if EMPTY = 1) valid entry in the queue"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FILL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "There are 2 valid entries in the queue"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FILL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "There are 3 valid entries in the queue"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == FILL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "There are 8 valid entries in the queue"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == FILL_A::VALUE4 @@ -86,18 +76,18 @@ impl From for bool { impl EMPTY_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EMPTY_A { + pub const fn variant(&self) -> EMPTY_A { match self.bits { false => EMPTY_A::VALUE1, true => EMPTY_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "There are valid entries in the queue (see FILL)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EMPTY_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "No valid entries (queue is empty)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EMPTY_A::VALUE2 @@ -122,18 +112,18 @@ impl From for bool { impl REQGT_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REQGT_A { + pub const fn variant(&self) -> REQGT_A { match self.bits { false => REQGT_A::VALUE1, true => REQGT_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "The gate input is low"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REQGT_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "The gate input is high"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REQGT_A::VALUE2 @@ -158,18 +148,18 @@ impl From for bool { impl EV_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EV_A { + pub const fn variant(&self) -> EV_A { match self.bits { false => EV_A::VALUE1, true => EV_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No trigger event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EV_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A trigger event has been detected"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EV_A::VALUE2 @@ -197,15 +187,13 @@ impl R { EV_R::new(((self.bits >> 8) & 1) != 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"] +#[doc = "Queue 0 Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`qsr0::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`qsr0::R`](R) reader structure"] +impl crate::Readable for QSR0_SPEC {} #[doc = "`reset()` method sets QSR0 to value 0x20"] impl crate::Resettable for QSR0_SPEC { const RESET_VALUE: Self::Ux = 0x20; diff --git a/src/vadc_g0/rcr.rs b/src/vadc_g0/rcr.rs index 8ca57a92..a05e08e5 100644 --- a/src/vadc_g0/rcr.rs +++ b/src/vadc_g0/rcr.rs @@ -1,45 +1,13 @@ #[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) - } -} +pub type R = crate::R; #[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 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `DRCTR` reader - Data Reduction Control"] -pub type DRCTR_R = crate::FieldReader; +pub type DRCTR_R = crate::FieldReader; #[doc = "Field `DRCTR` writer - Data Reduction Control"] -pub type DRCTR_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RCR_SPEC, u8, u8, 4, O>; +pub type DRCTR_W<'a, REG> = crate::FieldWriter<'a, REG, 4>; #[doc = "Field `DMM` reader - Data Modification Mode"] -pub type DMM_R = crate::FieldReader; +pub type DMM_R = crate::FieldReader; #[doc = "Data Modification Mode\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -57,10 +25,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for DMM_A { + type Ux = u8; +} impl DMM_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(DMM_A::VALUE1), 1 => Some(DMM_A::VALUE2), @@ -68,38 +39,42 @@ impl DMM_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Standard data reduction (accumulation)"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == DMM_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Result filtering mode"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == DMM_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Difference mode"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == DMM_A::VALUE3 } } #[doc = "Field `DMM` writer - Data Modification Mode"] -pub type DMM_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RCR_SPEC, u8, DMM_A, 2, O>; -impl<'a, const O: u8> DMM_W<'a, O> { +pub type DMM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, DMM_A>; +impl<'a, REG> DMM_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Standard data reduction (accumulation)"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(DMM_A::VALUE1) } #[doc = "Result filtering mode"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(DMM_A::VALUE2) } #[doc = "Difference mode"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(DMM_A::VALUE3) } } @@ -122,39 +97,42 @@ impl From for bool { impl WFR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> WFR_A { + pub const fn variant(&self) -> WFR_A { match self.bits { false => WFR_A::VALUE1, true => WFR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Overwrite mode"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == WFR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Wait-for-read mode enabled for this register"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == WFR_A::VALUE2 } } #[doc = "Field `WFR` writer - Wait-for-Read Mode Enable"] -pub type WFR_W<'a, const O: u8> = crate::BitWriter<'a, u32, RCR_SPEC, WFR_A, O>; -impl<'a, const O: u8> WFR_W<'a, O> { +pub type WFR_W<'a, REG> = crate::BitWriter<'a, REG, WFR_A>; +impl<'a, REG> WFR_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Overwrite mode"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(WFR_A::VALUE1) } #[doc = "Wait-for-read mode enabled for this register"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(WFR_A::VALUE2) } } #[doc = "Field `FEN` reader - FIFO Mode Enable"] -pub type FEN_R = crate::FieldReader; +pub type FEN_R = crate::FieldReader; #[doc = "FIFO Mode Enable\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -170,38 +148,45 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for FEN_A { + type Ux = u8; +} impl FEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(FEN_A::VALUE1), 1 => Some(FEN_A::VALUE2), _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Separate result register"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Part of a FIFO structure: copy each new valid result"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FEN_A::VALUE2 } } #[doc = "Field `FEN` writer - FIFO Mode Enable"] -pub type FEN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RCR_SPEC, u8, FEN_A, 2, O>; -impl<'a, const O: u8> FEN_W<'a, O> { +pub type FEN_W<'a, REG> = crate::FieldWriter<'a, REG, 2, FEN_A>; +impl<'a, REG> FEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Separate result register"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(FEN_A::VALUE1) } #[doc = "Part of a FIFO structure: copy each new valid result"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(FEN_A::VALUE2) } } @@ -224,34 +209,37 @@ impl From for bool { impl SRGEN_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SRGEN_A { + pub const fn variant(&self) -> SRGEN_A { match self.bits { false => SRGEN_A::VALUE1, true => SRGEN_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No service request"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SRGEN_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Service request after a result event"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SRGEN_A::VALUE2 } } #[doc = "Field `SRGEN` writer - Service Request Generation Enable"] -pub type SRGEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RCR_SPEC, SRGEN_A, O>; -impl<'a, const O: u8> SRGEN_W<'a, O> { +pub type SRGEN_W<'a, REG> = crate::BitWriter<'a, REG, SRGEN_A>; +impl<'a, REG> SRGEN_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No service request"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SRGEN_A::VALUE1) } #[doc = "Service request after a result event"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SRGEN_A::VALUE2) } } @@ -286,52 +274,53 @@ impl W { #[doc = "Bits 16:19 - Data Reduction Control"] #[inline(always)] #[must_use] - pub fn drctr(&mut self) -> DRCTR_W<16> { - DRCTR_W::new(self) + pub fn drctr(&mut self) -> DRCTR_W { + DRCTR_W::new(self, 16) } #[doc = "Bits 20:21 - Data Modification Mode"] #[inline(always)] #[must_use] - pub fn dmm(&mut self) -> DMM_W<20> { - DMM_W::new(self) + pub fn dmm(&mut self) -> DMM_W { + DMM_W::new(self, 20) } #[doc = "Bit 24 - Wait-for-Read Mode Enable"] #[inline(always)] #[must_use] - pub fn wfr(&mut self) -> WFR_W<24> { - WFR_W::new(self) + pub fn wfr(&mut self) -> WFR_W { + WFR_W::new(self, 24) } #[doc = "Bits 25:26 - FIFO Mode Enable"] #[inline(always)] #[must_use] - pub fn fen(&mut self) -> FEN_W<25> { - FEN_W::new(self) + pub fn fen(&mut self) -> FEN_W { + FEN_W::new(self, 25) } #[doc = "Bit 31 - Service Request Generation Enable"] #[inline(always)] #[must_use] - pub fn srgen(&mut self) -> SRGEN_W<31> { - SRGEN_W::new(self) + pub fn srgen(&mut self) -> SRGEN_W { + SRGEN_W::new(self, 31) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Result Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`rcr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`rcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`rcr::R`](R) reader structure"] +impl crate::Readable for RCR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`rcr::W`](W) writer structure"] impl crate::Writable for RCR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/refclr.rs b/src/vadc_g0/refclr.rs index 112dd323..12d4f659 100644 --- a/src/vadc_g0/refclr.rs +++ b/src/vadc_g0/refclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `REFCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Result Event for Result Register 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum REV0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `REV0` writer - Clear Result Event for Result Register 0"] -pub type REV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV0_AW, O>; -impl<'a, const O: u8> REV0_W<'a, O> { +pub type REV0_W<'a, REG> = crate::BitWriter<'a, REG, REV0_AW>; +impl<'a, REG> REV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV0_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `REV1` writer - Clear Result Event for Result Register 1"] -pub type REV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV1_AW, O>; -impl<'a, const O: u8> REV1_W<'a, O> { +pub type REV1_W<'a, REG> = crate::BitWriter<'a, REG, REV1_AW>; +impl<'a, REG> REV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV1_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `REV2` writer - Clear Result Event for Result Register 2"] -pub type REV2_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV2_AW, O>; -impl<'a, const O: u8> REV2_W<'a, O> { +pub type REV2_W<'a, REG> = crate::BitWriter<'a, REG, REV2_AW>; +impl<'a, REG> REV2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV2_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `REV3` writer - Clear Result Event for Result Register 3"] -pub type REV3_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV3_AW, O>; -impl<'a, const O: u8> REV3_W<'a, O> { +pub type REV3_W<'a, REG> = crate::BitWriter<'a, REG, REV3_AW>; +impl<'a, REG> REV3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV3_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `REV4` writer - Clear Result Event for Result Register 4"] -pub type REV4_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV4_AW, O>; -impl<'a, const O: u8> REV4_W<'a, O> { +pub type REV4_W<'a, REG> = crate::BitWriter<'a, REG, REV4_AW>; +impl<'a, REG> REV4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV4_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV4_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `REV5` writer - Clear Result Event for Result Register 5"] -pub type REV5_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV5_AW, O>; -impl<'a, const O: u8> REV5_W<'a, O> { +pub type REV5_W<'a, REG> = crate::BitWriter<'a, REG, REV5_AW>; +impl<'a, REG> REV5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV5_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV5_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `REV6` writer - Clear Result Event for Result Register 6"] -pub type REV6_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV6_AW, O>; -impl<'a, const O: u8> REV6_W<'a, O> { +pub type REV6_W<'a, REG> = crate::BitWriter<'a, REG, REV6_AW>; +impl<'a, REG> REV6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV6_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV6_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `REV7` writer - Clear Result Event for Result Register 7"] -pub type REV7_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV7_AW, O>; -impl<'a, const O: u8> REV7_W<'a, O> { +pub type REV7_W<'a, REG> = crate::BitWriter<'a, REG, REV7_AW>; +impl<'a, REG> REV7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV7_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV7_AW::VALUE2) } } @@ -258,16 +263,19 @@ impl From for bool { } } #[doc = "Field `REV8` writer - Clear Result Event for Result Register 8"] -pub type REV8_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV8_AW, O>; -impl<'a, const O: u8> REV8_W<'a, O> { +pub type REV8_W<'a, REG> = crate::BitWriter<'a, REG, REV8_AW>; +impl<'a, REG> REV8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV8_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV8_AW::VALUE2) } } @@ -286,16 +294,19 @@ impl From for bool { } } #[doc = "Field `REV9` writer - Clear Result Event for Result Register 9"] -pub type REV9_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV9_AW, O>; -impl<'a, const O: u8> REV9_W<'a, O> { +pub type REV9_W<'a, REG> = crate::BitWriter<'a, REG, REV9_AW>; +impl<'a, REG> REV9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV9_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV9_AW::VALUE2) } } @@ -314,16 +325,19 @@ impl From for bool { } } #[doc = "Field `REV10` writer - Clear Result Event for Result Register 10"] -pub type REV10_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV10_AW, O>; -impl<'a, const O: u8> REV10_W<'a, O> { +pub type REV10_W<'a, REG> = crate::BitWriter<'a, REG, REV10_AW>; +impl<'a, REG> REV10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV10_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV10_AW::VALUE2) } } @@ -342,16 +356,19 @@ impl From for bool { } } #[doc = "Field `REV11` writer - Clear Result Event for Result Register 11"] -pub type REV11_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV11_AW, O>; -impl<'a, const O: u8> REV11_W<'a, O> { +pub type REV11_W<'a, REG> = crate::BitWriter<'a, REG, REV11_AW>; +impl<'a, REG> REV11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV11_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV11_AW::VALUE2) } } @@ -370,16 +387,19 @@ impl From for bool { } } #[doc = "Field `REV12` writer - Clear Result Event for Result Register 12"] -pub type REV12_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV12_AW, O>; -impl<'a, const O: u8> REV12_W<'a, O> { +pub type REV12_W<'a, REG> = crate::BitWriter<'a, REG, REV12_AW>; +impl<'a, REG> REV12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV12_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV12_AW::VALUE2) } } @@ -398,16 +418,19 @@ impl From for bool { } } #[doc = "Field `REV13` writer - Clear Result Event for Result Register 13"] -pub type REV13_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV13_AW, O>; -impl<'a, const O: u8> REV13_W<'a, O> { +pub type REV13_W<'a, REG> = crate::BitWriter<'a, REG, REV13_AW>; +impl<'a, REG> REV13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV13_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV13_AW::VALUE2) } } @@ -426,16 +449,19 @@ impl From for bool { } } #[doc = "Field `REV14` writer - Clear Result Event for Result Register 14"] -pub type REV14_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV14_AW, O>; -impl<'a, const O: u8> REV14_W<'a, O> { +pub type REV14_W<'a, REG> = crate::BitWriter<'a, REG, REV14_AW>; +impl<'a, REG> REV14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV14_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV14_AW::VALUE2) } } @@ -454,16 +480,19 @@ impl From for bool { } } #[doc = "Field `REV15` writer - Clear Result Event for Result Register 15"] -pub type REV15_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFCLR_SPEC, REV15_AW, O>; -impl<'a, const O: u8> REV15_W<'a, O> { +pub type REV15_W<'a, REG> = crate::BitWriter<'a, REG, REV15_AW>; +impl<'a, REG> REV15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV15_AW::VALUE1) } #[doc = "Clear the result event flag in GxREFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV15_AW::VALUE2) } } @@ -471,114 +500,117 @@ impl W { #[doc = "Bit 0 - Clear Result Event for Result Register 0"] #[inline(always)] #[must_use] - pub fn rev0(&mut self) -> REV0_W<0> { - REV0_W::new(self) + pub fn rev0(&mut self) -> REV0_W { + REV0_W::new(self, 0) } #[doc = "Bit 1 - Clear Result Event for Result Register 1"] #[inline(always)] #[must_use] - pub fn rev1(&mut self) -> REV1_W<1> { - REV1_W::new(self) + pub fn rev1(&mut self) -> REV1_W { + REV1_W::new(self, 1) } #[doc = "Bit 2 - Clear Result Event for Result Register 2"] #[inline(always)] #[must_use] - pub fn rev2(&mut self) -> REV2_W<2> { - REV2_W::new(self) + pub fn rev2(&mut self) -> REV2_W { + REV2_W::new(self, 2) } #[doc = "Bit 3 - Clear Result Event for Result Register 3"] #[inline(always)] #[must_use] - pub fn rev3(&mut self) -> REV3_W<3> { - REV3_W::new(self) + pub fn rev3(&mut self) -> REV3_W { + REV3_W::new(self, 3) } #[doc = "Bit 4 - Clear Result Event for Result Register 4"] #[inline(always)] #[must_use] - pub fn rev4(&mut self) -> REV4_W<4> { - REV4_W::new(self) + pub fn rev4(&mut self) -> REV4_W { + REV4_W::new(self, 4) } #[doc = "Bit 5 - Clear Result Event for Result Register 5"] #[inline(always)] #[must_use] - pub fn rev5(&mut self) -> REV5_W<5> { - REV5_W::new(self) + pub fn rev5(&mut self) -> REV5_W { + REV5_W::new(self, 5) } #[doc = "Bit 6 - Clear Result Event for Result Register 6"] #[inline(always)] #[must_use] - pub fn rev6(&mut self) -> REV6_W<6> { - REV6_W::new(self) + pub fn rev6(&mut self) -> REV6_W { + REV6_W::new(self, 6) } #[doc = "Bit 7 - Clear Result Event for Result Register 7"] #[inline(always)] #[must_use] - pub fn rev7(&mut self) -> REV7_W<7> { - REV7_W::new(self) + pub fn rev7(&mut self) -> REV7_W { + REV7_W::new(self, 7) } #[doc = "Bit 8 - Clear Result Event for Result Register 8"] #[inline(always)] #[must_use] - pub fn rev8(&mut self) -> REV8_W<8> { - REV8_W::new(self) + pub fn rev8(&mut self) -> REV8_W { + REV8_W::new(self, 8) } #[doc = "Bit 9 - Clear Result Event for Result Register 9"] #[inline(always)] #[must_use] - pub fn rev9(&mut self) -> REV9_W<9> { - REV9_W::new(self) + pub fn rev9(&mut self) -> REV9_W { + REV9_W::new(self, 9) } #[doc = "Bit 10 - Clear Result Event for Result Register 10"] #[inline(always)] #[must_use] - pub fn rev10(&mut self) -> REV10_W<10> { - REV10_W::new(self) + pub fn rev10(&mut self) -> REV10_W { + REV10_W::new(self, 10) } #[doc = "Bit 11 - Clear Result Event for Result Register 11"] #[inline(always)] #[must_use] - pub fn rev11(&mut self) -> REV11_W<11> { - REV11_W::new(self) + pub fn rev11(&mut self) -> REV11_W { + REV11_W::new(self, 11) } #[doc = "Bit 12 - Clear Result Event for Result Register 12"] #[inline(always)] #[must_use] - pub fn rev12(&mut self) -> REV12_W<12> { - REV12_W::new(self) + pub fn rev12(&mut self) -> REV12_W { + REV12_W::new(self, 12) } #[doc = "Bit 13 - Clear Result Event for Result Register 13"] #[inline(always)] #[must_use] - pub fn rev13(&mut self) -> REV13_W<13> { - REV13_W::new(self) + pub fn rev13(&mut self) -> REV13_W { + REV13_W::new(self, 13) } #[doc = "Bit 14 - Clear Result Event for Result Register 14"] #[inline(always)] #[must_use] - pub fn rev14(&mut self) -> REV14_W<14> { - REV14_W::new(self) + pub fn rev14(&mut self) -> REV14_W { + REV14_W::new(self, 14) } #[doc = "Bit 15 - Clear Result Event for Result Register 15"] #[inline(always)] #[must_use] - pub fn rev15(&mut self) -> REV15_W<15> { - REV15_W::new(self) + pub fn rev15(&mut self) -> REV15_W { + REV15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Result Event Flag Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`refclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct REFCLR_SPEC; impl crate::RegisterSpec for REFCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [refclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`refclr::W`](W) writer structure"] impl crate::Writable for REFCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/reflag.rs b/src/vadc_g0/reflag.rs index fa21067a..a5198267 100644 --- a/src/vadc_g0/reflag.rs +++ b/src/vadc_g0/reflag.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `REV0` reader - Result Event for Result Register 0"] pub type REV0_R = crate::BitReader; #[doc = "Result Event for Result Register 0\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl REV0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV0_A { + pub const fn variant(&self) -> REV0_A { match self.bits { false => REV0_A::VALUE1, true => REV0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV0_A::VALUE2 } } #[doc = "Field `REV0` writer - Result Event for Result Register 0"] -pub type REV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV0_A, O>; -impl<'a, const O: u8> REV0_W<'a, O> { +pub type REV0_W<'a, REG> = crate::BitWriter<'a, REG, REV0_A>; +impl<'a, REG> REV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV0_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl REV1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV1_A { + pub const fn variant(&self) -> REV1_A { match self.bits { false => REV1_A::VALUE1, true => REV1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV1_A::VALUE2 } } #[doc = "Field `REV1` writer - Result Event for Result Register 1"] -pub type REV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV1_A, O>; -impl<'a, const O: u8> REV1_W<'a, O> { +pub type REV1_W<'a, REG> = crate::BitWriter<'a, REG, REV1_A>; +impl<'a, REG> REV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV1_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl REV2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV2_A { + pub const fn variant(&self) -> REV2_A { match self.bits { false => REV2_A::VALUE1, true => REV2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV2_A::VALUE2 } } #[doc = "Field `REV2` writer - Result Event for Result Register 2"] -pub type REV2_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV2_A, O>; -impl<'a, const O: u8> REV2_W<'a, O> { +pub type REV2_W<'a, REG> = crate::BitWriter<'a, REG, REV2_A>; +impl<'a, REG> REV2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV2_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl REV3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV3_A { + pub const fn variant(&self) -> REV3_A { match self.bits { false => REV3_A::VALUE1, true => REV3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV3_A::VALUE2 } } #[doc = "Field `REV3` writer - Result Event for Result Register 3"] -pub type REV3_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV3_A, O>; -impl<'a, const O: u8> REV3_W<'a, O> { +pub type REV3_W<'a, REG> = crate::BitWriter<'a, REG, REV3_A>; +impl<'a, REG> REV3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV3_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl REV4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV4_A { + pub const fn variant(&self) -> REV4_A { match self.bits { false => REV4_A::VALUE1, true => REV4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV4_A::VALUE2 } } #[doc = "Field `REV4` writer - Result Event for Result Register 4"] -pub type REV4_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV4_A, O>; -impl<'a, const O: u8> REV4_W<'a, O> { +pub type REV4_W<'a, REG> = crate::BitWriter<'a, REG, REV4_A>; +impl<'a, REG> REV4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV4_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl REV5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV5_A { + pub const fn variant(&self) -> REV5_A { match self.bits { false => REV5_A::VALUE1, true => REV5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV5_A::VALUE2 } } #[doc = "Field `REV5` writer - Result Event for Result Register 5"] -pub type REV5_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV5_A, O>; -impl<'a, const O: u8> REV5_W<'a, O> { +pub type REV5_W<'a, REG> = crate::BitWriter<'a, REG, REV5_A>; +impl<'a, REG> REV5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV5_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl REV6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV6_A { + pub const fn variant(&self) -> REV6_A { match self.bits { false => REV6_A::VALUE1, true => REV6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV6_A::VALUE2 } } #[doc = "Field `REV6` writer - Result Event for Result Register 6"] -pub type REV6_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV6_A, O>; -impl<'a, const O: u8> REV6_W<'a, O> { +pub type REV6_W<'a, REG> = crate::BitWriter<'a, REG, REV6_A>; +impl<'a, REG> REV6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV6_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl REV7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV7_A { + pub const fn variant(&self) -> REV7_A { match self.bits { false => REV7_A::VALUE1, true => REV7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV7_A::VALUE2 } } #[doc = "Field `REV7` writer - Result Event for Result Register 7"] -pub type REV7_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV7_A, O>; -impl<'a, const O: u8> REV7_W<'a, O> { +pub type REV7_W<'a, REG> = crate::BitWriter<'a, REG, REV7_A>; +impl<'a, REG> REV7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV7_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl REV8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV8_A { + pub const fn variant(&self) -> REV8_A { match self.bits { false => REV8_A::VALUE1, true => REV8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV8_A::VALUE2 } } #[doc = "Field `REV8` writer - Result Event for Result Register 8"] -pub type REV8_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV8_A, O>; -impl<'a, const O: u8> REV8_W<'a, O> { +pub type REV8_W<'a, REG> = crate::BitWriter<'a, REG, REV8_A>; +impl<'a, REG> REV8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV8_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl REV9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV9_A { + pub const fn variant(&self) -> REV9_A { match self.bits { false => REV9_A::VALUE1, true => REV9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV9_A::VALUE2 } } #[doc = "Field `REV9` writer - Result Event for Result Register 9"] -pub type REV9_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV9_A, O>; -impl<'a, const O: u8> REV9_W<'a, O> { +pub type REV9_W<'a, REG> = crate::BitWriter<'a, REG, REV9_A>; +impl<'a, REG> REV9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV9_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl REV10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV10_A { + pub const fn variant(&self) -> REV10_A { match self.bits { false => REV10_A::VALUE1, true => REV10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV10_A::VALUE2 } } #[doc = "Field `REV10` writer - Result Event for Result Register 10"] -pub type REV10_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV10_A, O>; -impl<'a, const O: u8> REV10_W<'a, O> { +pub type REV10_W<'a, REG> = crate::BitWriter<'a, REG, REV10_A>; +impl<'a, REG> REV10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV10_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl REV11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV11_A { + pub const fn variant(&self) -> REV11_A { match self.bits { false => REV11_A::VALUE1, true => REV11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV11_A::VALUE2 } } #[doc = "Field `REV11` writer - Result Event for Result Register 11"] -pub type REV11_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV11_A, O>; -impl<'a, const O: u8> REV11_W<'a, O> { +pub type REV11_W<'a, REG> = crate::BitWriter<'a, REG, REV11_A>; +impl<'a, REG> REV11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV11_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl REV12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV12_A { + pub const fn variant(&self) -> REV12_A { match self.bits { false => REV12_A::VALUE1, true => REV12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV12_A::VALUE2 } } #[doc = "Field `REV12` writer - Result Event for Result Register 12"] -pub type REV12_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV12_A, O>; -impl<'a, const O: u8> REV12_W<'a, O> { +pub type REV12_W<'a, REG> = crate::BitWriter<'a, REG, REV12_A>; +impl<'a, REG> REV12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV12_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl REV13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV13_A { + pub const fn variant(&self) -> REV13_A { match self.bits { false => REV13_A::VALUE1, true => REV13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV13_A::VALUE2 } } #[doc = "Field `REV13` writer - Result Event for Result Register 13"] -pub type REV13_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV13_A, O>; -impl<'a, const O: u8> REV13_W<'a, O> { +pub type REV13_W<'a, REG> = crate::BitWriter<'a, REG, REV13_A>; +impl<'a, REG> REV13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV13_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl REV14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV14_A { + pub const fn variant(&self) -> REV14_A { match self.bits { false => REV14_A::VALUE1, true => REV14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV14_A::VALUE2 } } #[doc = "Field `REV14` writer - Result Event for Result Register 14"] -pub type REV14_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV14_A, O>; -impl<'a, const O: u8> REV14_W<'a, O> { +pub type REV14_W<'a, REG> = crate::BitWriter<'a, REG, REV14_A>; +impl<'a, REG> REV14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV14_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl REV15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> REV15_A { + pub const fn variant(&self) -> REV15_A { match self.bits { false => REV15_A::VALUE1, true => REV15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No result event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "New result was stored in register GxRESy"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV15_A::VALUE2 } } #[doc = "Field `REV15` writer - Result Event for Result Register 15"] -pub type REV15_W<'a, const O: u8> = crate::BitWriter<'a, u32, REFLAG_SPEC, REV15_A, O>; -impl<'a, const O: u8> REV15_W<'a, O> { +pub type REV15_W<'a, REG> = crate::BitWriter<'a, REG, REV15_A>; +impl<'a, REG> REV15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No result event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV15_A::VALUE1) } #[doc = "New result was stored in register GxRESy"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Result Event for Result Register 0"] #[inline(always)] #[must_use] - pub fn rev0(&mut self) -> REV0_W<0> { - REV0_W::new(self) + pub fn rev0(&mut self) -> REV0_W { + REV0_W::new(self, 0) } #[doc = "Bit 1 - Result Event for Result Register 1"] #[inline(always)] #[must_use] - pub fn rev1(&mut self) -> REV1_W<1> { - REV1_W::new(self) + pub fn rev1(&mut self) -> REV1_W { + REV1_W::new(self, 1) } #[doc = "Bit 2 - Result Event for Result Register 2"] #[inline(always)] #[must_use] - pub fn rev2(&mut self) -> REV2_W<2> { - REV2_W::new(self) + pub fn rev2(&mut self) -> REV2_W { + REV2_W::new(self, 2) } #[doc = "Bit 3 - Result Event for Result Register 3"] #[inline(always)] #[must_use] - pub fn rev3(&mut self) -> REV3_W<3> { - REV3_W::new(self) + pub fn rev3(&mut self) -> REV3_W { + REV3_W::new(self, 3) } #[doc = "Bit 4 - Result Event for Result Register 4"] #[inline(always)] #[must_use] - pub fn rev4(&mut self) -> REV4_W<4> { - REV4_W::new(self) + pub fn rev4(&mut self) -> REV4_W { + REV4_W::new(self, 4) } #[doc = "Bit 5 - Result Event for Result Register 5"] #[inline(always)] #[must_use] - pub fn rev5(&mut self) -> REV5_W<5> { - REV5_W::new(self) + pub fn rev5(&mut self) -> REV5_W { + REV5_W::new(self, 5) } #[doc = "Bit 6 - Result Event for Result Register 6"] #[inline(always)] #[must_use] - pub fn rev6(&mut self) -> REV6_W<6> { - REV6_W::new(self) + pub fn rev6(&mut self) -> REV6_W { + REV6_W::new(self, 6) } #[doc = "Bit 7 - Result Event for Result Register 7"] #[inline(always)] #[must_use] - pub fn rev7(&mut self) -> REV7_W<7> { - REV7_W::new(self) + pub fn rev7(&mut self) -> REV7_W { + REV7_W::new(self, 7) } #[doc = "Bit 8 - Result Event for Result Register 8"] #[inline(always)] #[must_use] - pub fn rev8(&mut self) -> REV8_W<8> { - REV8_W::new(self) + pub fn rev8(&mut self) -> REV8_W { + REV8_W::new(self, 8) } #[doc = "Bit 9 - Result Event for Result Register 9"] #[inline(always)] #[must_use] - pub fn rev9(&mut self) -> REV9_W<9> { - REV9_W::new(self) + pub fn rev9(&mut self) -> REV9_W { + REV9_W::new(self, 9) } #[doc = "Bit 10 - Result Event for Result Register 10"] #[inline(always)] #[must_use] - pub fn rev10(&mut self) -> REV10_W<10> { - REV10_W::new(self) + pub fn rev10(&mut self) -> REV10_W { + REV10_W::new(self, 10) } #[doc = "Bit 11 - Result Event for Result Register 11"] #[inline(always)] #[must_use] - pub fn rev11(&mut self) -> REV11_W<11> { - REV11_W::new(self) + pub fn rev11(&mut self) -> REV11_W { + REV11_W::new(self, 11) } #[doc = "Bit 12 - Result Event for Result Register 12"] #[inline(always)] #[must_use] - pub fn rev12(&mut self) -> REV12_W<12> { - REV12_W::new(self) + pub fn rev12(&mut self) -> REV12_W { + REV12_W::new(self, 12) } #[doc = "Bit 13 - Result Event for Result Register 13"] #[inline(always)] #[must_use] - pub fn rev13(&mut self) -> REV13_W<13> { - REV13_W::new(self) + pub fn rev13(&mut self) -> REV13_W { + REV13_W::new(self, 13) } #[doc = "Bit 14 - Result Event for Result Register 14"] #[inline(always)] #[must_use] - pub fn rev14(&mut self) -> REV14_W<14> { - REV14_W::new(self) + pub fn rev14(&mut self) -> REV14_W { + REV14_W::new(self, 14) } #[doc = "Bit 15 - Result Event for Result Register 15"] #[inline(always)] #[must_use] - pub fn rev15(&mut self) -> REV15_W<15> { - REV15_W::new(self) + pub fn rev15(&mut self) -> REV15_W { + REV15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Result Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`reflag::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`reflag::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`reflag::R`](R) reader structure"] +impl crate::Readable for REFLAG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`reflag::W`](W) writer structure"] impl crate::Writable for REFLAG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/res.rs b/src/vadc_g0/res.rs index 2b0e29ab..060d12e3 100644 --- a/src/vadc_g0/res.rs +++ b/src/vadc_g0/res.rs @@ -1,51 +1,19 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `RESULT` reader - Result of Most Recent Conversion"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; #[doc = "Field `RESULT` writer - Result of Most Recent Conversion"] -pub type RESULT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, RES_SPEC, u16, u16, 16, O>; +pub type RESULT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>; #[doc = "Field `DRC` reader - Data Reduction Counter"] -pub type DRC_R = crate::FieldReader; +pub type DRC_R = crate::FieldReader; #[doc = "Field `CHNR` reader - Channel Number"] -pub type CHNR_R = crate::FieldReader; +pub type CHNR_R = crate::FieldReader; #[doc = "Field `EMUX` reader - External Multiplexer Setting"] -pub type EMUX_R = crate::FieldReader; +pub type EMUX_R = crate::FieldReader; #[doc = "Field `CRS` reader - Converted Request Source"] -pub type CRS_R = crate::FieldReader; +pub type CRS_R = crate::FieldReader; #[doc = "Converted Request Source\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -63,10 +31,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CRS_A { + type Ux = u8; +} impl CRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CRS_A::VALUE1), 1 => Some(CRS_A::VALUE2), @@ -74,17 +45,17 @@ impl CRS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Request source 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request source 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CRS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Request source 2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CRS_A::VALUE3 @@ -109,18 +80,18 @@ impl From for bool { impl FCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FCR_A { + pub const fn variant(&self) -> FCR_A { match self.bits { false => FCR_A::VALUE1, true => FCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Signal level was below compare value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal level was above compare value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FCR_A::VALUE2 @@ -145,18 +116,18 @@ impl From for bool { impl VF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF_A { + pub const fn variant(&self) -> VF_A { match self.bits { false => VF_A::VALUE1, true => VF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new result available"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bitfield RESULT has been updated with new result value and has not yet been read, or bit FCR has been updated"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF_A::VALUE2 @@ -203,28 +174,29 @@ impl W { #[doc = "Bits 0:15 - Result of Most Recent Conversion"] #[inline(always)] #[must_use] - pub fn result(&mut self) -> RESULT_W<0> { - RESULT_W::new(self) + pub fn result(&mut self) -> RESULT_W { + RESULT_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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\n\nOne or more dependent resources other than the current register are immediately affected by a read operation."] +#[doc = "Result Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`res::R`](R). WARN: One or more dependent resources other than the current register are immediately affected by a read operation. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`res::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`res::R`](R) reader structure"] +impl crate::Readable for RES_SPEC {} +#[doc = "`write(|w| ..)` method takes [`res::W`](W) writer structure"] impl crate::Writable for RES_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/resd.rs b/src/vadc_g0/resd.rs index 2b434b25..1f8bf863 100644 --- a/src/vadc_g0/resd.rs +++ b/src/vadc_g0/resd.rs @@ -1,28 +1,15 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `RESULT` reader - Result of Most Recent Conversion"] -pub type RESULT_R = crate::FieldReader; +pub type RESULT_R = crate::FieldReader; #[doc = "Field `DRC` reader - Data Reduction Counter"] -pub type DRC_R = crate::FieldReader; +pub type DRC_R = crate::FieldReader; #[doc = "Field `CHNR` reader - Channel Number"] -pub type CHNR_R = crate::FieldReader; +pub type CHNR_R = crate::FieldReader; #[doc = "Field `EMUX` reader - External Multiplexer Setting"] -pub type EMUX_R = crate::FieldReader; +pub type EMUX_R = crate::FieldReader; #[doc = "Field `CRS` reader - Converted Request Source"] -pub type CRS_R = crate::FieldReader; +pub type CRS_R = crate::FieldReader; #[doc = "Converted Request Source\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -40,10 +27,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for CRS_A { + type Ux = u8; +} impl CRS_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(CRS_A::VALUE1), 1 => Some(CRS_A::VALUE2), @@ -51,17 +41,17 @@ impl CRS_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Request source 0"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == CRS_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Request source 1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == CRS_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Request source 2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == CRS_A::VALUE3 @@ -86,18 +76,18 @@ impl From for bool { impl FCR_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> FCR_A { + pub const fn variant(&self) -> FCR_A { match self.bits { false => FCR_A::VALUE1, true => FCR_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Signal level was below compare value"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == FCR_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Signal level was above compare value"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == FCR_A::VALUE2 @@ -122,18 +112,18 @@ impl From for bool { impl VF_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF_A { + pub const fn variant(&self) -> VF_A { match self.bits { false => VF_A::VALUE1, true => VF_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No new result available"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Bitfield RESULT has been updated with new result value and has not yet been read, or bit FCR has been updated"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF_A::VALUE2 @@ -176,15 +166,13 @@ impl R { VF_R::new(((self.bits >> 31) & 1) != 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"] +#[doc = "Result Register, Debug\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`resd::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`resd::R`](R) reader structure"] +impl crate::Readable for RESD_SPEC {} #[doc = "`reset()` method sets RESD[%s] to value 0"] impl crate::Resettable for RESD_SPEC { diff --git a/src/vadc_g0/revnp0.rs b/src/vadc_g0/revnp0.rs index 9cb0f7bb..a823ce49 100644 --- a/src/vadc_g0/revnp0.rs +++ b/src/vadc_g0/revnp0.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `REV0NP` reader - Service Request Node Pointer Result Event i"] -pub type REV0NP_R = crate::FieldReader; +pub type REV0NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV0NP_A { + type Ux = u8; +} impl REV0NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV0NP_A::VALUE1), 3 => Some(REV0NP_A::VALUE2), @@ -67,53 +38,57 @@ impl REV0NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV0NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV0NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV0NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV0NP_A::VALUE4 } } #[doc = "Field `REV0NP` writer - Service Request Node Pointer Result Event i"] -pub type REV0NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP0_SPEC, u8, REV0NP_A, 4, O>; -impl<'a, const O: u8> REV0NP_W<'a, O> { +pub type REV0NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV0NP_A>; +impl<'a, REG> REV0NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV0NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV0NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV0NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV0NP_A::VALUE4) } } #[doc = "Field `REV1NP` reader - Service Request Node Pointer Result Event i"] -pub type REV1NP_R = crate::FieldReader; +pub type REV1NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV1NP_A { + type Ux = u8; +} impl REV1NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV1NP_A::VALUE1), 3 => Some(REV1NP_A::VALUE2), @@ -145,53 +123,57 @@ impl REV1NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV1NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV1NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV1NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV1NP_A::VALUE4 } } #[doc = "Field `REV1NP` writer - Service Request Node Pointer Result Event i"] -pub type REV1NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP0_SPEC, u8, REV1NP_A, 4, O>; -impl<'a, const O: u8> REV1NP_W<'a, O> { +pub type REV1NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV1NP_A>; +impl<'a, REG> REV1NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV1NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV1NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV1NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV1NP_A::VALUE4) } } #[doc = "Field `REV2NP` reader - Service Request Node Pointer Result Event i"] -pub type REV2NP_R = crate::FieldReader; +pub type REV2NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV2NP_A { + type Ux = u8; +} impl REV2NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV2NP_A::VALUE1), 3 => Some(REV2NP_A::VALUE2), @@ -223,53 +208,57 @@ impl REV2NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV2NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV2NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV2NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV2NP_A::VALUE4 } } #[doc = "Field `REV2NP` writer - Service Request Node Pointer Result Event i"] -pub type REV2NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP0_SPEC, u8, REV2NP_A, 4, O>; -impl<'a, const O: u8> REV2NP_W<'a, O> { +pub type REV2NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV2NP_A>; +impl<'a, REG> REV2NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV2NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV2NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV2NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV2NP_A::VALUE4) } } #[doc = "Field `REV3NP` reader - Service Request Node Pointer Result Event i"] -pub type REV3NP_R = crate::FieldReader; +pub type REV3NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV3NP_A { + type Ux = u8; +} impl REV3NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV3NP_A::VALUE1), 3 => Some(REV3NP_A::VALUE2), @@ -301,53 +293,57 @@ impl REV3NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV3NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV3NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV3NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV3NP_A::VALUE4 } } #[doc = "Field `REV3NP` writer - Service Request Node Pointer Result Event i"] -pub type REV3NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP0_SPEC, u8, REV3NP_A, 4, O>; -impl<'a, const O: u8> REV3NP_W<'a, O> { +pub type REV3NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV3NP_A>; +impl<'a, REG> REV3NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV3NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV3NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV3NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV3NP_A::VALUE4) } } #[doc = "Field `REV4NP` reader - Service Request Node Pointer Result Event i"] -pub type REV4NP_R = crate::FieldReader; +pub type REV4NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV4NP_A { + type Ux = u8; +} impl REV4NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV4NP_A::VALUE1), 3 => Some(REV4NP_A::VALUE2), @@ -379,53 +378,57 @@ impl REV4NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV4NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV4NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV4NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV4NP_A::VALUE4 } } #[doc = "Field `REV4NP` writer - Service Request Node Pointer Result Event i"] -pub type REV4NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP0_SPEC, u8, REV4NP_A, 4, O>; -impl<'a, const O: u8> REV4NP_W<'a, O> { +pub type REV4NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV4NP_A>; +impl<'a, REG> REV4NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV4NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV4NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV4NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV4NP_A::VALUE4) } } #[doc = "Field `REV5NP` reader - Service Request Node Pointer Result Event i"] -pub type REV5NP_R = crate::FieldReader; +pub type REV5NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV5NP_A { + type Ux = u8; +} impl REV5NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV5NP_A::VALUE1), 3 => Some(REV5NP_A::VALUE2), @@ -457,53 +463,57 @@ impl REV5NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV5NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV5NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV5NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV5NP_A::VALUE4 } } #[doc = "Field `REV5NP` writer - Service Request Node Pointer Result Event i"] -pub type REV5NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP0_SPEC, u8, REV5NP_A, 4, O>; -impl<'a, const O: u8> REV5NP_W<'a, O> { +pub type REV5NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV5NP_A>; +impl<'a, REG> REV5NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV5NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV5NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV5NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV5NP_A::VALUE4) } } #[doc = "Field `REV6NP` reader - Service Request Node Pointer Result Event i"] -pub type REV6NP_R = crate::FieldReader; +pub type REV6NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -523,10 +533,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV6NP_A { + type Ux = u8; +} impl REV6NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV6NP_A::VALUE1), 3 => Some(REV6NP_A::VALUE2), @@ -535,53 +548,57 @@ impl REV6NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV6NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV6NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV6NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV6NP_A::VALUE4 } } #[doc = "Field `REV6NP` writer - Service Request Node Pointer Result Event i"] -pub type REV6NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP0_SPEC, u8, REV6NP_A, 4, O>; -impl<'a, const O: u8> REV6NP_W<'a, O> { +pub type REV6NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV6NP_A>; +impl<'a, REG> REV6NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV6NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV6NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV6NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV6NP_A::VALUE4) } } #[doc = "Field `REV7NP` reader - Service Request Node Pointer Result Event i"] -pub type REV7NP_R = crate::FieldReader; +pub type REV7NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -601,10 +618,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV7NP_A { + type Ux = u8; +} impl REV7NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV7NP_A::VALUE1), 3 => Some(REV7NP_A::VALUE2), @@ -613,48 +633,52 @@ impl REV7NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV7NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV7NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV7NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV7NP_A::VALUE4 } } #[doc = "Field `REV7NP` writer - Service Request Node Pointer Result Event i"] -pub type REV7NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP0_SPEC, u8, REV7NP_A, 4, O>; -impl<'a, const O: u8> REV7NP_W<'a, O> { +pub type REV7NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV7NP_A>; +impl<'a, REG> REV7NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV7NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV7NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV7NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV7NP_A::VALUE4) } } @@ -704,70 +728,71 @@ impl W { #[doc = "Bits 0:3 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev0np(&mut self) -> REV0NP_W<0> { - REV0NP_W::new(self) + pub fn rev0np(&mut self) -> REV0NP_W { + REV0NP_W::new(self, 0) } #[doc = "Bits 4:7 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev1np(&mut self) -> REV1NP_W<4> { - REV1NP_W::new(self) + pub fn rev1np(&mut self) -> REV1NP_W { + REV1NP_W::new(self, 4) } #[doc = "Bits 8:11 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev2np(&mut self) -> REV2NP_W<8> { - REV2NP_W::new(self) + pub fn rev2np(&mut self) -> REV2NP_W { + REV2NP_W::new(self, 8) } #[doc = "Bits 12:15 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev3np(&mut self) -> REV3NP_W<12> { - REV3NP_W::new(self) + pub fn rev3np(&mut self) -> REV3NP_W { + REV3NP_W::new(self, 12) } #[doc = "Bits 16:19 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev4np(&mut self) -> REV4NP_W<16> { - REV4NP_W::new(self) + pub fn rev4np(&mut self) -> REV4NP_W { + REV4NP_W::new(self, 16) } #[doc = "Bits 20:23 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev5np(&mut self) -> REV5NP_W<20> { - REV5NP_W::new(self) + pub fn rev5np(&mut self) -> REV5NP_W { + REV5NP_W::new(self, 20) } #[doc = "Bits 24:27 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev6np(&mut self) -> REV6NP_W<24> { - REV6NP_W::new(self) + pub fn rev6np(&mut self) -> REV6NP_W { + REV6NP_W::new(self, 24) } #[doc = "Bits 28:31 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev7np(&mut self) -> REV7NP_W<28> { - REV7NP_W::new(self) + pub fn rev7np(&mut self) -> REV7NP_W { + REV7NP_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Result Event Node Pointer Register 0\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`revnp0::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`revnp0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`revnp0::R`](R) reader structure"] +impl crate::Readable for REVNP0_SPEC {} +#[doc = "`write(|w| ..)` method takes [`revnp0::W`](W) writer structure"] impl crate::Writable for REVNP0_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/revnp1.rs b/src/vadc_g0/revnp1.rs index 7ef9f32f..28a3e0d1 100644 --- a/src/vadc_g0/revnp1.rs +++ b/src/vadc_g0/revnp1.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `REV8NP` reader - Service Request Node Pointer Result Event i"] -pub type REV8NP_R = crate::FieldReader; +pub type REV8NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV8NP_A { + type Ux = u8; +} impl REV8NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV8NP_A::VALUE1), 3 => Some(REV8NP_A::VALUE2), @@ -67,53 +38,57 @@ impl REV8NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV8NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV8NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV8NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV8NP_A::VALUE4 } } #[doc = "Field `REV8NP` writer - Service Request Node Pointer Result Event i"] -pub type REV8NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP1_SPEC, u8, REV8NP_A, 4, O>; -impl<'a, const O: u8> REV8NP_W<'a, O> { +pub type REV8NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV8NP_A>; +impl<'a, REG> REV8NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV8NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV8NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV8NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV8NP_A::VALUE4) } } #[doc = "Field `REV9NP` reader - Service Request Node Pointer Result Event i"] -pub type REV9NP_R = crate::FieldReader; +pub type REV9NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV9NP_A { + type Ux = u8; +} impl REV9NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV9NP_A::VALUE1), 3 => Some(REV9NP_A::VALUE2), @@ -145,53 +123,57 @@ impl REV9NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV9NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV9NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV9NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV9NP_A::VALUE4 } } #[doc = "Field `REV9NP` writer - Service Request Node Pointer Result Event i"] -pub type REV9NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP1_SPEC, u8, REV9NP_A, 4, O>; -impl<'a, const O: u8> REV9NP_W<'a, O> { +pub type REV9NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV9NP_A>; +impl<'a, REG> REV9NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV9NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV9NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV9NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV9NP_A::VALUE4) } } #[doc = "Field `REV10NP` reader - Service Request Node Pointer Result Event i"] -pub type REV10NP_R = crate::FieldReader; +pub type REV10NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -211,10 +193,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV10NP_A { + type Ux = u8; +} impl REV10NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV10NP_A::VALUE1), 3 => Some(REV10NP_A::VALUE2), @@ -223,53 +208,57 @@ impl REV10NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV10NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV10NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV10NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV10NP_A::VALUE4 } } #[doc = "Field `REV10NP` writer - Service Request Node Pointer Result Event i"] -pub type REV10NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP1_SPEC, u8, REV10NP_A, 4, O>; -impl<'a, const O: u8> REV10NP_W<'a, O> { +pub type REV10NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV10NP_A>; +impl<'a, REG> REV10NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV10NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV10NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV10NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV10NP_A::VALUE4) } } #[doc = "Field `REV11NP` reader - Service Request Node Pointer Result Event i"] -pub type REV11NP_R = crate::FieldReader; +pub type REV11NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -289,10 +278,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV11NP_A { + type Ux = u8; +} impl REV11NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV11NP_A::VALUE1), 3 => Some(REV11NP_A::VALUE2), @@ -301,53 +293,57 @@ impl REV11NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV11NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV11NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV11NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV11NP_A::VALUE4 } } #[doc = "Field `REV11NP` writer - Service Request Node Pointer Result Event i"] -pub type REV11NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP1_SPEC, u8, REV11NP_A, 4, O>; -impl<'a, const O: u8> REV11NP_W<'a, O> { +pub type REV11NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV11NP_A>; +impl<'a, REG> REV11NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV11NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV11NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV11NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV11NP_A::VALUE4) } } #[doc = "Field `REV12NP` reader - Service Request Node Pointer Result Event i"] -pub type REV12NP_R = crate::FieldReader; +pub type REV12NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -367,10 +363,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV12NP_A { + type Ux = u8; +} impl REV12NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV12NP_A::VALUE1), 3 => Some(REV12NP_A::VALUE2), @@ -379,53 +378,57 @@ impl REV12NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV12NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV12NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV12NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV12NP_A::VALUE4 } } #[doc = "Field `REV12NP` writer - Service Request Node Pointer Result Event i"] -pub type REV12NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP1_SPEC, u8, REV12NP_A, 4, O>; -impl<'a, const O: u8> REV12NP_W<'a, O> { +pub type REV12NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV12NP_A>; +impl<'a, REG> REV12NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV12NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV12NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV12NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV12NP_A::VALUE4) } } #[doc = "Field `REV13NP` reader - Service Request Node Pointer Result Event i"] -pub type REV13NP_R = crate::FieldReader; +pub type REV13NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -445,10 +448,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV13NP_A { + type Ux = u8; +} impl REV13NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV13NP_A::VALUE1), 3 => Some(REV13NP_A::VALUE2), @@ -457,53 +463,57 @@ impl REV13NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV13NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV13NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV13NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV13NP_A::VALUE4 } } #[doc = "Field `REV13NP` writer - Service Request Node Pointer Result Event i"] -pub type REV13NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP1_SPEC, u8, REV13NP_A, 4, O>; -impl<'a, const O: u8> REV13NP_W<'a, O> { +pub type REV13NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV13NP_A>; +impl<'a, REG> REV13NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV13NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV13NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV13NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV13NP_A::VALUE4) } } #[doc = "Field `REV14NP` reader - Service Request Node Pointer Result Event i"] -pub type REV14NP_R = crate::FieldReader; +pub type REV14NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -523,10 +533,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV14NP_A { + type Ux = u8; +} impl REV14NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV14NP_A::VALUE1), 3 => Some(REV14NP_A::VALUE2), @@ -535,53 +548,57 @@ impl REV14NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV14NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV14NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV14NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV14NP_A::VALUE4 } } #[doc = "Field `REV14NP` writer - Service Request Node Pointer Result Event i"] -pub type REV14NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP1_SPEC, u8, REV14NP_A, 4, O>; -impl<'a, const O: u8> REV14NP_W<'a, O> { +pub type REV14NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV14NP_A>; +impl<'a, REG> REV14NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV14NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV14NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV14NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV14NP_A::VALUE4) } } #[doc = "Field `REV15NP` reader - Service Request Node Pointer Result Event i"] -pub type REV15NP_R = crate::FieldReader; +pub type REV15NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Result Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -601,10 +618,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for REV15NP_A { + type Ux = u8; +} impl REV15NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(REV15NP_A::VALUE1), 3 => Some(REV15NP_A::VALUE2), @@ -613,48 +633,52 @@ impl REV15NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == REV15NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == REV15NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == REV15NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == REV15NP_A::VALUE4 } } #[doc = "Field `REV15NP` writer - Service Request Node Pointer Result Event i"] -pub type REV15NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REVNP1_SPEC, u8, REV15NP_A, 4, O>; -impl<'a, const O: u8> REV15NP_W<'a, O> { +pub type REV15NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, REV15NP_A>; +impl<'a, REG> REV15NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(REV15NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(REV15NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(REV15NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(REV15NP_A::VALUE4) } } @@ -704,70 +728,71 @@ impl W { #[doc = "Bits 0:3 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev8np(&mut self) -> REV8NP_W<0> { - REV8NP_W::new(self) + pub fn rev8np(&mut self) -> REV8NP_W { + REV8NP_W::new(self, 0) } #[doc = "Bits 4:7 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev9np(&mut self) -> REV9NP_W<4> { - REV9NP_W::new(self) + pub fn rev9np(&mut self) -> REV9NP_W { + REV9NP_W::new(self, 4) } #[doc = "Bits 8:11 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev10np(&mut self) -> REV10NP_W<8> { - REV10NP_W::new(self) + pub fn rev10np(&mut self) -> REV10NP_W { + REV10NP_W::new(self, 8) } #[doc = "Bits 12:15 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev11np(&mut self) -> REV11NP_W<12> { - REV11NP_W::new(self) + pub fn rev11np(&mut self) -> REV11NP_W { + REV11NP_W::new(self, 12) } #[doc = "Bits 16:19 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev12np(&mut self) -> REV12NP_W<16> { - REV12NP_W::new(self) + pub fn rev12np(&mut self) -> REV12NP_W { + REV12NP_W::new(self, 16) } #[doc = "Bits 20:23 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev13np(&mut self) -> REV13NP_W<20> { - REV13NP_W::new(self) + pub fn rev13np(&mut self) -> REV13NP_W { + REV13NP_W::new(self, 20) } #[doc = "Bits 24:27 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev14np(&mut self) -> REV14NP_W<24> { - REV14NP_W::new(self) + pub fn rev14np(&mut self) -> REV14NP_W { + REV14NP_W::new(self, 24) } #[doc = "Bits 28:31 - Service Request Node Pointer Result Event i"] #[inline(always)] #[must_use] - pub fn rev15np(&mut self) -> REV15NP_W<28> { - REV15NP_W::new(self) + pub fn rev15np(&mut self) -> REV15NP_W { + REV15NP_W::new(self, 28) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Result Event Node Pointer Register 1\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`revnp1::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`revnp1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`revnp1::R`](R) reader structure"] +impl crate::Readable for REVNP1_SPEC {} +#[doc = "`write(|w| ..)` method takes [`revnp1::W`](W) writer structure"] impl crate::Writable for REVNP1_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/sefclr.rs b/src/vadc_g0/sefclr.rs index 81af283d..148fa710 100644 --- a/src/vadc_g0/sefclr.rs +++ b/src/vadc_g0/sefclr.rs @@ -1,24 +1,5 @@ #[doc = "Register `SEFCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Clear Source Event 0/1\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum SEV0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `SEV0` writer - Clear Source Event 0/1"] -pub type SEV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SEFCLR_SPEC, SEV0_AW, O>; -impl<'a, const O: u8> SEV0_W<'a, O> { +pub type SEV0_W<'a, REG> = crate::BitWriter<'a, REG, SEV0_AW>; +impl<'a, REG> SEV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEV0_AW::VALUE1) } #[doc = "Clear the source event flag in GxSEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEV0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `SEV1` writer - Clear Source Event 0/1"] -pub type SEV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SEFCLR_SPEC, SEV1_AW, O>; -impl<'a, const O: u8> SEV1_W<'a, O> { +pub type SEV1_W<'a, REG> = crate::BitWriter<'a, REG, SEV1_AW>; +impl<'a, REG> SEV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEV1_AW::VALUE1) } #[doc = "Clear the source event flag in GxSEFLAG"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEV1_AW::VALUE2) } } @@ -79,30 +66,33 @@ impl W { #[doc = "Bit 0 - Clear Source Event 0/1"] #[inline(always)] #[must_use] - pub fn sev0(&mut self) -> SEV0_W<0> { - SEV0_W::new(self) + pub fn sev0(&mut self) -> SEV0_W { + SEV0_W::new(self, 0) } #[doc = "Bit 1 - Clear Source Event 0/1"] #[inline(always)] #[must_use] - pub fn sev1(&mut self) -> SEV1_W<1> { - SEV1_W::new(self) + pub fn sev1(&mut self) -> SEV1_W { + SEV1_W::new(self, 1) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Event Flag Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sefclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SEFCLR_SPEC; impl crate::RegisterSpec for SEFCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [sefclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`sefclr::W`](W) writer structure"] impl crate::Writable for SEFCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/seflag.rs b/src/vadc_g0/seflag.rs index a71db902..6df823fb 100644 --- a/src/vadc_g0/seflag.rs +++ b/src/vadc_g0/seflag.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SEV0` reader - Source Event 0/1"] pub type SEV0_R = crate::BitReader; #[doc = "Source Event 0/1\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl SEV0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SEV0_A { + pub const fn variant(&self) -> SEV0_A { match self.bits { false => SEV0_A::VALUE1, true => SEV0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No source event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SEV0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A source event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SEV0_A::VALUE2 } } #[doc = "Field `SEV0` writer - Source Event 0/1"] -pub type SEV0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SEFLAG_SPEC, SEV0_A, O>; -impl<'a, const O: u8> SEV0_W<'a, O> { +pub type SEV0_W<'a, REG> = crate::BitWriter<'a, REG, SEV0_A>; +impl<'a, REG> SEV0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No source event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEV0_A::VALUE1) } #[doc = "A source event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEV0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl SEV1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> SEV1_A { + pub const fn variant(&self) -> SEV1_A { match self.bits { false => SEV1_A::VALUE1, true => SEV1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No source event"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SEV1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "A source event has occurred"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SEV1_A::VALUE2 } } #[doc = "Field `SEV1` writer - Source Event 0/1"] -pub type SEV1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SEFLAG_SPEC, SEV1_A, O>; -impl<'a, const O: u8> SEV1_W<'a, O> { +pub type SEV1_W<'a, REG> = crate::BitWriter<'a, REG, SEV1_A>; +impl<'a, REG> SEV1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No source event"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEV1_A::VALUE1) } #[doc = "A source event has occurred"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEV1_A::VALUE2) } } @@ -150,34 +124,35 @@ impl W { #[doc = "Bit 0 - Source Event 0/1"] #[inline(always)] #[must_use] - pub fn sev0(&mut self) -> SEV0_W<0> { - SEV0_W::new(self) + pub fn sev0(&mut self) -> SEV0_W { + SEV0_W::new(self, 0) } #[doc = "Bit 1 - Source Event 0/1"] #[inline(always)] #[must_use] - pub fn sev1(&mut self) -> SEV1_W<1> { - SEV1_W::new(self) + pub fn sev1(&mut self) -> SEV1_W { + SEV1_W::new(self, 1) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Event Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`seflag::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`seflag::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`seflag::R`](R) reader structure"] +impl crate::Readable for SEFLAG_SPEC {} +#[doc = "`write(|w| ..)` method takes [`seflag::W`](W) writer structure"] impl crate::Writable for SEFLAG_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/sevnp.rs b/src/vadc_g0/sevnp.rs index f16fffaa..afce0c66 100644 --- a/src/vadc_g0/sevnp.rs +++ b/src/vadc_g0/sevnp.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `SEV0NP` reader - Service Request Node Pointer Source Event i"] -pub type SEV0NP_R = crate::FieldReader; +pub type SEV0NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Source Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SEV0NP_A { + type Ux = u8; +} impl SEV0NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SEV0NP_A::VALUE1), 3 => Some(SEV0NP_A::VALUE2), @@ -67,53 +38,57 @@ impl SEV0NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SEV0NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SEV0NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SEV0NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SEV0NP_A::VALUE4 } } #[doc = "Field `SEV0NP` writer - Service Request Node Pointer Source Event i"] -pub type SEV0NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SEVNP_SPEC, u8, SEV0NP_A, 4, O>; -impl<'a, const O: u8> SEV0NP_W<'a, O> { +pub type SEV0NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SEV0NP_A>; +impl<'a, REG> SEV0NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEV0NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEV0NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SEV0NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SEV0NP_A::VALUE4) } } #[doc = "Field `SEV1NP` reader - Service Request Node Pointer Source Event i"] -pub type SEV1NP_R = crate::FieldReader; +pub type SEV1NP_R = crate::FieldReader; #[doc = "Service Request Node Pointer Source Event i\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -133,10 +108,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for SEV1NP_A { + type Ux = u8; +} impl SEV1NP_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> Option { + pub const fn variant(&self) -> Option { match self.bits { 0 => Some(SEV1NP_A::VALUE1), 3 => Some(SEV1NP_A::VALUE2), @@ -145,48 +123,52 @@ impl SEV1NP_R { _ => None, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Select service request line 0 of group x"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == SEV1NP_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Select service request line 3 of group x"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == SEV1NP_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Select shared service request line 0"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == SEV1NP_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Select shared service request line 3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == SEV1NP_A::VALUE4 } } #[doc = "Field `SEV1NP` writer - Service Request Node Pointer Source Event i"] -pub type SEV1NP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SEVNP_SPEC, u8, SEV1NP_A, 4, O>; -impl<'a, const O: u8> SEV1NP_W<'a, O> { +pub type SEV1NP_W<'a, REG> = crate::FieldWriter<'a, REG, 4, SEV1NP_A>; +impl<'a, REG> SEV1NP_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Select service request line 0 of group x"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(SEV1NP_A::VALUE1) } #[doc = "Select service request line 3 of group x"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(SEV1NP_A::VALUE2) } #[doc = "Select shared service request line 0"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(SEV1NP_A::VALUE3) } #[doc = "Select shared service request line 3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(SEV1NP_A::VALUE4) } } @@ -206,34 +188,35 @@ impl W { #[doc = "Bits 0:3 - Service Request Node Pointer Source Event i"] #[inline(always)] #[must_use] - pub fn sev0np(&mut self) -> SEV0NP_W<0> { - SEV0NP_W::new(self) + pub fn sev0np(&mut self) -> SEV0NP_W { + SEV0NP_W::new(self, 0) } #[doc = "Bits 4:7 - Service Request Node Pointer Source Event i"] #[inline(always)] #[must_use] - pub fn sev1np(&mut self) -> SEV1NP_W<4> { - SEV1NP_W::new(self) + pub fn sev1np(&mut self) -> SEV1NP_W { + SEV1NP_W::new(self, 4) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Source Event Node Pointer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sevnp::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sevnp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`sevnp::R`](R) reader structure"] +impl crate::Readable for SEVNP_SPEC {} +#[doc = "`write(|w| ..)` method takes [`sevnp::W`](W) writer structure"] impl crate::Writable for SEVNP_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/sract.rs b/src/vadc_g0/sract.rs index 45875b4e..6b8a3fd1 100644 --- a/src/vadc_g0/sract.rs +++ b/src/vadc_g0/sract.rs @@ -1,24 +1,5 @@ #[doc = "Register `SRACT` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Activate Group Service Request Node 0\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum AGSR0_AW { @@ -34,16 +15,19 @@ impl From for bool { } } #[doc = "Field `AGSR0` writer - Activate Group Service Request Node 0"] -pub type AGSR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRACT_SPEC, AGSR0_AW, O>; -impl<'a, const O: u8> AGSR0_W<'a, O> { +pub type AGSR0_W<'a, REG> = crate::BitWriter<'a, REG, AGSR0_AW>; +impl<'a, REG> AGSR0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AGSR0_AW::VALUE1) } #[doc = "Activate the associated service request line"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AGSR0_AW::VALUE2) } } @@ -62,16 +46,19 @@ impl From for bool { } } #[doc = "Field `AGSR1` writer - Activate Group Service Request Node 1"] -pub type AGSR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRACT_SPEC, AGSR1_AW, O>; -impl<'a, const O: u8> AGSR1_W<'a, O> { +pub type AGSR1_W<'a, REG> = crate::BitWriter<'a, REG, AGSR1_AW>; +impl<'a, REG> AGSR1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AGSR1_AW::VALUE1) } #[doc = "Activate the associated service request line"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AGSR1_AW::VALUE2) } } @@ -90,16 +77,19 @@ impl From for bool { } } #[doc = "Field `AGSR2` writer - Activate Group Service Request Node 2"] -pub type AGSR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRACT_SPEC, AGSR2_AW, O>; -impl<'a, const O: u8> AGSR2_W<'a, O> { +pub type AGSR2_W<'a, REG> = crate::BitWriter<'a, REG, AGSR2_AW>; +impl<'a, REG> AGSR2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AGSR2_AW::VALUE1) } #[doc = "Activate the associated service request line"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AGSR2_AW::VALUE2) } } @@ -118,16 +108,19 @@ impl From for bool { } } #[doc = "Field `AGSR3` writer - Activate Group Service Request Node 3"] -pub type AGSR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRACT_SPEC, AGSR3_AW, O>; -impl<'a, const O: u8> AGSR3_W<'a, O> { +pub type AGSR3_W<'a, REG> = crate::BitWriter<'a, REG, AGSR3_AW>; +impl<'a, REG> AGSR3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(AGSR3_AW::VALUE1) } #[doc = "Activate the associated service request line"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(AGSR3_AW::VALUE2) } } @@ -146,16 +139,19 @@ impl From for bool { } } #[doc = "Field `ASSR0` writer - Activate Shared Service Request Node 0"] -pub type ASSR0_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRACT_SPEC, ASSR0_AW, O>; -impl<'a, const O: u8> ASSR0_W<'a, O> { +pub type ASSR0_W<'a, REG> = crate::BitWriter<'a, REG, ASSR0_AW>; +impl<'a, REG> ASSR0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSR0_AW::VALUE1) } #[doc = "Activate the associated service request line"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSR0_AW::VALUE2) } } @@ -174,16 +170,19 @@ impl From for bool { } } #[doc = "Field `ASSR1` writer - Activate Shared Service Request Node 1"] -pub type ASSR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRACT_SPEC, ASSR1_AW, O>; -impl<'a, const O: u8> ASSR1_W<'a, O> { +pub type ASSR1_W<'a, REG> = crate::BitWriter<'a, REG, ASSR1_AW>; +impl<'a, REG> ASSR1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSR1_AW::VALUE1) } #[doc = "Activate the associated service request line"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSR1_AW::VALUE2) } } @@ -202,16 +201,19 @@ impl From for bool { } } #[doc = "Field `ASSR2` writer - Activate Shared Service Request Node 2"] -pub type ASSR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRACT_SPEC, ASSR2_AW, O>; -impl<'a, const O: u8> ASSR2_W<'a, O> { +pub type ASSR2_W<'a, REG> = crate::BitWriter<'a, REG, ASSR2_AW>; +impl<'a, REG> ASSR2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSR2_AW::VALUE1) } #[doc = "Activate the associated service request line"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSR2_AW::VALUE2) } } @@ -230,16 +232,19 @@ impl From for bool { } } #[doc = "Field `ASSR3` writer - Activate Shared Service Request Node 3"] -pub type ASSR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SRACT_SPEC, ASSR3_AW, O>; -impl<'a, const O: u8> ASSR3_W<'a, O> { +pub type ASSR3_W<'a, REG> = crate::BitWriter<'a, REG, ASSR3_AW>; +impl<'a, REG> ASSR3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No action"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(ASSR3_AW::VALUE1) } #[doc = "Activate the associated service request line"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(ASSR3_AW::VALUE2) } } @@ -247,66 +252,69 @@ impl W { #[doc = "Bit 0 - Activate Group Service Request Node 0"] #[inline(always)] #[must_use] - pub fn agsr0(&mut self) -> AGSR0_W<0> { - AGSR0_W::new(self) + pub fn agsr0(&mut self) -> AGSR0_W { + AGSR0_W::new(self, 0) } #[doc = "Bit 1 - Activate Group Service Request Node 1"] #[inline(always)] #[must_use] - pub fn agsr1(&mut self) -> AGSR1_W<1> { - AGSR1_W::new(self) + pub fn agsr1(&mut self) -> AGSR1_W { + AGSR1_W::new(self, 1) } #[doc = "Bit 2 - Activate Group Service Request Node 2"] #[inline(always)] #[must_use] - pub fn agsr2(&mut self) -> AGSR2_W<2> { - AGSR2_W::new(self) + pub fn agsr2(&mut self) -> AGSR2_W { + AGSR2_W::new(self, 2) } #[doc = "Bit 3 - Activate Group Service Request Node 3"] #[inline(always)] #[must_use] - pub fn agsr3(&mut self) -> AGSR3_W<3> { - AGSR3_W::new(self) + pub fn agsr3(&mut self) -> AGSR3_W { + AGSR3_W::new(self, 3) } #[doc = "Bit 8 - Activate Shared Service Request Node 0"] #[inline(always)] #[must_use] - pub fn assr0(&mut self) -> ASSR0_W<8> { - ASSR0_W::new(self) + pub fn assr0(&mut self) -> ASSR0_W { + ASSR0_W::new(self, 8) } #[doc = "Bit 9 - Activate Shared Service Request Node 1"] #[inline(always)] #[must_use] - pub fn assr1(&mut self) -> ASSR1_W<9> { - ASSR1_W::new(self) + pub fn assr1(&mut self) -> ASSR1_W { + ASSR1_W::new(self, 9) } #[doc = "Bit 10 - Activate Shared Service Request Node 2"] #[inline(always)] #[must_use] - pub fn assr2(&mut self) -> ASSR2_W<10> { - ASSR2_W::new(self) + pub fn assr2(&mut self) -> ASSR2_W { + ASSR2_W::new(self, 10) } #[doc = "Bit 11 - Activate Shared Service Request Node 3"] #[inline(always)] #[must_use] - pub fn assr3(&mut self) -> ASSR3_W<11> { - ASSR3_W::new(self) + pub fn assr3(&mut self) -> ASSR3_W { + ASSR3_W::new(self, 11) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Service Request Software Activation Trigger\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`sract::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SRACT_SPEC; impl crate::RegisterSpec for SRACT_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [sract::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`sract::W`](W) writer structure"] impl crate::Writable for SRACT_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/synctr.rs b/src/vadc_g0/synctr.rs index 52e1a13c..6be42c4c 100644 --- a/src/vadc_g0/synctr.rs +++ b/src/vadc_g0/synctr.rs @@ -1,41 +1,9 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `STSEL` reader - Start Selection"] -pub type STSEL_R = crate::FieldReader; +pub type STSEL_R = crate::FieldReader; #[doc = "Start Selection\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] @@ -55,10 +23,13 @@ impl From for u8 { variant as _ } } +impl crate::FieldSpec for STSEL_A { + type Ux = u8; +} impl STSEL_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> STSEL_A { + pub const fn variant(&self) -> STSEL_A { match self.bits { 0 => STSEL_A::VALUE1, 1 => STSEL_A::VALUE2, @@ -67,48 +38,52 @@ impl STSEL_R { _ => unreachable!(), } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Kernel is synchronization master: Use own bitfield GxARBCFG.ANONC"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == STSEL_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Kernel is synchronization slave: Control information from input CI1"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == STSEL_A::VALUE2 } - #[doc = "Checks if the value of the field is `VALUE3`"] + #[doc = "Kernel is synchronization slave: Control information from input CI2"] #[inline(always)] pub fn is_value3(&self) -> bool { *self == STSEL_A::VALUE3 } - #[doc = "Checks if the value of the field is `VALUE4`"] + #[doc = "Kernel is synchronization slave: Control information from input CI3"] #[inline(always)] pub fn is_value4(&self) -> bool { *self == STSEL_A::VALUE4 } } #[doc = "Field `STSEL` writer - Start Selection"] -pub type STSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, SYNCTR_SPEC, u8, STSEL_A, 2, O>; -impl<'a, const O: u8> STSEL_W<'a, O> { +pub type STSEL_W<'a, REG> = crate::FieldWriterSafe<'a, REG, 2, STSEL_A>; +impl<'a, REG> STSEL_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, + REG::Ux: From, +{ #[doc = "Kernel is synchronization master: Use own bitfield GxARBCFG.ANONC"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(STSEL_A::VALUE1) } #[doc = "Kernel is synchronization slave: Control information from input CI1"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(STSEL_A::VALUE2) } #[doc = "Kernel is synchronization slave: Control information from input CI2"] #[inline(always)] - pub fn value3(self) -> &'a mut W { + pub fn value3(self) -> &'a mut crate::W { self.variant(STSEL_A::VALUE3) } #[doc = "Kernel is synchronization slave: Control information from input CI3"] #[inline(always)] - pub fn value4(self) -> &'a mut W { + pub fn value4(self) -> &'a mut crate::W { self.variant(STSEL_A::VALUE4) } } @@ -131,34 +106,37 @@ impl From for bool { impl EVALR1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EVALR1_A { + pub const fn variant(&self) -> EVALR1_A { match self.bits { false => EVALR1_A::VALUE1, true => EVALR1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ready input control"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EVALR1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Ready input Rx is considered for the start of a parallel conversion of this conversion group"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EVALR1_A::VALUE2 } } #[doc = "Field `EVALR1` writer - Evaluate Ready Input Rx"] -pub type EVALR1_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYNCTR_SPEC, EVALR1_A, O>; -impl<'a, const O: u8> EVALR1_W<'a, O> { +pub type EVALR1_W<'a, REG> = crate::BitWriter<'a, REG, EVALR1_A>; +impl<'a, REG> EVALR1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No ready input control"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EVALR1_A::VALUE1) } #[doc = "Ready input Rx is considered for the start of a parallel conversion of this conversion group"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EVALR1_A::VALUE2) } } @@ -181,34 +159,37 @@ impl From for bool { impl EVALR2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EVALR2_A { + pub const fn variant(&self) -> EVALR2_A { match self.bits { false => EVALR2_A::VALUE1, true => EVALR2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ready input control"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EVALR2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Ready input Rx is considered for the start of a parallel conversion of this conversion group"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EVALR2_A::VALUE2 } } #[doc = "Field `EVALR2` writer - Evaluate Ready Input Rx"] -pub type EVALR2_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYNCTR_SPEC, EVALR2_A, O>; -impl<'a, const O: u8> EVALR2_W<'a, O> { +pub type EVALR2_W<'a, REG> = crate::BitWriter<'a, REG, EVALR2_A>; +impl<'a, REG> EVALR2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No ready input control"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EVALR2_A::VALUE1) } #[doc = "Ready input Rx is considered for the start of a parallel conversion of this conversion group"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EVALR2_A::VALUE2) } } @@ -231,34 +212,37 @@ impl From for bool { impl EVALR3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> EVALR3_A { + pub const fn variant(&self) -> EVALR3_A { match self.bits { false => EVALR3_A::VALUE1, true => EVALR3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "No ready input control"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == EVALR3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Ready input Rx is considered for the start of a parallel conversion of this conversion group"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == EVALR3_A::VALUE2 } } #[doc = "Field `EVALR3` writer - Evaluate Ready Input Rx"] -pub type EVALR3_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYNCTR_SPEC, EVALR3_A, O>; -impl<'a, const O: u8> EVALR3_W<'a, O> { +pub type EVALR3_W<'a, REG> = crate::BitWriter<'a, REG, EVALR3_A>; +impl<'a, REG> EVALR3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "No ready input control"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(EVALR3_A::VALUE1) } #[doc = "Ready input Rx is considered for the start of a parallel conversion of this conversion group"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(EVALR3_A::VALUE2) } } @@ -288,46 +272,47 @@ impl W { #[doc = "Bits 0:1 - Start Selection"] #[inline(always)] #[must_use] - pub fn stsel(&mut self) -> STSEL_W<0> { - STSEL_W::new(self) + pub fn stsel(&mut self) -> STSEL_W { + STSEL_W::new(self, 0) } #[doc = "Bit 4 - Evaluate Ready Input Rx"] #[inline(always)] #[must_use] - pub fn evalr1(&mut self) -> EVALR1_W<4> { - EVALR1_W::new(self) + pub fn evalr1(&mut self) -> EVALR1_W { + EVALR1_W::new(self, 4) } #[doc = "Bit 5 - Evaluate Ready Input Rx"] #[inline(always)] #[must_use] - pub fn evalr2(&mut self) -> EVALR2_W<5> { - EVALR2_W::new(self) + pub fn evalr2(&mut self) -> EVALR2_W { + EVALR2_W::new(self, 5) } #[doc = "Bit 6 - Evaluate Ready Input Rx"] #[inline(always)] #[must_use] - pub fn evalr3(&mut self) -> EVALR3_W<6> { - EVALR3_W::new(self) + pub fn evalr3(&mut self) -> EVALR3_W { + EVALR3_W::new(self, 6) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Synchronization Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`synctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`synctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`synctr::R`](R) reader structure"] +impl crate::Readable for SYNCTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`synctr::W`](W) writer structure"] impl crate::Writable for SYNCTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/vadc_g0/vfr.rs b/src/vadc_g0/vfr.rs index b5e5f99b..b8300857 100644 --- a/src/vadc_g0/vfr.rs +++ b/src/vadc_g0/vfr.rs @@ -1,39 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `VF0` reader - Valid Flag of Result Register x"] pub type VF0_R = crate::BitReader; #[doc = "Valid Flag of Result Register x\n\nValue on reset: 0"] @@ -53,34 +21,37 @@ impl From for bool { impl VF0_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF0_A { + pub const fn variant(&self) -> VF0_A { match self.bits { false => VF0_A::VALUE1, true => VF0_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF0_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF0_A::VALUE2 } } #[doc = "Field `VF0` writer - Valid Flag of Result Register x"] -pub type VF0_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF0_A, O>; -impl<'a, const O: u8> VF0_W<'a, O> { +pub type VF0_W<'a, REG> = crate::BitWriter<'a, REG, VF0_A>; +impl<'a, REG> VF0_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF0_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF0_A::VALUE2) } } @@ -103,34 +74,37 @@ impl From for bool { impl VF1_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF1_A { + pub const fn variant(&self) -> VF1_A { match self.bits { false => VF1_A::VALUE1, true => VF1_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF1_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF1_A::VALUE2 } } #[doc = "Field `VF1` writer - Valid Flag of Result Register x"] -pub type VF1_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF1_A, O>; -impl<'a, const O: u8> VF1_W<'a, O> { +pub type VF1_W<'a, REG> = crate::BitWriter<'a, REG, VF1_A>; +impl<'a, REG> VF1_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF1_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF1_A::VALUE2) } } @@ -153,34 +127,37 @@ impl From for bool { impl VF2_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF2_A { + pub const fn variant(&self) -> VF2_A { match self.bits { false => VF2_A::VALUE1, true => VF2_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF2_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF2_A::VALUE2 } } #[doc = "Field `VF2` writer - Valid Flag of Result Register x"] -pub type VF2_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF2_A, O>; -impl<'a, const O: u8> VF2_W<'a, O> { +pub type VF2_W<'a, REG> = crate::BitWriter<'a, REG, VF2_A>; +impl<'a, REG> VF2_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF2_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF2_A::VALUE2) } } @@ -203,34 +180,37 @@ impl From for bool { impl VF3_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF3_A { + pub const fn variant(&self) -> VF3_A { match self.bits { false => VF3_A::VALUE1, true => VF3_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF3_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF3_A::VALUE2 } } #[doc = "Field `VF3` writer - Valid Flag of Result Register x"] -pub type VF3_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF3_A, O>; -impl<'a, const O: u8> VF3_W<'a, O> { +pub type VF3_W<'a, REG> = crate::BitWriter<'a, REG, VF3_A>; +impl<'a, REG> VF3_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF3_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF3_A::VALUE2) } } @@ -253,34 +233,37 @@ impl From for bool { impl VF4_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF4_A { + pub const fn variant(&self) -> VF4_A { match self.bits { false => VF4_A::VALUE1, true => VF4_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF4_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF4_A::VALUE2 } } #[doc = "Field `VF4` writer - Valid Flag of Result Register x"] -pub type VF4_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF4_A, O>; -impl<'a, const O: u8> VF4_W<'a, O> { +pub type VF4_W<'a, REG> = crate::BitWriter<'a, REG, VF4_A>; +impl<'a, REG> VF4_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF4_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF4_A::VALUE2) } } @@ -303,34 +286,37 @@ impl From for bool { impl VF5_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF5_A { + pub const fn variant(&self) -> VF5_A { match self.bits { false => VF5_A::VALUE1, true => VF5_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF5_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF5_A::VALUE2 } } #[doc = "Field `VF5` writer - Valid Flag of Result Register x"] -pub type VF5_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF5_A, O>; -impl<'a, const O: u8> VF5_W<'a, O> { +pub type VF5_W<'a, REG> = crate::BitWriter<'a, REG, VF5_A>; +impl<'a, REG> VF5_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF5_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF5_A::VALUE2) } } @@ -353,34 +339,37 @@ impl From for bool { impl VF6_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF6_A { + pub const fn variant(&self) -> VF6_A { match self.bits { false => VF6_A::VALUE1, true => VF6_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF6_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF6_A::VALUE2 } } #[doc = "Field `VF6` writer - Valid Flag of Result Register x"] -pub type VF6_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF6_A, O>; -impl<'a, const O: u8> VF6_W<'a, O> { +pub type VF6_W<'a, REG> = crate::BitWriter<'a, REG, VF6_A>; +impl<'a, REG> VF6_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF6_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF6_A::VALUE2) } } @@ -403,34 +392,37 @@ impl From for bool { impl VF7_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF7_A { + pub const fn variant(&self) -> VF7_A { match self.bits { false => VF7_A::VALUE1, true => VF7_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF7_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF7_A::VALUE2 } } #[doc = "Field `VF7` writer - Valid Flag of Result Register x"] -pub type VF7_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF7_A, O>; -impl<'a, const O: u8> VF7_W<'a, O> { +pub type VF7_W<'a, REG> = crate::BitWriter<'a, REG, VF7_A>; +impl<'a, REG> VF7_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF7_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF7_A::VALUE2) } } @@ -453,34 +445,37 @@ impl From for bool { impl VF8_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF8_A { + pub const fn variant(&self) -> VF8_A { match self.bits { false => VF8_A::VALUE1, true => VF8_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF8_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF8_A::VALUE2 } } #[doc = "Field `VF8` writer - Valid Flag of Result Register x"] -pub type VF8_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF8_A, O>; -impl<'a, const O: u8> VF8_W<'a, O> { +pub type VF8_W<'a, REG> = crate::BitWriter<'a, REG, VF8_A>; +impl<'a, REG> VF8_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF8_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF8_A::VALUE2) } } @@ -503,34 +498,37 @@ impl From for bool { impl VF9_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF9_A { + pub const fn variant(&self) -> VF9_A { match self.bits { false => VF9_A::VALUE1, true => VF9_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF9_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF9_A::VALUE2 } } #[doc = "Field `VF9` writer - Valid Flag of Result Register x"] -pub type VF9_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF9_A, O>; -impl<'a, const O: u8> VF9_W<'a, O> { +pub type VF9_W<'a, REG> = crate::BitWriter<'a, REG, VF9_A>; +impl<'a, REG> VF9_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF9_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF9_A::VALUE2) } } @@ -553,34 +551,37 @@ impl From for bool { impl VF10_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF10_A { + pub const fn variant(&self) -> VF10_A { match self.bits { false => VF10_A::VALUE1, true => VF10_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF10_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF10_A::VALUE2 } } #[doc = "Field `VF10` writer - Valid Flag of Result Register x"] -pub type VF10_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF10_A, O>; -impl<'a, const O: u8> VF10_W<'a, O> { +pub type VF10_W<'a, REG> = crate::BitWriter<'a, REG, VF10_A>; +impl<'a, REG> VF10_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF10_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF10_A::VALUE2) } } @@ -603,34 +604,37 @@ impl From for bool { impl VF11_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF11_A { + pub const fn variant(&self) -> VF11_A { match self.bits { false => VF11_A::VALUE1, true => VF11_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF11_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF11_A::VALUE2 } } #[doc = "Field `VF11` writer - Valid Flag of Result Register x"] -pub type VF11_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF11_A, O>; -impl<'a, const O: u8> VF11_W<'a, O> { +pub type VF11_W<'a, REG> = crate::BitWriter<'a, REG, VF11_A>; +impl<'a, REG> VF11_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF11_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF11_A::VALUE2) } } @@ -653,34 +657,37 @@ impl From for bool { impl VF12_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF12_A { + pub const fn variant(&self) -> VF12_A { match self.bits { false => VF12_A::VALUE1, true => VF12_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF12_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF12_A::VALUE2 } } #[doc = "Field `VF12` writer - Valid Flag of Result Register x"] -pub type VF12_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF12_A, O>; -impl<'a, const O: u8> VF12_W<'a, O> { +pub type VF12_W<'a, REG> = crate::BitWriter<'a, REG, VF12_A>; +impl<'a, REG> VF12_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF12_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF12_A::VALUE2) } } @@ -703,34 +710,37 @@ impl From for bool { impl VF13_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF13_A { + pub const fn variant(&self) -> VF13_A { match self.bits { false => VF13_A::VALUE1, true => VF13_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF13_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF13_A::VALUE2 } } #[doc = "Field `VF13` writer - Valid Flag of Result Register x"] -pub type VF13_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF13_A, O>; -impl<'a, const O: u8> VF13_W<'a, O> { +pub type VF13_W<'a, REG> = crate::BitWriter<'a, REG, VF13_A>; +impl<'a, REG> VF13_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF13_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF13_A::VALUE2) } } @@ -753,34 +763,37 @@ impl From for bool { impl VF14_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF14_A { + pub const fn variant(&self) -> VF14_A { match self.bits { false => VF14_A::VALUE1, true => VF14_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF14_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF14_A::VALUE2 } } #[doc = "Field `VF14` writer - Valid Flag of Result Register x"] -pub type VF14_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF14_A, O>; -impl<'a, const O: u8> VF14_W<'a, O> { +pub type VF14_W<'a, REG> = crate::BitWriter<'a, REG, VF14_A>; +impl<'a, REG> VF14_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF14_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF14_A::VALUE2) } } @@ -803,34 +816,37 @@ impl From for bool { impl VF15_R { #[doc = "Get enumerated values variant"] #[inline(always)] - pub fn variant(&self) -> VF15_A { + pub const fn variant(&self) -> VF15_A { match self.bits { false => VF15_A::VALUE1, true => VF15_A::VALUE2, } } - #[doc = "Checks if the value of the field is `VALUE1`"] + #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] pub fn is_value1(&self) -> bool { *self == VF15_A::VALUE1 } - #[doc = "Checks if the value of the field is `VALUE2`"] + #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] pub fn is_value2(&self) -> bool { *self == VF15_A::VALUE2 } } #[doc = "Field `VF15` writer - Valid Flag of Result Register x"] -pub type VF15_W<'a, const O: u8> = crate::BitWriter<'a, u32, VFR_SPEC, VF15_A, O>; -impl<'a, const O: u8> VF15_W<'a, O> { +pub type VF15_W<'a, REG> = crate::BitWriter<'a, REG, VF15_A>; +impl<'a, REG> VF15_W<'a, REG> +where + REG: crate::Writable + crate::RegisterSpec, +{ #[doc = "Read access: No new valid data available Write access: No effect"] #[inline(always)] - pub fn value1(self) -> &'a mut W { + pub fn value1(self) -> &'a mut crate::W { self.variant(VF15_A::VALUE1) } #[doc = "Read access: Result register x contains valid data and has not yet been read, or bit FCR has been updated Write access: Clear this valid flag and bitfield DRC in register GxRESy (overrides a hardware set action)"] #[inline(always)] - pub fn value2(self) -> &'a mut W { + pub fn value2(self) -> &'a mut crate::W { self.variant(VF15_A::VALUE2) } } @@ -920,118 +936,119 @@ impl W { #[doc = "Bit 0 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf0(&mut self) -> VF0_W<0> { - VF0_W::new(self) + pub fn vf0(&mut self) -> VF0_W { + VF0_W::new(self, 0) } #[doc = "Bit 1 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf1(&mut self) -> VF1_W<1> { - VF1_W::new(self) + pub fn vf1(&mut self) -> VF1_W { + VF1_W::new(self, 1) } #[doc = "Bit 2 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf2(&mut self) -> VF2_W<2> { - VF2_W::new(self) + pub fn vf2(&mut self) -> VF2_W { + VF2_W::new(self, 2) } #[doc = "Bit 3 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf3(&mut self) -> VF3_W<3> { - VF3_W::new(self) + pub fn vf3(&mut self) -> VF3_W { + VF3_W::new(self, 3) } #[doc = "Bit 4 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf4(&mut self) -> VF4_W<4> { - VF4_W::new(self) + pub fn vf4(&mut self) -> VF4_W { + VF4_W::new(self, 4) } #[doc = "Bit 5 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf5(&mut self) -> VF5_W<5> { - VF5_W::new(self) + pub fn vf5(&mut self) -> VF5_W { + VF5_W::new(self, 5) } #[doc = "Bit 6 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf6(&mut self) -> VF6_W<6> { - VF6_W::new(self) + pub fn vf6(&mut self) -> VF6_W { + VF6_W::new(self, 6) } #[doc = "Bit 7 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf7(&mut self) -> VF7_W<7> { - VF7_W::new(self) + pub fn vf7(&mut self) -> VF7_W { + VF7_W::new(self, 7) } #[doc = "Bit 8 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf8(&mut self) -> VF8_W<8> { - VF8_W::new(self) + pub fn vf8(&mut self) -> VF8_W { + VF8_W::new(self, 8) } #[doc = "Bit 9 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf9(&mut self) -> VF9_W<9> { - VF9_W::new(self) + pub fn vf9(&mut self) -> VF9_W { + VF9_W::new(self, 9) } #[doc = "Bit 10 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf10(&mut self) -> VF10_W<10> { - VF10_W::new(self) + pub fn vf10(&mut self) -> VF10_W { + VF10_W::new(self, 10) } #[doc = "Bit 11 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf11(&mut self) -> VF11_W<11> { - VF11_W::new(self) + pub fn vf11(&mut self) -> VF11_W { + VF11_W::new(self, 11) } #[doc = "Bit 12 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf12(&mut self) -> VF12_W<12> { - VF12_W::new(self) + pub fn vf12(&mut self) -> VF12_W { + VF12_W::new(self, 12) } #[doc = "Bit 13 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf13(&mut self) -> VF13_W<13> { - VF13_W::new(self) + pub fn vf13(&mut self) -> VF13_W { + VF13_W::new(self, 13) } #[doc = "Bit 14 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf14(&mut self) -> VF14_W<14> { - VF14_W::new(self) + pub fn vf14(&mut self) -> VF14_W { + VF14_W::new(self, 14) } #[doc = "Bit 15 - Valid Flag of Result Register x"] #[inline(always)] #[must_use] - pub fn vf15(&mut self) -> VF15_W<15> { - VF15_W::new(self) + pub fn vf15(&mut self) -> VF15_W { + VF15_W::new(self, 15) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "Valid Flag Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`vfr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`vfr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`vfr::R`](R) reader structure"] +impl crate::Readable for VFR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`vfr::W`](W) writer structure"] impl crate::Writable for VFR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/wdt.rs b/src/wdt.rs index e38c899a..d43a0e68 100644 --- a/src/wdt.rs +++ b/src/wdt.rs @@ -1,52 +1,94 @@ #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { + id: ID, + ctr: CTR, + srv: SRV, + tim: TIM, + wlb: WLB, + wub: WUB, + wdtsts: WDTSTS, + wdtclr: WDTCLR, +} +impl RegisterBlock { #[doc = "0x00 - WDT ID Register"] - pub id: ID, + #[inline(always)] + pub const fn id(&self) -> &ID { + &self.id + } #[doc = "0x04 - WDT Control Register"] - pub ctr: CTR, + #[inline(always)] + pub const fn ctr(&self) -> &CTR { + &self.ctr + } #[doc = "0x08 - WDT Service Register"] - pub srv: SRV, + #[inline(always)] + pub const fn srv(&self) -> &SRV { + &self.srv + } #[doc = "0x0c - WDT Timer Register"] - pub tim: TIM, + #[inline(always)] + pub const fn tim(&self) -> &TIM { + &self.tim + } #[doc = "0x10 - WDT Window Lower Bound Register"] - pub wlb: WLB, + #[inline(always)] + pub const fn wlb(&self) -> &WLB { + &self.wlb + } #[doc = "0x14 - WDT Window Upper Bound Register"] - pub wub: WUB, + #[inline(always)] + pub const fn wub(&self) -> &WUB { + &self.wub + } #[doc = "0x18 - WDT Status Register"] - pub wdtsts: WDTSTS, + #[inline(always)] + pub const fn wdtsts(&self) -> &WDTSTS { + &self.wdtsts + } #[doc = "0x1c - WDT Clear Register"] - pub wdtclr: WDTCLR, + #[inline(always)] + pub const fn wdtclr(&self) -> &WDTCLR { + &self.wdtclr + } } -#[doc = "ID (r) register accessor: an alias for `Reg`"] +#[doc = "ID (r) register accessor: WDT ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@id`] +module"] pub type ID = crate::Reg; #[doc = "WDT ID Register"] pub mod id; -#[doc = "CTR (rw) register accessor: an alias for `Reg`"] +#[doc = "CTR (rw) register accessor: WDT Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctr::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctr::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctr`] +module"] pub type CTR = crate::Reg; #[doc = "WDT Control Register"] pub mod ctr; -#[doc = "SRV (w) register accessor: an alias for `Reg`"] +#[doc = "SRV (w) register accessor: WDT Service Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srv::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@srv`] +module"] pub type SRV = crate::Reg; #[doc = "WDT Service Register"] pub mod srv; -#[doc = "TIM (r) register accessor: an alias for `Reg`"] +#[doc = "TIM (r) register accessor: WDT Timer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tim::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tim`] +module"] pub type TIM = crate::Reg; #[doc = "WDT Timer Register"] pub mod tim; -#[doc = "WLB (rw) register accessor: an alias for `Reg`"] +#[doc = "WLB (rw) register accessor: WDT Window Lower Bound Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`wlb::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`wlb::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wlb`] +module"] pub type WLB = crate::Reg; #[doc = "WDT Window Lower Bound Register"] pub mod wlb; -#[doc = "WUB (rw) register accessor: an alias for `Reg`"] +#[doc = "WUB (rw) register accessor: WDT Window Upper Bound Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`wub::R`]. You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`wub::W`]. You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wub`] +module"] pub type WUB = crate::Reg; #[doc = "WDT Window Upper Bound Register"] pub mod wub; -#[doc = "WDTSTS (r) register accessor: an alias for `Reg`"] +#[doc = "WDTSTS (r) register accessor: WDT Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`wdtsts::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdtsts`] +module"] pub type WDTSTS = crate::Reg; #[doc = "WDT Status Register"] pub mod wdtsts; -#[doc = "WDTCLR (w) register accessor: an alias for `Reg`"] +#[doc = "WDTCLR (w) register accessor: WDT Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`wdtclr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@wdtclr`] +module"] 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 ccdecbb7..048a7955 100644 --- a/src/wdt/ctr.rs +++ b/src/wdt/ctr.rs @@ -1,55 +1,23 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `ENB` reader - Enable"] -pub type ENB_R = crate::BitReader; +pub type ENB_R = crate::BitReader; #[doc = "Field `ENB` writer - Enable"] -pub type ENB_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type ENB_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `PRE` reader - Pre-warning"] -pub type PRE_R = crate::BitReader; +pub type PRE_R = crate::BitReader; #[doc = "Field `PRE` writer - Pre-warning"] -pub type PRE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type PRE_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `DSP` reader - Debug Suspend"] -pub type DSP_R = crate::BitReader; +pub type DSP_R = crate::BitReader; #[doc = "Field `DSP` writer - Debug Suspend"] -pub type DSP_W<'a, const O: u8> = crate::BitWriter<'a, u32, CTR_SPEC, bool, O>; +pub type DSP_W<'a, REG> = crate::BitWriter<'a, REG>; #[doc = "Field `SPW` reader - Service Indication Pulse Width"] -pub type SPW_R = crate::FieldReader; +pub type SPW_R = crate::FieldReader; #[doc = "Field `SPW` writer - Service Indication Pulse Width"] -pub type SPW_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CTR_SPEC, u8, u8, 8, O>; +pub type SPW_W<'a, REG> = crate::FieldWriter<'a, REG, 8>; impl R { #[doc = "Bit 0 - Enable"] #[inline(always)] @@ -76,46 +44,47 @@ impl W { #[doc = "Bit 0 - Enable"] #[inline(always)] #[must_use] - pub fn enb(&mut self) -> ENB_W<0> { - ENB_W::new(self) + pub fn enb(&mut self) -> ENB_W { + ENB_W::new(self, 0) } #[doc = "Bit 1 - Pre-warning"] #[inline(always)] #[must_use] - pub fn pre(&mut self) -> PRE_W<1> { - PRE_W::new(self) + pub fn pre(&mut self) -> PRE_W { + PRE_W::new(self, 1) } #[doc = "Bit 4 - Debug Suspend"] #[inline(always)] #[must_use] - pub fn dsp(&mut self) -> DSP_W<4> { - DSP_W::new(self) + pub fn dsp(&mut self) -> DSP_W { + DSP_W::new(self, 4) } #[doc = "Bits 8:15 - Service Indication Pulse Width"] #[inline(always)] #[must_use] - pub fn spw(&mut self) -> SPW_W<8> { - SPW_W::new(self) + pub fn spw(&mut self) -> SPW_W { + SPW_W::new(self, 8) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "WDT Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ctr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ctr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`ctr::R`](R) reader structure"] +impl crate::Readable for CTR_SPEC {} +#[doc = "`write(|w| ..)` method takes [`ctr::W`](W) writer structure"] impl crate::Writable for CTR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/wdt/id.rs b/src/wdt/id.rs index 33d2c7e1..bc458f14 100644 --- a/src/wdt/id.rs +++ b/src/wdt/id.rs @@ -1,24 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `MOD_REV` reader - Module Revision"] -pub type MOD_REV_R = crate::FieldReader; +pub type MOD_REV_R = crate::FieldReader; #[doc = "Field `MOD_TYPE` reader - Module Type"] -pub type MOD_TYPE_R = crate::FieldReader; +pub type MOD_TYPE_R = crate::FieldReader; #[doc = "Field `MOD_NUMBER` reader - Module Number"] -pub type MOD_NUMBER_R = crate::FieldReader; +pub type MOD_NUMBER_R = crate::FieldReader; impl R { #[doc = "Bits 0:7 - Module Revision"] #[inline(always)] @@ -36,15 +23,13 @@ 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"] +#[doc = "WDT ID Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`id::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`id::R`](R) reader structure"] +impl crate::Readable for ID_SPEC {} #[doc = "`reset()` method sets ID to value 0x00ad_c000"] impl crate::Resettable for ID_SPEC { const RESET_VALUE: Self::Ux = 0x00ad_c000; diff --git a/src/wdt/srv.rs b/src/wdt/srv.rs index d964728f..a4cc0059 100644 --- a/src/wdt/srv.rs +++ b/src/wdt/srv.rs @@ -1,48 +1,32 @@ #[doc = "Register `SRV` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `SRV` writer - Service"] -pub type SRV_W<'a, const O: u8> = crate::FieldWriter<'a, u32, SRV_SPEC, u32, u32, 32, O>; +pub type SRV_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl W { #[doc = "Bits 0:31 - Service"] #[inline(always)] #[must_use] - pub fn srv(&mut self) -> SRV_W<0> { - SRV_W::new(self) + pub fn srv(&mut self) -> SRV_W { + SRV_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "WDT Service Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`srv::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct SRV_SPEC; impl crate::RegisterSpec for SRV_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [srv::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`srv::W`](W) writer structure"] impl crate::Writable for SRV_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/wdt/tim.rs b/src/wdt/tim.rs index 7674fd05..0888757c 100644 --- a/src/wdt/tim.rs +++ b/src/wdt/tim.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `TIM` reader - Timer Value"] -pub type TIM_R = crate::FieldReader; +pub type TIM_R = crate::FieldReader; impl R { #[doc = "Bits 0:31 - Timer Value"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { TIM_R::new(self.bits) } } -#[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"] +#[doc = "WDT Timer Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tim::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`tim::R`](R) reader structure"] +impl crate::Readable for TIM_SPEC {} #[doc = "`reset()` method sets TIM to value 0"] impl crate::Resettable for TIM_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/wdt/wdtclr.rs b/src/wdt/wdtclr.rs index c62cb213..7658c29b 100644 --- a/src/wdt/wdtclr.rs +++ b/src/wdt/wdtclr.rs @@ -1,48 +1,32 @@ #[doc = "Register `WDTCLR` writer"] -pub struct W(crate::W); -impl core::ops::Deref for W { - type Target = crate::W; - #[inline(always)] - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl core::ops::DerefMut for W { - #[inline(always)] - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} -impl From> for W { - #[inline(always)] - fn from(writer: crate::W) -> Self { - W(writer) - } -} +pub type W = crate::W; #[doc = "Field `ALMC` writer - Pre-warning Alarm"] -pub type ALMC_W<'a, const O: u8> = crate::BitWriter<'a, u32, WDTCLR_SPEC, bool, O>; +pub type ALMC_W<'a, REG> = crate::BitWriter<'a, REG>; impl W { #[doc = "Bit 0 - Pre-warning Alarm"] #[inline(always)] #[must_use] - pub fn almc(&mut self) -> ALMC_W<0> { - ALMC_W::new(self) + pub fn almc(&mut self) -> ALMC_W { + ALMC_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "WDT Clear Register\n\nYou can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`wdtclr::W`](W). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] pub struct WDTCLR_SPEC; impl crate::RegisterSpec for WDTCLR_SPEC { type Ux = u32; } -#[doc = "`write(|w| ..)` method takes [wdtclr::W](W) writer structure"] +#[doc = "`write(|w| ..)` method takes [`wdtclr::W`](W) writer structure"] impl crate::Writable for WDTCLR_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/wdt/wdtsts.rs b/src/wdt/wdtsts.rs index 0769f57f..46e3498c 100644 --- a/src/wdt/wdtsts.rs +++ b/src/wdt/wdtsts.rs @@ -1,20 +1,7 @@ #[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) - } -} +pub type R = crate::R; #[doc = "Field `ALMS` reader - Pre-warning Alarm"] -pub type ALMS_R = crate::BitReader; +pub type ALMS_R = crate::BitReader; impl R { #[doc = "Bit 0 - Pre-warning Alarm"] #[inline(always)] @@ -22,15 +9,13 @@ impl R { ALMS_R::new((self.bits & 1) != 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"] +#[doc = "WDT Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`wdtsts::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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 = "`read()` method returns [`wdtsts::R`](R) reader structure"] +impl crate::Readable for WDTSTS_SPEC {} #[doc = "`reset()` method sets WDTSTS to value 0"] impl crate::Resettable for WDTSTS_SPEC { const RESET_VALUE: Self::Ux = 0; diff --git a/src/wdt/wlb.rs b/src/wdt/wlb.rs index e86c9f4a..2dd4aab4 100644 --- a/src/wdt/wlb.rs +++ b/src/wdt/wlb.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WLB` reader - Window Lower Bound"] -pub type WLB_R = crate::FieldReader; +pub type WLB_R = crate::FieldReader; #[doc = "Field `WLB` writer - Window Lower Bound"] -pub type WLB_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WLB_SPEC, u32, u32, 32, O>; +pub type WLB_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Window Lower Bound"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Window Lower Bound"] #[inline(always)] #[must_use] - pub fn wlb(&mut self) -> WLB_W<0> { - WLB_W::new(self) + pub fn wlb(&mut self) -> WLB_W { + WLB_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "WDT Window Lower Bound Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`wlb::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`wlb::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`wlb::R`](R) reader structure"] +impl crate::Readable for WLB_SPEC {} +#[doc = "`write(|w| ..)` method takes [`wlb::W`](W) writer structure"] impl crate::Writable for WLB_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; } diff --git a/src/wdt/wub.rs b/src/wdt/wub.rs index 228fb6da..282c19d4 100644 --- a/src/wdt/wub.rs +++ b/src/wdt/wub.rs @@ -1,43 +1,11 @@ #[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) - } -} +pub type R = crate::R; #[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) - } -} +pub type W = crate::W; #[doc = "Field `WUB` reader - Window Upper Bound"] -pub type WUB_R = crate::FieldReader; +pub type WUB_R = crate::FieldReader; #[doc = "Field `WUB` writer - Window Upper Bound"] -pub type WUB_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WUB_SPEC, u32, u32, 32, O>; +pub type WUB_W<'a, REG> = crate::FieldWriter<'a, REG, 32, u32>; impl R { #[doc = "Bits 0:31 - Window Upper Bound"] #[inline(always)] @@ -49,28 +17,29 @@ impl W { #[doc = "Bits 0:31 - Window Upper Bound"] #[inline(always)] #[must_use] - pub fn wub(&mut self) -> WUB_W<0> { - WUB_W::new(self) + pub fn wub(&mut self) -> WUB_W { + WUB_W::new(self, 0) } - #[doc = "Writes raw bits to the register."] + #[doc = r" Writes raw bits to the register."] + #[doc = r""] + #[doc = r" # Safety"] + #[doc = r""] + #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { - self.0.bits(bits); + self.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"] +#[doc = "WDT Window Upper Bound Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`wub::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`wub::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."] 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"] +#[doc = "`read()` method returns [`wub::R`](R) reader structure"] +impl crate::Readable for WUB_SPEC {} +#[doc = "`write(|w| ..)` method takes [`wub::W`](W) writer structure"] impl crate::Writable for WUB_SPEC { - type Writer = W; const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0; }